Author: Bleep <tomh@inxpress.net>
[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 Channel;
15 struct ConfItem;
16
17 /* 
18  * Structures
19  */
20
21 struct SLink {
22   struct SLink *next;
23   union {
24     struct Client *cptr;
25     struct Channel *chptr;
26     struct ConfItem *aconf;
27     char *cp;
28     struct {
29       char *banstr;
30       char *who;
31       time_t when;
32     } ban;
33   } value;
34   unsigned int flags;
35 };
36
37 struct DLink {
38   struct DLink*  next;
39   struct DLink*  prev;
40   union {
41     struct Client*  cptr;
42     struct Channel* chptr;
43     char*           ch;
44   } value;
45 };
46
47 /*
48  * Proto types
49  */
50
51 extern void free_link(struct SLink *lp);
52 extern struct SLink *make_link(void);
53 extern struct SLink *find_user_link(struct SLink *lp, struct Client *ptr);
54 extern void init_list(void);
55 extern struct Client *make_client(struct Client *from, int status);
56 extern void free_client(struct Client *cptr);
57 extern struct Server *make_server(struct Client *cptr);
58 extern void remove_client_from_list(struct Client *cptr);
59 extern void add_client_to_list(struct Client *cptr);
60 extern struct DLink *add_dlink(struct DLink **lpp, struct Client *cp);
61 extern void remove_dlink(struct DLink **lpp, struct DLink *lp);
62 extern struct ConfItem *make_conf(void);
63 extern void delist_conf(struct ConfItem *aconf);
64 extern void free_conf(struct ConfItem *aconf);
65 extern void send_listinfo(struct Client *cptr, char *name);
66
67 #endif /* INCLUDED_list_h */