home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb153.zip / fweb-1.53 / web / custom.h.org < prev    next >
Text File  |  1996-02-29  |  15KB  |  422 lines

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