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

Annotation of /eggdrop1.4/src/chan.h

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


Revision 1.13 - (hide annotations) (download) (as text)
Mon Jul 31 02:35:02 2000 UTC (21 years, 3 months ago) by guppy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +3 -1 lines
File MIME type: text/x-csrc
yay

1 guppy 1.10 /*
2     * chan.h
3     * stuff common to chan.c and mode.c
4     * users.h needs to be loaded too
5     *
6 guppy 1.13 * $Id: chan.h,v 1.12 2000/01/08 21:23:13 per Exp $
7 segfault 1.1 */
8 guppy 1.10 /*
9     * Copyright (C) 1997 Robey Pointer
10 per 1.12 * Copyright (C) 1999, 2000 Eggheads
11 guppy 1.10 *
12     * This program is free software; you can redistribute it and/or
13     * modify it under the terms of the GNU General Public License
14     * as published by the Free Software Foundation; either version 2
15     * of the License, or (at your option) any later version.
16     *
17     * This program is distributed in the hope that it will be useful,
18     * but WITHOUT ANY WARRANTY; without even the implied warranty of
19     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20     * GNU General Public License for more details.
21     *
22     * You should have received a copy of the GNU General Public License
23     * along with this program; if not, write to the Free Software
24     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25     */
26 guppy 1.11
27 guppy 1.10 #ifndef _EGG_CHAN_H
28     #define _EGG_CHAN_H
29 segfault 1.1
30     typedef struct memstruct {
31     char nick[NICKLEN]; /* "dalnet" allows 30 */
32     char userhost[UHOSTLEN];
33     time_t joined;
34     unsigned short flags;
35     time_t split; /* in case they were just netsplit */
36     time_t last; /* for measuring idle time */
37 guppy 1.9 time_t delay; /* for delayed autoop */
38 segfault 1.1 struct userrec *user;
39     struct memstruct *next;
40     } memberlist;
41    
42     #define CHANMETA "#&!+"
43    
44     #define CHANOP 0x0001 /* channel +o */
45     #define CHANVOICE 0x0002 /* channel +v */
46     #define FAKEOP 0x0004 /* op'd by server */
47     #define SENTOP 0x0008 /* a mode +o was already sent out for
48     * this user */
49     #define SENTDEOP 0x0010 /* a mode -o was already sent out for
50     * this user */
51     #define SENTKICK 0x0020 /* a kick was already sent out for this user */
52 guppy 1.4 #define SENTVOICE 0x0040 /* a mode +v was already sent out for
53     * this user */
54 segfault 1.1 #define SENTDEVOICE 0x0080 /* a devoice has been sent */
55     #define WASOP 0x0100 /* was an op before a split */
56 guppy 1.4 #define STOPWHO 0x0200
57 segfault 1.1
58     #define chan_hasvoice(x) (x->flags & CHANVOICE)
59     #define chan_hasop(x) (x->flags & CHANOP)
60     #define chan_fakeop(x) (x->flags & FAKEOP)
61     #define chan_sentop(x) (x->flags & SENTOP)
62     #define chan_sentdeop(x) (x->flags & SENTDEOP)
63     #define chan_sentkick(x) (x->flags & SENTKICK)
64     #define chan_sentvoice(x) (x->flags & SENTVOICE)
65 guppy 1.4 #define chan_sentdevoice(x) (x->flags & SENTDEVOICE)
66 segfault 1.1 #define chan_issplit(x) (x->split > 0)
67     #define chan_wasop(x) (x->flags & WASOP)
68    
69 poptix 1.7 /* Why duplicate this struct for exempts and invites only under another
70     * name? <cybah>
71     */
72     typedef struct maskstruct {
73     char *mask;
74 segfault 1.1 char *who;
75     time_t timer;
76 poptix 1.7 struct maskstruct *next;
77     } masklist;
78 segfault 1.1
79 poptix 1.7 /* used for temporary bans, exempts and invites */
80     typedef struct maskrec {
81     struct maskrec *next;
82     char *mask,
83     *desc,
84     *user;
85     time_t expire,
86     added,
87     lastactive;
88     int flags;
89     } maskrec;
90     extern maskrec *global_bans, *global_exempts, *global_invites;
91 segfault 1.1
92 poptix 1.7 #define MASKREC_STICKY 1
93     #define MASKREC_PERM 2
94 segfault 1.1
95     /* for every channel i join */
96     struct chan_t {
97     memberlist *member;
98 poptix 1.7 masklist *ban;
99     masklist *exempt;
100     masklist *invite;
101 segfault 1.1 char *topic;
102     char *key;
103     unsigned short int mode;
104     int maxmembers;
105     int members;
106     };
107    
108     #define CHANINV 0x0001 /* +i */
109     #define CHANPRIV 0x0002 /* +p */
110     #define CHANSEC 0x0004 /* +s */
111     #define CHANMODER 0x0008 /* +m */
112     #define CHANTOPIC 0x0010 /* +t */
113     #define CHANNOMSG 0x0020 /* +n */
114     #define CHANLIMIT 0x0040 /* -l -- used only for protecting modes */
115 guppy 1.8 #define CHANKEY 0x0080 /* +k */
116 segfault 1.1 #define CHANANON 0x0100 /* +a -- ircd 2.9 */
117     #define CHANQUIET 0x0200 /* +q -- ircd 2.9 */
118 guppy 1.13 #define CHANNOCLR 0x0400 /* +c -- bahamut */
119     #define CHANREGON 0x0800 /* +R -- bahamut */
120 segfault 1.1
121     /* for every channel i'm supposed to be active on */
122     struct chanset_t {
123     struct chanset_t *next;
124     struct chan_t channel; /* current information */
125     char name[81];
126     char need_op[121];
127     char need_key[121];
128     char need_limit[121];
129     char need_unban[121];
130     char need_invite[121];
131     int flood_pub_thr;
132     int flood_pub_time;
133     int flood_join_thr;
134     int flood_join_time;
135     int flood_deop_thr;
136     int flood_deop_time;
137     int flood_kick_thr;
138     int flood_kick_time;
139     int flood_ctcp_thr;
140     int flood_ctcp_time;
141     int status;
142     int ircnet_status;
143     int idle_kick;
144 poptix 1.7 /* temporary channel bans, exempts and invites */
145     maskrec *bans,
146     *exempts,
147     *invites;
148 segfault 1.1 /* 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[81]; /* new key to set */
157     char rmkey[81]; /* old key to remove */
158     int limit; /* new limit to set */
159     int bytes; /* total bytes so far */
160 poptix 1.6 int compat; /* to prevent mixing old/new modes */
161 segfault 1.1 struct {
162     char *op;
163     char type;
164     } cmode[6]; /* parameter-type mode changes - */
165     /* detect floods */
166     char floodwho[FLOOD_CHAN_MAX][81];
167     time_t floodtime[FLOOD_CHAN_MAX];
168     int floodnum[FLOOD_CHAN_MAX];
169     char deopd[NICKLEN]; /* last person deop'd (must change) */
170     };
171    
172     /* behavior modes for the channel */
173     #define CHAN_CLEARBANS 0x0001 /* clear bans on join */
174     #define CHAN_ENFORCEBANS 0x0002 /* kick people who match channel bans */
175     #define CHAN_DYNAMICBANS 0x0004 /* only activate bans when needed */
176     #define CHAN_NOUSERBANS 0x0008 /* don't let non-bots place bans */
177     #define CHAN_OPONJOIN 0x0010 /* op +o people as soon as they join */
178     #define CHAN_BITCH 0x0020 /* be a tightwad with ops */
179     #define CHAN_GREET 0x0040 /* greet people with their info line */
180     #define CHAN_PROTECTOPS 0x0080 /* re-op any +o people who get deop'd */
181     #define CHAN_LOGSTATUS 0x0100 /* log channel status every 5 mins */
182     #define CHAN_STOPNETHACK 0x0200 /* deop netsplit hackers */
183     #define CHAN_REVENGE 0x0400 /* get revenge on bad people */
184     #define CHAN_SECRET 0x0800 /* don't advertise channel on botnet */
185     #define CHAN_AUTOVOICE 0x1000 /* dish out voice stuff automatically */
186     #define CHAN_CYCLE 0x2000 /* cycle the channel if possible */
187     #define CHAN_DONTKICKOPS 0x4000 /* never kick +o flag people - arthur2 */
188     #define CHAN_WASOPTEST 0x8000 /* wasop test for all +o user
189     * when +stopnethack */
190     #define CHAN_INACTIVE 0x10000 /* no irc support for this channel - drummer */
191 segfault 1.2 #define CHAN_PROTECTFRIENDS 0x20000 /* re-op any +f people who get deop'd */
192 guppy 1.8 #define CHAN_SHARED 0x40000 /* channel is being shared */
193     #define CHAN_SEEN 0x80000
194     #define CHAN_REVENGEBOT 0x100000 /* revenge on actions against the bot */
195     /* 0x200000 */
196     /* 0x400000 */
197     /* 0x800000 */
198 segfault 1.1 #define CHAN_ACTIVE 0x1000000 /* like i'm actually on the channel
199     * and stuff */
200     #define CHAN_PEND 0x2000000 /* just joined; waiting for end of
201     * WHO list */
202     #define CHAN_FLAGGED 0x4000000 /* flagged during rehash for delete */
203     #define CHAN_STATIC 0x8000000 /* channels that are NOT dynamic */
204 guppy 1.8 #define CHAN_ASKEDBANS 0x10000000
205     #define CHAN_ASKEDMODES 0x20000000 /* find out key-info on IRCu */
206 segfault 1.1
207 arthur2 1.3 #define CHAN_ASKED_EXEMPTS 0x0001
208     #define CHAN_ASKED_INVITED 0x0002
209    
210     #define CHAN_DYNAMICEXEMPTS 0x0004
211     #define CHAN_NOUSEREXEMPTS 0x0008
212     #define CHAN_DYNAMICINVITES 0x0010
213     #define CHAN_NOUSERINVITES 0x0020
214 segfault 1.1
215     /* prototypes */
216     memberlist *ismember(struct chanset_t *, char *);
217     struct chanset_t *findchan();
218    
219     /* is this channel +s/+p? */
220     #define channel_hidden(chan) (chan->channel.mode & (CHANPRIV | CHANSEC))
221     /* is this channel +t? */
222     #define channel_optopic(chan) (chan->channel.mode & CHANTOPIC)
223     #define channel_active(chan) (chan->status & CHAN_ACTIVE)
224     #define channel_pending(chan) (chan->status & CHAN_PEND)
225     #define channel_bitch(chan) (chan->status & CHAN_BITCH)
226     #define channel_autoop(chan) (chan->status & CHAN_OPONJOIN)
227     #define channel_wasoptest(chan) (chan->status & CHAN_WASOPTEST)
228     #define channel_autovoice(chan) (chan->status & CHAN_AUTOVOICE)
229     #define channel_greet(chan) (chan->status & CHAN_GREET)
230     #define channel_logstatus(chan) (chan->status & CHAN_LOGSTATUS)
231     #define channel_clearbans(chan) (chan->status & CHAN_CLEARBANS)
232     #define channel_enforcebans(chan) (chan->status & CHAN_ENFORCEBANS)
233     #define channel_revenge(chan) (chan->status & CHAN_REVENGE)
234     #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
235     #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)
236     #define channel_protectops(chan) (chan->status & CHAN_PROTECTOPS)
237 segfault 1.2 #define channel_protectfriends(chan) (chan->status & CHAN_PROTECTFRIENDS)
238 segfault 1.1 #define channel_dontkickops(chan) (chan->status & CHAN_DONTKICKOPS)
239     #define channel_stopnethack(chan) (chan->status & CHAN_STOPNETHACK)
240     #define channel_secret(chan) (chan->status & CHAN_SECRET)
241     #define channel_shared(chan) (chan->status & CHAN_SHARED)
242     #define channel_static(chan) (chan->status & CHAN_STATIC)
243     #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
244     #define channel_seen(chan) (chan->status & CHAN_SEEN)
245     #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)
246 poptix 1.5 #define channel_revengebot(chan) (chan->status & CHAN_REVENGEBOT)
247 arthur2 1.3 #define channel_dynamicexempts(chan) (chan->ircnet_status & CHAN_DYNAMICEXEMPTS)
248     #define channel_nouserexempts(chan) (chan->ircnet_status & CHAN_NOUSEREXEMPTS)
249     #define channel_dynamicinvites(chan) (chan->ircnet_status & CHAN_DYNAMICINVITES)
250     #define channel_nouserinvites(chan) (chan->ircnet_status & CHAN_NOUSERINVITES)
251 segfault 1.1
252     struct server_list {
253     struct server_list *next;
254     char *name;
255     int port;
256     char *pass;
257     char *realname;
258     };
259    
260     struct msgq_head {
261     struct msgq *head;
262     struct msgq *last;
263     int tot;
264     int warned;
265     };
266    
267     /* used to queue a lot of things */
268     struct msgq {
269     struct msgq *next;
270     int len;
271     char *msg;
272     };
273    
274 guppy 1.10 #endif /* _EGG_CHAN_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23