home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb140x.zip / custom.h next >
C/C++ Source or Header  |  1996-02-26  |  14KB  |  413 lines

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