X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fsvec.c;h=381ee324dce1b7ecf82247055a3825ac2b9084db;hb=8d0abb5ef553bc4a43f0df7f7398142b9600294b;hp=078b107042195900bf35da392cefd48b35161f07;hpb=a14bc59fb8f27db193d74662dc9c5cb8237177ef;p=sliver-openvswitch.git diff --git a/lib/svec.c b/lib/svec.c index 078b10704..381ee324d 100644 --- a/lib/svec.c +++ b/lib/svec.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +22,10 @@ #include #include "dynamic-string.h" #include "util.h" - -#define THIS_MODULE VLM_svec #include "vlog.h" +VLOG_DEFINE_THIS_MODULE(svec); + void svec_init(struct svec *svec) { @@ -49,7 +49,7 @@ svec_destroy(struct svec *svec) } void -svec_clear(struct svec *svec) +svec_clear(struct svec *svec) { size_t i; @@ -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) {