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

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

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

revision 1.1.1.1 by segfault, Wed Jun 23 19:51:26 1999 UTC revision 1.13 by guppy, Mon Jul 31 02:35:02 2000 UTC
# Line 1  Line 1 
 /* stuff common to chan.c & mode.c */  
 /* users.h needs to be loaded too */  
1  /*  /*
2   * This file is part of the eggdrop source code   * chan.h
3   * copyright (c) 1997 Robey Pointer   *   stuff common to chan.c and mode.c
4   * and is distributed according to the GNU general public license.   *   users.h needs to be loaded too
5   * For full details, read the top of 'main.c' or the file called   *
6   * COPYING that was distributed with this code.   * $Id$
7   */   */
8  #ifndef _H_CHAN  /*
9  #define _H_CHAN   * Copyright (C) 1997  Robey Pointer
10     * Copyright (C) 1999, 2000  Eggheads
11     *
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    
27    #ifndef _EGG_CHAN_H
28    #define _EGG_CHAN_H
29    
30  typedef struct memstruct {  typedef struct memstruct {
31    char nick[NICKLEN];       /* "dalnet" allows 30 */    char nick[NICKLEN];       /* "dalnet" allows 30 */
# Line 17  typedef struct memstruct { Line 34  typedef struct memstruct {
34    unsigned short flags;    unsigned short flags;
35    time_t split;         /* in case they were just netsplit */    time_t split;         /* in case they were just netsplit */
36    time_t last;          /* for measuring idle time */    time_t last;          /* for measuring idle time */
37      time_t delay;         /* for delayed autoop */
38    struct userrec *user;    struct userrec *user;
39    struct memstruct *next;    struct memstruct *next;
40  } memberlist;  } memberlist;
# Line 31  typedef struct memstruct { Line 49  typedef struct memstruct {
49  #define SENTDEOP    0x0010  /* a mode -o was already sent out for  #define SENTDEOP    0x0010  /* a mode -o was already sent out for
50                     * this user */                     * this user */
51  #define SENTKICK    0x0020  /* a kick was already sent out for this user */  #define SENTKICK    0x0020  /* a kick was already sent out for this user */
52  #define SENTVOICE   0x0040  /* a voice has been sent since a deop */  #define SENTVOICE   0x0040  /* a mode +v was already sent out for
53                       * this user */
54  #define SENTDEVOICE 0x0080  /* a devoice has been sent */  #define SENTDEVOICE 0x0080  /* a devoice has been sent */
55  #define WASOP       0x0100  /* was an op before a split */  #define WASOP       0x0100  /* was an op before a split */
56    #define STOPWHO     0x0200
57    
58  #define chan_hasvoice(x) (x->flags & CHANVOICE)  #define chan_hasvoice(x) (x->flags & CHANVOICE)
59  #define chan_hasop(x) (x->flags & CHANOP)  #define chan_hasop(x) (x->flags & CHANOP)
# Line 42  typedef struct memstruct { Line 62  typedef struct memstruct {
62  #define chan_sentdeop(x) (x->flags & SENTDEOP)  #define chan_sentdeop(x) (x->flags & SENTDEOP)
63  #define chan_sentkick(x) (x->flags & SENTKICK)  #define chan_sentkick(x) (x->flags & SENTKICK)
64  #define chan_sentvoice(x) (x->flags & SENTVOICE)  #define chan_sentvoice(x) (x->flags & SENTVOICE)
65    #define chan_sentdevoice(x) (x->flags & SENTDEVOICE)
66  #define chan_issplit(x) (x->split > 0)  #define chan_issplit(x) (x->split > 0)
67  #define chan_wasop(x) (x->flags & WASOP)  #define chan_wasop(x) (x->flags & WASOP)
68    
69  typedef struct banstruct {  /*        Why duplicate this struct for exempts and invites only under another
70    char *ban;   *      name? <cybah>
71     */
72    typedef struct maskstruct {
73      char *mask;
74    char *who;    char *who;
75    time_t timer;    time_t timer;
76    struct banstruct *next;    struct maskstruct *next;
77  } banlist;  } masklist;
78    
79  /* Next 2 structures created for IRCnet server module - Daemus - 2/1/1999 */  /* used for temporary bans, exempts and invites */
80  typedef struct exbanstruct {  typedef struct maskrec {
81    char *exempt;    struct maskrec *next;
82    char *who;    char *mask,
83    time_t timer;         *desc,
84    struct exbanstruct *next;         *user;
85  } exemptlist;    time_t expire,
86             added,
87             lastactive;
88      int flags;
89    } maskrec;
90    extern maskrec *global_bans, *global_exempts, *global_invites;
91    
92  typedef struct exinvitestruct {  #define MASKREC_STICKY 1
93    char *invite;  #define MASKREC_PERM   2
   char *who;  
   time_t timer;  
   struct exinvitestruct *next;  
 } invitelist;  
94    
95  /* for every channel i join */  /* for every channel i join */
96  struct chan_t {  struct chan_t {
97    memberlist *member;    memberlist *member;
98    banlist *ban;    masklist *ban;
99    exemptlist *exempt;    masklist *exempt;
100    invitelist *invite;    masklist *invite;
101    char *topic;    char *topic;
102    char *key;    char *key;
103    unsigned short int mode;    unsigned short int mode;
# Line 87  struct chan_t { Line 112  struct chan_t {
112  #define CHANTOPIC  0x0010   /* +t */  #define CHANTOPIC  0x0010   /* +t */
113  #define CHANNOMSG  0x0020   /* +n */  #define CHANNOMSG  0x0020   /* +n */
114  #define CHANLIMIT  0x0040   /* -l -- used only for protecting modes */  #define CHANLIMIT  0x0040   /* -l -- used only for protecting modes */
115  #define CHANKEY    0x0080   /* -k -- used only for protecting modes */  #define CHANKEY    0x0080   /* +k */
116  #define CHANANON   0x0100   /* +a -- ircd 2.9 */  #define CHANANON   0x0100   /* +a -- ircd 2.9 */
117  #define CHANQUIET  0x0200   /* +q -- ircd 2.9 */  #define CHANQUIET  0x0200   /* +q -- ircd 2.9 */
118    #define CHANNOCLR  0x0400   /* +c -- bahamut */
119    #define CHANREGON  0x0800   /* +R -- bahamut */
120    
121  /* for every channel i'm supposed to be active on */  /* for every channel i'm supposed to be active on */
122  struct chanset_t {  struct chanset_t {
# Line 114  struct chanset_t { Line 141  struct chanset_t {
141    int status;    int status;
142    int ircnet_status;    int ircnet_status;
143    int idle_kick;    int idle_kick;
144    struct banrec *bans;      /* temporary channel bans */    /* temporary channel bans, exempts and invites */
145      maskrec *bans,
146              *exempts,
147              *invites;
148    /* desired channel modes: */    /* desired channel modes: */
149    int mode_pls_prot;        /* modes to enforce */    int mode_pls_prot;        /* modes to enforce */
150    int mode_mns_prot;        /* modes to reject */    int mode_mns_prot;        /* modes to reject */
# Line 127  struct chanset_t { Line 157  struct chanset_t {
157    char rmkey[81];       /* old key to remove */    char rmkey[81];       /* old key to remove */
158    int limit;            /* new limit to set */    int limit;            /* new limit to set */
159    int bytes;            /* total bytes so far */    int bytes;            /* total bytes so far */
160      int compat;           /* to prevent mixing old/new modes */
161    struct {    struct {
162      char *op;      char *op;
163      char type;      char type;
# Line 157  struct chanset_t { Line 188  struct chanset_t {
188  #define CHAN_WASOPTEST      0x8000  /* wasop test for all +o user  #define CHAN_WASOPTEST      0x8000  /* wasop test for all +o user
189                       * when +stopnethack */                       * when +stopnethack */
190  #define CHAN_INACTIVE       0x10000 /* no irc support for this channel - drummer */  #define CHAN_INACTIVE       0x10000 /* no irc support for this channel - drummer */
191    #define CHAN_PROTECTFRIENDS 0x20000     /* re-op any +f people who get deop'd */
192    #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  #define CHAN_ACTIVE         0x1000000   /* like i'm actually on the channel  #define CHAN_ACTIVE         0x1000000   /* like i'm actually on the channel
199                       * and stuff */                       * and stuff */
200  #define CHAN_PEND           0x2000000   /* just joined; waiting for end of  #define CHAN_PEND           0x2000000   /* just joined; waiting for end of
201                       * WHO list */                       * WHO list */
202  #define CHAN_FLAGGED        0x4000000   /* flagged during rehash for delete */  #define CHAN_FLAGGED        0x4000000   /* flagged during rehash for delete */
203  #define CHAN_STATIC         0x8000000   /* channels that are NOT dynamic */  #define CHAN_STATIC         0x8000000   /* channels that are NOT dynamic */
204  #define CHAN_SHARED         0x10000000  /* channel is being shared */  #define CHAN_ASKEDBANS      0x10000000
205  #define CHAN_ASKEDBANS      0x20000000  #define CHAN_ASKEDMODES     0x20000000  /* find out key-info on IRCu */
 #define CHAN_SEEN           0x40000000  
206    
207  #define CHAN_ASKED_EXEMPTS 0x0001  #define CHAN_ASKED_EXEMPTS 0x0001
208  #define CHAN_ASKED_INVITED 0x0002  #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    
215  /* prototypes */  /* prototypes */
216  memberlist *ismember(struct chanset_t *, char *);  memberlist *ismember(struct chanset_t *, char *);
217  struct chanset_t *findchan();  struct chanset_t *findchan();
# Line 192  struct chanset_t *findchan(); Line 234  struct chanset_t *findchan();
234  #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)  #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
235  #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)  #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)
236  #define channel_protectops(chan) (chan->status & CHAN_PROTECTOPS)  #define channel_protectops(chan) (chan->status & CHAN_PROTECTOPS)
237    #define channel_protectfriends(chan) (chan->status & CHAN_PROTECTFRIENDS)
238  #define channel_dontkickops(chan) (chan->status & CHAN_DONTKICKOPS)  #define channel_dontkickops(chan) (chan->status & CHAN_DONTKICKOPS)
239  #define channel_stopnethack(chan) (chan->status & CHAN_STOPNETHACK)  #define channel_stopnethack(chan) (chan->status & CHAN_STOPNETHACK)
240  #define channel_secret(chan) (chan->status & CHAN_SECRET)  #define channel_secret(chan) (chan->status & CHAN_SECRET)
# Line 200  struct chanset_t *findchan(); Line 243  struct chanset_t *findchan();
243  #define channel_cycle(chan) (chan->status & CHAN_CYCLE)  #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
244  #define channel_seen(chan) (chan->status & CHAN_SEEN)  #define channel_seen(chan) (chan->status & CHAN_SEEN)
245  #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)  #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)
246    #define channel_revengebot(chan) (chan->status & CHAN_REVENGEBOT)
247    #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    
252  struct server_list {  struct server_list {
253    struct server_list *next;    struct server_list *next;
# Line 223  struct msgq { Line 271  struct msgq {
271    char *msg;    char *msg;
272  };  };
273    
274  #endif  #endif              /* _EGG_CHAN_H */

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.13

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23