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_cap_change
;
51 int register_hook(const char *name
);
52 void add_hook(const char *name
, hookfn fn
);
53 void add_hook_prio(const char *name
, hookfn fn
, enum hook_priority priority
);
54 void remove_hook(const char *name
, hookfn fn
);
55 void call_hook(int id
, void *arg
);
59 struct Client
*client
;
66 struct Client
*client
;
73 struct Client
*client
;
81 struct Client
*client
;
82 struct Client
*target
;
87 struct Client
*client
;
88 struct Channel
*chptr
;
94 struct Client
*client
;
95 struct Channel
*chptr
;
97 } hook_data_channel_activity
;
101 struct Client
*client
;
102 struct Channel
*chptr
;
103 struct membership
*msptr
;
104 struct Client
*target
;
109 } hook_data_channel_approval
;
113 struct Client
*client
;
114 struct Client
*target
;
115 struct Channel
*chptr
;
116 struct membership
*clientms
;
117 struct membership
*targetms
;
119 } hook_data_channel_visibility
;
123 struct Client
*client
;
124 struct Client
*target
;
126 } hook_data_client_approval
;
130 struct Client
*local_link
; /* local client originating this, or NULL */
131 struct Client
*target
; /* dying client */
132 struct Client
*from
; /* causing client (could be &me or target) */
134 } hook_data_client_exit
;
138 struct Client
*client
;
140 const char *orig_reason
;
141 } hook_data_client_quit
;
145 struct Client
*client
;
146 unsigned int oldumodes
;
147 unsigned int oldsnomask
;
148 } hook_data_umode_changed
;
152 struct Client
*client
;
156 } hook_data_cap_change
;
160 MESSAGE_TYPE_PRIVMSG
,
167 enum message_type msgtype
;
168 struct Client
*source_p
;
169 struct Channel
*chptr
;
172 } hook_data_privmsg_channel
;
176 enum message_type msgtype
;
177 struct Client
*source_p
;
178 struct Client
*target_p
;
181 } hook_data_privmsg_user
;