/[cvs]/eggdrop1.9/src/egglib/linked_list.h
ViewVC logotype

Contents of /eggdrop1.9/src/egglib/linked_list.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Sun Oct 28 13:30:35 2001 UTC (17 years, 11 months ago) by ite
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/x-csrc
FILE REMOVED
Renamed src/adns, src/compat, src/egglib to lib/adns, lib/compat, lib/egglib respectively.

1 #ifndef _LINKED_LIST_H_
2 #define _LINKED_LIST_H_
3
4 #define LINKED_LIST_SORTED 1
5 #define LINKED_LIST_DOUBLE 2
6 #define LINKED_LIST_STATIC 4
7
8 typedef int (*linked_list_cmp_func)(const void *left, const void *right);
9 typedef void (*linked_list_node_func)(void *data, void *param);
10
11 typedef struct linked_list_node_b {
12 void *key;
13 void *data;
14 struct linked_list_node_b *next, *prev;
15 } linked_list_node_t;
16
17 typedef struct linked_list_b {
18 linked_list_cmp_func cmp;
19 linked_list_node_t *head, *tail;
20 int flags;
21 } linked_list_t;
22
23 typedef struct linked_list_cursor_b {
24 linked_list_node_t *node;
25 linked_list_t *list;
26 int flags;
27 } linked_list_cursor_t;
28
29
30 linked_list_t *linked_list_create(linked_list_t *list, linked_list_cmp_func func, int flags);
31 int linked_list_destroy(linked_list_t *list);
32 int linked_list_walk(linked_list_t *list, linked_list_node_func callback, void *param);
33 linked_list_cursor_t *linked_list_cursor_create(linked_list_cursor_t *cursor, linked_list_t *list);
34 int linked_list_cursor_destroy(linked_list_cursor_t *cursor);
35 int linked_list_cursor_get(linked_list_cursor_t *cursor, void *itemptr);
36 int linked_list_cursor_home(linked_list_cursor_t *cursor);
37 int linked_list_cursor_end(linked_list_cursor_t *cursor);
38 int linked_list_cursor_prepend(linked_list_cursor_t *cursor, void *key, void *data);
39 int linked_list_cursor_append(linked_list_cursor_t *cursor, void *key, void *data);
40 int linked_list_cursor_prev(linked_list_cursor_t *cursor);
41 int linked_list_cursor_next(linked_list_cursor_t *cursor);
42 int linked_list_cursor_find(linked_list_cursor_t *cursor, void *key);
43 int linked_list_cursor_replace(linked_list_cursor_t *cursor, void *key, void *data);
44 int linked_list_cursor_delete(linked_list_cursor_t *cursor);
45 int linked_list_append(linked_list_t *list, void *key, void *data);
46 int linked_list_prepend(linked_list_t *list, void *key, void *data);
47 int linked_list_insert(linked_list_t *list, void *key, void *data);
48 int linked_list_delete(linked_list_t *list, void *key, linked_list_node_func callback);
49 int linked_list_int_cmp(const void *left, const void *right);
50
51 #endif

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23