92b35ecf0d4c4a644153cf2768f7172689e1efe6
[srvx.git] / src / opserv.h
1 /* opserv.h - IRC Operator assistant service
2  * Copyright 2000-2004 srvx Development Team
3  *
4  * This file is part of srvx.
5  *
6  * srvx is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with srvx; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
19  */
20
21 #ifndef _opserv_h
22 #define _opserv_h
23
24 /* DEVNULL_MODE_* go into devnull_class.modes */
25 #define DEVNULL_MODE_A 0x00000001
26 #define DEVNULL_MODE_B 0x00000002
27 #define DEVNULL_MODE_C 0x00000004
28 #define DEVNULL_MODE_D 0x00000008
29 #define DEVNULL_MODE_E 0x00000010
30 #define DEVNULL_MODE_F 0x00000020
31 #define DEVNULL_MODE_G 0x00000040
32 #define DEVNULL_MODE_H 0x00000080
33 #define DEVNULL_MODE_I 0x00000100
34 #define DEVNULL_MODE_J 0x00000200
35 #define DEVNULL_MODE_K 0x00000400
36 #define DEVNULL_MODE_L 0x00000800
37 #define DEVNULL_MODE_M 0x00001000
38 #define DEVNULL_MODE_N 0x00002000
39 #define DEVNULL_MODE_OPME 0x00004000
40
41 #define DEVNULL_MODES "abcdefghijklmno"
42
43 #define DEVNULL_FLAGGED(hi, tok) ((hi)->modes & DEVNULL_##tok)
44 #define DEVNULL_SET_FLAG(hi, tok) ((hi)->modes |= DEVNULL_##tok)
45 #define DEVNULL_CLEAR_FLAG(hi, tok) ((hi)->modes &= ~DEVNULL_##tok)
46
47 struct devnull_class {
48     char *name;
49     unsigned long modes;
50     unsigned long maxchan;
51     unsigned long maxsendq;
52 };
53
54 void init_opserv(const char *nick);
55 unsigned int gag_create(const char *mask, const char *owner, const char *reason, unsigned long expires);
56 int opserv_bad_channel(const char *name);
57 void devnull_delete(const char *auth);
58 void devnull_rename(const char *oldauth, const char *newauth);
59 int devnull_check(const char *name);
60 struct devnull_class* devnull_get(const char *name);
61 struct userNode* GetOpServ(void);
62 void operpart(struct chanNode *chan, struct userNode *user);
63 void operadd(struct userNode *user);
64 void operdel(struct userNode *user);
65
66 #endif