/[cvs]/eggdrop1.9/src/chan.h
ViewVC logotype

Contents of /eggdrop1.9/src/chan.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.38 - (show annotations) (download) (as text)
Sun May 11 02:30:54 2003 UTC (16 years, 4 months ago) by stdarg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.37: +1 -1 lines
File MIME type: text/x-csrc
FILE REMOVED
* Trying out the autoconf way of detecting tcl (test)

1 /*
2 * chan.h --
3 *
4 * stuff common to chan.c and mode.c
5 * users.h needs to be loaded too
6 */
7 /*
8 * Copyright (C) 1997 Robey Pointer
9 * Copyright (C) 1999, 2000, 2001, 2002, 2003 Eggheads Development Team
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 */
25 /*
26 * $Id: chan.h,v 1.37 2003/02/15 05:04:58 wcc Exp $
27 */
28
29 #ifndef _EGG_CHAN_H
30 #define _EGG_CHAN_H
31
32 typedef struct memstruct {
33 char nick[NICKLEN];
34 char userhost[UHOSTLEN];
35 time_t joined;
36 unsigned short flags;
37 time_t split; /* in case they were just netsplit */
38 time_t last; /* for measuring idle time */
39 time_t delay; /* for delayed autoop */
40 struct userrec *user;
41 struct memstruct *next;
42 } memberlist;
43
44 #define CHANMETA "#&!+"
45
46 #define CHANOP 0x0001 /* channel +o */
47 #define CHANVOICE 0x0002 /* channel +v */
48 #define FAKEOP 0x0004 /* op'd by server */
49 #define SENTOP 0x0008 /* a mode +o was already sent out for
50 this user */
51 #define SENTDEOP 0x0010 /* a mode -o was already sent out for
52 this user */
53 #define SENTKICK 0x0020 /* a kick was already sent out for this
54 user */
55 #define SENTVOICE 0x0040 /* a mode +v was already sent out for
56 this user */
57 #define SENTDEVOICE 0x0080 /* a devoice has been sent */
58 #define WASOP 0x0100 /* was an op before a split */
59 #define STOPWHO 0x0200
60 #define FULL_DELAY 0x0400
61 #define STOPCHECK 0x0800
62
63 #define chan_hasvoice(x) (x->flags & CHANVOICE)
64 #define chan_hasop(x) (x->flags & CHANOP)
65 #define chan_fakeop(x) (x->flags & FAKEOP)
66 #define chan_sentop(x) (x->flags & SENTOP)
67 #define chan_sentdeop(x) (x->flags & SENTDEOP)
68 #define chan_sentkick(x) (x->flags & SENTKICK)
69 #define chan_sentvoice(x) (x->flags & SENTVOICE)
70 #define chan_sentdevoice(x) (x->flags & SENTDEVOICE)
71 #define chan_issplit(x) (x->split > 0)
72 #define chan_wasop(x) (x->flags & WASOP)
73 #define chan_stopcheck(x) (x->flags & STOPCHECK)
74
75 /* Why duplicate this struct for exempts and invites only under another
76 * name? <cybah>
77 */
78 typedef struct maskstruct {
79 char *mask;
80 char *who;
81 time_t timer;
82 struct maskstruct *next;
83 } masklist;
84
85 /* Used for temporary bans, exempts and invites */
86 typedef struct maskrec {
87 struct maskrec *next;
88 char *mask,
89 *desc,
90 *user;
91 time_t expire,
92 added,
93 lastactive;
94 int flags;
95 } maskrec;
96 extern maskrec *global_bans, *global_exempts, *global_invites;
97
98 #define MASKREC_STICKY 1
99 #define MASKREC_PERM 2
100
101 /* For every channel i join */
102 struct chan_t {
103 memberlist *member;
104 masklist *ban;
105 masklist *exempt;
106 masklist *invite;
107 char *topic;
108 char *key;
109 unsigned short int mode;
110 int maxmembers;
111 int members;
112 };
113
114 #define CHANINV 0x0001 /* +i */
115 #define CHANPRIV 0x0002 /* +p */
116 #define CHANSEC 0x0004 /* +s */
117 #define CHANMODER 0x0008 /* +m */
118 #define CHANTOPIC 0x0010 /* +t */
119 #define CHANNOMSG 0x0020 /* +n */
120 #define CHANLIMIT 0x0040 /* -l -- used only for protecting modes */
121 #define CHANKEY 0x0080 /* +k */
122 #define CHANANON 0x0100 /* +a -- ircd 2.9 */
123 #define CHANQUIET 0x0200 /* +q -- ircd 2.9 */
124 #define CHANNOCLR 0x0400 /* +c -- bahamut */
125 #define CHANREGON 0x0800 /* +R -- bahamut */
126 #define CHANMODREG 0x1000 /* +M -- bahamut */
127
128 #define MODES_PER_LINE_MAX 6
129
130 /* For every channel i'm supposed to be active on */
131 struct chanset_t {
132 struct chanset_t *next;
133 struct chan_t channel; /* current information */
134 char dname[81]; /* what the users know the channel as,
135 like !eggdev */
136 char name[81]; /* what the servers know the channel
137 as, like !ABCDEeggdev */
138 int aop_min;
139 int aop_max;
140 int status;
141 int ircnet_status;
142 int ban_time;
143 int invite_time;
144 int exempt_time;
145 maskrec *bans, /* temporary channel bans */
146 *exempts, /* temporary channel exempts */
147 *invites; /* temporary channel invites */
148 /* desired channel modes: */
149 int mode_pls_prot; /* modes to enforce */
150 int mode_mns_prot; /* modes to reject */
151 int limit_prot; /* desired limit */
152 char key_prot[121]; /* desired password */
153 /* queued mode changes: */
154 char pls[21]; /* positive mode changes */
155 char mns[21]; /* negative mode changes */
156 char *key; /* new key to set */
157 char *rmkey; /* old key to remove */
158 int limit; /* new limit to set */
159 int bytes; /* total bytes so far */
160 int compat; /* to prevent mixing old/new modes */
161 struct {
162 char *op;
163 int type;
164 } cmode[MODES_PER_LINE_MAX]; /* parameter-type mode changes - */
165 char deopd[NICKLEN]; /* last person deop'd (must change */
166 };
167
168 /* behavior modes for the channel */
169 #define CHAN_ENFORCEBANS 0x0001
170 #define CHAN_DYNAMICBANS 0x0002
171 /* 0x0004 */
172 #define CHAN_OPONJOIN 0x0008
173 /* 0x0010 */
174 #define CHAN_GREET 0x0020
175 /* 0x0040 */
176 #define CHAN_LOGSTATUS 0x0080
177 /* 0x0100 */
178 #define CHAN_SECRET 0x0200
179 #define CHAN_AUTOVOICE 0x0400
180 #define CHAN_CYCLE 0x0800
181 #define CHAN_DONTKICKOPS 0x1000
182 #define CHAN_INACTIVE 0x2000
183 /* 0x4000 */
184 /* 0x8000 */
185 /* 0x10000 */
186 /* 0x20000 */
187 #define CHAN_NODESYNCH 0x40000
188 #define CHAN_HONORGLOBALBANS 0x80000
189 /* 0x100000 */
190
191 #define CHAN_ACTIVE 0x1000000
192 #define CHAN_PEND 0x2000000
193 #define CHAN_FLAGGED 0x4000000
194 #define CHAN_STATIC 0x8000000
195 #define CHAN_ASKEDBANS 0x10000000
196 #define CHAN_ASKEDMODES 0x20000000
197 #define CHAN_JUPED 0x40000000
198 #define CHAN_STOP_CYCLE 0x80000000
199
200 #define CHAN_ASKED_EXEMPTS 0x0001
201 #define CHAN_ASKED_INVITED 0x0002
202
203 #define CHAN_DYNAMICEXEMPTS 0x0004
204 /* 0x0008 */
205 #define CHAN_DYNAMICINVITES 0x0010
206 /* 0x0020 */
207 #define CHAN_HONORGLOBALEXEMPTS 0x0040
208 #define CHAN_HONORGLOBALINVITES 0x0080
209
210 /* prototypes */
211 memberlist *ismember(struct chanset_t *, char *);
212 struct chanset_t *findchan(const char *name);
213 struct chanset_t *findchan_by_dname(const char *name);
214
215 /* is this channel +s/+p? */
216 #define channel_hidden(chan) (chan->channel.mode & (CHANPRIV | CHANSEC))
217 /* is this channel +t? */
218 #define channel_optopic(chan) (chan->channel.mode & CHANTOPIC)
219
220 #define channel_active(chan) (chan->status & CHAN_ACTIVE)
221 #define channel_pending(chan) (chan->status & CHAN_PEND)
222 #define channel_nodesynch(chan) (chan->status & CHAN_NODESYNCH)
223 #define channel_autoop(chan) (chan->status & CHAN_OPONJOIN)
224 #define channel_autovoice(chan) (chan->status & CHAN_AUTOVOICE)
225 #define channel_greet(chan) (chan->status & CHAN_GREET)
226 #define channel_logstatus(chan) (chan->status & CHAN_LOGSTATUS)
227 #define channel_enforcebans(chan) (chan->status & CHAN_ENFORCEBANS)
228 #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
229 #define channel_dontkickops(chan) (chan->status & CHAN_DONTKICKOPS)
230 #define channel_secret(chan) (chan->status & CHAN_SECRET)
231 #define channel_static(chan) (chan->status & CHAN_STATIC)
232 #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
233 #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)
234 #define channel_dynamicexempts(chan) (chan->ircnet_status & CHAN_DYNAMICEXEMPTS)
235 #define channel_dynamicinvites(chan) (chan->ircnet_status & CHAN_DYNAMICINVITES)
236 #define channel_juped(chan) (chan->status & CHAN_JUPED)
237 #define channel_stop_cycle(chan) (chan->status & CHAN_STOP_CYCLE)
238 #define channel_honor_global_bans(chan) (chan->status & CHAN_HONORGLOBALBANS)
239 #define channel_honor_global_exempts(chan) (chan->ircnet_status & CHAN_HONORGLOBALEXEMPTS)
240 #define channel_honor_global_invites(chan) (chan->ircnet_status & CHAN_HONORGLOBALINVITES)
241
242 struct msgq_head {
243 struct msgq *head;
244 struct msgq *last;
245 int tot;
246 int warned;
247 };
248
249 /* Used to queue a lot of things */
250 struct msgq {
251 struct msgq *next;
252 int len;
253 char *msg;
254 };
255
256 #endif /* !_EGG_CHAN_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23