1
0
Эх сурвалжийг харах

* More bit conversions

svn: 915
Bryan Drewery 22 жил өмнө
parent
commit
8a3a46ef8a
13 өөрчлөгдсөн 193 нэмэгдсэн , 237 устгасан
  1. 61 76
      src/chan.h
  2. 4 4
      src/conf.h
  3. 45 45
      src/dcc.h
  4. 1 1
      src/flags.c
  5. 2 3
      src/flags.h
  6. 21 28
      src/log.h
  7. 7 7
      src/mod/irc.mod/mode.c
  8. 5 5
      src/mod/share.mod/share.h
  9. 11 12
      src/net.h
  10. 12 12
      src/shell.h
  11. 17 19
      src/tclhash.h
  12. 1 1
      src/userrec.c
  13. 6 24
      src/users.c

+ 61 - 76
src/chan.h

@@ -26,24 +26,20 @@ typedef struct memstruct {
 #define CHANMETA "#&!+"
 #define NICKVALID "[{}]^`|\\_-"
 
-#define CHANOP       0x00001 /* channel +o                                   */
-#define CHANVOICE    0x00002 /* channel +v                                   */
-#define FAKEOP       0x00004 /* op'd by server                               */
-#define SENTOP       0x00008 /* a mode +o was already sent out for this user */
-#define SENTDEOP     0x00010 /* a mode -o was already sent out for this user */
-#define SENTKICK     0x00020 /* a kick was already sent out for this user    */
-#define SENTVOICE    0x00040 /* a mode +v was already sent out for this user */
-#define SENTDEVOICE  0x00080 /* a devoice has been sent                      */
-#define WASOP        0x00100 /* was an op before a split                     */
-#define STOPWHO      0x00200
-#define FULL_DELAY   0x00400
-#define STOPCHECK    0x00800
-#define EVOICE       0x01000 /* keeps people -v */
-#define OPER         0x02000
-/*                   0x02000 */
-/*                   0x04000 */
-/*                   0x08000 */
-/*                   0x10000 */
+#define CHANOP       BIT0 /* channel +o                                   */
+#define CHANVOICE    BIT1 /* channel +v                                   */
+#define FAKEOP       BIT2 /* op'd by server                               */
+#define SENTOP       BIT3 /* a mode +o was already sent out for this user */
+#define SENTDEOP     BIT4 /* a mode -o was already sent out for this user */
+#define SENTKICK     BIT5 /* a kick was already sent out for this user    */
+#define SENTVOICE    BIT6 /* a mode +v was already sent out for this user */
+#define SENTDEVOICE  BIT7 /* a devoice has been sent                      */
+#define WASOP        BIT8 /* was an op before a split                     */
+#define STOPWHO      BIT9
+#define FULL_DELAY   BIT10
+#define STOPCHECK    BIT11
+#define EVOICE       BIT12 /* keeps people -v */
+#define OPER         BIT13
 
 #define chan_hasvoice(x) (x->flags & CHANVOICE)
 #define chan_hasop(x) (x->flags & CHANOP)
@@ -106,21 +102,22 @@ struct chan_t {
 
 };
 
-#define CHANINV    0x0001	/* +i					*/
-#define CHANPRIV   0x0002	/* +p					*/
-#define CHANSEC    0x0004	/* +s					*/
-#define CHANMODER  0x0008	/* +m					*/
-#define CHANTOPIC  0x0010	/* +t					*/
-#define CHANNOMSG  0x0020	/* +n					*/
-#define CHANLIMIT  0x0040	/* -l -- used only for protecting modes	*/
-#define CHANKEY    0x0080	/* +k					*/
-#define CHANANON   0x0100	/* +a -- ircd 2.9			*/
-#define CHANQUIET  0x0200	/* +q -- ircd 2.9			*/
-#define CHANNOCLR  0x0400	/* +c -- bahamut			*/
-#define CHANREGON  0x0800	/* +R -- bahamut			*/
-#define CHANMODR   0x1000	/* +M -- bahamut			*/
-#define CHANNOCTCP 0x2000      /* +C -- QuakeNet's ircu 2.10           */
-#define CHANLONLY  0x4000      /* +r -- ircu 2.10.11                   */
+#define CHANINV    BIT0		/* +i					*/
+#define CHANPRIV   BIT1		/* +p					*/
+#define CHANSEC    BIT2		/* +s					*/
+#define CHANMODER  BIT3		/* +m					*/
+#define CHANTOPIC  BIT4		/* +t					*/
+#define CHANNOMSG  BIT5		/* +n					*/
+#define CHANLIMIT  BIT6		/* -l -- used only for protecting modes	*/
+#define CHANKEY    BIT7		/* +k					*/
+/* FIXME: JUST REMOVE THESE :D */
+#define CHANANON   BIT8		/* +a -- ircd 2.9			*/
+#define CHANQUIET  BIT9		/* +q -- ircd 2.9			*/
+#define CHANNOCLR  BIT10	/* +c -- bahamut			*/
+#define CHANREGON  BIT11	/* +R -- bahamut			*/
+#define CHANMODR   BIT12	/* +M -- bahamut			*/
+#define CHANNOCTCP BIT13        /* +C -- QuakeNet's ircu 2.10           */
+#define CHANLONLY  BIT14        /* +r -- ircu 2.10.11                   */
 
 #define MODES_PER_LINE_MAX 6
 
@@ -208,46 +205,38 @@ struct chanset_t {
  * #define CHAN_TEMP           0x0000
  */
 
-#define CHAN_ENFORCEBANS    0x0001	   /* kick people who match channel bans */
-#define CHAN_DYNAMICBANS    0x0002	   /* only activate bans when needed     */
-#define CHAN_NOUSERBANS     0x0004	   /* don't let non-bots place bans      */
-#define CHAN_CLOSED         0x0008	   /* Only users +o can join */
-#define CHAN_BITCH          0x0010	   /* be a tightwad with ops             */
-#define CHAN_TAKE 	    0x0020         /* When a bot gets opped, take the chan */
-#define CHAN_PROTECTOPS     0x0040	   /* re-op any +o people who get deop'd */
-#define CHAN_NOMOP	    0x0080         /* If a bot sees a mass op, botnet mdops */
-#define CHAN_REVENGE        0x0100	   /* get revenge on bad people          */
-#define CHAN_SECRET         0x0200	   /* don't advertise channel on botnet  */
-#define CHAN_MANOP          0x0400         /* manual opping allowed? */
-#define CHAN_CYCLE          0x0800	   /* cycle the channel if possible      */
-/*#define CHAN_    0x1000	   */
-#define CHAN_INACTIVE       0x2000	   /* no irc support for this channel
-                                         - drummer                           */
-/* #define CHAN_               0x4000	   */
-#define CHAN_VOICE          0x8000	   /* a bot +y|y will voice *, except +q */
-/* #define CHAN_           0x10000 */
-#define CHAN_REVENGEBOT     0x20000	   /* revenge on actions against the bot */
-#define CHAN_NODESYNCH      0x40000
-#define CHAN_FASTOP         0x80000        /* Bots will not use +o-b to op (no cookies) */ 
-#define CHAN_PRIVATE         0x100000       /* users need |o to access chan */ 
-#define CHAN_ACTIVE         0x1000000  /* like i'm actually on the channel
-                                          and stuff                          */
-#define CHAN_PEND           0x2000000  /* just joined; waiting for end of
-                                          WHO list                           */
-#define CHAN_FLAGGED        0x4000000  /* flagged during rehash for delete   */
-/* #define CHAN_ 		    0x8000000  */
-#define CHAN_ASKEDBANS      0x10000000
-#define CHAN_ASKEDMODES     0x20000000 /* find out key-info on IRCu          */
-#define CHAN_JUPED          0x40000000 /* Is channel juped                   */
-#define CHAN_STOP_CYCLE     0x80000000 /* Some efnetservers have defined
-                                          NO_CHANOPS_WHEN_SPLIT              */
-#define CHAN_ASKED_EXEMPTS  0x0001
-#define CHAN_ASKED_INVITED  0x0002
+#define CHAN_ENFORCEBANS    BIT0	/* kick people who match channel bans */
+#define CHAN_DYNAMICBANS    BIT1	/* only activate bans when needed     */
+#define CHAN_NOUSERBANS     BIT2	/* don't let non-bots place bans      */
+#define CHAN_CLOSED         BIT3	/* Only users +o can join */
+#define CHAN_BITCH          BIT4	/* be a tightwad with ops             */
+#define CHAN_TAKE 	    BIT5	/* When a bot gets opped, take the chan */
+#define CHAN_PROTECTOPS     BIT6	/* re-op any +o people who get deop'd */
+#define CHAN_NOMOP	    BIT7        /* If a bot sees a mass op, botnet mdops */
+#define CHAN_REVENGE        BIT8	/* get revenge on bad people          */
+#define CHAN_SECRET         BIT9	/* don't advertise channel on botnet  */
+#define CHAN_MANOP          BIT10       /* manual opping allowed? */
+#define CHAN_CYCLE          BIT11	/* cycle the channel if possible      */
+#define CHAN_INACTIVE       BIT12	/* no irc support for this channel */
+#define CHAN_VOICE          BIT13	/* a bot +y|y will voice *, except +q */
+#define CHAN_REVENGEBOT     BIT14	/* revenge on actions against the bot */
+#define CHAN_NODESYNCH      BIT15
+#define CHAN_FASTOP         BIT16	/* Bots will not use +o-b to op (no cookies) */ 
+#define CHAN_PRIVATE        BIT17	/* users need |o to access chan */ 
+#define CHAN_ACTIVE         BIT18	/* like i'm actually on the channel and stuff */
+#define CHAN_PEND           BIT19	/* just joined; waiting for end of WHO list */
+#define CHAN_FLAGGED        BIT20	/* flagged during rehash for delete   */
+#define CHAN_ASKEDBANS      BIT21
+#define CHAN_ASKEDMODES     BIT22	/* find out key-info on IRCu          */
+#define CHAN_JUPED          BIT23	/* Is channel juped                   */
+#define CHAN_STOP_CYCLE     BIT24	/* Some efnetservers have defined NO_CHANOPS_WHEN_SPLIT */
 
-#define CHAN_DYNAMICEXEMPTS 0x0004
-#define CHAN_NOUSEREXEMPTS  0x0008
-#define CHAN_DYNAMICINVITES 0x0010
-#define CHAN_NOUSERINVITES  0x0020
+#define CHAN_ASKED_EXEMPTS  BIT0
+#define CHAN_ASKED_INVITED  BIT1
+#define CHAN_DYNAMICEXEMPTS BIT2
+#define CHAN_NOUSEREXEMPTS  BIT3
+#define CHAN_DYNAMICINVITES BIT4
+#define CHAN_NOUSERINVITES  BIT5
 /* prototypes */
 memberlist *ismember(struct chanset_t *, char *);
 struct chanset_t *findchan(const char *name);
@@ -267,9 +256,7 @@ struct chanset_t *findchan_by_dname(const char *name);
 #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
 #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)
 #define channel_protectops(chan) (chan->status & CHAN_PROTECTOPS)
-#define channel_autovoice(chan) (0)
 #define channel_secret(chan) (chan->status & CHAN_SECRET)
-#define channel_shared(chan) (1)
 #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
 #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)
 #define channel_revengebot(chan) (chan->status & CHAN_REVENGEBOT)
@@ -292,8 +279,6 @@ struct chanset_t *findchan_by_dname(const char *name);
  *#define channel_temp(chan) (chan->status & CHAN_PRIVATE)
  */
 
-
-
 struct msgq_head {
   struct msgq *head;
   struct msgq *last;

+ 4 - 4
src/conf.h

@@ -5,6 +5,8 @@
 #include <stdio.h>
 
 typedef struct conf_bot_b {
+  struct conf_bot_b *next;
+  struct userrec *u;	/* our own user record */
   char *nick;
   char *host;
   char *host6;
@@ -15,11 +17,11 @@ typedef struct conf_bot_b {
 #ifdef LEAF
   int localhub;         /* bot is localhub */
 #endif /* LEAF */
-  struct userrec *u;	/* our own user record */
-  struct conf_bot_b *next;
 } conf_bot;
 
 typedef struct conf_b {
+  conf_bot *bots;       /* the list of bots */
+  conf_bot *bot;        /* single bot (me) */
   uid_t uid;
   char *uname;
   char *username;       /* shell username */
@@ -32,8 +34,6 @@ typedef struct conf_b {
   char *binname;        /* binary name, ie: .sshrc */
   int autocron;         /* should the bot auto crontab itself? */
   char *comments;       /* we dont want to lose our comments now do we?! */
-  conf_bot *bots;       /* the list of bots */
-  conf_bot *bot;        /* single bot (me) */
 } conf_t;
 
 extern conf_t		conf, conffile;

+ 45 - 45
src/dcc.h

@@ -125,67 +125,67 @@ struct dupwait_info {
 
 /* Flags about dcc types
  */
-#define DCT_CHAT      0x00000001        /* this dcc type receives botnet
+#define DCT_CHAT      BIT0        /* this dcc type receives botnet
                                            chatter                          */
-#define DCT_MASTER    0x00000002        /* received master chatter          */
-#define DCT_SHOWWHO   0x00000004        /* show the user in .who            */
-#define DCT_REMOTEWHO 0x00000008        /* show in remote who               */
-#define DCT_VALIDIDX  0x00000010        /* valid idx for outputting to
-                                           in tcl                           */
-#define DCT_SIMUL     0x00000020        /* can be tcl_simul'd               */
-#define DCT_CANBOOT   0x00000040        /* can be booted                    */
 #define DCT_GETNOTES  DCT_CHAT          /* can receive notes                */
-#define DCT_          0x00000080        /* unused */
-#define DCT_FORKTYPE  0x00000100        /* a forking type                   */
-#define DCT_BOT       0x00000200        /* a bot connection of some sort... */
-#define DCT_FILETRAN  0x00000400        /* a file transfer of some sort     */
-#define DCT_FILESEND  0x00000800        /* a sending file transfer,
+#define DCT_MASTER    BIT1        /* received master chatter          */
+#define DCT_SHOWWHO   BIT2        /* show the user in .who            */
+#define DCT_REMOTEWHO BIT3        /* show in remote who               */
+#define DCT_VALIDIDX  BIT4        /* valid idx for outputting to
+                                           in tcl                           */
+#define DCT_SIMUL     BIT5        /* can be tcl_simul'd               */
+#define DCT_CANBOOT   BIT6        /* can be booted                    */
+#define DCT_          BIT7        /* unused */
+#define DCT_FORKTYPE  BIT8        /* a forking type                   */
+#define DCT_BOT       BIT9        /* a bot connection of some sort... */
+#define DCT_FILETRAN  BIT10       /* a file transfer of some sort     */
+#define DCT_FILESEND  BIT11       /* a sending file transfer,
                                            getting = !this                  */
-#define DCT_LISTEN    0x00001000        /* a listening port of some sort    */
+#define DCT_LISTEN    BIT12       /* a listening port of some sort    */
 
 /* For dcc chat & files:
  */
-#define STAT_ECHO    0x00001    /* echo commands back?                  */
-#define STAT_DENY    0x00002    /* bad username (ignore password & deny
+#define STAT_ECHO    BIT0    /* echo commands back?                  */
+#define STAT_DENY    BIT1    /* bad username (ignore password & deny
                                    access)                              */
-#define STAT_CHAT    0x00004    /* in file-system but may return        */
-#define STAT_TELNET  0x00008    /* connected via telnet                 */
-#define STAT_PARTY   0x00010    /* only on party line via 'p' flag      */
-#define STAT_BOTONLY 0x00020    /* telnet on bots-only connect          */
-#define STAT_USRONLY 0x00040    /* telnet on users-only connect         */
-#define STAT_PAGE    0x00080    /* page output to the user              */
-#define STAT_COLOR   0x00100    /* Color enabled for user */
+#define STAT_CHAT    BIT2    /* in file-system but may return        */
+#define STAT_TELNET  BIT3    /* connected via telnet                 */
+#define STAT_PARTY   BIT4    /* only on party line via 'p' flag      */
+#define STAT_BOTONLY BIT5    /* telnet on bots-only connect          */
+#define STAT_USRONLY BIT6    /* telnet on users-only connect         */
+#define STAT_PAGE    BIT7    /* page output to the user              */
+#define STAT_COLOR   BIT8    /* Color enabled for user */
 
 /* For stripping out mIRC codes
  */
-#define STRIP_COLOR  0x00001    /* remove mIRC color codes              */
-#define STRIP_BOLD   0x00002    /* remove bold codes                    */
-#define STRIP_REV    0x00004    /* remove reverse video codes           */
-#define STRIP_UNDER  0x00008    /* remove underline codes               */
-#define STRIP_ANSI   0x00010    /* remove ALL ansi codes                */
-#define STRIP_BELLS  0x00020    /* remote ctrl-g's                      */
-#define STRIP_ALL    0x00040    /* remove every damn thing!             */
+#define STRIP_COLOR  BIT0    /* remove mIRC color codes              */
+#define STRIP_BOLD   BIT1    /* remove bold codes                    */
+#define STRIP_REV    BIT2    /* remove reverse video codes           */
+#define STRIP_UNDER  BIT3    /* remove underline codes               */
+#define STRIP_ANSI   BIT4    /* remove ALL ansi codes                */
+#define STRIP_BELLS  BIT5    /* remote ctrl-g's                      */
+#define STRIP_ALL    BIT6    /* remove every damn thing!             */
 
 /* for dcc bot links: */
-#define STAT_PINGED  0x00001    /* waiting for ping to return            */
-#define STAT_SHARE   0x00002    /* sharing user data with the bot        */
-#define STAT_CALLED  0x00004    /* this bot called me                    */
-#define STAT_OFFERED 0x00008    /* offered her the user file             */
-#define STAT_SENDING 0x00010    /* in the process of sending a user list */
-#define STAT_GETTING 0x00020    /* in the process of getting a user list */
-#define STAT_WARNED  0x00040    /* warned him about unleaflike behavior  */
-#define STAT_LEAF    0x00080    /* this bot is a leaf only               */
-#define STAT_LINKING 0x00100    /* the bot is currently going through
+#define STAT_PINGED  BIT0    /* waiting for ping to return            */
+#define STAT_SHARE   BIT1    /* sharing user data with the bot        */
+#define STAT_CALLED  BIT2    /* this bot called me                    */
+#define STAT_OFFERED BIT3    /* offered her the user file             */
+#define STAT_SENDING BIT4    /* in the process of sending a user list */
+#define STAT_GETTING BIT5    /* in the process of getting a user list */
+#define STAT_WARNED  BIT6    /* warned him about unleaflike behavior  */
+#define STAT_LEAF    BIT7    /* this bot is a leaf only               */
+#define STAT_LINKING BIT8    /* the bot is currently going through
                                    the linking stage                     */
-#define STAT_AGGRESSIVE   0x00200 /* aggressively sharing with this bot    */
-#define STAT_OFFEREDU 0x00400
-#define STAT_SENDINGU 0x00800
-#define STAT_GETTINGU 0x01000
-#define STAT_UPDATED  0x02000
+#define STAT_AGGRESSIVE BIT9 /* aggressively sharing with this bot    */
+#define STAT_OFFEREDU BIT10
+#define STAT_SENDINGU BIT11
+#define STAT_GETTINGU BIT12
+#define STAT_UPDATED  BIT13
 
 /* Flags for listening sockets
  */
-#define LSTN_PUBLIC  0x000001   /* No access restrictions               */
+#define LSTN_PUBLIC  BIT0   /* No access restrictions               */
 
 /* Telnet codes.  See "TELNET Protocol Specification" (RFC 854) and
  * "TELNET Echo Option" (RFC 875) for details.

+ 1 - 1
src/flags.c

@@ -398,7 +398,7 @@ void set_user_flagrec(struct userrec *u, struct flag_record *fr, const char *chn
     }
     if (cr && ch) {
       cr->flags = fr->chan;
-      if (!noshare && !(u->flags & USER_UNSHARED) && channel_shared(ch)) {
+      if (!noshare && !(u->flags & USER_UNSHARED)) {
 	fr->match = FR_CHAN;
 	build_flags(buffer, fr, NULL);
 	shareout(ch, "a %s %s %s\n", u->handle, buffer, chname);

+ 2 - 3
src/flags.h

@@ -18,7 +18,6 @@ typedef unsigned long flag_t;
 struct flag_record {
   flag_t match;
   flag_t global;
-/* FIXME: ALSO MAKE THESE LONG */
   flag_t  bot;
   flag_t chan;
 };
@@ -26,9 +25,9 @@ struct flag_record {
 #define FR_GLOBAL 0x00000001
 #define FR_BOT    0x00000002
 #define FR_CHAN   0x00000004
-#define FR_OR     0x40000000
-#define FR_AND    0x20000000
 #define FR_ANYWH  0x10000000
+#define FR_AND    0x20000000
+#define FR_OR     0x40000000
 #define FR_ALL    0x0fffffff
 
 /*

+ 21 - 28
src/log.h

@@ -6,34 +6,27 @@
 
 /* Logfile display flags
  */
-#define LOG_MSGS     0x000001   /* m   msgs/notice/ctcps                */
-#define LOG_PUBLIC   0x000002   /* p   public msg/notice/ctcps          */
-#define LOG_JOIN     0x000004   /* j   channel joins/parts/etc          */
-#define LOG_MODES    0x000008   /* k   mode changes/kicks/bans          */
-#define LOG_CMDS     0x000010   /* c   user dcc or msg commands         */
-#define LOG_MISC     0x000020   /* o   other misc bot things            */
-#define LOG_BOTS     0x000040   /* b   bot notices                      */
-#define LOG_RAW      0x000080   /* r   raw server stuff coming in       */
-#define LOG_FILES    0x000100   /* x   file transfer commands and stats */
-#define LOG_ERRORS   0x000200   /* e   misc errors                      */
-#define LOG_ERROR    0x000200   /* e   misc errors                      */
-#define LOG_GETIN    0x000400   /* g   op system. (Getin)                       */
-#define LOG_WARN     0x000800   /* u   warnings                 */
-#define LOG_WARNING  0x000800   /* u   warnings                 */
-
-/* the rest of these can be used for new console modes.... */
-#define LOG_LEV4     0x001000   /* 4   user log level                   */
-#define LOG_LEV5     0x002000   /* 5   user log level                   */
-#define LOG_LEV6     0x004000   /* 6   user log level                   */
-#define LOG_LEV7     0x008000   /* 7   user log level                   */
-#define LOG_LEV8     0x010000   /* 8   user log level                   */
-#define LOG_SERV     0x020000   /* s   server information               */
-#define LOG_DEBUG    0x040000   /* d   debug                            */
-#define LOG_WALL     0x080000   /* w   wallops                          */
-#define LOG_SRVOUT   0x100000   /* v   server output                    */
-#define LOG_BOTNET   0x200000   /* t   botnet traffic                   */
-#define LOG_BOTSHARE 0x400000   /* h   share traffic                    */
-#define LOG_ALL      0x7fffff   /* (dump to all logfiles)               */
+#define LOG_MSGS     BIT0   /* m   msgs/notice/ctcps                */
+#define LOG_PUBLIC   BIT1   /* p   public msg/notice/ctcps          */
+#define LOG_JOIN     BIT2   /* j   channel joins/parts/etc          */
+#define LOG_MODES    BIT3   /* k   mode changes/kicks/bans          */
+#define LOG_CMDS     BIT4   /* c   user dcc or msg commands         */
+#define LOG_MISC     BIT5   /* o   other misc bot things            */
+#define LOG_BOTS     BIT6   /* b   bot notices                      */
+#define LOG_RAW      BIT7   /* r   raw server stuff coming in       */
+#define LOG_FILES    BIT8   /* x   file transfer commands and stats */
+#define LOG_ERRORS   BIT9   /* e   misc errors                      */
+#define LOG_ERROR    BIT10  /* e   misc errors                      */
+#define LOG_GETIN    BIT11  /* g   op system. (Getin)                       */
+#define LOG_WARN     BIT12  /* u   warnings                 */
+#define LOG_WARNING  BIT13  /* u   warnings                 */
+#define LOG_SERV     BIT14   /* s   server information               */
+#define LOG_DEBUG    BIT15   /* d   debug                            */
+#define LOG_WALL     BIT16   /* w   wallops                          */
+#define LOG_SRVOUT   BIT17   /* v   server output                    */
+#define LOG_BOTNET   BIT18   /* t   botnet traffic                   */
+#define LOG_BOTSHARE BIT19   /* h   share traffic                    */
+#define LOG_ALL      0xfffffff   /* (dump to all logfiles)               */
 
 inline void logidx(int, char *, ...);
 void putlog (int, char *, char *, ...);

+ 7 - 7
src/mod/irc.mod/mode.c

@@ -10,13 +10,13 @@
 /* Reversing this mode? */
 static int reversing = 0;
 
-#define PLUS    0x01
-#define MINUS   0x02
-#define CHOP    0x04
-#define BAN     0x08
-#define VOICE   0x10
-#define EXEMPT  0x20
-#define INVITE  0x40
+#define PLUS    BIT0
+#define MINUS   BIT1
+#define CHOP    BIT2
+#define BAN     BIT3
+#define VOICE   BIT4
+#define EXEMPT  BIT5
+#define INVITE  BIT6
 
 static struct flag_record user   = {FR_GLOBAL | FR_CHAN, 0, 0, 0};
 static struct flag_record victim = {FR_GLOBAL | FR_CHAN, 0, 0, 0};

+ 5 - 5
src/mod/share.mod/share.h

@@ -6,11 +6,11 @@
 #ifndef _EGG_MOD_SHARE_SHARE_H
 #define _EGG_MOD_SHARE_SHARE_H
 
-#define	UFF_OVERRIDE	0x000001	/* Override existing bot entries    */
-#define UFF_INVITE	0x000002	/* Send invites in user file	    */
-#define UFF_EXEMPT	0x000004	/* Send exempts in user file	    */
-#define UFF_CHANS	0x000020	/* Send channels in user file */
-#define UFF_TCL		0x000040	/* Send tcl file with userfile */
+#define	UFF_OVERRIDE	BIT0	/* Override existing bot entries    */
+#define UFF_INVITE	BIT1	/* Send invites in user file	    */
+#define UFF_EXEMPT	BIT2	/* Send exempts in user file	    */
+#define UFF_CHANS	BIT3	/* Send channels in user file */
+#define UFF_TCL		BIT4	/* Send tcl file with userfile */
 
 /* Currently reserved flags for other modules:
  *      UFF_COMPRESS    0x000008	   Compress the user file

+ 11 - 12
src/net.h

@@ -48,18 +48,17 @@ enum {
 
 /* Socket flags:
  */
-#define SOCK_UNUSED     0x0001  /* empty socket                         */
-#define SOCK_BINARY     0x0002  /* do not buffer input                  */
-#define SOCK_LISTEN     0x0004  /* listening port                       */
-#define SOCK_CONNECT    0x0008  /* connection attempt                   */
-#define SOCK_NONSOCK    0x0010  /* used for file i/o on debug           */
-#define SOCK_STRONGCONN 0x0020  /* don't report success until sure      */
-#define SOCK_EOFD       0x0040  /* it EOF'd recently during a write     */
-#define SOCK_PROXYWAIT  0x0080  /* waiting for SOCKS traversal          */
-#define SOCK_PASS       0x0100  /* passed on; only notify in case
-                                   of traffic                           */
-#define SOCK_VIRTUAL    0x0200  /* not-connected socket (dont read it!) */
-#define SOCK_BUFFER     0x0400  /* buffer data; don't notify dcc funcs  */
+#define SOCK_UNUSED     BIT0  /* empty socket                         */
+#define SOCK_BINARY     BIT1  /* do not buffer input                  */
+#define SOCK_LISTEN     BIT2  /* listening port                       */
+#define SOCK_CONNECT    BIT3  /* connection attempt                   */
+#define SOCK_NONSOCK    BIT4  /* used for file i/o on debug           */
+#define SOCK_STRONGCONN BIT5  /* don't report success until sure      */
+#define SOCK_EOFD       BIT6  /* it EOF'd recently during a write     */
+#define SOCK_PROXYWAIT  BIT7  /* waiting for SOCKS traversal          */
+#define SOCK_PASS       BIT8  /* passed on; only notify in case of traffic */
+#define SOCK_VIRTUAL    BIT9  /* not-connected socket (dont read it!) */
+#define SOCK_BUFFER     BIT10 /* buffer data; don't notify dcc funcs  */
 
 /* Flags to sock_has_data
  */

+ 12 - 12
src/shell.h

@@ -21,20 +21,20 @@
 #define ERR_NOBOTS	18
 #define ERR_MAX         19
 
-#define EMAIL_OWNERS    0x1
-#define EMAIL_TEAM      0x2
+#define EMAIL_OWNERS    BIT0
+#define EMAIL_TEAM      BIT1
 
-#define DETECT_LOGIN 1
-#define DETECT_TRACE 2
-#define DETECT_PROMISC 3
-#define DETECT_PROCESS 4
-#define DETECT_SIGCONT 5
+#define DETECT_LOGIN 	1
+#define DETECT_TRACE 	2
+#define DETECT_PROMISC 	3
+#define DETECT_PROCESS 	4
+#define DETECT_SIGCONT 	5
 
-#define DET_IGNORE 0
-#define DET_WARN 1
-#define DET_REJECT 2
-#define DET_DIE 3
-#define DET_SUICIDE 4
+#define DET_IGNORE 	0
+#define DET_WARN 	1
+#define DET_REJECT 	2
+#define DET_DIE 	3
+#define DET_SUICIDE 	4
 
 void check_mypid();
 int clear_tmp();

+ 17 - 19
src/tclhash.h

@@ -8,34 +8,32 @@
 
 #include "cmds.h"
 
-#define TC_DELETED	0x0001	/* This command/trigger was deleted.	*/
-
 /* Match type flags for bind tables. */
-#define MATCH_PARTIAL       1
-#define MATCH_EXACT         2
-#define MATCH_MASK          4
-#define MATCH_CASE          8
-#define MATCH_NONE          16
-#define MATCH_FLAGS_AND	    32
-#define MATCH_FLAGS_OR	    64
-#define MATCH_FLAGS	    96
+#define MATCH_PARTIAL       BIT0
+#define MATCH_EXACT         BIT1
+#define MATCH_MASK          BIT2
+#define MATCH_CASE          BIT3
+#define MATCH_NONE          BIT4
+#define MATCH_FLAGS_AND	    BIT5
+#define MATCH_FLAGS_OR	    BIT6
+#define MATCH_FLAGS	    BIT7
 
 
 /* Flags for binds. */
 /* Does the callback want their client_data inserted as the first argument? */
-#define BIND_WANTS_CD 1
-#define BIND_BREAKABLE	2
-#define BIND_STACKABLE	4
-#define BIND_DELETED	8
-#define BIND_FAKE	16
+#define BIND_WANTS_CD 	BIT0
+#define BIND_BREAKABLE	BIT1
+#define BIND_STACKABLE	BIT2
+#define BIND_DELETED	BIT3
+#define BIND_FAKE	BIT4
 /*** Note: bind entries can specify these two flags, defined above.
-#define MATCH_FLAGS_AND	32
-#define MATCH_FLAGS_OR	64
+#define MATCH_FLAGS_AND	BIT5
+#define MATCH_FLAGS_OR	BIT6
 ***/
 
 /* Flags for return values from bind callbacks */
-#define BIND_RET_LOG 1
-#define BIND_RET_BREAK 2
+#define BIND_RET_LOG 	1
+#define BIND_RET_BREAK 	2
 
 /* This holds the information of a bind entry. */
 typedef struct bind_entry_b {

+ 1 - 1
src/userrec.c

@@ -297,7 +297,7 @@ int write_user(struct userrec *u, FILE * f, int idx)
     return 0;
   for (ch = u->chanrec; ch; ch = ch->next) {
     cst = findchan_by_dname(ch->channel);
-    if (cst && ((idx < 0) || channel_shared(cst))) {
+    if (cst) {
       if (idx >= 0) {
 	fr.match = (FR_CHAN | FR_BOT);
 	get_user_flagrec(dcc[idx].user, &fr, ch->channel);

+ 6 - 24
src/users.c

@@ -830,14 +830,8 @@ int readuserfile(char *file, struct userrec **ret)
 	    /* NOTE only remove bans for when getting a userfile
 	     * from another bot & that channel is shared */
 	    cst = findchan_by_dname(lasthand);
-	    if ((*ret == userlist) || channel_shared(cst)) {
-	      clear_masks(cst->bans);
-	      cst->bans = NULL;
-	    } else {
-	      /* otherwise ignore any bans for this channel */
-	      cst = NULL;
-	      lasthand[0] = 0;
-	    }
+            clear_masks(cst->bans);
+	    cst->bans = NULL;
 	  }
 	} else if (!strncmp(code, "&&", 2)) {
 	  /* channel-specific exempts */
@@ -856,14 +850,8 @@ int readuserfile(char *file, struct userrec **ret)
 	    /* NOTE only remove exempts for when getting a userfile
 	     * from another bot & that channel is shared */
 	    cst = findchan_by_dname(lasthand);
-	    if ((*ret == userlist) || channel_shared(cst)) {
-	      clear_masks(cst->exempts);
-	      cst->exempts = NULL;
-	    } else {
-	      /* otherwise ignore any exempts for this channel */
-	      cst = NULL;
-	      lasthand[0] = 0;
-	    }
+	    clear_masks(cst->exempts);
+	    cst->exempts = NULL;
 	  }
 	} else if (!strncmp(code, "$$", 2)) {
 	  /* channel-specific invites */
@@ -882,14 +870,8 @@ int readuserfile(char *file, struct userrec **ret)
 	    /* NOTE only remove invites for when getting a userfile
 	     * from another bot & that channel is shared */
 	    cst = findchan_by_dname(lasthand);
-	    if ((*ret == userlist) || channel_shared(cst)) {
-	      clear_masks(cst->invites);
-              cst->invites = NULL;
-	    } else {
-	      /* otherwise ignore any invites for this channel */
-	      cst = NULL;
-	      lasthand[0] = 0;
-	    }
+	    clear_masks(cst->invites);
+            cst->invites = NULL;
 	  }
 	} else if (!strncmp(code, "--", 2)) {
 	  if (u) {