-
Notifications
You must be signed in to change notification settings - Fork 1
/
string_list.h
30 lines (25 loc) · 967 Bytes
/
string_list.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef CXINE_STRING_LIST_H
#define CXINE_STRING_LIST_H
typedef struct
{
int next;
int size;
char **list;
} TStringList;
#define StringListSize(sl) ((sl)->size)
#define StringListPos(sl) ((sl)->next -1)
TStringList *StringListCreate(int argc, char **argv);
int StringListAdd(TStringList *sl, const char *str);
int StringListDel(TStringList *sl, int pos);
int StringListSplit(TStringList *sl, const char *str, const char *separators);
const char *StringListItem(TStringList *sl, unsigned int pos);
const char *StringListGet(TStringList *sl, unsigned int pos);
void StringListSet(TStringList *sl, unsigned int pos, const char *Str);
void StringListSwap(TStringList *sl, int pos1, int pos2);
#define StringListFirst(sl) StringListGet((sl), 0)
const char *StringListCurr(TStringList *sl);
const char *StringListPrev(TStringList *sl);
const char *StringListNext(TStringList *sl);
void StringListDestroy(TStringList *sl);
void StringListClear(TStringList *sl);
#endif