Mercurial > pidgin.yaz
annotate plugins/icq/list.h @ 1487:7bb7eca3fa14
[gaim-migrate @ 1497]
i thought i fixed this already. maybe that was yahoo. sigh.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 09 Feb 2001 03:44:06 +0000 |
parents | 4c510ca3563f |
children | 0ef6603d986e |
rev | line source |
---|---|
1152 | 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 #ifndef _LIST_H | |
3 #define _LIST_H | |
4 | |
5 #ifdef HAVE_CONFIG_H | |
6 #include <config.h> | |
7 #endif | |
8 | |
9 #include <stdarg.h> | |
10 | |
11 #define list_enqueue(plist, p) \ | |
12 list_insert(plist, 0, p) | |
13 | |
14 #define list_dequeue(plist) \ | |
15 list_remove_node(plist, plist->head) | |
16 | |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
17 typedef struct list_node_s list_node; |
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
18 typedef struct list_s list; |
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
19 |
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
20 struct list_node_s |
1152 | 21 { |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
22 list_node *next; |
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
23 list_node *previous; |
1152 | 24 void *item; |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
25 }; |
1152 | 26 |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
27 struct list_s |
1152 | 28 { |
29 list_node *head; | |
30 list_node *tail; | |
31 int count; | |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
32 }; |
1152 | 33 |
34 list *list_new(void); | |
35 void list_delete(list *plist, void (*item_free_f)(void *)); | |
36 void list_free(list *plist, void (*item_free_f)(void *)); | |
37 void list_insert(list *plist, list_node *pnode, void *pitem); | |
38 void *list_remove(list *plist, void *pitem); | |
39 void *list_traverse(list *plist, int (*item_f)(void *, va_list), ...); | |
40 int list_dump(list *plist); | |
41 void *list_first(list *plist); | |
42 void *list_last(list *plist); | |
43 void *list_at(list *plist, int num); | |
44 list_node *list_find(list *plist, void *pitem); | |
45 void *list_remove_node(list *plist, list_node *p); | |
46 | |
47 #endif /* _LIST_H */ |