strlist.h revision 9663:ace9a2ac3683
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 32typedef struct _StrList StrList; 33struct _StrList { 34 StrList* next; 35 const wchar_t* str; 36}; 37 38extern char* language; 39extern char* gettext_charset; 40extern char* term_charset; 41 42extern StrList* str_list_create (const char* first, ...); 43extern StrList* str_list_create_unique (const char* first, ...); 44extern void str_list_destroy (StrList* list); 45extern void str_list_destroy_node (StrList* list); 46 47extern StrList* str_list_duplicate (const StrList* list); 48extern StrList* str_list_duplicate_node (const StrList* list); 49extern StrList* str_list_insert (StrList* list, const char* str); 50extern StrList* str_list_append (StrList* list, const char* str); 51extern StrList* str_list_append_unique (StrList* list, const char* str); 52extern StrList* str_list_join (StrList* a, StrList* b); 53extern char* str_list_convert (const StrList* list); 54extern char* str_list_convert_node (const StrList* list); 55 56extern void str_list_print (const StrList* list); 57extern void str_list_print_wrap (const StrList* list, int line_length, 58 int offset, int indent); 59extern int str_list_match_any (const StrList* list, const char* str); 60extern int str_list_match_node (const StrList* list, const char* str); 61extern StrList* str_list_match (const StrList* list, const char* str); 62 63extern int str_list_length (const StrList* list); 64 65#endif /* STRLIST_H_INCLUDED */ 66 67