]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix Selection.clone implementation and documentation
authorMichael Schroeder <mls@suse.de>
Wed, 28 Feb 2018 15:26:21 +0000 (16:26 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 28 Feb 2018 15:26:21 +0000 (16:26 +0100)
bindings/solv.i
doc/gen/libsolv-bindings.3
doc/libsolv-bindings.txt

index b3892a0b9d0c496b76a61133fd9c0b63fbcefa28..acd01ac4a41c99ceb1463bf74d38cbf018b611e6 100644 (file)
@@ -1299,11 +1299,9 @@ typedef struct {
   }
   %newobject clone;
   Selection *clone(int flags = 0) {
-    Selection *s;
-    s = solv_calloc(1, sizeof(*s));
-    s->pool = $self->pool;
+    Selection *s = new_Selection($self->pool);
+    queue_init_clone(&s->q, &$self->q);
     s->flags = $self->flags;
-    queue_init_clone(&s>q, &$self>q);
     return s;
   }
   void filter(Selection *lsel) {
index 5bb636616f33299e79da3003d63fe6a1114f87fc..a6534aa24898caa9b1d2794130fccb3a6db0cf4c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: Libsolv-Bindings
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/18/2018
+.\"      Date: 02/28/2018
 .\"    Manual: LIBSOLV
 .\"    Source: libsolv
 .\"  Language: English
 .\"
-.TH "LIBSOLV\-BINDINGS" "3" "02/27/2018" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-BINDINGS" "3" "02/28/2018" "libsolv" "LIBSOLV"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -3167,7 +3167,7 @@ Back pointer to pool\&.
 .RS 4
 .\}
 .nf
-\fBint flags()\fR;
+\fBint flags()\fR
 my \fI$flags\fR \fB=\fR \fI$sel\fR\fB\->flags()\fR;
 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
 \fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
@@ -3182,7 +3182,7 @@ Return the result flags of the selection\&. The flags are a subset of the ones u
 .RS 4
 .\}
 .nf
-\fBbool isempty()\fR;
+\fBbool isempty()\fR
 \fI$sel\fR\fB\->isempty()\fR
 \fIsel\fR\fB\&.isempty()\fR
 \fIsel\fR\fB\&.isempty?\fR
@@ -3197,7 +3197,7 @@ 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;
+\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
@@ -3206,7 +3206,7 @@ my \fI$cloned\fR \fB=\fR \fI$sel\fR\fB\->clone()\fR;
 .RE
 .\}
 .sp
-Clone selection\&.
+Return a copy of a selection\&.
 .sp
 .if n \{\
 .RS 4
index 0d336cec7af590ed89bf132540924198afc89baf..1f6422f180be70f01d0ac1ea9cdd678e392be8b4 100644 (file)
@@ -1782,7 +1782,7 @@ Back pointer to pool.
 
 === METHODS ===
 
-       int flags();
+       int flags()
        my $flags = $sel->flags();
        flags = sel.flags()
        flags = sel.flags()
@@ -1795,13 +1795,20 @@ flags will either be SELECTION_NAME or SELECTION_PROVIDES depending
 if there was a package that matched the name or not. If there was
 no match at all, the flags will be zero.
 
-       bool isempty();
+       bool isempty()
        $sel->isempty()
        sel.isempty()
        sel.isempty?
 
 Return true if the selection is empty, i.e. no package could be matched.
 
+       Selection clone(int flags = 0)
+       my $cloned = $sel->clone();
+       cloned = sel.clone()
+       cloned = sel.clone()
+
+Return a copy of a selection.
+
        void filter(Selection *other)
        $sel->filter($other);
        sel.filter(other)