Skip to content

Commit

Permalink
Add datamatch.dep attribute support to the bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Mar 27, 2024
1 parent 5029b8c commit 538cf2e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
9 changes: 9 additions & 0 deletions bindings/solv.i
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
19 changes: 17 additions & 2 deletions doc/gen/libsolv-bindings.3
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: Libsolv-Bindings
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http:https://docbook.sf.net/>
.\" 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
.\" -----------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions doc/libsolv-bindings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 538cf2e

Please sign in to comment.