]> jfr.im git - solanum.git/blame - include/hook.h
authd: fix "is provider done" logic in blacklist/opm providers
[solanum.git] / include / hook.h
CommitLineData
212380e3
AC
1/*
2 * Copyright (C) 2004-2005 Lee Hardy <lee -at- leeh.co.uk>
3 * Copyright (C) 2004-2005 ircd-ratbox development team
212380e3
AC
4 */
5#ifndef INCLUDED_HOOK_H
6#define INCLUDED_HOOK_H
7
8typedef struct
9{
10 char *name;
5b96d9a6 11 rb_dlink_list hooks;
212380e3
AC
12} hook;
13
14typedef void (*hookfn) (void *data);
15
2e819b6b
JT
16extern int h_iosend_id;
17extern int h_iorecv_id;
18extern int h_iorecvctrl_id;
212380e3 19
2e819b6b
JT
20extern int h_burst_client;
21extern int h_burst_channel;
22extern int h_burst_finished;
23extern int h_server_introduced;
24extern int h_server_eob;
25extern int h_client_exit;
26extern int h_umode_changed;
27extern int h_new_local_user;
28extern int h_new_remote_user;
29extern int h_introduce_client;
5f8d323c 30extern int h_can_kick;
ca4c2a86
AC
31extern int h_privmsg_channel;
32extern int h_privmsg_user;
7d603754
KB
33extern int h_conf_read_start;
34extern int h_conf_read_end;
4f8ababa 35extern int h_outbound_msgbuf;
2575a78b 36extern int h_rehash;
212380e3
AC
37
38void init_hook(void);
39int register_hook(const char *name);
40void add_hook(const char *name, hookfn fn);
41void remove_hook(const char *name, hookfn fn);
42void call_hook(int id, void *arg);
43
48a2b7c1
AC
44typedef struct
45{
46 struct Client *client;
47 void *arg1;
48 void *arg2;
49} hook_data;
50
212380e3
AC
51typedef struct
52{
53 struct Client *client;
54 const void *arg1;
55 const void *arg2;
48a2b7c1 56} hook_cdata;
212380e3
AC
57
58typedef struct
59{
60 struct Client *client;
61 const void *arg1;
62 int arg2;
ea2d2700 63 int result;
212380e3
AC
64} hook_data_int;
65
66typedef struct
67{
68 struct Client *client;
69 struct Client *target;
9e07c8f7
AC
70 struct Channel *chptr;
71 int approved;
212380e3
AC
72} hook_data_client;
73
74typedef struct
75{
76 struct Client *client;
77 struct Channel *chptr;
78 int approved;
79} hook_data_channel;
80
81typedef struct
82{
83 struct Client *client;
84 struct Channel *chptr;
5bc95eaf 85 const char *key;
212380e3
AC
86} hook_data_channel_activity;
87
5f8d323c
AC
88typedef struct
89{
90 struct Client *client;
91 struct Channel *chptr;
6ca4dec9 92 struct membership *msptr;
5f8d323c
AC
93 struct Client *target;
94 int approved;
202d4966 95 int dir;
b870a5f8 96 const char *modestr;
5f8d323c
AC
97} hook_data_channel_approval;
98
212380e3
AC
99typedef struct
100{
101 struct Client *client;
9d745dbd 102 struct Client *target;
212380e3
AC
103 int approved;
104} hook_data_client_approval;
105
106typedef struct
107{
108 struct Client *local_link; /* local client originating this, or NULL */
109 struct Client *target; /* dying client */
110 struct Client *from; /* causing client (could be &me or target) */
111 const char *comment;
112} hook_data_client_exit;
113
114typedef struct
115{
116 struct Client *client;
117 unsigned int oldumodes;
118 unsigned int oldsnomask;
119} hook_data_umode_changed;
120
ca4c2a86
AC
121enum message_type {
122 MESSAGE_TYPE_NOTICE,
123 MESSAGE_TYPE_PRIVMSG,
62cf5b40 124 MESSAGE_TYPE_PART,
ca4c2a86
AC
125 MESSAGE_TYPE_COUNT
126};
127
128typedef struct
129{
130 enum message_type msgtype;
131 struct Client *source_p;
132 struct Channel *chptr;
133 const char *text;
134 int approved;
135} hook_data_privmsg_channel;
136
137typedef struct
138{
139 enum message_type msgtype;
140 struct Client *source_p;
141 struct Client *target_p;
142 const char *text;
143 int approved;
144} hook_data_privmsg_user;
145
2575a78b
EM
146typedef struct
147{
148 bool signal;
149} hook_data_rehash;
150
212380e3 151#endif