2 * @brief Singly and doubly linked list manipulation interface.
5 #ifndef INCLUDED_list_h
6 #define INCLUDED_list_h
7 #ifndef INCLUDED_sys_types_h
8 #include <sys/types.h> /* time_t, size_t */
9 #define INCLUDED_sys_types_h
21 /** Node in a singly linked list. */
23 struct SLink *next; /**< Next element in list. */
25 struct Client *cptr; /**< List element as a client. */
26 struct Channel *chptr; /**< List element as a channel. */
27 struct ConfItem *aconf; /**< List element as a configuration item. */
28 char *cp; /**< List element as a string. */
30 char *banstr; /**< Ban hostmask. */
31 char *who; /**< Name of client that set the ban. */
32 time_t when; /**< Timestamp when ban was added. */
33 } ban; /**< List element as a ban. */
34 } value; /**< Value of list element. */
35 unsigned int flags; /**< Modifier flags for list element. */
38 /** Node in a doubly linked list. */
40 struct DLink* next; /**< Next element in list. */
41 struct DLink* prev; /**< Previous element in list. */
43 struct Client* cptr; /**< List element as a client. */
44 struct Channel* chptr; /**< List element as a channel. */
45 char* ch; /**< List element as a string. */
46 } value; /**< Value of list element. */
53 extern void free_link(struct SLink *lp);
54 extern struct SLink *make_link(void);
55 extern struct SLink *find_user_link(struct SLink *lp, struct Client *ptr);
56 extern void init_list(void);
57 extern struct Client *make_client(struct Client *from, int status);
58 extern void free_connection(struct Connection *con);
59 extern void free_client(struct Client *cptr);
60 extern struct Server *make_server(struct Client *cptr);
61 extern void remove_client_from_list(struct Client *cptr);
62 extern void add_client_to_list(struct Client *cptr);
63 extern struct DLink *add_dlink(struct DLink **lpp, struct Client *cp);
64 extern void remove_dlink(struct DLink **lpp, struct DLink *lp);
65 extern struct ConfItem *make_conf(void);
66 extern void free_conf(struct ConfItem *aconf);
67 extern void send_listinfo(struct Client *cptr, char *name);
69 #endif /* INCLUDED_list_h */