00001
00002
00003
00004
00005
00006 #ifndef __COMMAND_H
00007 #define __COMMAND_H
00008
00009 #define CMD_NO_ARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int)
00010 #define CMD_ONE_ARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int, char *)
00011 #define CMD_ONE_ARG_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int, char *, char *[], int)
00012 #define CMD_TWO_ARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int, int, char *, char *)
00013 #define CMD_TWO_ARG_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int, char *, char *, char*[], int)
00014 #define CMD_TWO_ARG_ARGV(name) extern void name(dbref executor, dbref caller, dbref enactor, int, char *, char *[], int)
00015 #define CMD_TWO_ARG_ARGV_CMDARG(name) extern void name(dbref executor, dbref caller, dbref enactor, int, char *, char *[], int, char*[], int)
00016
00017
00018
00019
00020 CMD_TWO_ARG(do_cemit);
00021 CMD_TWO_ARG(do_chboot);
00022 CMD_TWO_ARG(do_editchannel);
00023 CMD_ONE_ARG(do_checkchannel);
00024 CMD_ONE_ARG(do_createchannel);
00025 CMD_ONE_ARG(do_destroychannel);
00026 CMD_TWO_ARG(do_edituser);
00027 CMD_ONE_ARG(do_chanlist);
00028 CMD_TWO_ARG(do_chopen);
00029 CMD_ONE_ARG(do_channelwho);
00030 CMD_TWO_ARG(do_addcom);
00031 CMD_ONE_ARG(do_allcom);
00032 CMD_ONE_ARG(do_comlist);
00033 CMD_TWO_ARG(do_comtitle);
00034
00035 CMD_ONE_ARG(do_delcom);
00036
00037
00038
00039 CMD_TWO_ARG(do_mail);
00040 CMD_TWO_ARG(do_malias);
00041 CMD_ONE_ARG(do_prepend);
00042 CMD_ONE_ARG(do_postpend);
00043
00044 CMD_ONE_ARG_CMDARG(do_apply_marked);
00045 CMD_TWO_ARG(do_admin);
00046 CMD_TWO_ARG(do_alias);
00047 CMD_TWO_ARG(do_attribute);
00048 CMD_ONE_ARG(do_boot);
00049 CMD_TWO_ARG(do_chown);
00050 CMD_TWO_ARG(do_chownall);
00051 CMD_TWO_ARG(do_chzone);
00052 CMD_TWO_ARG(do_clone);
00053 CMD_NO_ARG(do_comment);
00054 CMD_TWO_ARG_ARGV(do_cpattr);
00055 CMD_TWO_ARG(do_create);
00056 CMD_ONE_ARG(do_cut);
00057 CMD_NO_ARG(do_dbck);
00058 CMD_TWO_ARG(do_decomp);
00059 CMD_ONE_ARG(do_destroy);
00060 CMD_TWO_ARG_ARGV(do_dig);
00061 CMD_ONE_ARG(do_doing);
00062 CMD_TWO_ARG_CMDARG(do_dolist);
00063 CMD_ONE_ARG(do_drop);
00064 CMD_NO_ARG(do_dump);
00065 CMD_TWO_ARG_ARGV(do_edit);
00066 CMD_ONE_ARG(do_enter);
00067 CMD_ONE_ARG(do_entrances);
00068 CMD_ONE_ARG(do_examine);
00069 CMD_ONE_ARG(do_find);
00070 CMD_TWO_ARG(do_fixdb);
00071 CMD_TWO_ARG_CMDARG(do_force);
00072 CMD_ONE_ARG_CMDARG(do_force_prefixed);
00073 CMD_TWO_ARG(do_forwardlist);
00074 CMD_TWO_ARG(do_function);
00075 CMD_ONE_ARG(do_get);
00076 CMD_TWO_ARG(do_give);
00077 CMD_ONE_ARG(do_global);
00078 CMD_ONE_ARG(do_halt);
00079 CMD_ONE_ARG(do_help);
00080 CMD_TWO_ARG_ARGV_CMDARG(do_if);
00081 CMD_NO_ARG(do_inventory);
00082 CMD_TWO_ARG(do_prog);
00083 CMD_ONE_ARG(do_quitprog);
00084 CMD_TWO_ARG(do_kill);
00085 CMD_ONE_ARG(do_last);
00086 CMD_NO_ARG(do_leave);
00087 CMD_TWO_ARG(do_link);
00088 CMD_ONE_ARG(do_list);
00089 CMD_ONE_ARG(do_list_file);
00090 CMD_TWO_ARG(do_lock);
00091 CMD_TWO_ARG(do_log);
00092 CMD_ONE_ARG(do_look);
00093 CMD_NO_ARG(do_markall);
00094 CMD_ONE_ARG(do_motd);
00095 CMD_ONE_ARG(do_move);
00096 CMD_TWO_ARG_ARGV(do_mvattr);
00097 CMD_TWO_ARG(do_name);
00098 CMD_TWO_ARG(do_newpassword);
00099 CMD_TWO_ARG(do_notify);
00100 CMD_TWO_ARG_ARGV(do_open);
00101 CMD_TWO_ARG(do_page);
00102 CMD_TWO_ARG(do_parent);
00103 CMD_TWO_ARG(do_password);
00104 CMD_TWO_ARG(do_pcreate);
00105 CMD_TWO_ARG(do_pemit);
00106 CMD_ONE_ARG(do_poor);
00107 CMD_TWO_ARG(do_power);
00108 CMD_ONE_ARG(do_ps);
00109 CMD_ONE_ARG(do_queue);
00110 CMD_TWO_ARG(do_quota);
00111 CMD_NO_ARG(do_readcache);
00112 CMD_NO_ARG(do_restart);
00113 CMD_NO_ARG(do_backup);
00114 CMD_ONE_ARG(do_say);
00115 CMD_NO_ARG(do_score);
00116 CMD_ONE_ARG(do_search);
00117 CMD_TWO_ARG(do_set);
00118 CMD_TWO_ARG(do_setattr);
00119 CMD_TWO_ARG(do_setvattr);
00120 CMD_ONE_ARG(do_shout);
00121 CMD_ONE_ARG(do_shutdown);
00122 CMD_ONE_ARG(do_stats);
00123 CMD_ONE_ARG(do_sweep);
00124 CMD_TWO_ARG_ARGV_CMDARG(do_switch);
00125 CMD_TWO_ARG(do_teleport);
00126 CMD_ONE_ARG(do_think);
00127 CMD_NO_ARG(do_timecheck);
00128 CMD_ONE_ARG(do_timewarp);
00129 CMD_TWO_ARG(do_toad);
00130 CMD_TWO_ARG_ARGV(do_trigger);
00131 CMD_ONE_ARG(do_unlock);
00132 CMD_ONE_ARG(do_unlink);
00133 CMD_ONE_ARG(do_use);
00134 CMD_NO_ARG(do_version);
00135 CMD_NO_ARG(do_report);
00136 CMD_TWO_ARG_ARGV(do_verb);
00137 CMD_TWO_ARG_CMDARG(do_wait);
00138 #ifdef QUERY_SLAVE
00139 CMD_TWO_ARG_CMDARG(do_query);
00140 #endif // QUERY_SLAVE
00141 CMD_ONE_ARG(do_wipe);
00142 CMD_NO_ARG(do_dbclean);
00143 CMD_TWO_ARG(do_addcommand);
00144 CMD_TWO_ARG(do_delcommand);
00145 CMD_ONE_ARG(do_listcommands);
00146 CMD_ONE_ARG(do_break);
00147 #ifdef REALITY_LVLS
00148 CMD_TWO_ARG(do_rxlevel);
00149 CMD_TWO_ARG(do_txlevel);
00150 #endif
00151 CMD_TWO_ARG_ARGV(do_icmd);
00152 CMD_ONE_ARG(do_hook);
00153 CMD_TWO_ARG(do_flag);
00154 CMD_ONE_ARG(do_train);
00155 CMD_TWO_ARG(do_moniker);
00156
00157 typedef struct
00158 {
00159 char *cmdname;
00160 NAMETAB *switches;
00161 int perms;
00162 int extra;
00163 int callseq;
00164 int hookmask;
00165 void (*handler)(dbref executor, dbref caller, dbref enactor, int);
00166 } CMDENT_NO_ARG;
00167
00168 typedef struct
00169 {
00170 char *cmdname;
00171 NAMETAB *switches;
00172 int perms;
00173 int extra;
00174 int callseq;
00175 int hookmask;
00176 void (*handler)(dbref executor, dbref caller, dbref enactor, int, char *);
00177 } CMDENT_ONE_ARG;
00178
00179 typedef struct
00180 {
00181 char *cmdname;
00182 NAMETAB *switches;
00183 int perms;
00184 int extra;
00185 int callseq;
00186 int hookmask;
00187 void (*handler)(dbref executor, dbref caller, dbref enactor, int, char *, char *[], int);
00188 } CMDENT_ONE_ARG_CMDARG;
00189
00190 typedef struct
00191 {
00192 char *cmdname;
00193 NAMETAB *switches;
00194 int perms;
00195 int extra;
00196 int callseq;
00197 int hookmask;
00198 void (*handler)(dbref executor, dbref caller, dbref enactor, int, int, char *, char *);
00199 } CMDENT_TWO_ARG;
00200
00201 typedef struct
00202 {
00203 char *cmdname;
00204 NAMETAB *switches;
00205 int perms;
00206 int extra;
00207 int callseq;
00208 int hookmask;
00209 void (*handler)(dbref executor, dbref caller, dbref enactor, int, char *, char *, char*[], int);
00210 } CMDENT_TWO_ARG_CMDARG;
00211
00212 typedef struct
00213 {
00214 char *cmdname;
00215 NAMETAB *switches;
00216 int perms;
00217 int extra;
00218 int callseq;
00219 int hookmask;
00220 void (*handler)(dbref executor, dbref caller, dbref enactor, int, char *, char *[], int);
00221 } CMDENT_TWO_ARG_ARGV;
00222
00223 typedef struct
00224 {
00225 char *cmdname;
00226 NAMETAB *switches;
00227 int perms;
00228 int extra;
00229 int callseq;
00230 int hookmask;
00231 void (*handler)(dbref executor, dbref caller, dbref enactor, int,
00232 char *, char *[], int, char*[], int);
00233 } CMDENT_TWO_ARG_ARGV_CMDARG;
00234
00235 typedef struct addedentry ADDENT;
00236 struct addedentry
00237 {
00238 dbref thing;
00239 int atr;
00240 char *name;
00241 struct addedentry *next;
00242 };
00243
00244 typedef struct
00245 {
00246 char *cmdname;
00247 NAMETAB *switches;
00248 int perms;
00249 int extra;
00250 int callseq;
00251 int hookmask;
00252 union
00253 {
00254 void (*handler)(void);
00255 ADDENT *addent;
00256 };
00257 } CMDENT;
00258
00259 void commands_no_arg_add(CMDENT_NO_ARG cmdent[]);
00260 void commands_one_arg_add(CMDENT_ONE_ARG cmdent[]);
00261 void commands_one_arg_cmdarg_add(CMDENT_ONE_ARG_CMDARG cmdent[]);
00262 void commands_two_arg_add(CMDENT_TWO_ARG cmdent[]);
00263 void commands_two_arg_cmdarg_add(CMDENT_TWO_ARG_CMDARG cmdent[]);
00264 void commands_two_arg_argv_add(CMDENT_TWO_ARG_ARGV cmdent[]);
00265 void commands_two_arg_argv_cmdarg_add(CMDENT_TWO_ARG_ARGV_CMDARG cmdent[]);
00266 void init_cmdtab(void);
00267
00268 extern NAMETAB access_nametab[];
00269 extern NAMETAB attraccess_nametab[];
00270 extern NAMETAB indiv_attraccess_nametab[];
00271 extern NAMETAB lock_sw[];
00272 extern NAMETAB logoptions_nametab[];
00273 extern NAMETAB logdata_nametab[];
00274 extern NAMETAB list_names[];
00275
00276
00277
00278 #define CS_NO_ARGS 0x0000
00279 #define CS_ONE_ARG 0x0001
00280 #define CS_TWO_ARG 0x0002
00281 #define CS_NARG_MASK 0x0003
00282 #define CS_ARGV 0x0004
00283 #define CS_INTERP 0x0010
00284 #define CS_NOINTERP 0x0020
00285 #define CS_CAUSE 0x0040
00286 #define CS_UNPARSE 0x0080
00287 #define CS_CMDARG 0x0100
00288 #define CS_STRIP 0x0200
00289 #define CS_STRIP_AROUND 0x0400
00290 #define CS_ADDED 0x0800
00291 #define CS_LEADIN 0x1000
00292 #define CS_NOSQUISH 0x4000 // Do not space-compress.
00293
00294
00295
00296 #define CA_PUBLIC 0x00000000
00297 #define CA_GOD 0x00000001
00298 #define CA_WIZARD 0x00000002
00299 #define CA_BUILDER 0x00000004
00300 #define CA_IMMORTAL 0x00000008
00301 #define CA_STAFF 0x00000010
00302 #define CA_HEAD 0x00000020
00303
00304 #define CA_ADMIN 0x00000080
00305 #define CA_ROBOT 0x00000100
00306 #define CA_ANNOUNCE 0x00000200
00307 #define CA_UNINS 0x00000400
00308 #define CA_MUSTBE_MASK (CA_GOD|CA_WIZARD|CA_BUILDER|CA_IMMORTAL|CA_STAFF|CA_HEAD|CA_ADMIN|CA_ROBOT|CA_ANNOUNCE|CA_UNINS)
00309
00310 #define CA_NO_HAVEN 0x00001000
00311 #define CA_NO_ROBOT 0x00002000
00312 #define CA_NO_SLAVE 0x00004000
00313 #define CA_NO_SUSPECT 0x00008000
00314 #define CA_NO_GUEST 0x00010000
00315 #define CA_NO_UNINS 0x00020000
00316 #define CA_CANTBE_MASK (CA_NO_HAVEN|CA_NO_ROBOT|CA_NO_SLAVE|CA_NO_SUSPECT|CA_NO_GUEST|CA_NO_UNINS)
00317
00318 #define CA_MARKER0 0x00002000
00319 #define CA_MARKER1 0x00004000
00320 #define CA_MARKER2 0x00008000
00321 #define CA_MARKER3 0x00010000
00322 #define CA_MARKER4 0x00020000
00323 #define CA_MARKER5 0x00040000
00324 #define CA_MARKER6 0x00080000
00325 #define CA_MARKER7 0x00100000
00326 #define CA_MARKER8 0x00200000
00327 #define CA_MARKER9 0x00400000
00328
00329 #define CA_GBL_BUILD 0x00800000
00330 #define CA_GBL_INTERP 0x01000000
00331 #define CA_DISABLED 0x02000000
00332 #define CA_STATIC 0x04000000
00333 #define CA_NO_DECOMP 0x08000000
00334
00335 #define CA_LOCATION 0x10000000
00336 #define CA_CONTENTS 0x20000000
00337 #define CA_PLAYER 0x40000000
00338 #define CF_DARK 0x80000000
00339
00340 #define SW_MULTIPLE 0x80000000
00341 #define SW_GOT_UNIQUE 0x40000000
00342 #define SW_NOEVAL 0x20000000
00343
00344
00345 #endif // !__COMMAND_H