/[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.9 - (hide annotations) (download) (as text)
Tue Oct 12 21:25:15 1999 UTC (20 years, 1 month ago) by guppy
Branch: MAIN
Changes since 1.8: +1 -0 lines
File MIME type: text/x-csrc
come on rc2

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23