From: Ben Pfaff Date: Wed, 4 Mar 2009 17:57:01 +0000 (-0800) Subject: New function svec_clone(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a38553bd0e0c5277dbff1834c63e54ef5430a9d5;p=openvswitch New function svec_clone(). --- diff --git a/lib/svec.c b/lib/svec.c index e2ac25d3..bbf4b353 100644 --- a/lib/svec.c +++ b/lib/svec.c @@ -51,6 +51,13 @@ svec_init(struct svec *svec) svec->allocated = 0; } +void +svec_clone(struct svec *svec, const struct svec *other) +{ + svec_init(svec); + svec_append(svec, other); +} + void svec_destroy(struct svec *svec) { diff --git a/lib/svec.h b/lib/svec.h index 0cd21922..542e8687 100644 --- a/lib/svec.h +++ b/lib/svec.h @@ -46,6 +46,7 @@ struct svec { #define SVEC_EMPTY_INITIALIZER { NULL, 0, 0 } void svec_init(struct svec *); +void svec_clone(struct svec *, const struct svec *); void svec_destroy(struct svec *); void svec_clear(struct svec *); void svec_add(struct svec *, const char *);