X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=strv.c;h=4fe1e332536a243619e9449f6fcab14bd49b2041;hp=faa878c006748c0e0fc21f4c7ea004636224c73f;hb=a7334b0952ab66c17ee787e36e6d2c5ceb387de6;hpb=034c6ed7da5e44bfdde5a5d0da75f7b7a59953b8 diff --git a/strv.c b/strv.c index faa878c00..4fe1e3325 100644 --- a/strv.c +++ b/strv.c @@ -1,5 +1,24 @@ /*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*** + This file is part of systemd. + + Copyright 2010 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with systemd; If not, see . +***/ + #include #include #include @@ -145,3 +164,13 @@ fail: return NULL; } + +bool strv_contains(char **l, const char *s) { + char **i; + + STRV_FOREACH(i, l) + if (streq(*i, s)) + return true; + + return false; +}