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
;
82 struct Channel
*chptr
;
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
;
117 } hook_data_client_approval
;
121 struct Client
*local_link
; /* local client originating this, or NULL */
122 struct Client
*target
; /* dying client */
123 struct Client
*from
; /* causing client (could be &me or target) */
125 } hook_data_client_exit
;
129 struct Client
*client
;
131 const char *orig_reason
;
132 } hook_data_client_quit
;
136 struct Client
*client
;
137 unsigned int oldumodes
;
138 unsigned int oldsnomask
;
139 } hook_data_umode_changed
;
143 MESSAGE_TYPE_PRIVMSG
,
150 enum message_type msgtype
;
151 struct Client
*source_p
;
152 struct Channel
*chptr
;
155 } hook_data_privmsg_channel
;
159 enum message_type msgtype
;
160 struct Client
*source_p
;
161 struct Client
*target_p
;
164 } hook_data_privmsg_user
;