From: Michael Schroeder Date: Wed, 15 Nov 2017 14:14:20 +0000 (+0100) Subject: bindings: add a selection clone method X-Git-Tag: 0.6.31~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9aeefd615c84faedbedf043a03a4f613209dbc15;p=thirdparty%2Flibsolv.git bindings: add a selection clone method --- diff --git a/bindings/solv.i b/bindings/solv.i index b1d9cc70..319a85bf 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -1293,6 +1293,15 @@ typedef struct { bool isempty() { return $self->q.count == 0; } + %newobject clone; + Selection *clone(Selection *from, 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); + return s; + } void filter(Selection *lsel) { if ($self->pool != lsel->pool) queue_empty(&$self->q);