| 1 |
/* |
| 2 |
* $Id: strlist.h 443 2006-05-30 04:37:13Z darren $ |
| 3 |
* |
| 4 |
* Copyright (c) 1999-2002, Darren Hiebert |
| 5 |
* |
| 6 |
* This source code is released for free distribution under the terms of the |
| 7 |
* GNU General Public License. |
| 8 |
* |
| 9 |
* Defines external interface to resizable string lists. |
| 10 |
*/ |
| 11 |
#ifndef _STRLIST_H |
| 12 |
#define _STRLIST_H |
| 13 |
|
| 14 |
/* |
| 15 |
* INCLUDE FILES |
| 16 |
*/ |
| 17 |
#include "general.h" /* must always come first */ |
| 18 |
|
| 19 |
#include "vstring.h" |
| 20 |
|
| 21 |
/* |
| 22 |
* DATA DECLARATIONS |
| 23 |
*/ |
| 24 |
typedef struct sStringList { |
| 25 |
unsigned int max; |
| 26 |
unsigned int count; |
| 27 |
vString **list; |
| 28 |
} stringList; |
| 29 |
|
| 30 |
/* |
| 31 |
* FUNCTION PROTOTYPES |
| 32 |
*/ |
| 33 |
extern stringList *stringListNew (void); |
| 34 |
extern void stringListAdd (stringList *const current, vString *string); |
| 35 |
extern void stringListRemoveLast (stringList *const current); |
| 36 |
extern void stringListCombine (stringList *const current, stringList *const from); |
| 37 |
extern stringList* stringListNewFromArgv (const char* const* const list); |
| 38 |
extern stringList* stringListNewFromFile (const char* const fileName); |
| 39 |
extern void stringListClear (stringList *const current); |
| 40 |
extern unsigned int stringListCount (const stringList *const current); |
| 41 |
extern vString* stringListItem (const stringList *const current, const unsigned int indx); |
| 42 |
extern vString* stringListLast (const stringList *const current); |
| 43 |
extern void stringListDelete (stringList *const current); |
| 44 |
extern boolean stringListHasInsensitive (const stringList *const current, const char *const string); |
| 45 |
extern boolean stringListHas (const stringList *const current, const char *const string); |
| 46 |
extern boolean stringListHasTest (const stringList *const current, boolean (*test)(const char *s)); |
| 47 |
extern boolean stringListRemoveExtension (stringList* const current, const char* const extension); |
| 48 |
extern boolean stringListExtensionMatched (const stringList* const list, const char* const extension); |
| 49 |
extern boolean stringListFileMatched (const stringList* const list, const char* const str); |
| 50 |
extern void stringListPrint (const stringList *const current); |
| 51 |
|
| 52 |
#endif /* _STRLIST_H */ |
| 53 |
|
| 54 |
/* vi:set tabstop=4 shiftwidth=4: */ |