Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / list.h
1 /*
2  * list.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_list_h
7 #define INCLUDED_list_h
8 #ifndef INCLUDED_sys_types_h
9 #include <sys/types.h>         /* time_t, size_t */
10 #define INCLUDED_sys_types_h
11 #endif
12
13 struct Client;
14 struct Connection;
15 struct Channel;
16 struct ConfItem;
17
18 /* 
19  * Structures
20  */
21
22 struct SLink {
23   struct SLink *next;
24   union {
25     struct Client *cptr;
26     struct Channel *chptr;
27     struct ConfItem *aconf;
28     char *cp;
29     struct {
30       char *banstr;
31       char *who;
32       time_t when;
33     } ban;
34   } value;
35   unsigned int flags;
36 };
37
38 struct DLink {
39   struct DLink*  next;
40   struct DLink*  prev;
41   union {
42     struct Client*  cptr;
43     struct Channel* chptr;
44     char*           ch;
45   } value;
46 };
47
48 /*
49  * Proto types
50  */
51
52 extern void free_link(struct SLink *lp);
53 extern struct SLink *make_link(void);
54 extern struct SLink *find_user_link(struct SLink *lp, struct Client *ptr);
55 extern void init_list(void);
56 extern struct Client *make_client(struct Client *from, int status);
57 extern void free_connection(struct Connection *con);
58 extern void free_client(struct Client *cptr);
59 extern struct Server *make_server(struct Client *cptr);
60 extern void remove_client_from_list(struct Client *cptr);
61 extern void add_client_to_list(struct Client *cptr);
62 extern struct DLink *add_dlink(struct DLink **lpp, struct Client *cp);
63 extern void remove_dlink(struct DLink **lpp, struct DLink *lp);
64 extern struct ConfItem *make_conf(void);
65 extern void delist_conf(struct ConfItem *aconf);
66 extern void free_conf(struct ConfItem *aconf);
67 extern void send_listinfo(struct Client *cptr, char *name);
68
69 #endif /* INCLUDED_list_h */