Mercurial > pidgin.yaz
annotate plugins/icq/list.h @ 1727:02653161cbce
[gaim-migrate @ 1737]
bleh. this should be handled by write_to_conv.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 19 Apr 2001 03:53:23 +0000 |
parents | 0ef6603d986e |
children | 8ed70631ed15 |
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; |
1498
0ef6603d986e
[gaim-migrate @ 1508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1432
diff
changeset
|
19 typedef int (*icq_ListCompareFunc)(void *o1, void *o2); |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
20 |
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
21 struct list_node_s |
1152 | 22 { |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
23 list_node *next; |
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
24 list_node *previous; |
1152 | 25 void *item; |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
26 }; |
1152 | 27 |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
28 struct list_s |
1152 | 29 { |
30 list_node *head; | |
31 list_node *tail; | |
32 int count; | |
1498
0ef6603d986e
[gaim-migrate @ 1508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1432
diff
changeset
|
33 icq_ListCompareFunc compare_function; |
1432
4c510ca3563f
[gaim-migrate @ 1442]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1152
diff
changeset
|
34 }; |
1152 | 35 |
36 list *list_new(void); | |
37 void list_delete(list *plist, void (*item_free_f)(void *)); | |
38 void list_free(list *plist, void (*item_free_f)(void *)); | |
1498
0ef6603d986e
[gaim-migrate @ 1508]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1432
diff
changeset
|
39 void list_insert_sorted(list *plist, void *pitem); |
1152 | 40 void list_insert(list *plist, list_node *pnode, void *pitem); |
41 void *list_remove(list *plist, void *pitem); | |
42 void *list_traverse(list *plist, int (*item_f)(void *, va_list), ...); | |
43 int list_dump(list *plist); | |
44 void *list_first(list *plist); | |
45 void *list_last(list *plist); | |
46 void *list_at(list *plist, int num); | |
47 list_node *list_find(list *plist, void *pitem); | |
48 void *list_remove_node(list *plist, list_node *p); | |
49 | |
50 #endif /* _LIST_H */ |