2 * Copyright (C) 1998, 2000, 2001, 2006 Free Software Foundation, Inc.
4 * This file is part of GnuPG.
6 * GnuPG is free software; you can redistribute it and/or modify it
7 * under the terms of either
9 * - the GNU Lesser General Public License as published by the Free
10 * Software Foundation; either version 3 of the License, or (at
11 * your option) any later version.
15 * - the GNU General Public License as published by the Free
16 * Software Foundation; either version 2 of the License, or (at
17 * your option) any later version.
19 * or both in parallel, as here.
21 * GnuPG is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * General Public License for more details.
26 * You should have received a copies of the GNU General Public License
27 * and the GNU Lesser General Public License along with this program;
28 * if not, see <https://www.gnu.org/licenses/>.
31 #ifndef GNUPG_COMMON_STRLIST_H
32 #define GNUPG_COMMON_STRLIST_H
36 struct string_list *next;
40 typedef struct string_list *strlist_t;
42 void free_strlist (strlist_t sl);
43 void free_strlist_wipe (strlist_t sl);
45 strlist_t add_to_strlist (strlist_t *list, const char *string);
46 strlist_t add_to_strlist_try (strlist_t *list, const char *string);
48 strlist_t add_to_strlist2( strlist_t *list, const char *string, int is_utf8);
50 strlist_t append_to_strlist (strlist_t *list, const char *string);
51 strlist_t append_to_strlist_try (strlist_t *list, const char *string);
52 strlist_t append_to_strlist2 (strlist_t *list, const char *string,
55 strlist_t strlist_copy (strlist_t list);
57 strlist_t strlist_prev (strlist_t head, strlist_t node);
58 strlist_t strlist_last (strlist_t node);
59 char * strlist_pop (strlist_t *list);
61 strlist_t strlist_find (strlist_t haystack, const char *needle);
62 int strlist_length (strlist_t list);
64 strlist_t strlist_rev (strlist_t *haystack);
66 #define FREE_STRLIST(a) do { free_strlist((a)); (a) = NULL ; } while(0)
69 #endif /*GNUPG_COMMON_STRLIST_H*/