/[cvs]/eggdrop1.8/src/flags.h
ViewVC logotype

Annotation of /eggdrop1.8/src/flags.h

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


Revision 1.1.1.1 - (hide annotations) (download) (as text) (vendor branch)
Mon Jul 26 21:11:06 2010 UTC (9 years ago) by simple
Branch: eggheads, MAIN
CVS Tags: v1, HEAD
Branch point for: gettext
Changes since 1.1: +0 -0 lines
File MIME type: text/x-csrc
Imported Eggdrop 1.6.20

1 simple 1.1 /*
2     * flags.h
3     *
4     * $Id: flags.h,v 1.1.1.1 2010/07/26 21:11:06 simple Exp $
5     */
6     /*
7     * Copyright (C) 1997 Robey Pointer
8     * Copyright (C) 1999 - 2010 Eggheads Development Team
9     *
10     * This program is free software; you can redistribute it and/or
11     * modify it under the terms of the GNU General Public License
12     * as published by the Free Software Foundation; either version 2
13     * of the License, or (at your option) any later version.
14     *
15     * This program is distributed in the hope that it will be useful,
16     * but WITHOUT ANY WARRANTY; without even the implied warranty of
17     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     * GNU General Public License for more details.
19     *
20     * You should have received a copy of the GNU General Public License
21     * along with this program; if not, write to the Free Software
22     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23     */
24    
25     #ifndef _EGG_FLAGS_H
26     #define _EGG_FLAGS_H
27    
28     struct flag_record {
29     int match;
30     int global;
31     int udef_global;
32     intptr_t bot;
33     int chan;
34     int udef_chan;
35     };
36    
37     #define FR_GLOBAL 0x00000001
38     #define FR_BOT 0x00000002
39     #define FR_CHAN 0x00000004
40     #define FR_OR 0x40000000
41     #define FR_AND 0x20000000
42     #define FR_ANYWH 0x10000000
43     #define FR_ALL 0x0fffffff
44    
45     /*
46     * userflags:
47     * abcdefgh?jklmnopqr?tuvwxyz + user defined A-Z
48     * unused letters: is
49     *
50     * botflags:
51     * 0123456789ab????ghi??l???p?rs???????
52     * unused letters: cdefjkmnoqtuvwxyz
53     *
54     * chanflags:
55     * a??defg???klmno?qr??uv??yz + user defined A-Z
56     * unused letters: bchijpstwx
57     */
58     #define USER_VALID 0x03fbfeff /* Sum of all USER_ flags */
59     #define CHAN_VALID 0x03777c79 /* Sum of all CHAN_ flags */
60     #define BOT_VALID 0x7fe689C1 /* Sum of all BOT_ flags */
61    
62    
63     #define USER_AUTOOP 0x00000001 /* a auto-op */
64     #define USER_BOT 0x00000002 /* b user is a bot */
65     #define USER_COMMON 0x00000004 /* c user is actually a public site */
66     #define USER_DEOP 0x00000008 /* d user is global de-op */
67     #define USER_EXEMPT 0x00000010 /* e exempted from stopnethack */
68     #define USER_FRIEND 0x00000020 /* f user is global friend */
69     #define USER_GVOICE 0x00000040 /* g auto-voice */
70     #define USER_HIGHLITE 0x00000080 /* h highlighting (bold) */
71     #define USER_I 0x00000100 /* i unused */
72     #define USER_JANITOR 0x00000200 /* j user is file area master */
73     #define USER_KICK 0x00000400 /* k user is global auto-kick */
74     #define USER_HALFOP 0x00000800 /* l user is +h on all channels */
75     #define USER_MASTER 0x00001000 /* m user has full bot access */
76     #define USER_OWNER 0x00002000 /* n user is the bot owner */
77     #define USER_OP 0x00004000 /* o user is +o on all channels */
78     #define USER_PARTY 0x00008000 /* p user has party line access */
79     #define USER_QUIET 0x00010000 /* q user is global de-voice */
80     #define USER_DEHALFOP 0x00020000 /* r user is global de-halfop */
81     #define USER_S 0x00040000 /* s unused */
82     #define USER_BOTMAST 0x00080000 /* t user is botnet master */
83     #define USER_UNSHARED 0x00100000 /* u not shared with sharebots */
84     #define USER_VOICE 0x00200000 /* v user is +v on all channels */
85     #define USER_WASOPTEST 0x00400000 /* w wasop test needed for stopnethack */
86     #define USER_XFER 0x00800000 /* x user has file area access */
87     #define USER_AUTOHALFOP 0x01000000 /* y auto-halfop */
88     #define USER_WASHALFOPTEST 0x02000000 /* z washalfop test needed for stopnethack */
89     #define USER_DEFAULT 0x40000000 /* use default-flags */
90    
91     /* Flags specifically for bots */
92     #define BOT_ALT 0x00000001 /* a auto-link here if all hubs fail */
93     #define BOT_BOT 0x00000002 /* b sanity bot flag */
94     #define BOT_C 0x00000004 /* c unused */
95     #define BOT_D 0x00000008 /* d unused */
96     #define BOT_E 0x00000010 /* e unused */
97     #define BOT_F 0x00000020 /* f unused */
98     #define BOT_GLOBAL 0x00000040 /* g all channel are shared */
99     #define BOT_HUB 0x00000080 /* h auto-link to ONE of these bots */
100     #define BOT_ISOLATE 0x00000100 /* i isolate party line from botnet */
101     #define BOT_J 0x00000200 /* j unused */
102     #define BOT_K 0x00000400 /* k unused */
103     #define BOT_LEAF 0x00000800 /* l may not link other bots */
104     #define BOT_M 0x00001000 /* m unused */
105     #define BOT_N 0x00002000 /* n unused */
106     #define BOT_O 0x00004000 /* o unused */
107     #define BOT_PASSIVE 0x00008000 /* p share passively with this bot */
108     #define BOT_Q 0x00010000 /* q unused */
109     #define BOT_REJECT 0x00020000 /* r automatically reject anywhere */
110     #define BOT_AGGRESSIVE 0x00040000 /* s bot shares user files */
111     #define BOT_T 0x00080000 /* t unused */
112     #define BOT_U 0x00100000 /* u unused */
113     #define BOT_V 0x00200000 /* v unused */
114     #define BOT_W 0x00400000 /* w unused */
115     #define BOT_X 0x00800000 /* x unused */
116     #define BOT_Y 0x01000000 /* y unused */
117     #define BOT_Z 0x02000000 /* z unused */
118     #define BOT_FLAG0 0x00200000 /* 0 user-defined flag #0 */
119     #define BOT_FLAG1 0x00400000 /* 1 user-defined flag #1 */
120     #define BOT_FLAG2 0x00800000 /* 2 user-defined flag #2 */
121     #define BOT_FLAG3 0x01000000 /* 3 user-defined flag #3 */
122     #define BOT_FLAG4 0x02000000 /* 4 user-defined flag #4 */
123     #define BOT_FLAG5 0x04000000 /* 5 user-defined flag #5 */
124     #define BOT_FLAG6 0x08000000 /* 6 user-defined flag #6 */
125     #define BOT_FLAG7 0x10000000 /* 7 user-defined flag #7 */
126     #define BOT_FLAG8 0x20000000 /* 8 user-defined flag #8 */
127     #define BOT_FLAG9 0x40000000 /* 9 user-defined flag #9 */
128     #define BOT_SHARE (BOT_AGGRESSIVE|BOT_PASSIVE)
129    
130    
131     /* Flag checking macros */
132     #define chan_op(x) ((x).chan & USER_OP)
133     #define glob_op(x) ((x).global & USER_OP)
134     #define chan_halfop(x) ((x).chan & USER_HALFOP)
135     #define glob_halfop(x) ((x).global & USER_HALFOP)
136     #define chan_deop(x) ((x).chan & USER_DEOP)
137     #define glob_deop(x) ((x).global & USER_DEOP)
138     #define chan_dehalfop(x) ((x).chan & USER_DEHALFOP)
139     #define glob_dehalfop(x) ((x).global & USER_DEHALFOP)
140     #define glob_master(x) ((x).global & USER_MASTER)
141     #define glob_bot(x) ((x).global & USER_BOT)
142     #define glob_owner(x) ((x).global & USER_OWNER)
143     #define chan_master(x) ((x).chan & USER_MASTER)
144     #define chan_owner(x) ((x).chan & USER_OWNER)
145     #define chan_autoop(x) ((x).chan & USER_AUTOOP)
146     #define glob_autoop(x) ((x).global & USER_AUTOOP)
147     #define chan_autohalfop(x) ((x).chan & USER_AUTOHALFOP)
148     #define glob_autohalfop(x) ((x).global & USER_AUTOHALFOP)
149     #define chan_gvoice(x) ((x).chan & USER_GVOICE)
150     #define glob_gvoice(x) ((x).global & USER_GVOICE)
151     #define chan_kick(x) ((x).chan & USER_KICK)
152     #define glob_kick(x) ((x).global & USER_KICK)
153     #define chan_voice(x) ((x).chan & USER_VOICE)
154     #define glob_voice(x) ((x).global & USER_VOICE)
155     #define chan_wasoptest(x) ((x).chan & USER_WASOPTEST)
156     #define glob_wasoptest(x) ((x).global & USER_WASOPTEST)
157     #define chan_washalfoptest(x) ((x).chan & USER_WASHALFOPTEST)
158     #define glob_washalfoptest(x) ((x).global & USER_WASHALFOPTEST)
159     #define chan_quiet(x) ((x).chan & USER_QUIET)
160     #define glob_quiet(x) ((x).global & USER_QUIET)
161     #define chan_friend(x) ((x).chan & USER_FRIEND)
162     #define glob_friend(x) ((x).global & USER_FRIEND)
163     #define glob_botmast(x) ((x).global & USER_BOTMAST)
164     #define glob_party(x) ((x).global & USER_PARTY)
165     #define glob_xfer(x) ((x).global & USER_XFER)
166     #define glob_hilite(x) ((x).global & USER_HIGHLITE)
167     #define chan_exempt(x) ((x).chan & USER_EXEMPT)
168     #define glob_exempt(x) ((x).global & USER_EXEMPT)
169    
170     #define bot_global(x) ((x).bot & BOT_GLOBAL)
171     #define bot_chan(x) ((x).chan & BOT_AGGRESSIVE)
172     #define bot_shared(x) ((x).bot & BOT_SHARE)
173    
174    
175     #ifndef MAKING_MODS
176    
177     void get_user_flagrec(struct userrec *, struct flag_record *, const char *);
178     void set_user_flagrec(struct userrec *, struct flag_record *, const char *);
179     void break_down_flags(const char *, struct flag_record *, struct flag_record *);
180     int build_flags(char *, struct flag_record *, struct flag_record *);
181     int flagrec_eq(struct flag_record *, struct flag_record *);
182     int flagrec_ok(struct flag_record *, struct flag_record *);
183     int sanity_check(int);
184     int chan_sanity_check(int, int);
185     char geticon(int);
186    
187     #endif /* MAKING_MODS */
188    
189     #endif /* _EGG_FLAGS_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23