]> jfr.im git - irc/rqf/shadowircd.git/blob - include/hook.h
Only count throttle entries that cause rejection in /stats t.
[irc/rqf/shadowircd.git] / include / hook.h
1 /*
2 * Copyright (C) 2004-2005 Lee Hardy <lee -at- leeh.co.uk>
3 * Copyright (C) 2004-2005 ircd-ratbox development team
4 *
5 * $Id: hook.h 906 2006-02-21 02:25:43Z nenolod $
6 */
7 #ifndef INCLUDED_HOOK_H
8 #define INCLUDED_HOOK_H
9
10 typedef struct
11 {
12 char *name;
13 rb_dlink_list hooks;
14 } hook;
15
16 typedef void (*hookfn) (void *data);
17
18 extern int h_iosend_id;
19 extern int h_iorecv_id;
20 extern int h_iorecvctrl_id;
21
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
33 void init_hook(void);
34 int register_hook(const char *name);
35 void add_hook(const char *name, hookfn fn);
36 void remove_hook(const char *name, hookfn fn);
37 void call_hook(int id, void *arg);
38
39 typedef struct
40 {
41 struct Client *client;
42 const void *arg1;
43 const void *arg2;
44 } hook_data;
45
46 typedef struct
47 {
48 struct Client *client;
49 const void *arg1;
50 int arg2;
51 } hook_data_int;
52
53 typedef struct
54 {
55 struct Client *client;
56 struct Client *target;
57 } hook_data_client;
58
59 typedef struct
60 {
61 struct Client *client;
62 struct Channel *chptr;
63 int approved;
64 } hook_data_channel;
65
66 typedef struct
67 {
68 struct Client *client;
69 struct Channel *chptr;
70 char *key;
71 } hook_data_channel_activity;
72
73 typedef struct
74 {
75 struct Client *client;
76 int approved;
77 } hook_data_client_approval;
78
79 typedef struct
80 {
81 struct Client *local_link; /* local client originating this, or NULL */
82 struct Client *target; /* dying client */
83 struct Client *from; /* causing client (could be &me or target) */
84 const char *comment;
85 } hook_data_client_exit;
86
87 typedef struct
88 {
89 struct Client *client;
90 unsigned int oldumodes;
91 unsigned int oldsnomask;
92 } hook_data_umode_changed;
93
94 #endif