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
;
50 int register_hook(const char *name
);
51 void add_hook(const char *name
, hookfn fn
);
52 void add_hook_prio(const char *name
, hookfn fn
, enum hook_priority priority
);
53 void remove_hook(const char *name
, hookfn fn
);
54 void call_hook(int id
, void *arg
);
58 struct Client
*client
;
65 struct Client
*client
;
72 struct Client
*client
;
80 struct Client
*client
;
81 struct Client
*target
;
86 struct Client
*client
;
87 struct Channel
*chptr
;
93 struct Client
*client
;
94 struct Channel
*chptr
;
96 } hook_data_channel_activity
;
100 struct Client
*client
;
101 struct Channel
*chptr
;
102 struct membership
*msptr
;
103 struct Client
*target
;
108 } hook_data_channel_approval
;
112 struct Client
*client
;
113 struct Channel
*chptr
;
114 struct membership
*clientms
;
115 struct membership
*targms
;
117 } hook_data_channel_visibility
;
121 struct Client
*client
;
122 struct Client
*target
;
124 } hook_data_client_approval
;
128 struct Client
*local_link
; /* local client originating this, or NULL */
129 struct Client
*target
; /* dying client */
130 struct Client
*from
; /* causing client (could be &me or target) */
132 } hook_data_client_exit
;
136 struct Client
*client
;
138 const char *orig_reason
;
139 } hook_data_client_quit
;
143 struct Client
*client
;
144 unsigned int oldumodes
;
145 unsigned int oldsnomask
;
146 } hook_data_umode_changed
;
150 MESSAGE_TYPE_PRIVMSG
,
157 enum message_type msgtype
;
158 struct Client
*source_p
;
159 struct Channel
*chptr
;
162 } hook_data_privmsg_channel
;
166 enum message_type msgtype
;
167 struct Client
*source_p
;
168 struct Client
*target_p
;
171 } hook_data_privmsg_user
;