]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
bindings: use $self for Selection.clone() 257/head
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>
Mon, 26 Feb 2018 14:15:05 +0000 (15:15 +0100)
committerIgor Gnatenko <i.gnatenko.brain@gmail.com>
Tue, 27 Feb 2018 05:12:33 +0000 (06:12 +0100)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
bindings/solv.i
doc/gen/libsolv-bindings.3

index 743bcc8dd8ec1697c7375c8157d80b5a011ce679..b3892a0b9d0c496b76a61133fd9c0b63fbcefa28 100644 (file)
@@ -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) {
index 7ea859f1ca6a88c7b93a341f4937669a8ea952b2..5bb636616f33299e79da3003d63fe6a1114f87fc 100644 (file)
@@ -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