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_after_client_exit
;
27 extern int h_umode_changed
;
28 extern int h_new_local_user
;
29 extern int h_new_remote_user
;
30 extern int h_introduce_client
;
31 extern int h_can_kick
;
32 extern int h_privmsg_channel
;
33 extern int h_privmsg_user
;
34 extern int h_conf_read_start
;
35 extern int h_conf_read_end
;
36 extern int h_outbound_msgbuf
;
40 int register_hook(const char *name
);
41 void add_hook(const char *name
, hookfn fn
);
42 void remove_hook(const char *name
, hookfn fn
);
43 void call_hook(int id
, void *arg
);
47 struct Client
*client
;
54 struct Client
*client
;
61 struct Client
*client
;
69 struct Client
*client
;
70 struct Client
*target
;
71 struct Channel
*chptr
;
77 struct Client
*client
;
78 struct Channel
*chptr
;
84 struct Client
*client
;
85 struct Channel
*chptr
;
87 } hook_data_channel_activity
;
91 struct Client
*client
;
92 struct Channel
*chptr
;
93 struct membership
*msptr
;
94 struct Client
*target
;
99 } hook_data_channel_approval
;
103 struct Client
*client
;
104 struct Client
*target
;
106 } hook_data_client_approval
;
110 struct Client
*local_link
; /* local client originating this, or NULL */
111 struct Client
*target
; /* dying client */
112 struct Client
*from
; /* causing client (could be &me or target) */
114 } hook_data_client_exit
;
118 struct Client
*client
;
120 const char *orig_reason
;
121 } hook_data_client_quit
;
125 struct Client
*client
;
126 unsigned int oldumodes
;
127 unsigned int oldsnomask
;
128 } hook_data_umode_changed
;
132 MESSAGE_TYPE_PRIVMSG
,
139 enum message_type msgtype
;
140 struct Client
*source_p
;
141 struct Channel
*chptr
;
144 } hook_data_privmsg_channel
;
148 enum message_type msgtype
;
149 struct Client
*source_p
;
150 struct Client
*target_p
;
153 } hook_data_privmsg_user
;