00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SLIST_H
00016 #define SLIST_H
00017
00018 typedef struct slist_ SList;
00019 typedef struct slistopts_ SListOpts;
00020
00021 struct slist_ {
00022 void **list;
00023
00024 int16 count;
00025 int16 capacity;
00026 int16 limit;
00027
00028 SListOpts *opts;
00029 };
00030
00031 struct slistopts_ {
00032 int32 flags;
00033
00034 int (*compareitem) (SList *slist, void *item1, void *item2);
00035 int (*isequal) (SList *slist, void *item1, void *item2);
00036 void (*freeitem) (SList *slist, void *item);
00037 };
00038
00039 #define SLIST_DEFAULT_LIMIT 32767
00040
00041 #define SLISTF_NODUP 0x00000001
00042 #define SLISTF_SORT 0x00000002
00043
00044
00045 typedef int (*slist_enumcb_t) (SList *slist, int number, void *item, va_list args);
00046
00047 typedef int (*slist_delcheckcb_t) (SList *slist, void *item, va_list args);
00048
00049 #endif
00050