From: Igor Gnatenko Date: Mon, 26 Feb 2018 14:15:05 +0000 (+0100) Subject: bindings: use $self for Selection.clone() X-Git-Tag: 0.6.33~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be88c1fe24d51cfeadb4d6a0bddb7b0c25f3a247;p=thirdparty%2Flibsolv.git bindings: use $self for Selection.clone() Signed-off-by: Igor Gnatenko --- diff --git a/bindings/solv.i b/bindings/solv.i index 743bcc8d..b3892a0b 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -1298,12 +1298,12 @@ typedef struct { return $self->q.count == 0; } %newobject clone; - Selection *clone(Selection *from, int flags = 0) { + Selection *clone(int flags = 0) { Selection *s; s = solv_calloc(1, sizeof(*s)); - s->pool = from->pool; - s->flags = from->flags; - queue_init_clone(&s->q, &from->q); + s->pool = $self->pool; + s->flags = $self->flags; + queue_init_clone(&s>q, &$self>q); return s; } void filter(Selection *lsel) { diff --git a/doc/gen/libsolv-bindings.3 b/doc/gen/libsolv-bindings.3 index 7ea859f1..5bb63661 100644 --- a/doc/gen/libsolv-bindings.3 +++ b/doc/gen/libsolv-bindings.3 @@ -7,7 +7,7 @@ .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "01/18/2018" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "02/27/2018" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -3197,6 +3197,21 @@ Return true if the selection is empty, i\&.e\&. no package could be matched\&. .RS 4 .\} .nf +\fBSelection clone(int\fR \fIflags\fR \fB= 0)\fR; +my \fI$cloned\fR \fB=\fR \fI$sel\fR\fB\->clone()\fR; +\fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR +\fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR +.fi +.if n \{\ +.RE +.\} +.sp +Clone selection\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf \fBvoid filter(Selection *\fR\fIother\fR\fB)\fR \fI$sel\fR\fB\->filter(\fR\fI$other\fR\fB)\fR; \fIsel\fR\fB\&.filter(\fR\fIother\fR\fB)\fR