1 /* str-llist.h: a linked list of strings,
3 It's pretty sad that both this and str-list exist; the reason is
4 that C cannot express iterators very well, and I don't want to change
7 Copyright 1993, 1994, 2008, 2010 Karl Berry.
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with this library; if not, see <http://www.gnu.org/licenses/>. */
25 #include <kpathsea/c-proto.h>
26 #include <kpathsea/types.h>
33 /* It's a little bizarre to be using the same type for the list and the
34 elements of the list, but no reason not to in this case, I think --
35 we never need a NULL string in the middle of the list, and an extra
36 NULL/NULL element always at the end is inconsequential. */
42 struct str_llist_elt *next;
44 typedef struct str_llist_elt str_llist_elt_type;
45 typedef struct str_llist_elt *str_llist_type;
47 #define STR_LLIST(sl) ((sl).str)
48 #define STR_LLIST_MOVED(sl) ((sl).moved)
49 #define STR_LLIST_NEXT(sl) ((sl).next)
51 #ifdef MAKE_KPSE_DLL /* libkpathsea internal only */
53 /* Add the new string E to the end of the list L. */
54 extern void str_llist_add (str_llist_type *l, string e);
56 /* Reorganize L so that E is below only other elements that have already
57 been moved. Set `moved' member for E. */
58 extern void str_llist_float (str_llist_type *l, str_llist_elt_type *e);
60 #endif /* MAKE_KPSE_DLL */
66 #endif /* not STR_LLIST_H */