X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsvec.c;h=381ee324dce1b7ecf82247055a3825ac2b9084db;hb=96628ae85fe26ac86d35bca5f4c288e56048c3d6;hp=078b107042195900bf35da392cefd48b35161f07;hpb=34e63086edddcae06d7c1a4fa84fec0861e50758;p=openvswitch diff --git a/lib/svec.c b/lib/svec.c index 078b1070..381ee324 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) {