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
14 typedef void (*hookfn
) (void *data
);
16 extern int h_iosend_id
;
17 extern int h_iorecv_id
;
18 extern int h_iorecvctrl_id
;
20 extern int h_burst_client
;
21 extern int h_burst_channel
;
22 extern int h_burst_finished
;
23 extern int h_server_introduced
;
24 extern int h_server_eob
;
25 extern int h_client_exit
;
26 extern int h_umode_changed
;
27 extern int h_new_local_user
;
28 extern int h_new_remote_user
;
29 extern int h_introduce_client
;
30 extern int h_can_kick
;
31 extern int h_privmsg_channel
;
32 extern int h_privmsg_user
;
33 extern int h_conf_read_start
;
34 extern int h_conf_read_end
;
35 extern int h_outbound_msgbuf
;
38 int register_hook(const char *name
);
39 void add_hook(const char *name
, hookfn fn
);
40 void remove_hook(const char *name
, hookfn fn
);
41 void call_hook(int id
, void *arg
);
45 struct Client
*client
;
52 struct Client
*client
;
59 struct Client
*client
;
67 struct Client
*client
;
68 struct Client
*target
;
69 struct Channel
*chptr
;
75 struct Client
*client
;
76 struct Channel
*chptr
;
82 struct Client
*client
;
83 struct Channel
*chptr
;
85 } hook_data_channel_activity
;
89 struct Client
*client
;
90 struct Channel
*chptr
;
91 struct membership
*msptr
;
92 struct Client
*target
;
96 } hook_data_channel_approval
;
100 struct Client
*client
;
101 struct Client
*target
;
103 } hook_data_client_approval
;
107 struct Client
*local_link
; /* local client originating this, or NULL */
108 struct Client
*target
; /* dying client */
109 struct Client
*from
; /* causing client (could be &me or target) */
111 } hook_data_client_exit
;
115 struct Client
*client
;
116 unsigned int oldumodes
;
117 unsigned int oldsnomask
;
118 } hook_data_umode_changed
;
122 MESSAGE_TYPE_PRIVMSG
,
129 enum message_type msgtype
;
130 struct Client
*source_p
;
131 struct Channel
*chptr
;
134 } hook_data_privmsg_channel
;
138 enum message_type msgtype
;
139 struct Client
*source_p
;
140 struct Client
*target_p
;
143 } hook_data_privmsg_user
;