agent/
[gnupg.git] / jnlib / strlist.h
blob1e2ffa8dae324dd0783068a9ac276209af133717
1 /* strlist.h
2 * Copyright (C) 1998, 2000, 2001, 2006 Free Software Foundation, Inc.
4 * This file is part of JNLIB.
6 * JNLIB is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 3 of
9 * the License, or (at your option) any later version.
11 * JNLIB is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef LIBJNLIB_STRLIST_H
21 #define LIBJNLIB_STRLIST_H
23 struct string_list
25 struct string_list *next;
26 unsigned int flags;
27 char d[1];
29 typedef struct string_list *strlist_t;
31 void free_strlist (strlist_t sl);
32 strlist_t add_to_strlist (strlist_t *list, const char *string);
33 strlist_t add_to_strlist_try (strlist_t *list, const char *string);
35 strlist_t add_to_strlist2( strlist_t *list, const char *string, int is_utf8);
37 strlist_t append_to_strlist (strlist_t *list, const char *string);
38 strlist_t append_to_strlist2 (strlist_t *list, const char *string,
39 int is_utf8);
41 strlist_t strlist_copy (strlist_t list);
43 strlist_t strlist_prev (strlist_t head, strlist_t node);
44 strlist_t strlist_last (strlist_t node);
45 char * strlist_pop (strlist_t *list);
47 #define FREE_STRLIST(a) do { free_strlist((a)); (a) = NULL ; } while(0)
50 #endif /*LIBJNLIB_STRLIST_H*/