2 * Copyright (c) 1999-2002, Darren Hiebert
4 * This source code is released for free distribution under the terms of the
5 * GNU General Public License version 2 or (at your option) any later version.
7 * Defines external interface to resizable string lists.
9 #ifndef CTAGS_MAIN_STRLIST_H
10 #define CTAGS_MAIN_STRLIST_H
15 #include "general.h" /* must always come first */
17 #include "routines_p.h"
26 typedef ptrArray stringList
;
31 extern stringList
*stringListNew (void);
32 extern void stringListAdd (stringList
*const current
, vString
*string
);
33 extern void stringListRemoveLast (stringList
*const current
);
34 extern void stringListCombine (stringList
*const current
, stringList
*const from
);
35 extern stringList
* stringListNewFromArgv (const char* const* const list
);
36 extern stringList
* stringListNewFromFile (const char* const fileName
);
37 extern void stringListClear (stringList
*const current
);
38 extern unsigned int stringListCount (const stringList
*const current
);
39 extern vString
* stringListItem (const stringList
*const current
, const unsigned int indx
);
40 extern vString
* stringListLast (const stringList
*const current
);
41 extern void stringListDelete (stringList
*const current
);
42 extern bool stringListHasInsensitive (const stringList
*const current
, const char *const string
);
43 extern bool stringListHas (const stringList
*const current
, const char *const string
);
44 extern bool stringListHasTest (const stringList
*const current
,
45 bool (*test
)(const char *s
, void *userData
),
47 extern bool stringListDeleteItemExtension (stringList
* const current
, const char* const extension
);
50 * stringListExtension{Matched,Finds}
51 * They compares strcmp or strcasecmp.
52 * The choice of case-sensitive or case-insensitive is platform-dependent.
54 * stringListFile{Matched,Finds}:
55 * They do glob-matching with fnmatch().
56 * The choice of case-sensitive or case-insensitive is platform-dependent.
58 * stringListCase{Matched,Finds}:
59 * They always work case-insensitive way.
61 extern bool stringListExtensionMatched (const stringList
* const list
, const char* const extension
);
62 extern vString
* stringListExtensionFinds (const stringList
* const list
, const char* const extension
);
63 extern bool stringListFileMatched (const stringList
* const list
, const char* const str
);
64 extern vString
* stringListFileFinds (const stringList
* const list
, const char* const str
);
65 extern bool stringListCaseMatched (const stringList
* const list
, const char* const str
);
66 extern vString
* stringListCaseFinds (const stringList
* const list
, const char* const str
);
68 extern void stringListPrint (const stringList
*const current
, FILE *fp
);
69 extern void stringListReverse (const stringList
*const current
);
71 #endif /* CTAGS_MAIN_STRLIST_H */