fixed coding fails in the last 2 commits
[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_PRIV_* go into devnull_class.modes */
25 #define DEVNULL_PRIV_CHANLIMIT      0x0001
26 #define DEVNULL_PRIV_UNLIMITTARGET  0x0002
27 #define DEVNULL_PRIV_HALFFLOOD      0x0004
28 #define DEVNULL_PRIV_NOFLOOD        0x0008
29 #define DEVNULL_PRIV_CHANHIDE       0x0010
30 #define DEVNULL_PRIV_IDLEHIDE       0x0020
31 #define DEVNULL_PRIV_CHSERVMODE     0x0040
32 #define DEVNULL_PRIV_XTRAOPMODE     0x0080
33 #define DEVNULL_PRIV_NETSERVMODE    0x0100
34 #define DEVNULL_PRIV_SEEIDLE        0x0200
35 #define DEVNULL_PRIV_FORCEIDLEHIDE  0x0400
36 #define DEVNULL_PRIV_OVERRIDECC     0x0800
37 #define DEVNULL_PRIV_OVERRIDENOAMSG 0x1000
38 #define DEVNULL_PRIV_MAXSENDQ       0x2000
39 #define DEVNULL_PRIV_OPME           0x4000
40
41 #define DEVNULL_MODES               "abcdefghijklmno"
42
43 #define DEVNULL_HAS_PRIV(cl, tok) ((cl)->modes & DEVNULL_PRIV_##tok)
44 #define DEVNULL_SET_PRIV(cl, tok) ((cl)->modes |= DEVNULL_PRIV_##tok)
45 #define DEVNULL_CLEAR_PRIV(cl, tok) ((cl)->modes &= ~DEVNULL_PRIV_##tok)
46
47 struct devnull_class {
48     unsigned int id;
49     char *name;
50     unsigned long modes;
51     unsigned long maxchan;
52     unsigned long maxsendq;
53 };
54
55 extern void *devnull_check_priv_func;
56
57 void init_opserv(const char *nick);
58 unsigned int gag_create(const char *mask, const char *owner, const char *reason, unsigned long expires);
59 int opserv_bad_channel(const char *name);
60 int devnull_user_has_priv(struct handle_info *hi, int devnull_priv);
61 struct devnull_class devnull_user_get_class(struct handle_info *hi);
62 struct devnull_class *devnull_find_id(unsigned int id);
63 struct devnull_class *devnull_find_name(const char *name);
64 struct userNode* GetOpServ(void);
65 void operpart(struct chanNode *chan, struct userNode *user);
66 void operadd(struct userNode *user);
67 void operdel(struct userNode *user);
68
69 #endif