From: Michael Schroeder Date: Wed, 27 Mar 2024 10:38:52 +0000 (+0100) Subject: Add datamatch.dep attribute support to the bindings X-Git-Tag: 0.7.29~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=538cf2e50396a64b9067efb59f8d791da1426157;p=thirdparty%2Flibsolv.git Add datamatch.dep attribute support to the bindings --- diff --git a/bindings/solv.i b/bindings/solv.i index 0d52f7a4..68002101 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -3025,6 +3025,8 @@ returnself(matchsolvable) Id const id; const char * const idstr; const char * const str; + %newobject dep; + Dep * const dep; BinaryBlob const binary; unsigned long long const num; unsigned int const num2; @@ -3057,6 +3059,13 @@ returnself(matchsolvable) SWIGINTERN const char * const Datamatch_str_get(Dataiterator *di) { return di->kv.str; } + SWIGINTERN Dep *Datamatch_dep_get(Dataiterator *di) { + if (di->key->type == REPOKEY_TYPE_DIR || di->key->type == REPOKEY_TYPE_DIRSTRARRAY || di->key->type == REPOKEY_TYPE_DIRNUMNUMARRAY) + return 0; + if (di->data && di->data->localpool) + return 0; + return new_Dep(di->pool, di->kv.id); + } SWIGINTERN BinaryBlob Datamatch_binary_get(Dataiterator *di) { BinaryBlob bl; bl.data = 0; diff --git a/doc/gen/libsolv-bindings.3 b/doc/gen/libsolv-bindings.3 index a5f67565..d2d3067d 100644 --- a/doc/gen/libsolv-bindings.3 +++ b/doc/gen/libsolv-bindings.3 @@ -2,12 +2,12 @@ .\" Title: Libsolv-Bindings .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets vsnapshot -.\" Date: 03/26/2024 +.\" Date: 03/27/2024 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "03/26/2024" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "03/27/2024" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -3217,6 +3217,21 @@ The Id of the value that was matched (only valid for id types), either as id or .RS 4 .\} .nf +\fBDep *dep;\fR /* read only */ +\fI$d\fR\fB\->{dep}\fR +\fId\fR\fB\&.dep\fR +\fId\fR\fB\&.dep\fR +.fi +.if n \{\ +.RE +.\} +.sp +The id of the value that was matched converted to a dependency object\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf \fBconst char *\fR\fIstr\fR; \fI$d\fR\fB\->{str}\fR \fId\fR\fB\&.str\fR diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt index d41def80..45be37c8 100644 --- a/doc/libsolv-bindings.txt +++ b/doc/libsolv-bindings.txt @@ -1769,6 +1769,13 @@ The key type of the value that was matched, either as id or string. The Id of the value that was matched (only valid for id types), either as id or string. + Dep *dep; /* read only */ + $d->{dep} + d.dep + d.dep + +The id of the value that was matched converted to a dependency object. + const char *str; $d->{str} d.str