From: Ben Pfaff Date: Tue, 10 Nov 2009 23:31:03 +0000 (-0800) Subject: svec: New function svec_is_empty(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ecd53084ce42e2e868a9c24c57b2d9a7e59cfc2;p=openvswitch svec: New function svec_is_empty(). --- diff --git a/lib/svec.c b/lib/svec.c index 078b1070..81a36b57 100644 --- a/lib/svec.c +++ b/lib/svec.c @@ -59,6 +59,12 @@ svec_clear(struct svec *svec) svec->n = 0; } +bool +svec_is_empty(const struct svec *svec) +{ + return svec->n == 0; +} + void svec_add(struct svec *svec, const char *name) { diff --git a/lib/svec.h b/lib/svec.h index e1736bc6..ff561973 100644 --- a/lib/svec.h +++ b/lib/svec.h @@ -32,6 +32,7 @@ void svec_init(struct svec *); void svec_clone(struct svec *, const struct svec *); void svec_destroy(struct svec *); void svec_clear(struct svec *); +bool svec_is_empty(const struct svec *); void svec_add(struct svec *, const char *); void svec_add_nocopy(struct svec *, char *); void svec_del(struct svec *, const char *);