]> jfr.im git - irc/rqf/shadowircd.git/blame - include/hook.h
Add mr_flea (and Taros) to the list of Charybdis contributors.
[irc/rqf/shadowircd.git] / include / hook.h
CommitLineData
212380e3 1/*
2 * Copyright (C) 2004-2005 Lee Hardy <lee -at- leeh.co.uk>
3 * Copyright (C) 2004-2005 ircd-ratbox development team
4 *
212380e3 5 */
6#ifndef INCLUDED_HOOK_H
7#define INCLUDED_HOOK_H
8
9typedef struct
10{
11 char *name;
08d11e34 12 rb_dlink_list hooks;
212380e3 13} hook;
14
15typedef void (*hookfn) (void *data);
16
aa65834c
JT
17extern int h_iosend_id;
18extern int h_iorecv_id;
19extern int h_iorecvctrl_id;
212380e3 20
aa65834c
JT
21extern int h_burst_client;
22extern int h_burst_channel;
23extern int h_burst_finished;
24extern int h_server_introduced;
25extern int h_server_eob;
26extern int h_client_exit;
27extern int h_umode_changed;
28extern int h_new_local_user;
29extern int h_new_remote_user;
30extern int h_introduce_client;
16d8d9fc 31extern int h_can_kick;
212380e3 32
33void init_hook(void);
34int register_hook(const char *name);
35void add_hook(const char *name, hookfn fn);
36void remove_hook(const char *name, hookfn fn);
37void call_hook(int id, void *arg);
38
39typedef struct
40{
41 struct Client *client;
42 const void *arg1;
43 const void *arg2;
44} hook_data;
45
46typedef struct
47{
48 struct Client *client;
49 const void *arg1;
50 int arg2;
51} hook_data_int;
52
53typedef struct
54{
55 struct Client *client;
56 struct Client *target;
57} hook_data_client;
58
59typedef struct
60{
61 struct Client *client;
62 struct Channel *chptr;
63 int approved;
64} hook_data_channel;
65
66typedef struct
67{
68 struct Client *client;
69 struct Channel *chptr;
70 char *key;
71} hook_data_channel_activity;
72
16d8d9fc
WP
73typedef struct
74{
75 struct Client *client;
76 struct Channel *chptr;
77 struct Client *target;
78 int approved;
79} hook_data_channel_approval;
80
212380e3 81typedef struct
82{
83 struct Client *client;
84 int approved;
85} hook_data_client_approval;
86
87typedef struct
88{
89 struct Client *local_link; /* local client originating this, or NULL */
90 struct Client *target; /* dying client */
91 struct Client *from; /* causing client (could be &me or target) */
92 const char *comment;
93} hook_data_client_exit;
94
95typedef struct
96{
97 struct Client *client;
98 unsigned int oldumodes;
99 unsigned int oldsnomask;
100} hook_data_umode_changed;
101
102#endif