6 #include <sys/types.h> /* for u_* */
11 #define TAC_LIST_PARANOIA 1
14 /* Bidirectional lists */
16 #ifdef TAC_LIST_PARANOIA
17 #define TAC_LIST_MAGIC (0xBEF78147U)
18 #define TAC_LIST_NODE_MAGIC (0x297DA735U)
22 #ifdef TAC_LIST_PARANOIA
25 struct tac_list_node *_head, *_tail;
28 struct tac_list_node {
29 #ifdef TAC_LIST_PARANOIA
32 struct tac_list_node *_next, *_prev;
33 struct tac_list *_list;
37 extern void *tac_malloc TAC_ARGS((int size));
38 extern void *tac_realloc TAC_ARGS((void *ptr, int size));
39 extern void tac_exit TAC_ARGS((int status)) G_GNUC_NORETURN;
40 extern char *tac_strdup TAC_ARGS((const char *p));
41 extern char *tac_make_string TAC_ARGS((u_char *p, int len));
42 extern const char *tac_find_substring TAC_ARGS((const char *substring, const char *string));
43 extern int tac_lockfd TAC_ARGS((char *filename, int lockfd));
45 /* Bidirectional lists: */
47 extern void tac_list_init TAC_ARGS((struct tac_list *list));
48 extern void tac_list_node_init TAC_ARGS((struct tac_list_node *node));
49 extern struct tac_list *tac_list_node_get_list TAC_ARGS((struct tac_list_node *node));
50 struct tac_list_node *tac_list_first_node TAC_ARGS((struct tac_list *list));
51 struct tac_list_node *tac_list_last_node TAC_ARGS((struct tac_list *list));
52 extern void tac_list_addhead TAC_ARGS((struct tac_list *list, struct tac_list_node *node));
53 extern void tac_list_addtail TAC_ARGS((struct tac_list *list, struct tac_list_node *node));
54 extern struct tac_list_node *tac_list_node_next TAC_ARGS((struct tac_list_node *node));
55 extern struct tac_list_node *tac_list_node_prev TAC_ARGS((struct tac_list_node *node));
56 extern void tac_list_node_remove TAC_ARGS((struct tac_list_node *node));