quixadhal

local_options

Sep 9th, 2017
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.56 KB | None | 0 0
  1. /*
  2. * options.h: defines for the compile-time configuration of the MudOS driver
  3. */
  4.  
  5. #ifndef _OPTIONS_H_
  6. #define _OPTIONS_H_
  7.  
  8. /*
  9. * YOU PROBABLY DO NOT WANT TO MODIFY THIS FILE.
  10. *
  11. * Do 'cp options.h local_options' and edit that instead. local_options,
  12. * if it exists, overrides this file.
  13. *
  14. * The advantage is that when you upgrade to a newer MudOS driver, you can
  15. * simply copy your local_options file into the src directory. The build
  16. * process will warn you if new options have been added that you should
  17. * choose settings for.
  18. */
  19.  
  20. /****************************************************************************
  21. * EVERY time you change ANYTHING in this file, RECOMPILE from scratch. *
  22. * (type "make clean" then "make" on a UNIX system) Failure to do so may *
  23. * cause the driver to behave oddly. *
  24. ****************************************************************************/
  25.  
  26. /* NOTES:
  27. * Many of the configurable options are now set via the configuration file
  28. * that is specified as the first argument to the driver.
  29. * See port.h for those #defines related to portability (compatibility) if
  30. * you have problems compiling on your system.
  31. * Removing an efun from func_spec.c usually removes most, if not all,
  32. * of the code associated with it.
  33. * Note that anything defined in this file is also visible to LPC files
  34. * surrounded by __. So #define FOO in this file defines __FOO__ for
  35. * all LPC files. This allows code like:
  36. *
  37. * #ifdef __SENSIBLE_MODIFIERS__
  38. * ...
  39. */
  40.  
  41. /****************************************************************************
  42. * MALLOC *
  43. * -------- *
  44. * For performance reasons, LP drivers have a variety of memory allocation *
  45. * packages. If you don't care, use the default one on your system: *
  46. * #define SYSMALLOC, #undef the others. *
  47. ****************************************************************************/
  48.  
  49. /* You must choose exactly one of these malloc packages:
  50. * ~~~~
  51. * SYSMALLOC:
  52. * * Built-in system malloc.
  53. * * No statistics.
  54. * * SYSMALLOC incurs no additional CPU or memory overhead.
  55. *
  56. * SMALLOC:
  57. * * Satoria's smalloc.
  58. * * Statistics available. (see wrappers and DO_MSTATS)
  59. * * Faster than most system mallocs with modest ammount of memory overhead.
  60. * * Can fall back onto system malloc if sbrk() not ok.
  61. *
  62. * BSDMALLOC:
  63. * * BSD (Berkeley Software Distributions) malloc.
  64. * * Statistics available. (see wrappers and DO_MSTATS)
  65. * * Faster than SMALLOC but more memory overhead.
  66. * * Requires sbrk().
  67. */
  68. #undef SYSMALLOC
  69. #undef SMALLOC
  70. #undef BSDMALLOC
  71. #undef MMALLOC
  72. #define MALLOC64
  73. #undef MALLOC32
  74. /* You may optionally choose one (or none) of these malloc wrappers. These
  75. * can be used in conjunction with any of the above malloc packages.
  76. *
  77. * WRAPPEDMALLOC:
  78. * * Limited statistics.
  79. * * Limited additional cpu overhead and no additional memory overhead.
  80. *
  81. * DEBUGMALLOC:
  82. * * Statistics on precisely how much memory has been malloc'd (as well
  83. * as the stats provided by WRAPPEDMALLOC).
  84. * * Incurs a fair amount of overhead (both memory and CPU)
  85. */
  86. #undef WRAPPEDMALLOC
  87. #undef DEBUGMALLOC
  88.  
  89. /* The following add certain bells and whistles to malloc: */
  90.  
  91. /*
  92. * SBRK_OK: do not define this unless SMALLOC is chosen above.
  93. * Defining this causes smalloc to use the low level memory allocation
  94. * routines, and to act as a malloc replacement. Conversely, undef'ing
  95. * SBRK_OK causes smalloc to act as a wrapper for the system malloc
  96. * routines.
  97. *
  98. * Note:
  99. * NeXTStep 3.x users should always #undef SBRK_OK.
  100. */
  101. #undef SBRK_OK
  102.  
  103. /* DO_MSTATS: do not define this unless BSDMALLOC or SMALLOC is chosen above.
  104. * Defining this causes those replacement mallocs to keep statistics that
  105. * the malloc_status() efun will print out (including total memory
  106. * allocated/used).
  107. */
  108. #undef DO_MSTATS
  109.  
  110. /* DEBUGMALLOC_EXTENSIONS: defining this (in addition to DEBUGMALLOC) enables
  111. * the set_malloc_mask(int) and debugmalloc(string,int) efuns. These two
  112. * efuns basically allow you to cause certain malloc's and free's (with tags
  113. * selected by a specified mask) to print debug information (addr, tag,
  114. * description, size) to stdio (in the shell that invoked the driver) or to a
  115. * file. Not defining this does reduce the overhead of DEBUGMALLOC from 16
  116. * bytes per malloc down to 8. This macro has no effect if DEBUGMALLOC isn't
  117. * defined.
  118. */
  119. #undef DEBUGMALLOC_EXTENSIONS
  120.  
  121. /* CHECK_MEMORY: defining this (in addition to DEBUGMALLOC and
  122. * DEBUGMALLOC_EXTENSIONS) causes the driver to check for memory
  123. * corruption due to writing before the start or end of a block. This
  124. * also adds the check_memory() efun. Takes a considerable ammount
  125. * more memory. Mainly for debugging.
  126. */
  127. #undef CHECK_MEMORY
  128.  
  129. /****************************************************************************
  130. * COMPATIBILITY *
  131. * --------------- *
  132. * The MudOS driver has evolved quite a bit over the years. These defines *
  133. * are mainly to preserve old behavior in case people didn't want to *
  134. * rewrite the relevant portions of their code. *
  135. * *
  136. * In most cases, code which needs these defines should be rewritten when *
  137. * possible. The 'Compat status' field is designed to give an idea how *
  138. * likely it is that support for that option will be removed in the near *
  139. * future. Certain options are fairly easy to work around, and double *
  140. * the size of the associated code, as well as the maintenance workload, *
  141. * and can make the code significantly more complex or harder to read, so *
  142. * supporting them indefinitely is impractical. *
  143. * *
  144. * WARNING: If you are using software designed to run with the MudOS driver *
  145. * it may assume certain settings of these options. Check the *
  146. * instructions for details. *
  147. ****************************************************************************/
  148.  
  149. /* HAS_STATUS_TYPE: old MudOS drivers had a 'status' type which was
  150. * identical to the 'int' type. Define this to bring it back.
  151. *
  152. * Compat status: very archaic, but easy to support.
  153. */
  154. #undef HAS_STATUS_TYPE
  155.  
  156. /* explode():
  157. *
  158. * The old behavior (#undef both of the below) strips any number of
  159. * delimiters at the start of the string, and one at the end. So
  160. * explode("..x.y..z..", ".") gives ({ "x", "y", "", "z", "" })
  161. *
  162. * SANE_EXPLODE_STRING strips off at most one leading delimiter, and
  163. * still strips off one at the end, so the example above gives
  164. * ({ "", "x", "y", "", "z", "" }).
  165. *
  166. * REVERSIBLE_EXPLODE_STRING overrides SANE_EXPLODE_STRING, and makes
  167. * it so that implode(explode(x, y), y) is always x; i.e. no delimiters
  168. * are ever stripped. So the example above gives
  169. * ({ "", "", "x", "y", "", "z", "", "" }).
  170. */
  171. #undef SANE_EXPLODE_STRING
  172. #undef REVERSIBLE_EXPLODE_STRING
  173.  
  174. /* CAST_CALL_OTHERS: define this if you want to require casting of call_other's;
  175. * this was the default behavior of the driver prior to this addition.
  176. *
  177. * Compat status: code that requires it doesn't break, and it promotes
  178. * sloppy coding with no benefits.
  179. */
  180. #undef CAST_CALL_OTHERS
  181.  
  182. /* NONINTERACTIVE_STDERR_WRITE: if defined, all writes/tells/etc to
  183. * noninteractive objects will be written to stderr prefixed with a ']'
  184. * (old behavior).
  185. *
  186. * Compat status: Easy to support, and also on the "It's a bug! No, it's
  187. * a feature!" religious war list.
  188. */
  189. #undef NONINTERACTIVE_STDERR_WRITE
  190.  
  191. /* NO_LIGHT: define this to disable the set_light() and driver maintenance
  192. * of light levels in objects. You can simulate it via LPC if you want...
  193. *
  194. * Compat status: Very dated, easy to simulate, and gross.
  195. */
  196. #define NO_LIGHT
  197.  
  198. /* NO_ADD_ACTION: define this to remove add_action, commands, livings, etc.
  199. * process_input() then becomes the only way to deal with player input.
  200. *
  201. * Compat status: next to impossible to simulate, hard to replace, and
  202. * very, very widely used.
  203. */
  204. #define NO_ADD_ACTION
  205.  
  206. /* NO_SNOOP: disables the snoop() efun and all related functionality.
  207. */
  208. #undef NO_SNOOP
  209.  
  210. /* NO_ADD_ACTION: define this to remove add_action, commands, livings, etc.
  211. process_input() then becomes the only way to deal with player input. */
  212.  
  213. /* NO_ENVIRONMENT: define this to remove the handling of object containment
  214. * relationships by the driver
  215. *
  216. * Compat status: hard to simulate efficiently, and very widely used.
  217. */
  218. #undef NO_ENVIRONMENT
  219.  
  220. /* NO_WIZARDS: for historical reasons, MudOS used to keep track of who
  221. * is and isn't a wizard. Defining this removes that completely.
  222. * If this is defined, the wizardp() and related efuns don't exist.
  223. *
  224. * Also note that if it is not defined, then non-wizards are always put
  225. * in restricted mode when ed() is used, regardless of the setting of
  226. * the restrict parameter.
  227. *
  228. * Compat status: easy to simulate and dated.
  229. */
  230. #define NO_WIZARDS
  231.  
  232. /* OLD_TYPE_BEHAVIOR: reintroduces a bug in type-checking that effectively
  233. * renders compile time type checking useless. For backwards compatibility.
  234. *
  235. * Compat status: dealing with all the resulting compile errors can be
  236. * a huge pain even if they are correct, and the impact on the code is
  237. * small.
  238. */
  239. #undef OLD_TYPE_BEHAVIOR
  240.  
  241. /* OLD_RANGE_BEHAVIOR: define this if you want negative indexes in string
  242. * or buffer range values (not lvalue, i.e. x[-2..-1]; for e.g. not
  243. * x[-2..-1] = foo, the latter is always illegal) to mean counting from the
  244. * end
  245. *
  246. * Compat status: Not horribly difficult to replace reliance on this, but not
  247. * trivial, and cannot be simulated.
  248. */
  249. #undef OLD_RANGE_BEHAVIOR
  250.  
  251. /* OLD_ED: ed() efun backwards compatible with the old version. The new
  252. * version requires/allows a mudlib front end.
  253. *
  254. * Compat status: Easily simulated.
  255. */
  256. #define OLD_ED
  257.  
  258. /* In ed auto-indent,
  259. * 1) does the case line get indented after the switch() ?
  260. * 2) How far do we indent? (this can also be set in the mudlib)
  261. */
  262. #undef ED_INDENT_CASE
  263. #define ED_INDENT_SPACES 3
  264.  
  265. /* SENSIBLE_MODIFIERS:
  266. * Turning this on changes a few things, which may break old code:
  267. *
  268. * (1) 'static' is not recognized; either 'nosave' or 'protected' must
  269. * be used instead.
  270. * (2) The old meaning of 'public' is no longer allowed. Explicit
  271. * functions must be defined at each level to allow access to
  272. * privately inherited functions.
  273. * (3) 'public' now means the default visibility. Previously there was
  274. * no keyword that meant this (before you ask, 'public' meant something
  275. * else, and if you don't know that, you probably don't have any reason
  276. * to care about the old meaning).
  277. */
  278. #define SENSIBLE_MODIFIERS
  279.  
  280. /****************************************************************************
  281. * MISCELLANEOUS *
  282. * --------------- *
  283. * Various options that affect the way the driver behaves. *
  284. * *
  285. * WARNING: If you are using software designed to run with the MudOS driver *
  286. * it may assume certain settings of these options. Check the *
  287. * instructions for details. *
  288. ****************************************************************************/
  289.  
  290. /*
  291. * Define this in order to use Fermat@Equilibria's MD5 based crypt() instead
  292. * of the operating system's. It has the advantage of giving the same value
  293. * on all architectures, and being stronger than the standard UNIX crypt().
  294. */
  295. #undef CUSTOM_CRYPT
  296.  
  297. /*
  298. * Some minor tweaks that make it a bit easier to run code designed to run
  299. * on LPmud 3.2/3.2.1. Currently has the following effects:
  300. *
  301. * . m_indices() and m_values() are synonyms for keys() and values(),
  302. * respectively
  303. * . map_delete() returns it's first argument
  304. * . inherit_list() means deep_inherit_list(), not shallow_inherit_list()
  305. * . heart_beat_info() is a synonym for heart_beats()
  306. */
  307. #undef COMPAT_32
  308.  
  309. /*
  310. * Keep statistics about allocated strings, etc. Which can be viewed with
  311. * the mud_status() efun. If this is off, mud_status() and memory_info()
  312. * ignore allocated strings, but string operations run faster.
  313. */
  314. #define STRING_STATS
  315.  
  316. /*
  317. * Similarly for arrays ...
  318. */
  319. #define ARRAY_STATS
  320.  
  321. /* LOG_CATCHES: define this to cause errors that are catch()'d to be
  322. * sent to the debug log anyway.
  323. *
  324. * On by default, because newer libs use catch() a lot, and it's confusing
  325. * if the errors don't show up in the logs.
  326. */
  327. #define LOG_CATCHES
  328.  
  329. /* ARGUMENTS_IN_TRACEBACK: prints out function call arguments in error
  330. * tracebacks, to aid in debugging. Note: it prints the values of
  331. * the arguments at the time of the error, not when the function
  332. * was called. It looks like this:
  333. *
  334. * Failed to load file: read_buffer
  335. * program: command/update.c, object: command/update line 15
  336. * ' commandHook' in ' clone/user.c' (' clone/user#1')line 72
  337. * arguments were ("/read_buffer.c")
  338. * ' main' in ' command/update.c' (' command/update')line 15
  339. * arguments were ("/read_buffer.c")
  340. *
  341. * The only down side is some people like their logs shorter
  342. */
  343. #define ARGUMENTS_IN_TRACEBACK
  344.  
  345. /* LOCALS_IN_TRACEBACK: similar to ARGUMENTS_IN_TRACEBACK, but for local
  346. * variables. The output looks more or less like:
  347. *
  348. * locals: 1, "local_value"
  349. *
  350. * Same as above. Tends to produce even longer logs, but very useful for
  351. * tracking errors.
  352. */
  353. #define LOCALS_IN_TRACEBACK
  354.  
  355. /* MUDLIB_ERROR_HANDLER: If you define this, the driver doesn't do any
  356. * handling of runtime errors, other than to turn the heartbeats of
  357. * objects off. Information about the error is passed in a mapping
  358. * to the error_handler() function in the master object. Whatever is
  359. * returned is put in the debug.log.
  360. *
  361. * A good mudlib error handler is one of the best tools for tracking down
  362. * errors. Unfortunately, you need to have one. Check the testsuite or
  363. * other libs for an example.
  364. */
  365. #define MUDLIB_ERROR_HANDLER
  366.  
  367. /* CONFIG_FILE_DIR specifies a directory in which the driver will search for
  368. * config files by default. If you don't wish to use this define, you may
  369. * always specify a full path to the config file when starting the driver.
  370. */
  371. #define CONFIG_FILE_DIR "/home/atuin/bin"
  372.  
  373. /* DEFAULT_PRAGMAS: This should be a sum of pragmas you want to always
  374. * be on, i.e.
  375. *
  376. * #define DEFAULT_PRAGMAS PRAGMA_STRICT_TYPES + PRAGMA_SAVE_TYPES
  377. *
  378. * will make every LPC file behave as if it had the lines:
  379. * #pragma strict_types
  380. * #pragma save_types
  381. *
  382. * for no default pragmas:
  383. * #define DEFAULT_PRAGMAS 0
  384. *
  385. * If you don't know what these are, 0 is a good choice.
  386. *
  387. * Supported pragmas:
  388. * PRAGMA_STRICT_TYPES: enforces strict type checking
  389. * PRAGMA_WARNINGS: issues warnings about various dangerous things in
  390. * your code
  391. * PRAGMA_SAVE_TYPES: save the types of function arguments for checking
  392. * calls to functions in this object by objects that
  393. * inherit it.
  394. * PRAGMA_OPTIMIZE: make a second pass over the generated code to
  395. * optimize it further. Currently does jump threading.
  396. * PRAGMA_ERROR_CONTEXT:include some text telling where on the line a
  397. * compilation error occured.
  398. */
  399. #define DEFAULT_PRAGMAS PRAGMA_WARNINGS + PRAGMA_STRICT_TYPES + PRAGMA_ERROR_CONTEXT
  400.  
  401. /* supress warnings about unused arguments; only warn about unused local
  402. * variables. Makes older code (where argument names were required) compile
  403. * more quietly.
  404. */
  405. #define SUPPRESS_ARGUMENT_WARNINGS
  406.  
  407. /* NO_RESETS: completely disable the periodic calling of reset() */
  408. #undef NO_RESETS
  409.  
  410. /* LAZY_RESETS: if this is defined, an object will only have reset()
  411. * called in it when it is touched via call_other() or move_object()
  412. * (assuming enough time has passed since the last reset). If LAZY_RESETS
  413. * is #undef'd, then reset() will be called as always (which guaranteed that
  414. * reset would always be called at least once). The advantage of lazy
  415. * resets is that reset doesn't get called in an object that is touched
  416. * once and never again (which can save memory since some objects won't get
  417. * reloaded that otherwise would).
  418. */
  419. #undef LAZY_RESETS
  420.  
  421. /* SAVE_EXTENSION: defines the file extension used by save_object().
  422. * and restore_object(). Some sysadmins run scripts that periodically
  423. * scan for and remove files ending in .o (but many mudlibs are already
  424. * set up to use .o thus we leave .o as the default).
  425. */
  426. #define SAVE_EXTENSION ".o"
  427.  
  428. /* NO_ANSI: define if you wish to disallow users from typing in commands that
  429. * contain ANSI escape sequences. Defining NO_ANSI causes all escapes
  430. * (ASCII 27) to be replaced with a space ' ' before the string is passed
  431. * to the action routines added with add_action.
  432. *
  433. * STRIP_BEFORE_PROCESS_INPUT allows the location where the stripping is
  434. * done to be controlled. If it is defined, then process_input() doesn't
  435. * see ANSI characters either; if it is undefined ESC chars can be processed
  436. * by process_input(), but are stripped before add_actions are called.
  437. * Note that if NO_ADD_ACTION is defined, then #define NO_ANSI without
  438. * #define STRIP_BEFORE_PROCESS_INPUT is the same as #undef NO_ANSI.
  439. *
  440. * If you anticipate problems with users intentionally typing in ANSI codes
  441. * to make your terminal flash, etc define this.
  442. */
  443. #define NO_ANSI
  444. #define STRIP_BEFORE_PROCESS_INPUT
  445.  
  446. /* OPCPROF: define this if you wish to enable OPC profiling. Allows a dump
  447. * of the # of times each efun is invoked (via the opcprof() efun).
  448. */
  449. #undef OPCPROF
  450.  
  451. /* OPCPROF_2D: define this if you wish to enable 2-D OPC profiling. Allows a
  452. * dump of the # of times each *pair* of eoperators is invoked.
  453. *
  454. * You can't use this and OPCPROF at the same time.
  455. */
  456. #undef OPCPROF_2D
  457.  
  458. /* TRAP_CRASHES: define this if you want MudOS to call crash() in master.c
  459. * and then shutdown when signals are received that would normally crash the
  460. * driver.
  461. */
  462. #define TRAP_CRASHES
  463.  
  464. /* THIS_PLAYER_IN_CALL_OUT: define this if you wish this_player() to be
  465. * usable from within call_out() callbacks.
  466. */
  467. #define THIS_PLAYER_IN_CALL_OUT
  468.  
  469. /* CALLOUT_HANDLES: If this is defined, call_out() returns an integer, which
  470. * can be passed to remove_call_out() or find_call_out(). Removing call_outs
  471. * by name is still allowed, but is significantly less efficient, and also
  472. * doesn't work for function pointers. This option adds 4 bytes overhead
  473. * per callout to keep track of the handle.
  474. */
  475. #define CALLOUT_HANDLES
  476.  
  477. /* FLUSH_OUTPUT_IMMEDIATELY: Causes output to be written to sockets
  478. * immediately after being generated. Useful for debugging.
  479. */
  480. #undef FLUSH_OUTPUT_IMMEDIATELY
  481.  
  482. /* PRIVS: define this if you want object privileges. Your mudlib must
  483. * explicitly make use of this functionality to be useful. Defining this
  484. * this will increase the size of the object structure by 4 bytes (8 bytes
  485. * on the DEC Alpha) and will add a new master apply during object creation
  486. * to "privs_file". In general, privileges can be used to increase the
  487. * granularity of security beyond the current root uid mechanism.
  488. *
  489. * [NOTE: for those who'd rather do such things at the mudlib level, look at
  490. * the inherits() efun and the 'valid_object' apply to master.]
  491. */
  492. #undef PRIVS
  493.  
  494. /* INTERACTIVE_CATCH_TELL: define this if you want catch_tell called on
  495. * interactives as well as NPCs. If this is defined, user.c will need a
  496. * catch_tell(msg) method that calls receive(msg);
  497. */
  498. #undef INTERACTIVE_CATCH_TELL
  499.  
  500. /* RECEIVE_ED: define this if you want normal ed output to go to a
  501. receive_ed() apply in the player ob. Some errors still go directly
  502. to output. Useful for post-processing (perhaps colorizing?) ed
  503. output. Prototype: mixed receive_ed(string txt, string fname);
  504. If fname, return a string that ed will output, 0 to let ed handle
  505. the output in the default way, or 1 to handle the output yourself.
  506. If fname == 0, output is help text and you may return any of the above
  507. or an array of strings that will be more'ed.
  508. */
  509. #undef RECEIVE_ED
  510.  
  511. /* RESTRICTED_ED: define this if you want restricted ed mode enabled.
  512. */
  513. #define RESTRICTED_ED
  514.  
  515. /* NO_SHADOWS: define this if you want to disable shadows in your driver.
  516. */
  517. #undef NO_SHADOWS
  518.  
  519. /* SNOOP_SHADOWED: define this if you want snoop to report what is
  520. * sent to the player even in the event that the player's catch_tell() is
  521. * shadowed and the player may not be seeing what is being sent. Messages
  522. * of this sort will be prefixed with $$.
  523. */
  524. #undef SNOOP_SHADOWED
  525.  
  526. /* RECEIVE_SNOOP: define this if you want snoop text to be sent to
  527. * the receive_snoop() function in the snooper object (instead of being
  528. * sent directly via add_message()). This is useful if you want to
  529. * build a smart client that does something different with snoop messages.
  530. */
  531. #define RECEIVE_SNOOP
  532.  
  533. /* PROFILE_FUNCTIONS: define this to be able to measure the CPU time used by
  534. * all of the user-defined functions in each LPC object. Note: defining
  535. * this adds three long ints (12 bytes on 32-bit machines) to the function
  536. * header structs. Also note that the resolution of the getrusage() timer
  537. * may not be high enough on some machines to give non-zero execution
  538. * times to very small (fast) functions. In particular if the clock
  539. * resolution is 1/60 of a second, then any time less than approxmately 15k
  540. * microseconds will resolve to zero (0).
  541. */
  542. #define PROFILE_FUNCTIONS
  543.  
  544. /* NO_BUFFER_TYPE: if this is #define'd then LPC code using the 'buffer'
  545. * type won't be allowed to compile (since the 'buffer' type won't be
  546. * recognized by the lexer).
  547. */
  548. #undef NO_BUFFER_TYPE
  549.  
  550. /* BINARIES: define this to enable the 'save_binary' pragma.
  551. * This pragma, when set in a program, will cause it to save a
  552. * binary image when loaded, so that subsequent loadings will
  553. * be much faster. The binaries are saved in the directory
  554. * specified in the configuration file. The binaries will not
  555. * load if the LPC source or any of the inherited or included
  556. * files are out of date, in which case the file is compiled
  557. * normally (and may save a new binary).
  558. *
  559. * In order to save the binary, valid_save_binary() is called
  560. * in master.c, and is passed the name of the source file. If
  561. * this returns a non-zero value, the binary is allowed to be
  562. * saved. Allowing any file by any wizard to be saved as a
  563. * binary is convenient, but may take up a lot of disk space.
  564. */
  565. #define BINARIES
  566.  
  567. /* ARRAY_RESERVED_WORD: If this is defined then the word 'array' can
  568. * be used to define arrays, as in:
  569. *
  570. * int array x = ({ .... });
  571. *
  572. * A side effect is that 'array' cannot be a variable or function name.
  573. */
  574. #undef ARRAY_RESERVED_WORD
  575.  
  576. /* REF_RESERVED_WORD: If this is defined then the word 'ref' can be
  577. * used to pass arguments to functions by value. Example:
  578. *
  579. * void inc(int ref x) {
  580. * x++;
  581. * }
  582. *
  583. * ... y = 1; inc(ref y); ...
  584. *
  585. * A side effect is that 'ref' cannot be a variable or function name.
  586. *
  587. * Note: ref must be used in *both* places; this is intentional. It protects
  588. * against passing references to routines which don't intend to return values
  589. * through their arguments, and against forgetting to pass a reference
  590. * to a function which wants one (or accidentally having a variable modified!)
  591. */
  592. #define REF_RESERVED_WORD
  593.  
  594. /****************************************************************************
  595. * PACKAGES *
  596. * -------- *
  597. * Defining some/all of the following add certain efuns, and sometimes *
  598. * add/remove code from the driver. *
  599. * *
  600. * if PACKAGE_XYZZY is defined here, then the code in packages/xyzzy.c *
  601. * and the efuns in packages/xyzzy_spec.c will be added to the driver. *
  602. ****************************************************************************/
  603.  
  604. /* various miscellaneous efuns */
  605. #define PACKAGE_CONTRIB
  606.  
  607. /* efuns that are only of use to those that know something about driver
  608. internals */
  609. #define PACKAGE_DEVELOP
  610.  
  611. /* PACKAGE_MATH: determines whether or not the math efuns (for floats) are
  612. included.
  613. */
  614. #define PACKAGE_MATH
  615.  
  616. /* PACKAGE_MATRIX: determines whether or not the 3d graphics efuns (for floats)
  617. * are included - see packages/matrix.spec for a list.
  618. */
  619. #undef PACKAGE_MATRIX
  620.  
  621. /* PACKAGE_MUDLIB_STATS: define this to enable domain and author stats
  622. * maintenance by the driver. These mudlib stats are more domain
  623. * based than user based, and replaces the traditional wiz_list stats.
  624. */
  625. #undef PACKAGE_MUDLIB_STATS
  626.  
  627. /* PACKAGE_SOCKETS: define this to enable the socket efunctions. This
  628. * causes HAS_SOCKETS to be defined for all LPC objects.
  629. */
  630. #define PACKAGE_SOCKETS
  631.  
  632. /* PACKAGE_PARSER: Natural language parsing efuns for interactive fiction
  633. * type applications
  634. */
  635. #undef PACKAGE_PARSER
  636.  
  637. /* PACKAGE_EXTERNAL: Allows the driver to exec() commands specified in the
  638. * config file.
  639. */
  640. #define PACKAGE_EXTERNAL
  641.  
  642. /* NUM_EXTERNAL_CMDS: the number of external commands supported */
  643. #ifdef PACKAGE_EXTERNAL
  644. #define NUM_EXTERNAL_CMDS 100
  645. #endif
  646.  
  647. /* PACKAGE_DB: efuns for external database access using msql */
  648. #define PACKAGE_DB
  649.  
  650. /* If PACKAGE_DB is defined above, you must pick ONE of the following supported
  651. * databases
  652. */
  653. #ifdef PACKAGE_DB
  654. #undef USE_MSQL
  655. #undef MSQL
  656. #define USE_MYSQL 2
  657. #define MY_SQL
  658. #endif
  659.  
  660. /****************************************************************************
  661. * UID PACKAGE *
  662. * ----------- *
  663. * UIDS are the basis for some mudlib security systems. Basically, they're *
  664. * preserved for backwards compatibility, as several ways of breaking *
  665. * almost any system which relies on them are known. (No, it's not a flaw *
  666. * of uids; only that b/c of the ease with which LPC objects can call *
  667. * each other, it's far too easy to leave holes) *
  668. * *
  669. * If you don't care about security, the first option is probably what you *
  670. * want. *
  671. ****************************************************************************/
  672.  
  673. /*
  674. * PACKAGE_UIDS: define this if you want a driver that does use uids.
  675. *
  676. */
  677. #define PACKAGE_UIDS
  678.  
  679. /* AUTO_SETEUID: when an object is created it's euid is automatically set to
  680. * the equivalent of seteuid(getuid(this_object())). undef AUTO_SETEUID
  681. * if you would rather have the euid of the created object be set to 0.
  682. */
  683. #define AUTO_SETEUID
  684.  
  685. /* AUTO_TRUST_BACKBONE: define this if you want objects with the backbone
  686. * uid to automatically be trusted and to have their euid set to the uid of
  687. * the object that forced the object's creation.
  688. */
  689. #undef AUTO_TRUST_BACKBONE
  690.  
  691. /*************************************************************************
  692. * FOR EXPERIENCED USERS *
  693. * ----------------------- *
  694. * Most of these options will probably be of no interest to many users. *
  695. *************************************************************************/
  696.  
  697. /* USE_32BIT_ADDRESSES: Use 32 bits for addresses of function, instead of
  698. * the usual 16 bits. This increases the maximum program size from 64k
  699. * of LPC bytecode (NOT source) to 4 GB. Branches are still 16 bits,
  700. * imposing a 64k limit on catch(), if(), switch(), loops, and most other
  701. * control structures. It would take an extremely large function to hit
  702. * those limits, though.
  703. *
  704. * Overhead: 2 bytes/function with LPC->C off. Having LPC->C on forces
  705. * this option, since it needs 4 bytes to store the function pointers
  706. * anyway, and this setting is ignored.
  707. */
  708. #define USE_32BIT_ADDRESSES
  709.  
  710. /* HEARTBEAT_INTERVAL: define heartbeat interval in microseconds (us).
  711. * 1,000,000 us = 1 second. The value of this macro specifies
  712. * the frequency with which the heart_beat method will be called in
  713. * those LPC objects which have called set_heart_beat(1).
  714. *
  715. * [NOTE: if ualarm() isn't available, alarm() is used instead. Since
  716. * alarm() requires its argument in units of a second, we map 1 - 1,000,000 us
  717. * to an actual interval of one (1) second and 1,000,001 - 2,000,000 maps to
  718. * an actual interval of two (2) seconds, etc.]
  719. */
  720. #define HEARTBEAT_INTERVAL 2
  721.  
  722. /*
  723. * CALLOUT_CYCLE_SIZE: This is the number of slots in the call_out list.
  724. * It should be approximately the average number of active call_outs, or
  725. * a few times smaller. It should also be a power of 2, and also be relatively
  726. * prime to any common call_out lengths. If all this is too confusing, 32
  727. * isn't a bad number :-)
  728. */
  729. #define CALLOUT_CYCLE_SIZE 1024
  730.  
  731. /* LARGEST_PRINTABLE_STRING: defines the size of the vsprintf() buffer in
  732. * comm.c's add_message(). Instead of blindly making this value larger,
  733. * your mudlib should be coded to not send huge strings to users.
  734. */
  735. #define LARGEST_PRINTABLE_STRING 8192
  736.  
  737. /* MESSAGE_BUFFER_SIZE: determines the size of the buffer for output that
  738. * is sent to users.
  739. */
  740. #define MESSAGE_BUFFER_SIZE 4096
  741.  
  742. /* APPLY_CACHE_BITS: defines the number of bits to use in the call_other cache
  743. * (in interpret.c).
  744. *
  745. * Memory overhead is (1 << APPLY_CACHE_BITS)*16.
  746. * [assuming 32 bit pointers and 16 bit shorts]
  747. *
  748. * ACB: entries: overhead:
  749. * 6 64 1k
  750. * 8 256 4k
  751. * 10 1024 16k
  752. * 12 4096 64k
  753. * 14 16384 256k
  754. * 16 65536 1M
  755. */
  756. #define APPLY_CACHE_BITS 16
  757.  
  758. /* CACHE_STATS: define this if you want call_other (apply_low) cache
  759. * statistics. Causes HAS_CACHE_STATS to be defined in all LPC objects.
  760. */
  761. #define CACHE_STATS
  762.  
  763. /* TRACE: define this to enable the trace() and traceprefix() efuns.
  764. * (keeping this undefined will cause the driver to run faster).
  765. */
  766. #undef TRACE
  767.  
  768. /* RUNTIME_LOADING: On systems which support it, it allows LPC->C compilation
  769. * 'on the fly' without having to recompile the driver.
  770. *
  771. * Note: This currently only works on machines that have the dlopen() system
  772. * call. SunOS and IRIX do, as do a number of others. AIX and Ultrix don't.
  773. * Linux does if you are using ELF.
  774. */
  775. #undef RUNTIME_LOADING
  776.  
  777. /* TRACE_CODE: define this to enable code tracing (the driver will print
  778. * out the previous lines of code to an error) eval_instruction() runs about
  779. * twice as fast when this is not defined (for the most common eoperators).
  780. */
  781. #undef TRACE_CODE
  782.  
  783. /* HEART_BEAT_CHUNK: The number of heart_beat chunks allocated at a time.
  784. * A large number wastes memory as some will be sitting around unused, while
  785. * a small one wastes more CPU reallocating when it needs to grow. Default
  786. * to a medium value.
  787. */
  788. #define HEART_BEAT_CHUNK 512
  789.  
  790. /* SERVER_IP: For machines with multiple IP addresses, this specifies which
  791. * one to use. This is useful for IP accounting and is necessary to be
  792. * able to do ident lookups on such machines.
  793. *
  794. * example: #define SERVER_IP "194.229.18.27"
  795. */
  796. #undef SERVER_IP
  797.  
  798. /* Some maximum string sizes
  799. */
  800. #define SMALL_STRING_SIZE 100
  801. #define LARGE_STRING_SIZE 1000
  802. #define COMMAND_BUF_SIZE 2000
  803.  
  804. /* Number of levels of nested datastructures allowed -- this limit prevents
  805. * crashes from occuring when saving objects containing variables containing
  806. * recursive datastructures (with circular references).
  807. */
  808. #define MAX_SAVE_SVALUE_DEPTH 100
  809.  
  810. /* Miscellaneous config options that should probably be in the runtime
  811. * config file.
  812. */
  813. /* MAX_LOCAL: maximum number of local variables allowed per LPC function */
  814. #define CFG_MAX_LOCAL_VARIABLES 50
  815. /* Increasing max global vars beyond 256 is not recommended */
  816. #define CFG_MAX_GLOBAL_VARIABLES 65530
  817.  
  818. #define CFG_EVALUATOR_STACK_SIZE 3000000
  819. #define CFG_COMPILER_STACK_SIZE 1600000
  820. #define CFG_MAX_CALL_DEPTH 250
  821. /* This must be one of 4, 16, 64, 256, 1024, 4096 */
  822. #define CFG_LIVING_HASH_SIZE 256
  823.  
  824. /* NEXT_MALLOC_DEBUG: define this if using a NeXT and you want to enable
  825. * the malloc_check() and/or malloc_debug() efuns. Run the 'man malloc_debug'
  826. * command on the NeXT to find out what the arguments to malloc_debug(int)
  827. * mean. The malloc_check() efun calls the NeXT NXMallocCheck() system
  828. * call which does a consistency check on malloc's data structures (this
  829. * consistency check is done at each malloc() and free() for certain
  830. * malloc_debug() levels). A non-zero return value indicates there was
  831. * a consistency problem. For those NeXT users wanting a bit more
  832. * performance out of malloc, try defining NEXT_MALLOC_DEBUG and calling the
  833. * malloc_debug(-1) efun (with an arg of -1). This will turn all
  834. * malloc debugging off and call malloc_singlethreaded() which the NeXT
  835. * malloc man page claims can make NeXT system malloc 10% to 15% faster.
  836. *
  837. * [NOTE: This #define has no affect on the driver if not using the
  838. * NeXTSTEP OS.]
  839. *
  840. * Warning: if you use a NeXT and define NEXT_MALLOC_DEBUG, be sure to
  841. * protect the use of the malloc_check() and malloc_debug() efuns
  842. * since setting certain debug levels can cause malloc() and free()
  843. * to become _very_ slow (protect efuns by using simul_efuns and
  844. * valid_override).
  845. *
  846. * [NOTE: malloc_debug(6) is a good compromise between efficiency and
  847. * completeness of malloc debugging (malloc/free will be about half as fast).]
  848. */
  849. #undef NEXT_MALLOC_DEBUG
  850.  
  851.  
  852. /* GET_CHAR_IS_BUFFERED: Normally get_char() is unbuffered. That is, once
  853. * a character is received for get_char(), anything else is in the input
  854. * stream is immediately thrown away. This can be very undesirable, especially
  855. * if you're calling get_char() again from the handler from the previous call.
  856. * Define this if you want get_char() to be buffered. In this case, the buffer
  857. * will only get flushed if get_char() is not called from the first get_char()'s
  858. * LPC callback handler.
  859. */
  860. #undef GET_CHAR_IS_BUFFERED
  861.  
  862. #define HAVE_ZLIB
  863. #define PACKAGE_COMPRESS
  864. #define SAVE_GZ_EXTENSION ".o.gz"
  865. /* CALL_OTHER_TYPE_CHECK: enable type checking for call_other()
  866. * (-> operator on objects)
  867. */
  868. #undef CALL_OTHER_TYPE_CHECK
  869.  
  870.  
  871. /* CALL_OTHER_WARN, make it warning instead of errors */
  872. #define CALL_OTHER_WARN
  873.  
  874. #define PACKAGE_DWLIB
  875. #undef MMAP_SBRK
  876. /* WARN_TAB: Some versions of the editor built in indent function use
  877. * tabs for indenting. This options turns on a warning message for
  878. * files indented with tabs instead of spaces.
  879. */
  880. #define WARN_TAB
  881.  
  882. /* USE_ICONV: Use iconv to translate input and output from/to the users char
  883. * encoding
  884. */
  885. #define USE_ICONV
  886.  
  887. /* WOMBLES: don't allow spaces between start/end of array/mapping/functional token chars so ({1,2,3}) still works, but ( { 1 , 2 , 3 } ) doesn't and ({ 1 , 2 , 3 }) does.*/
  888. #define WOMBLES
  889.  
  890. /* ALLOW_INHERIT_AFTER_FUNCTION: allow inheriting after functions have been defined (this includes prototypes). This caused crashes in v22.2a but it may have been fixed since */
  891. #undef ALLOW_INHERIT_AFTER_FUNCTION
  892.  
  893. /*PACKAGE_ASYNC: adds some efuns for asyncronous IO */
  894. #define PACKAGE_ASYNC
  895.  
  896. #define PROG_REF_TYPE short
  897. #undef HAS_CONSOLE
  898. #define IPV6
  899. #undef PACKAGE_CRYPTO
  900. #undef PACKAGE_SHA1
  901. #undef DTRACE
  902. #define PACKAGE_PCRE
  903.  
  904. #undef PACKAGE_DB
  905. #undef NO_ANSI
  906. #undef STRIP_BEFORE_PROCESS_INPUT
  907. #define WARN_OLD_RANGE_BEHAVIOR
  908. #undef CLASS_STATS
  909. #undef GCMALLOC
  910. #define POSIX_TIMERS
  911. #define STRUCT_CLASS
  912. #undef STRUCT_STRUCT
  913. #define USE_32BIT_ADDRESSES
  914.  
  915. #define TRACE
  916. #define TRACE_CODE
  917.  
  918. #endif
Advertisement
Add Comment
Please, Sign In to add comment