/* * config.h * * This headerfile defines the configuration of the DriverLib. * * By changing the "values" of #defines, you will alter the * respective configuration settings. * Also, some defines do not have "values", but may be toggled * ON/OFF by use of #define/#undef. * On some rare occations, both value and namedefinition is used, * then #if 1/#if 0 wrapped around the define will toggle it ON/OFF. * * Started by: Frank Schmidt, Jesus@NorseMUD * */ #ifndef _CONFIG_H #define _CONFIG_H /* * DGD-driver specific configuration: */ /* use default base DGD directory? (fastest, no need to change) */ #define DEFAULT_DGD_DIR #ifndef DEFAULT_DGD_DIR /* user defined _DGD_DIR: */ # define _DGD_DIR "<undefined>" #else /* DO NOT CHANGE: */ # define _DGD_DIR "/dgd/" #endif /* Default resource limits for call_stack and tick_limit for ALL calls to * the current mudlib. Set value to -1 for unlimited default resources. * (But then loops may hang driver...) */ #define DEFAULT_CALL_STACK 100 #define DEFAULT_TICK_LIMIT 100000 /* interval between each disk swapping and state dumps by DRIVER object */ #define DRIVER_SWAP_INTERVAL 600 #define DRIVER_DUMP_INTERVAL 200 /* define this for shutting down driver safely when kill signal is received */ #define DRIVER_KILL_SIGNAL_SHUTDOWNS /* define this for sending driver output to stdout (recommended) */ #define DRIVER_STDOUT_ECHO /* level of debugging information shown to driver output: */ #define INFORM_DRIVER 20 /* * define path to our driver startup- and driver output logfile, pluss old * files. Set equal to 0 for no logging to file of driver output is desired */ #define DRIVER_STARTUP_LOG "/dgd/log/driver.startup" #define DRIVER_OLD_STARTUP_LOG "/dgd/log/driver.startup.old" #define DRIVER_OUTPUT_LOG "/dgd/log/driver.out" #define DRIVER_OLD_OUTPUT_LOG "/dgd/log/driver.old" /* define path to driver object logfiles: uptime log and swap/dump disk-log */ #define DRIVER_LOG "/dgd/log/DRIVER" #define DRIVER_DISK_LOG "/dgd/log/driver.disk" /* short_ctime() to use in driver output and logging */ #define short_ctime(t) (ctime(t)[4..15]+" "+ctime(t)[20..23]) /* * Redefinable function names: * NB! *_FUNC and *_DEF should always contain corresponsing "values"! * This is also a nice overview over functions serving as interface to mudlib */ /* called from USER object to master() object to get a login object */ #define __CONNECT_FUNC "connect" #define __CONNECT_DEF connect /* called from USER object to connected interactive object */ #define __LOGON_FUNC "logon" #define __LOGON_DEF logon #define __PROCESS_INPUT_FUNC "process_input" #define __PROCESS_INPUT_DEF process_input #define __LOGOFF_FUNC "logoff" #define __LOGOFF_DEF logoff /* non-static function calling receive() in interactive objects */ #define __CATCH_TELL_FUNC "catch_tell" #define __CATCH_TELL_DEF catch_tell /* function in interactive objects calling send_message() in USER object */ #define __RECEIVE_FUNC "receive" #define __RECEIVE_DEF receive /* called in objects that is "commanded" and MUDOS_COMMAND is not defined */ #define __DO_COMMAND_FUNC "do_command" #define __DO_COMMAND_DEF do_command /* internal create called in every object from DGD driver process */ #define __DGD_CREATE_FUNC "__create" #define __DGD_CREATE_DEF __create /* called in any object from DriverLib objects */ #define __CREATE_FUNC "create" #define __CREATE_DEF create #define __RESET_FUNC "reset" #define __RESET_DEF reset #define __INIT_FUNC "init" #define __INIT_DEF id #define __ID_FUNC "id" #define __ID_DEF id #define __MOVE_FUNC "move" #define __MOVE_DEF move #define __HEART_BEAT_FUNC "heart_beat" #define __HEART_BEAT_DEF heart_beat #define __DESTROY_FUNC "destroy" #define __DESTROY_DEF destroy #define __QUERY_PREVENT_CLONE_FUNC "query_prevent_clone" #define __QUERY_PREVENT_CLONE_DEF query_prevent_clone /* called from DRIVER object in any object */ #define __QUERY_PREVENT_RECOMPILE_FUNC "query_prevent_recompile" #define __QUERY_PREVENT_RECOMPILE_DEF query_prevent_recompile /* called in master() at any time */ #define __EPILOG_FUNC "epilog" #define __EPILOG_DEF epilog #define __PRELOAD_FUNC "preload" #define __PRELOAD_DEF preload #define __COMPILE_ERROR_FUNC "compile_error" #define __COMPILE_ERROR_DEF compile_error #define __RUNTIME_ERROR_FUNC "runtime_error" #define __RUNTIME_ERROR_DEF runtime_error #define __CREATOR_FILE_FUNC "creator_file" #define __CREATOR_FILE_DEF creator_file #define __VALID_OBJECT_FUNC "valid_object" #define __VALID_OBJECT_DEF valid_object #define __VALID_SETEUID_FUNC "valid_seteuid" #define __VALID_SETEUID_DEF valid_seteuid #define __VALID_EXEC_FUNC "valid_exec" #define __VALID_EXEC_DEF valid_exec #define __PARSE_USER_PATH_FUNC "parse_user_path" #define __PARSE_USER_PATH_DEF parse_user_path #define __VALID_READ_FUNC "valid_read" #define __VALID_READ_DEF valid_read #define __VALID_WRITE_FUNC "valid_write" #define __VALID_WRITE_DEF valid_write #define __DESTRUCT_ENV_OF_FUNC "destruct_env_of" #define __DESTRUCT_ENV_OF_DEF destruct_env_of /* called from EDITOR object to master() to get rescue file if any */ #define __GET_RESCUE_FILE_FUNC "get_rescue_file" #define __GET_RESCUE_FILE_DEF get_rescue_file /* * DriverLib switches: */ /* call valid_object(object) in master() to check if it is invalid? */ #undef MASTER_VALID_OBJECT /* automagically set euid to uid at creation of an object? */ #undef AUTO_SETEUID /* always trust backbone? (euid set to BACKBONE for clones by backbone) */ #undef AUTO_TRUST_BACKBONE /* automagically recompile blueprint of those objects that are out of date? */ #define AUTO_RECOMPILE_OBJECTS /* prevent rest of mudlib accessing DriverLib objects (slows down calls) */ #define PREVENT_MUDLIB_CALLS /* * Global objects (master, simul_efun) */ /* master object: */ #if 0 /* use mudlib's (not properly simulated in this package) */ # define MASTER "/secure/master" #else /* use a DGD-converted one in the /dgd/-directory */ # define MASTER "/dgd/master" #endif /* simul efun object: */ #if 0 /* use mudlib's (not properly simulated in this package) */ # define SIMUL_EFUN "/secure/simul_efun" #else /* use a DGD-converted one in the /dgd/-directory */ # define SIMUL_EFUN "/dgd/simul_efun" #endif /* * User IDentities (UIDs) */ #define DRIVER_UID "DRIVER" #define ROOT_UID "ROOT" #define BACKBONE_UID "BACKBONE" #define NONAME_UID "NONAME" /* * Effective User-ID checks (driver/mudlib security) */ #if 0 /* caller has euid of root? */ #define ROOT_EUID() (geteuid(calling_object()) == ROOT_UID) /* caller has euid of backbone? */ #define BACKBONE_EUID() (geteuid(calling_object()) == BACKBONE_UID) #endif /* * Misc configurable MudOS-like stuff */ /* minimum interval between each heartbeat, call_out and reset() */ #define HEART_BEAT_INTERVAL 1 #define CALL_OUT_INTERVAL 1 #define RESET_INTERVAL 3600 /* copy_file(), read_file() & tail() buffer-chunk and max cat'n tail lines */ #define COPY_FILE_CHUNK MAX_STRING_SIZE #define FILE_CHUNK 1024 #define TAIL_CHUNK 512 #define CAT_LINES 40 #define TAIL_LINES 40 /* allow referencing program sourcefiles with extension? * (for inherit, call_other(), compile_object() and find_object() kfuns. * This will imply clone_object() also) * #if 0 - do not allow source extension to be specified * #if 1 - allow default source extension in objectnames */ #if 0 # define DEFAULT_SRC_EXTENSION ".c" #endif /* default extension on binary datafiles * (for save_object() and restore_object() kfuns.) * #if 0 - do not allow default obj extension * #if 1 - allow default obj extension */ #if 0 # define DEFAULT_OBJ_EXTENSION ".o" #endif /* default notify_fail messy */ #define DEFAULT_NOTIFY_FAIL "What?\n" /* disallow ansi and/or termcap codes as user-in/output? */ #define NO_ANSI_CODES_IN #undef NO_TERMCAPS_IN #define NO_ANSI_CODES_OUT /* use termcap abilities, as a means of escape sequence code? */ #define USE_TERMCAPS #define ESC "%^" /* "built-in" wordwrapping on? (works perfectly with termcaps!) */ #define WORD_WRAPPING /* default screen width, height & tabsize (for wordwrapping) */ #define DEFAULT_SCREEN_TERM "dumb" #define DEFAULT_SCREEN_WIDTH 80 #define DEFAULT_SCREEN_HEIGHT 25 #define DEFAULT_TAB_SIZE 4 /* Tintin++ clients sends more empty lines, discard these? It will make it possible for TT++ users to logon... */ #define DISCARD_EXTRA_EMPTY_LINES /* * MudOS basics that can be triggered ON/OFF: */ /* define bitstring functions? */ #undef MUDOS_BITSTRING /* define typical MudOS functions for communications? like: tell_object(), write(), say(), shout().. etc */ #undef MUDOS_COMMUNICATION #undef MUDOS_ROOM_ECHO /* let tells to "rooms" echo through inventory, though what defines a room is undefined */ /* simulate function-pointers? (through macros) */ #define MUDOS_FUNCTIONP /* support objects with heartbeat? */ #undef MUDOS_HEART_BEAT /* should objects have inventory? */ #undef MUDOS_INVENTORY /* support for "living" objects? */ #undef MUDOS_LIVING /* sort users/players by living_names? (making e.g. find_player() work) */ #ifdef MUDOS_LIVING # define MUDOS_USER_LIVING_NAME #endif /* include support-code for add_trigger()? (similar to add_action) */ #if defined(MUDOS_FUNCTIONP) # undef MUDOS_TRIGGER #endif /* do everything MudOS does with cmd-strings typed in? */ #if defined(MUDOS_TRIGGER) # if defined(MUDOS_INVENTORY) # undef MUDOS_COMMAND # ifdef MUDOS_COMMAND # define MUDOS_NOTIFY_FAIL /* notify_fail() and query_notify_fail() */ # endif # endif #endif /* call reset() periodically in all objects? (simple implementation) */ #undef MUDOS_RESET /* define user_id (UID) functions for all objects like in MudOS? */ #define MUDOS_USER_ID #undef MUDOS_EXPORT_UID /* export_uid() may become a BIG security hole */ /* support 'array', 'function' variabletypes, and 'public' functiontype? */ #undef MUDOS_EXTRA_TYPES /* type-checking functions: intp(), floatp(), stringp(), arrayp(), etc? */ #define MUDOS_TYPEFUNCS /* #undef not supported! Used by DriverLib... */ #undef MUDOS_EXTRA_TYPEFUNCS /* pointerp(), mappingp() */ #undef MUDOS_TYPE_CONV_FUNCS /* to_int(), to_float(), atoi(), atof() */ #undef MUDOS_MAPPING_FUNCS /* keys(), values(), m_sizeof() */ /* allow MudOS names for file functions? (mv, mkdir, cp, rename etc) */ #undef MUDOS_FILEFUNCS #undef MUDOS_EXTRA_FILEFUNCS /* stat(), head(), tail() */ #undef MUDOS_GET_DIR_BEHAVIOUR /* behaviour like MudOS get_dir(file, flag)? but otherwise same result as DGD get_dir()... */ #undef MUDOS_WRITE_BYTES_ARGS /* define arguments for write_bytes to be like in MudOS (string, int, string) */ #undef MUDOS_RESTORE_OBJECT_FLAG /* dummy 2nd arg in restore_object()? */ #undef MUDOS_SAVE_OBJECT_FLAG /* save_object() too? */ /* accept second argument to allocate(), data to fill returned array with */ #undef MUDOS_ALLOCATE_FILLWITH /* sort_array() uses Bubblesort instead of Quicksort? (not recommended) */ #undef MUDOS_BUBBLE_SORT_ARRAY /* supports arrays being sent to call_other() and -> ? */ #undef MUDOS_CALL_OTHER_ARRAY /* mudos-type sizeof()? Returns sizes of arrays, strings and mappings. */ #undef MUDOS_LIBERAL_SIZEOF /* define <flag> as third parameter in member_array()? */ #undef MUDOS_MEMBER_ARRAY_FLAG /* support this_player(x) or use this_player1() instead? (latter is fastest) */ #undef MUDOS_THIS_PLAYER_1 /* * Turn specific auto object functions ON/OFF * (Some of them already exists under different (better) names!) */ #undef MUDOS_ALL_PRESENT /* all_present()? (irrelevant without MUDOS_INVENTORY) */ #undef MUDOS_CHILDREN /* children()? (slow) */ #undef MUDOS_CLONEP /* clonep()? */ #undef MUDOS_FUNCTION_EXISTS /* function_exists()? */ #undef MUDOS_CREATOR /* creator()? (needs MUDOS_USER_ID) */ #undef MUDOS_DESTRUCT /* destruct()? */ #undef MUDOS_DISABLE_COMMANDS /* disable_commands()? (does nothing, dummy function) */ #undef MUDOS_ENABLE_COMMANDS /* enable_commands()? (does nothing, dummy) */ #undef MUDOS_EVAL_COST /* eval_cost()? */ #undef MUDOS_EXTRACT /* extract()? */ #undef MUDOS_INVENTORY_INDEX /* inventory_index()? */ #undef MUDOS_LOWER_CASE /* lower_case()? */ #define MUDOS_MESSAGE /* message()? (bare-bone mudlib doesn't handle #undef) */ #undef MUDOS_MOVE_OBJECT /* move_object()? */ #undef MUDOS_NEW /* new()? */ #undef MUDOS_ORIGIN /* origin()? */ #undef MUDOS_PRESENT /* present()? (irrelevant without MUDOS_INVENTORY) */ #undef MUDOS_REBOOT_TIME /* reboot_time()? */ #define MUDOS_RECEIVE_MESSAGE /* receive_message()? (needed for message() to work) */ #undef MUDOS_SLICE_ARRAY /* slice_array()? */ #define MUDOS_SPRINTF /* sprintf/printf? */ #undef MUDOS_VERSION /* version()? */ #undef MUDOS_UPTIME /* uptime()? */ #undef MUDOS_THROW /* throw()? */ /* * Support for kfun packages: * (Kfun packages are patched to the driver.) */ /* regexp kfun package (implemented as sfun) */ #ifdef regexp_compile # ifdef regexp_match # define REGEXP_CACHE_SIZE 100 /* regexp cache size */ # define MUDOS_REGEXP /* regexp() sfun? */ # endif #endif #endif