2 * Copyright (C) 2004-2005 Lee Hardy <lee -at- leeh.co.uk>
3 * Copyright (C) 2004-2005 ircd-ratbox development team
5 * $Id: hook.h 906 2006-02-21 02:25:43Z nenolod $
7 #ifndef INCLUDED_HOOK_H
8 #define INCLUDED_HOOK_H
16 typedef void (*hookfn
) (void *data
);
18 extern int h_iosend_id
;
19 extern int h_iorecv_id
;
20 extern int h_iorecvctrl_id
;
22 extern int h_burst_client
;
23 extern int h_burst_channel
;
24 extern int h_burst_finished
;
25 extern int h_server_introduced
;
26 extern int h_server_eob
;
27 extern int h_client_exit
;
28 extern int h_umode_changed
;
29 extern int h_new_local_user
;
30 extern int h_new_remote_user
;
31 extern int h_introduce_client
;
32 extern int h_can_kick
;
33 extern int h_privmsg_channel
;
34 extern int h_privmsg_user
;
35 extern int h_conf_read_start
;
36 extern int h_conf_read_end
;
37 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
;
98 } hook_data_channel_approval
;
102 struct Client
*client
;
103 struct Client
*target
;
105 } hook_data_client_approval
;
109 struct Client
*local_link
; /* local client originating this, or NULL */
110 struct Client
*target
; /* dying client */
111 struct Client
*from
; /* causing client (could be &me or target) */
113 } hook_data_client_exit
;
117 struct Client
*client
;
118 unsigned int oldumodes
;
119 unsigned int oldsnomask
;
120 } hook_data_umode_changed
;
124 MESSAGE_TYPE_PRIVMSG
,
131 enum message_type msgtype
;
132 struct Client
*source_p
;
133 struct Channel
*chptr
;
136 } hook_data_privmsg_channel
;
140 enum message_type msgtype
;
141 struct Client
*source_p
;
142 struct Client
*target_p
;
145 } hook_data_privmsg_user
;