00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00032 #ifndef _LIST_H
00033 #define _LIST_H
00034 
00035 typedef struct node_l node_l;
00036 struct node_l {
00037         node_l *next;
00038         void *data;
00039 };
00040 
00041 typedef struct _data {
00042         int n;
00043         char str[1024];
00044 } data;
00045 
00046 
00047 int list_push(node_l **_x, void *_data);
00048 
00049 void *list_pop(node_l **_x);
00050 
00051 int list_move(node_l **_dest, node_l **_src);
00052 
00053 int list_reverse(node_l **_x);
00054 
00055 node_l *list_sub(const node_l *_x, int _pos);
00056 
00057 int list_insert(node_l **_x, int _pos, void *_data);
00058 
00059 void *list_remove(node_l **_x, int _pos);
00060 
00061 void *list_get(const node_l *_x, int _n);
00062 
00063 size_t list_size(const node_l *_x);
00064 
00065 node_l *list_join(node_l *_a, node_l *_b);
00066 
00067 void list_print(const node_l *_a);
00068 
00069 int list_split(node_l **_src, node_l **_front, node_l **_back);
00070 
00071 int list_merge(node_l **_dest, node_l **_a, node_l **_b, int _cmp(void *, void *));
00072 
00073 int list_sort(node_l **_x, int _cmp(void *, void *));
00074 
00075 int list_copy(const node_l *_src, node_l **_dest);
00076 
00077 int list_realloc(node_l *_x, size_t _sz);
00078 
00079 int list_dup(node_l *_src, node_l **_dest, size_t _sz);
00080 
00081 void list_delete(node_l **_x);
00082 
00083 void list_destroy(node_l **_x);
00084 
00085 int list_foreach(node_l *_x, int _func(void *));
00086 
00087 #endif