xref: /Universal-ctags/main/numarray.h (revision 090f0bb7b7842ff401067c62955c3c2701c816cd)
1 /*
2 *   Copyright (c) 1999-2002, Darren Hiebert
3 *
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.
6 *
7 *   Defines external interface to resizable pointer arrays.
8 */
9 #ifndef CTAGS_MAIN_NUMARRAY_H
10 #define CTAGS_MAIN_NUMARRAY_H
11 
12 /*
13 *   INCLUDE FILES
14 */
15 #include "general.h"  /* must always come first */
16 
17 
18 #define declNumArray(prefix,Prefix,type)								\
19 																		\
20 	struct s##Prefix##Array;											\
21 	typedef struct s##Prefix##Array prefix##Array;						\
22 																		\
23 	extern prefix##Array *prefix##ArrayNew (void);						\
24 	extern unsigned int prefix##ArrayAdd (prefix##Array *const current, type num); \
25 	extern void prefix##ArrayRemoveLast (prefix##Array *const current);	\
26 	extern void prefix##ArrayCombine (prefix##Array *const current, prefix##Array *const from);	\
27 	extern void prefix##ArrayClear (prefix##Array *const current);		\
28 	extern unsigned int prefix##ArrayCount (const prefix##Array *const current); \
29 	extern bool prefix##ArrayIsEmpty(const prefix##Array *const current); \
30 	extern type prefix##ArrayItem (const prefix##Array *const current, const unsigned int indx); \
31 	extern type prefix##ArrayLast (const prefix##Array *const current); \
32 	extern void prefix##ArrayDelete (prefix##Array *const current);		\
33 	extern bool prefix##ArrayHasTest (const prefix##Array *const current, \
34 									  bool (*test)(const type num, void *userData), \
35 									  void *userData);					\
36 	extern bool prefix##ArrayHas (const prefix##Array *const current, type num); \
37 	extern void prefix##ArrayReverse (const prefix##Array *const current); \
38 	extern void prefix##ArrayDeleteItem (prefix##Array* const current, unsigned int indx); \
39 	\
40 	extern void prefix##ArraySort (prefix##Array *const current, bool descendingOrder);
41 
42 declNumArray(char, Char, char)
43 declNumArray(uchar, Uchar, unsigned char)
44 declNumArray(int, Int, int)
45 declNumArray(uint, Uint, unsigned int)
46 declNumArray(long, Long, long)
47 declNumArray(ulong, Ulong, unsigned long)
48 
49 #endif  /* CTAGS_MAIN_NUMARRAY_H */
50