home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb153.zip / fweb-1.53 / web / custom.h.in < prev    next >
Text File  |  1995-09-23  |  16KB  |  441 lines

  1. #if(0)
  2.   FTANGLE v1.53, created with UNIX on "Thursday, September 21, 1995 at 15:06." 
  3.   COMMAND LINE: "./ftangle ./custom -uCONFIG -mCONFIG -mCC -= /u/krommes/fweb/1.53/web/custom.h.in -# -v"
  4.   RUN TIME: "Saturday, September 23, 1995 at 16:17."
  5.   WEB FILE:    "./custom.web"
  6.   CHANGE FILE: (none)
  7. #endif
  8.  
  9. /* --- BOOTSTRAPPING --- */
  10.  
  11. /* To bootstrap yourself onto a new system, you should modify this file \
  12. appropriately.  In most cases, you set a flag by saying ``#define \
  13. FLAG''---i.e., you make a null definition.  Don't set these flags to~0 \
  14. or~1.  However, in a few cases the macros are not flags and must be given \
  15. the appropriate definition. */
  16.  
  17. /* --- MACHINE COMPILER FLAG --- */
  18.  
  19. /* This must be in lower case.  Presently these are drawn from the list \
  20. {ansi, bsd, dsu, ibmpc, mac, misc, mvs, sgi, sun, vax}.  These \
  21. flags may be used in #define statements within the source code to tailor \
  22. things to a particular compiler or operating system.  If you use \
  23. ./configure to generate custom.h, there will be no definition following \
  24. this comment. */
  25.  
  26.  
  27. /* --- FWEB SYSTEM NAME --- */
  28.  
  29. /* This is a string such as ``IBM-PC/DOS'' or ``VAX/VMS''. It is printed \
  30. when FWEB starts up. */
  31.  
  32. #define THE_SYSTEM  "UNIX"
  33.  
  34. /* --- An optional local banner, printed after the system name above. --- */
  35.  
  36. #define LOCAL_BANNER ""
  37.  
  38.  
  39. /* Does your compiler understand the ANSI preprocessor command \#error? \
  40. If it does, define |HAVE_ERROR|.  (I haven't figured out a general \
  41. autoconf test yet; it seems to be impossible in principle.) */
  42.  
  43. #define HAVE_ERROR 1
  44.  
  45.  
  46. /* Do we bother with translations to the internal |ASCII| representation? \
  47. If so, define |TRANSLATE_ASCII|.  Don't bother on |ASCII| machines. */
  48.  
  49. #define TRANSLATE_ASCII 0
  50.  
  51. /* For \It{debugging} of target machines whose character set differs from \
  52. the one on which you're working, define |DEBUG_XCHR|.  \It{Usually, this \
  53. flag should not be defined.}  When it is defined, the |TRANSLATE_ASCII| \
  54. flag is automatically turned on, and the value of the style-file field \
  55. `xchr' is relevant. \It{Don't use this flag unless you're a system \
  56. developer!!!} */
  57.  
  58. #define DEBUG_XCHR 0
  59.  
  60. /* Does the operating system have a Unix-like path? \
  61. That is, does it have the form ``/u/krommes'' rather than the VMS form \
  62. ``ux3:[krommes]''?  If so, define |UNIX_PATH|. */
  63.  
  64. #define UNIX_PATH 1
  65.  
  66.  
  67. /* If the |getenv| call to obtain an environment variable is supported \
  68. (it usually is) define |HAVE_GETENV|. */
  69.  
  70. /*  (The flag |HAVE_GETENV| is set automatically in config.h by ./configure.) */
  71.  
  72.  
  73. /* --- FILE NAMES and EXTENSIONS --- */
  74.  
  75. /* Name of the null file.  This macro merely defines the default value of \
  76. the style-file parameter `null_file', so it's not essential to add any more \
  77. machines here. */
  78.  
  79. #define NULL_FILE_NAME  "/dev/null"/* For Unix systems. */
  80.  
  81. /* Name of \FWEB's initialization file.  Please see below, after the \
  82. definition of |SMALL_MEMORY|. */
  83.  
  84. /* Name of \FWEB's default style file.  \It{Please don't change this unless \
  85. you absolutely have to!  Use the `-z' option instead.} */
  86.  
  87. #define STYLE_FILE_NAME "fweb.sty"
  88.  
  89. /* Here are the default file extensions for each language.  These merely \
  90. set default style-file parameters, so it's not essential that you change \
  91. anything here.  See the parameters `suffix.C', `suffix.N', etc. */
  92.  
  93. #define C_EXT "c"
  94. #define V_EXT "mk"
  95. #define X_EXT "sty"
  96.  
  97. /* Unix. */
  98. #define Cpp_EXT "C" /* Per \.{gcc}. */
  99. #define R_EXT "r"
  100. #define R90_EXT "r90"
  101. #define N_EXT "f"
  102. #define N90_EXT "f90"
  103.  
  104.  
  105. /*  (The flag |HAVE_TMPNAM| is set automatically in config.h by ./configure.) */
  106.  
  107. /*  (The flag |HAVE_TEMPNAM| is set automatically in config.h by ./configure.) */
  108.  
  109.  
  110. /* The |FANCY_SPLIT| flag is used for buffering the output lines of C~code. \
  111. Define this if the C~compiler CAN'T continue an incomplete line with a \
  112. backslash.  (ANSI compilers should be able to.) \
  113. {\bf (This code may not be fully debugged yet!)} */
  114.  
  115.  
  116. /*  (The flag |FANCY_SPLIT| is set automatically in config.h by ./configure.) */
  117.  
  118.  
  119. /* --- INCLUDING FILES --- */
  120.  
  121. /* The code is written in C, and various header files of the form \
  122. ``<*.h>'' are included near the beginning of each source file.  The \
  123. names of these files are standardized by ANSI.  Unfortunately, not everyone \
  124. has gotten around to ANSI yet.  Therefore, here we include important files \
  125. whose names may be nonstandard or whose functions may fluctuate. */
  126.  
  127. /* Does the ANSI <stdlib.h> exist?  If so, say so here.  This is supposed \
  128. to contain prototypes for the following functions used by \FWEB: |abort|, \
  129. |abs|, |atof|, |atoi|, |atol|, |calloc|, |exit|, |free|, |getenv|, \
  130. |realloc|, |strtod|, |strtol|.  If it doesn't, either find the prototypes \
  131. in another file and include it here, or actually give the prototypes here. */
  132.  
  133.  
  134. /*  (The flag |HAVE_STDLIB_H| is set automatically in config.h by ./configure.) */
  135.  
  136.  
  137. /*  (The flag |HAVE_STDARG_H| is set automatically in config.h by ./configure.) */
  138.  
  139.  
  140. /* Does the ANSI <stddef.h> exist?  If so, include it here.  This is \
  141. supposed to define the |NULL| pointer, and the type |size_t|.  Sometimes \
  142. these are defined in other places as well. */
  143.  
  144.  
  145. /*  (The flag |HAVE_STDDEF_H| is set automatically in config.h by ./configure.) */
  146.  
  147. /* Other stuff handled by autoconf. */
  148.  
  149. /*  (The flag |HAVE_STRING_H| is set automatically in config.h by ./configure.) */
  150.  
  151.  
  152. /*  (The flag |HAVE_MEMORY_H| is set automatically in config.h by ./configure.) */
  153.  
  154.  
  155. /*  (The flag |HAVE_FLOAT_H| is set automatically in config.h by ./configure.) */
  156.  
  157. /* Does (non-ANSI) <sys/types.h> exist?  You may find some useful stuff in \
  158. here. But don't use it unless you have to. */
  159.  
  160. /*  #include<sys/types.h> */
  161.  
  162. /* Must we include an extra file for memory management?  E.g., for \
  163. Microsoft, <malloc.h>; for Borland; <alloc.h>.  Not necessary for ANSI; \
  164. it's in <stdlib.h>. */
  165.  
  166. /*  #include<malloc.h> */
  167.  
  168. /* Numerical limits.  We use the following ANSI macros: |INT_MAX|, \
  169. |INT_MIN|, |LONG_MAX|, |LONG_MIN|, and |ULONG_MAX|, which are found in \
  170. <limits.h>. If you can't find those macros, define the flag \
  171. |HAVE_VALUES_H|, and possibly include another file with different names for \
  172. the limits, such as <values.h> on the Sun.  The flag |HAVE_VALUES_H| \
  173. assumes that the macros |MAXINT| and |MAXLONG| are defined.  If they are \
  174. not, you must define them here. */
  175.  
  176.  
  177. /*  (The flag |HAVE_LIMITS_H| is set automatically in config.h by ./configure.) */
  178.  
  179. /*  (The flag |HAVE_VALUES_H| is set automatically in config.h by ./configure.) */
  180.  
  181. /* Please note that additional files are included automatically \
  182. (essentially immediately after this file is read; see <includes.hweb>). \
  183. These were considered to be standard, but that might be a mistake.  Those \
  184. files are: <string.h>, <stdio.h>, <ctype.h>, <setjmp.h>, <time.h>. \
  185. Remember that by convention these files should limit themselves to being \
  186. included only once.  Therefore, if for some reason you need to include one \
  187. of these somewhere in this file, you should be able to do it without \
  188. difficulty; the later automatic include just won't be done if those files \
  189. are following standard protocol. */
  190.  
  191.  
  192. /*  (The flag |ANSI_CTYPE_H| is set automatically in config.h by ./configure.) */
  193.  
  194.  
  195. /* --- VARIABLE-LENGTH ARGUMENT LISTS --- */
  196.  
  197. /* For convenience, FWEB attempts to use functions with variable numbers of \
  198. arguments.  We attempt to support two conventions: ANSI, and Sun's.  If \
  199. this feature is supported, define the flag |VARIABLE_ARGUMENTS|, say \
  200. whether |va_start| has one or two arguments, and include the associated \
  201. header file (<stdarg.h> for ANSI). */
  202.  
  203. /* Does the compiler allow ANSI-style variable arguments? */
  204.  
  205. #define VARIABLE_ARGUMENTS 1
  206.  
  207. /* Is |va_start| defined with one argument (Sun's convention) or two \
  208. (ANSI)? */
  209. #define NUM_VA_ARGS 2
  210.  
  211. /*  (The flag |HAVE_STDARG_H| is set automatically in config.h by ./configure.) */
  212.  
  213.  
  214. /* --- ADDITIONAL PROTOTYPES --- */
  215.  
  216. /* You may wish to collect any additional prototypes that are required and \
  217. put them into your own header file that you include here. */
  218.  
  219. /* If the flag |HAVE_STD_PROTOTYPES| is false, it causes the file \
  220. "stdlib0.h" to be loaded.  This contains ANSI prototypes that for some \
  221. reason aren't provided with the gcc environment on the Sun. */
  222.  
  223. /*  (The flag |HAVE_STD_PROTOTYPES| is set automatically in config.h by ./configure.) */
  224.  
  225.  
  226. /* Define the flag |OLD_PROTOTYPES| for compilers that don't support the \
  227. new (ANSI) style of function declaration and prototyping.  The new style is \
  228. |fcn(int i,char *s){}|; the old style is |fcn(i,s) int i; char *s; {}|. */
  229.  
  230.  
  231. /*  (The flag |OLD_PROTOTYPES| is set automatically in config.h by ./configure.) */
  232.  
  233. /* ANSI also introduces the type |void|.  If your compiler doesn't \
  234. understand the constructions |void *| and |void fcn()|, define |NO_VOID|. */
  235.  
  236.  
  237. /*  (The flag |NO_VOID| is set automatically in config.h by ./configure.) */
  238.  
  239.  
  240. /* --- SPECIAL TYPES --- */
  241.  
  242. /* |const| seems to be an annoyance; not all compilers treat it the same \
  243. way.  We really only want it for debugging, anyway, so we mostly just \
  244. remove it.  It's kept when compiling on the Sun with gcc, because it \
  245. gives the developer more checks on the code.  If you want to keep it, \
  246. define |KEEP_CONST|. */
  247.  
  248. #define KEEP_CONST 1
  249.  
  250. /* For personal computers, the kind of pointer is an issue.  They must be \
  251. |huge|.  If your compiler understands |huge|, define |HUGE_POINTERS|. */
  252.  
  253. #define HUGE_POINTERS 0
  254.  
  255.  
  256. /* --- SPECIAL FUNCTIONS --- */
  257.  
  258. /* The ANSI |sprintf| function returns the number of characters written. \
  259. If this is the case on your system, define |ANSI_SPRINTF|.  (It's always \
  260. safe to not define it.) */
  261.  
  262.  
  263. /*  (The flag |ANSI_SPRINTF| is set automatically in config.h by ./configure.) */
  264.  
  265. /* The ANSI |sscanf| does some cute things with scansets, but it doesn't \
  266. always work. */
  267.  
  268. /*  (The flag |ANSI_SSCANF| is set automatically in config.h by ./configure.) */
  269.  
  270. /* The ANSI |system| function is supposed to take |NULL| as an argument, \
  271. which means check if a command processor exists.  If this works properly, \
  272. defined |ANSI_SYSTEM|.  (It doesn't work on the Sun.) */
  273.  
  274. #define ANSI_SYSTEM 0
  275.  
  276.  
  277. /* --- ANNOYING WARNINGS --- */
  278.  
  279. /* Sometimes the compiler can't understand that the \
  280. control flow can never get to the bottom of a function. To avoid warning \
  281. complaints, we have the following: */
  282.  
  283. #define DUMMY_RETURN(value) return value
  284.  
  285.  
  286. /* --- UNUSUAL NAMES --- */
  287.  
  288. /* Put here any definitions that override standard names.  For example, for \
  289. some ancient on the MAC one had to say ``#define getc agetc''. */
  290.  
  291. /* Nothing to be done. */
  292.  
  293.  
  294. /* --- DIRECTORY SPECIFICATIONS --- */
  295.  
  296. /* Directory specifications are delimited in different ways under the various \
  297. operating systems. Unix: '/'; IBM-PC: '\\'; VAX/VMS: ']'. */
  298.  
  299. #define PREFIX_END_CHAR '/' /* The Unix convention. */
  300.  
  301.  
  302. /* --- TIMING --- */
  303.  
  304. /* First of all, we have a flag to say whether timing information is \
  305. printed at the end of the run.  (If you can't figure out the timing \
  306. routines for your machine or don't want a timing information line at the \
  307. end of your terminal output, don't define this.)  Beginning with fweb-1.53, \
  308. timing is turned off by default. */
  309.  
  310. #define TIMING 0
  311.  
  312. /* --- Number of decimal places  for timing information in seconds.  (Use \
  313. at least 2 for supercomputers.) --- */
  314.  
  315. #define TIMING_WIDTH 1
  316.  
  317. /* There's supposed to be a function |clock()| that returns the cpu time, \
  318. in units of |CLOCKS_PER_SEC|.  The type of |clock| is |clock_t|.  If that \
  319. is defined, define the flag |CLOCK_T_DEFINED|; otherwise, say |typedef ... \
  320. clock_t| here. */
  321.  
  322.  
  323. /*  (The flag |CLOCK_T_DEFINED| is set automatically in config.h by ./configure.) */
  324.  
  325. /* Some systems don't define |CLOCKS_PER_SEC|.  If not, we try |CLK_TCK|. \
  326. If that's not defined, it defaults to 1000000.  If that's not appropriate, \
  327. define |CLOCKS_PER_SEC| here. */
  328.  
  329. /* \
  330. #define CLOCKS_PER_SEC 1000000 \
  331. */
  332.  
  333. /* Are there system routines that return wall-clock time in sub-second units? \
  334. First, look for |gettimeofday| ($\mu$sec timing). */
  335.  
  336. /*  (The flag |HAVE_GETTIMEOFDAY| is set automatically in config.h by ./configure.) */
  337.  
  338. /* Otherwise, does the file sys/timeb.h exist that along with |ftime| gives \
  339. millisecond timing for wall-clock time?  We check for the header file, not \
  340. |ftime| itself, since |ftime| may be in a Berkeley compatibility library, \
  341. not in libc. */
  342.  
  343.  
  344. /*  (The flag |HAVE_SYS_TIMEB_H| is set automatically in config.h by ./configure.) */
  345.  
  346. /* Do we use our own version of |difftime()|, which computes the difference \
  347. of two wall clock times?  If so, define |NEW_DIFFTIME|.  This flag should \
  348. always be defined if |HAVE_SYS_TIMEB_H| is defined above.  */
  349.  
  350. /* |NEW_DIFFTIME| is computed from flags set by ./configure. */
  351.  
  352.  
  353. /* --- MAKING IT FIT --- */
  354.  
  355. /* Sometimes the compiler can't handle functions or switches that are too \
  356. large.  In that case, define |FCN_CALLS|.  That converts certain in-line \
  357. code (such as in the syntax production analyzer) into function calls (at \
  358. the price of slowing things down a bit). */
  359.  
  360. #define FCN_CALLS 0
  361.  
  362. /* The personal computers are starved for memory.  For those machines, we \
  363. specify smaller default values for the lengths of dynamic arrays; define \
  364. |SMALL_MEMORY|.  (You can always use the `-y' option to override these \
  365. defaults.) */
  366.  
  367. #define SMALL_MEMORY 0
  368.  
  369. /* Name of \FWEB's default initialization file.  Please don't change these \
  370. conventions unless you absolutely have to!!!  Also, note that these \
  371. definitions are overridden by the environment variable |FWEB_INI|, if it is \
  372. defined. */
  373.  
  374. #ifndef SMALL_MEMORY
  375. #define SMALL_MEMORY 0
  376. #endif
  377.  
  378. #if SMALL_MEMORY
  379. #define FWEB_INI "fweb.ini"
  380. #else
  381. #define FWEB_INI ".fweb"
  382. #endif
  383.  
  384.  
  385. /* --- MEMORY ALLOCATIONS --- */
  386.  
  387. /* The ANSI |calloc| routine takes two arguments:  |void \
  388. *calloc(size_t,size_t)|. If the system doesn't have a standard |calloc| \
  389. routine, or if the name isn't standard, you must define an UPPERCASE macro \
  390. that does the same thing.  (The name isn't standard on personal computers \
  391. because one is dealing with |huge| allocations.)  If you define \
  392. |NON_ANSI_CALLOC|, you must define |CALLOC|, |REALLOC|, and |FREE|.  E.g., the \
  393. relevant definitions for Borland are \
  394. \begintt \
  395. #define CALLOC farcalloc \
  396. #define REALLOC(oldblock,nbytes) \ \
  397.  farrealloc((void far *)(oldblock),(unsigned long)(nbytes)) \
  398. #define FREE(block) farfree((void far *)(block)) \
  399. \endtt \
  400. */
  401.  
  402. #define NON_ANSI_CALLOC 0
  403.  
  404. /* |IBMPC| */
  405.  
  406. /* Do we supply below a routine that obtains the available memory, such \
  407. as Borland's farcoreleft()? */
  408.  
  409. #define PRINT_AVAILABLE_MEMORY 0
  410.  
  411. /* The function call that obtains the memory is called |CORE_LEFT|.  This \
  412. function is assumed to return an |unsigned long int|.  For Microsoft, we had \
  413. to write our own routine |_hmemavl|; see below.  For Borland, the routine \
  414. should be called |farcoreleft|.  For the other machines, we don't have \
  415. anything as yet. */
  416.  
  417.  
  418.  
  419.  
  420. /* The following flag is defined only by \common.web}. */
  421. #ifdef COMMON_FCNS_
  422. #if(part==0 || part==1)
  423.  
  424. /* Give here the C code for any additional functions that are \
  425. compiler-specific or missing from your implementation, such as maybe \
  426. |strtod|.  Note that these are bracketed with the flag COMMON_FCNS_ so they \
  427. are compiled into just one module, namely common.c. You must \
  428. always supply some version of the debugging routine |trap|, which must \
  429. return~0 as a minimum. */
  430.  
  431.  
  432. /* The default |trap| function for debugging. */
  433. int trap(void)
  434. {return 0;}
  435.  
  436. #endif /* |part == 1| */
  437.  
  438. #endif /* |COMMON_FCNS_| */
  439.  
  440.  
  441.