From 8ecd53084ce42e2e868a9c24c57b2d9a7e59cfc2 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 10 Nov 2009 15:31:03 -0800 Subject: [PATCH] svec: New function svec_is_empty(). --- lib/svec.c | 6 ++++++ lib/svec.h | 1 + 2 files changed, 7 insertions(+) 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 *); -- 2.30.2