00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00030
00031
00032
00033
00034
00035 #ifndef GUTENPRINT_LIST_H
00036 #define GUTENPRINT_LIST_H
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00054 struct stp_list_item;
00059 typedef struct stp_list_item stp_list_item_t;
00060
00061 struct stp_list;
00066 typedef struct stp_list stp_list_t;
00067
00072 typedef void (*stp_node_freefunc)(void *);
00073
00079 typedef void *(*stp_node_copyfunc)(const void *);
00080
00087 typedef const char *(*stp_node_namefunc)(const void *);
00088
00096 typedef int (*stp_node_sortfunc)(const void *, const void *);
00097
00104 extern void stp_list_node_free_data(void *item);
00105
00110 extern stp_list_t *stp_list_create(void);
00111
00119 extern stp_list_t *stp_list_copy(const stp_list_t *list);
00120
00127 extern int stp_list_destroy(stp_list_t *list);
00128
00135 extern stp_list_item_t *stp_list_get_start(const stp_list_t *list);
00136
00143 extern stp_list_item_t *stp_list_get_end(const stp_list_t *list);
00144
00152 extern stp_list_item_t *stp_list_get_item_by_index(const stp_list_t *list,
00153 int idx);
00154
00162 extern stp_list_item_t *stp_list_get_item_by_name(const stp_list_t *list,
00163 const char *name);
00164
00172 extern stp_list_item_t *stp_list_get_item_by_long_name(const stp_list_t *list,
00173 const char *long_name);
00174
00180 extern int stp_list_get_length(const stp_list_t *list);
00181
00190 extern void stp_list_set_freefunc(stp_list_t *list,
00191 stp_node_freefunc freefunc);
00192
00199 extern stp_node_freefunc stp_list_get_freefunc(const stp_list_t *list);
00200
00209 extern void stp_list_set_copyfunc(stp_list_t *list,
00210 stp_node_copyfunc copyfunc);
00211
00218 extern stp_node_copyfunc stp_list_get_copyfunc(const stp_list_t *list);
00219
00228 extern void stp_list_set_namefunc(stp_list_t *list,
00229 stp_node_namefunc namefunc);
00230
00237 extern stp_node_namefunc stp_list_get_namefunc(const stp_list_t *list);
00238
00247 extern void stp_list_set_long_namefunc(stp_list_t *list,
00248 stp_node_namefunc long_namefunc);
00249
00256 extern stp_node_namefunc stp_list_get_long_namefunc(const stp_list_t *list);
00257
00265 extern void stp_list_set_sortfunc(stp_list_t *list,
00266 stp_node_sortfunc sortfunc);
00267
00274 extern stp_node_sortfunc stp_list_get_sortfunc(const stp_list_t *list);
00275
00284 extern int stp_list_item_create(stp_list_t *list,
00285 stp_list_item_t *next,
00286 const void *data);
00287
00294 extern int stp_list_item_destroy(stp_list_t *list,
00295 stp_list_item_t *item);
00296
00303 extern stp_list_item_t *stp_list_item_prev(const stp_list_item_t *item);
00304
00311 extern stp_list_item_t *stp_list_item_next(const stp_list_item_t *item);
00312
00318 extern void *stp_list_item_get_data(const stp_list_item_t *item);
00319
00328 extern int stp_list_item_set_data(stp_list_item_t *item,
00329 void *data);
00330
00333 #ifdef __cplusplus
00334 }
00335 #endif
00336
00337 #endif