1 /*
2 parted - a frontend to libparted
3 Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef STRLIST_H_INCLUDED
20 #define STRLIST_H_INCLUDED
21
22 #include <wchar.h>
23
24 #ifndef ENABLE_NLS
25 # define L_(str) str
26 # ifdef wchar_t
27 # undef wchar_t
28 # endif
29 # define wchar_t char
30 #endif
31
32 typedef struct _StrList StrList;
33 struct _StrList {
34 StrList* next;
35 const wchar_t* str;
36 };
37
38 extern char* language;
39 extern char* gettext_charset;
40 extern char* term_charset;
41
42 extern StrList* str_list_create (const char* first, ...);
43 extern StrList* str_list_create_unique (const char* first, ...);
44 extern void str_list_destroy (StrList* list);
45 extern void str_list_destroy_node (StrList* list);
46
47 extern StrList* str_list_duplicate (const StrList* list);
48 extern StrList* str_list_duplicate_node (const StrList* list);
49 extern StrList* str_list_insert (StrList* list, const char* str);
50 extern StrList* str_list_append (StrList* list, const char* str);
51 extern StrList* str_list_append_unique (StrList* list, const char* str);
52 extern StrList* str_list_join (StrList* a, StrList* b);
53 extern char* str_list_convert (const StrList* list);
54 extern char* str_list_convert_node (const StrList* list);
55
56 extern void str_list_print (const StrList* list);
57 extern void str_list_print_wrap (const StrList* list, int line_length,
58 int offset, int indent);
59 extern int str_list_match_any (const StrList* list, const char* str);
60 extern int str_list_match_node (const StrList* list, const char* str);
61 extern StrList* str_list_match (const StrList* list, const char* str);
62
63 extern int str_list_length (const StrList* list);
64
65 #endif /* STRLIST_H_INCLUDED */
66