2 * Copyright (C) 2004-2005 Lee Hardy <lee -at- leeh.co.uk>
3 * Copyright (C) 2004-2005 ircd-ratbox development team
5 #ifndef INCLUDED_HOOK_H
6 #define INCLUDED_HOOK_H
24 typedef void (*hookfn
) (void *data
);
26 extern int h_iosend_id
;
27 extern int h_iorecv_id
;
28 extern int h_iorecvctrl_id
;
30 extern int h_burst_client
;
31 extern int h_burst_channel
;
32 extern int h_burst_finished
;
33 extern int h_server_introduced
;
34 extern int h_server_eob
;
35 extern int h_client_exit
;
36 extern int h_after_client_exit
;
37 extern int h_umode_changed
;
38 extern int h_new_local_user
;
39 extern int h_new_remote_user
;
40 extern int h_introduce_client
;
41 extern int h_can_kick
;
42 extern int h_privmsg_channel
;
43 extern int h_privmsg_user
;
44 extern int h_conf_read_start
;
45 extern int h_conf_read_end
;
46 extern int h_outbound_msgbuf
;
48 extern int h_priv_change
;
49 extern int h_cap_change
;
52 int register_hook(const char *name
);
53 void add_hook(const char *name
, hookfn fn
);
54 void add_hook_prio(const char *name
, hookfn fn
, enum hook_priority priority
);
55 void remove_hook(const char *name
, hookfn fn
);
56 void call_hook(int id
, void *arg
);
60 struct Client
*client
;
67 struct Client
*client
;
74 struct Client
*client
;
82 struct Client
*client
;
83 struct Client
*target
;
88 struct Client
*client
;
89 struct Channel
*chptr
;
95 struct Client
*client
;
96 struct Channel
*chptr
;
98 } hook_data_channel_activity
;
102 struct Client
*client
;
103 struct Channel
*chptr
;
104 struct membership
*msptr
;
105 struct Client
*target
;
110 } hook_data_channel_approval
;
114 struct Client
*client
;
115 struct Client
*target
;
116 struct Channel
*chptr
;
117 struct membership
*clientms
;
118 struct membership
*targetms
;
120 } hook_data_channel_visibility
;
124 struct Client
*client
;
125 struct Client
*target
;
127 } hook_data_client_approval
;
131 struct Client
*local_link
; /* local client originating this, or NULL */
132 struct Client
*target
; /* dying client */
133 struct Client
*from
; /* causing client (could be &me or target) */
135 } hook_data_client_exit
;
139 struct Client
*client
;
141 const char *orig_reason
;
142 } hook_data_client_quit
;
146 struct Client
*client
;
147 unsigned int oldumodes
;
148 unsigned int oldsnomask
;
149 } hook_data_umode_changed
;
153 struct Client
*client
;
157 } hook_data_cap_change
;
161 MESSAGE_TYPE_PRIVMSG
,
168 enum message_type msgtype
;
169 struct Client
*source_p
;
170 struct Channel
*chptr
;
173 } hook_data_privmsg_channel
;
177 enum message_type msgtype
;
178 struct Client
*source_p
;
179 struct Client
*target_p
;
182 } hook_data_privmsg_user
;
186 struct Client
*client
;
187 struct PrivilegeSet
*old
;
188 struct PrivilegeSet
*new;
189 const struct PrivilegeSet
*added
;
190 const struct PrivilegeSet
*removed
;
191 const struct PrivilegeSet
*unchanged
;
192 } hook_data_priv_change
;