ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/channel_mode.h
Revision: 2937
Committed: Sun Jan 26 12:15:55 2014 UTC (12 years, 6 months ago) by michael
Content type: text/x-chdr
File size: 3693 byte(s)
Log Message:
- Clean up stupid pointer magic passed to the channel mode handlers.

File Contents

# User Rev Content
1 adx 30 /*
2 michael 2865 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 adx 30 *
4 michael 2865 * Copyright (c) 1997-2014 ircd-hybrid development team
5 adx 30 *
6     * This program 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 this program; if not, write to the Free Software
18     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19     * USA
20     */
21    
22 michael 2865 /*! \file channel_mode.h
23     * \brief Includes channel mode related definitions and structures.
24     * \version $Id$
25     */
26 adx 30
27     #ifndef INCLUDED_channel_mode_h
28     #define INCLUDED_channel_mode_h
29    
30     #define MODEBUFLEN 200
31    
32     /* Maximum mode changes allowed per client, per server is different */
33     #define MAXMODEPARAMS 4
34    
35 michael 2896 enum
36     {
37     MODE_QUERY = 0,
38     MODE_ADD = 1,
39     MODE_DEL = -1
40     };
41    
42     enum
43     {
44     CHACCESS_NOTONCHAN = -1,
45     CHACCESS_PEON = 0,
46     CHACCESS_HALFOP = 1,
47     CHACCESS_CHANOP = 2
48     };
49    
50 adx 30 /* can_send results */
51 michael 2896 enum
52     {
53     CAN_SEND_NO = 0,
54     CAN_SEND_NONOP = -1,
55     CAN_SEND_OPV = -2
56     };
57 adx 30
58    
59     /* Channel related flags */
60     #define CHFL_CHANOP 0x0001 /* Channel operator */
61     #define CHFL_HALFOP 0x0002 /* Channel half op */
62     #define CHFL_VOICE 0x0004 /* the power to speak */
63     #define CHFL_DEOPPED 0x0008 /* deopped by us, modes need to be bounced */
64     #define CHFL_BAN 0x0010 /* ban channel flag */
65     #define CHFL_EXCEPTION 0x0020 /* exception to ban channel flag */
66     #define CHFL_INVEX 0x0040
67    
68     /* channel modes ONLY */
69     #define MODE_PRIVATE 0x0001
70     #define MODE_SECRET 0x0002
71     #define MODE_MODERATED 0x0004
72     #define MODE_TOPICLIMIT 0x0008
73     #define MODE_INVITEONLY 0x0010
74     #define MODE_NOPRIVMSGS 0x0020
75 michael 1150 #define MODE_SSLONLY 0x0040
76     #define MODE_OPERONLY 0x0080
77 michael 1167 #define MODE_REGISTERED 0x0100 /* Channel has been registered with ChanServ */
78 michael 1173 #define MODE_REGONLY 0x0200
79 michael 1937 #define MODE_NOCTRL 0x0400
80 michael 1954 #define MODE_MODREG 0x0800
81 adx 30
82     /* cache flags for silence on ban */
83     #define CHFL_BAN_CHECKED 0x0080
84     #define CHFL_BAN_SILENCED 0x0100
85    
86     /* name invisible */
87     #define SecretChannel(x) (((x)->mode.mode & MODE_SECRET))
88 michael 2902 #define PubChannel(x) (((x)->mode.mode & (MODE_PRIVATE | MODE_SECRET)) == 0)
89 adx 30 /* knock is forbidden, halfops can't kick/deop other halfops.
90     * +pi means paranoid and will generate notices on each invite */
91     #define PrivateChannel(x) (((x)->mode.mode & MODE_PRIVATE))
92    
93     struct ChModeChange
94     {
95     char letter;
96     const char *arg;
97     const char *id;
98     int dir;
99 michael 1015 unsigned int caps;
100     unsigned int nocaps;
101 adx 30 int mems;
102     struct Client *client;
103     };
104    
105     struct ChCapCombo
106     {
107     int count;
108 michael 1015 unsigned int cap_yes;
109     unsigned int cap_no;
110 adx 30 };
111    
112 michael 1175 struct mode_letter
113     {
114     const unsigned int mode;
115     const unsigned char letter;
116     };
117    
118     extern const struct mode_letter chan_modes[];
119 michael 2937
120 adx 30 extern int add_id(struct Client *, struct Channel *, char *, int);
121     extern void set_channel_mode(struct Client *, struct Client *, struct Channel *,
122 michael 2937 struct Membership *, int, char **);
123 adx 30 extern void clear_ban_cache(struct Channel *);
124 michael 759 extern void clear_ban_cache_client(struct Client *);
125 adx 30 extern void init_chcap_usage_counts(void);
126     extern void set_chcap_usage_counts(struct Client *);
127     extern void unset_chcap_usage_counts(struct Client *);
128     #endif /* INCLUDED_channel_mode_h */

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision