/* Copyright 1989, 1990 by James Aspnes, David Applegate, and Bennet Yee */ /* See the file COPYING for distribution information */ #ifndef _CONFIG_H #define _CONFIG_H typedef long datum; /* must be big enough to hold struct * */ #define RESERVED_TOKENS (64) /* number of reserved words */ /* special flag names */ #define MIN_FLAGNAME (64) #define MAX_FLAGNAME (96) /* special variables which C code knows about */ #define OWNER_NAME (96) #define PARENT_NAME (97) #define PASSWORD_NAME (98) #define PLAYER_SET_NAME (99) /* list of players that can connect */ #define CONNECTED_SET_NAME (100) /* list of players that are connected */ #define ALIASES_NAME (101) #define CONTENTS_NAME (102) /* magic action names */ #define DEFAULT_ACTION (112) #define BEFORE_ACTION (113) #define AFTER_ACTION (114) #define INVOKE_ACTION (115) #define STARTUP_ACTION (116) #define CONNECT_ACTION (117) #define DISCONNECT_ACTION (118) #define TICK_ACTION (119) #define FIXED_STRINGS (128) /* these strings can never be gc'd */ #define MAX_NAMELEN (32) /* max length of variable name */ #define MAX_STRLEN (4096) /* max length of a string */ #define BOOL_MARKER '?' /* character that indicates boolean var */ #define NUM_MARKER '%' /* numeric variable */ #define STRING_MARKER '$' /* string variable */ #define ACTION_MARKER '&' /* action name */ #define SET_MARKER '@' /* set variable */ #define TIME_MARKER '~' /* time variable */ /* internal action delimiters */ #define LEFT_ACTION '<' #define RIGHT_ACTION '>' #define DOUBLE_ACTION '^' /* special single-character commands */ #define RUN_CODE_COMMAND '@' #define SAY_COMMAND '\"' #define POSE_COMMAND ':' #define ALIAS_SEPARATOR '|' /* separates alternative names */ /* magic names for parser */ #define ME_STRING "me" #define HERE_STRING "here" #define NUMERIC_NAME_TOKEN '#' /* something that will return non-negative datum's */ #define RAND() (OS_RAND() & 0x7ffffff) #define TELL_BUFFER_SIZE 32768 /* make it too big, and Sun-3 stacks blow */ /* code fragment to run instead of a broken action */ /* this get passed to sprintf with the error message */ #define LOSE_CODE "if $name then tell $name [ shorts out:] to you else tell [The nameless object ] %%id [ shorts out:] to you endif tell [ZzZt! %s] to you" /* message when parse fails completely */ #define DEFAULT_HUH_MESSAGE "Huh?" /* maximum number of commands for a full incremental GC */ #define GC_RATE (1024) /* top-level object from whom all others can be found */ #define TOP_OBJECT (1) #define TOP_INIT_COMMAND "Initialize" /* sent to TOP_OBJECT at startup */ /* interface information */ #define TINYPORT (4201) /* default port for network interface */ #define QUIT_COMMAND "QUIT" /* command to disconnect */ /* timing stuff */ #define COMMAND_TIME_MSEC 1000 /* time slice length in milliseconds */ #define COMMAND_BURST_SIZE 100 /* commands allowed per user in a burst */ #define COMMANDS_PER_TIME 10 /* commands per time slice after burst */ #define TICKS_PER_SLICE 20 /* max number of events per slice */ #endif /* _CONFIG_H */