home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource3 / 165_01 / config.d < prev    next >
Text File  |  1988-02-19  |  19KB  |  553 lines

  1. ###portdefs.h
  2. /* portdefs.h - definitions for portability */
  3. @@ ENVIRONMENT-DEPENDENT - ADJUST TO LOCAL SYSTEM */
  4. @@ Edit your local changes, then replace each "@@" with "/*" */
  5. #ifndef PORTDEFS_H
  6. #define PORTDEFS_H
  7.  
  8. /* adjust these names to local machine/compiler environment */
  9. typedef unsigned short ushort;    @@ or "unsigned" if short-size == int-size */
  10. typedef unsigned char utiny;    @@ to get unsigned byte */
  11. typedef int void;                @@ delete if compiler supports void */
  12. typedef unsigned index_t;        @@ may be chosen ad-lib locally */
  13. typedef char *data_ptr;            @@ use ANSI "generic ptr" if available */
  14.  
  15. /* next 5 names require no local changes, will work anywhere */
  16. typedef char tbits;                /* one byte, for bitwise uses */
  17. typedef char tbool;                /* one byte: {0:1} */
  18. typedef ushort bits;            /* 16 bits (or more), for bitwise uses */            
  19. typedef int bool;                /* for function returns: {0:1} */
  20. typedef short metachar;            /* return from getchar: {EOF,0:UCHAR_MAX} */
  21.  
  22. /* modulo function giving non-negative result */
  23. #define IMOD(i, j) (((i) % (j)) < 0 ? ((i) % (j)) + (j) : ((i) % (j)))
  24. @@ if i % j is never negative, replace with the following line: */
  25. @@ #define IMOD(i, j) ((i) % (j)) */
  26.  
  27. /* portably convert unsigned number to signed */
  28. #define UI_TO_I(ui) (int)(ui)    @@ more complicated on ones complement */
  29.  
  30. /* structure offsets and bounds; adjust to local system */
  31. #define STRICT_ALIGN int        @@ adjust to local alignment requirement */
  32. #define OFFSET(st, m) \
  33.     ((char *)&((st *)&struct_addr)->m - (char *)&struct_addr)
  34. #define BOUNDOF(t) \
  35.     ((char *)(struct {char byte0; t byten; } *)&struct_addr)->byten - \
  36.     (char *)&struct_addr)
  37. static STRICT_ALIGN struct_addr = 0;
  38. #define STRUCTASST(a, b) memcpy(&(a), &(b), sizeof(a))
  39.  
  40. /* defined constants */
  41. #define FAIL            1            @@ failure exit */
  42. #define SUCCEED            0            @@ normal exit */
  43. #define STDIN            0            /* standard input */
  44. #define STDOUT            1            /* standard output */
  45. #define STDERR            2            /* standard error output */
  46. #define SEEK_SET        0            /* seek relative to start of file */
  47. #define SEEK_CUR        1            /* seek relative to current position */
  48. #define SEEK_END        2            /* seek relative to end */
  49. #endif
  50. ###stddef.h
  51. /* stddef.h - standard definitions (partial listing) */
  52. @@ ENVIRONMENT-DEPENDENT - ADJUST TO LOCAL SYSTEM */
  53. @@ Edit your local changes, then replace each "@@" with "/*" */
  54. @@ Use your compiler's own <stddef.h>, if available */
  55. #ifndef STDDEF_H
  56. #define STDDEF_H
  57. typedef unsigned size_t;    @@ use unsigned long in large-object model */
  58.  
  59. #ifndef NULL
  60. #define NULL 0                @@ use 0L if  int-size < long-size == ptr-size */
  61. #endif
  62.  
  63. extern int errno;
  64. #endif
  65. ###limits.h
  66. /* limits.h - environment limits (partial listing) */
  67. @@ ENVIRONMENT-DEPENDENT - CONFIGURE BEFORE USING */
  68. @@ Edit your local changes, then replace each "@@" with "/*" */
  69. @@ Use your compiler's own <limits.h>, if available */
  70. #ifndef LIMITS_H
  71. #define LIMITS_H
  72. #define CHAR_BIT    8    @@ CONFIGURE */
  73. #endif
  74. ###c.pro
  75. # C.PRO - A CONFIGURATION FILE FOR WHITESMITHS C 3.0
  76. #    STANDARD ANSI C LIBRARY PROTO FILE
  77. #    CNDOS86     NATIVE MSDOS
  78. #    PROGRAMMABLE FLAG OPTIONS:
  79. #
  80. #    com    : create an 8080 model .com file
  81. #    debug    : load debugger with any C compile
  82. #    fpp    : use hardware floating point
  83. #    lincl    : include header files in listing or diagnostic output
  84. #    listcs    : create c/assembler listing
  85. #    lo    : create a file (r).lst for listings (default to STDOUT)
  86. #    mods    : uniform small model (64K data and 64K text maximum)
  87. #    modp    : uniform medium model (64K data and multiple text sections)
  88. #    modd    : uniform compact model (64K text and multiple data sections)
  89. #    modf    : uniform far model (multiple text and data sections)
  90. #    proto    : enable prototype checking
  91. #    savlnk    : save linker input file as (r).lnk
  92. #    pponly    : run pp only
  93.  
  94. sp:pp        -o (o) \
  95.         -i  "|a:/headers.d/|c:/c/hdrs/" \
  96.         c:/c/hdrs/do86{modp?p:{modd?d:{modf?f:s}}}f.h (i)
  97. s:
  98.  
  99. c:pp        -o (o) {lincl?+lincl} {pponly?:-x}  \
  100.         -i  "|a:/headers.d/|c:/c/hdrs/" \
  101.         -d_PROTO \
  102.         c:/c/hdrs/do86{modp?p:{modd?d:{modf?f:s}}}f.h (i)
  103. 1:cp1        -o (o) -cm {debug?+debug} -n31 +std \
  104.         -model{modp?p:{modd?d:{modf?f:s}}} (i)
  105. 2:p286        -o (o) -f \
  106.         {listcs?+list} (i)
  107. s:as86        -o (o) \
  108.         {listcs?+list -lo (r).lst} (i)
  109.  {listcs?lm    -o (r).asl -lt (r).lst}
  110.  {listcs?pr    (r).asl {lo?>(r).lst}}
  111.  {listcs?del    (r).asl}
  112.  
  113. o::echo     -o (o) > (r).lnk
  114.  type        c:\\c\\hdrs\\do86{com?c:{modp?p:{modd?d:{modf?f:s}}}}.lf \
  115.             >> (r).lnk
  116.  echo        (i) {modp?+text:{modd?+data:{modf?+text +data}}} >> (r).lnk
  117.  echo        \
  118.         c:/c/lib/liba{modp?p:{modd?d:{modf?f:s}}}f.86 \
  119.         c:/c/lib/libb{modp?p:{modd?d:{modf?f:s}}}f.86 \
  120.         c:/c/lib/libm{modp?p:{modd?d:{modf?f:s}}}f.86 \
  121.         {modd?+bss:{modf?+bss:}} >> (r).lnk
  122.  lnk          < (r).lnk
  123.  {savlnk?:del    (r).lnk}
  124. {com?:xeq:}
  125. com:
  126. xeq:todos -o (o) (i)
  127. exe:
  128. ###makefile
  129. @@ ENVIRONMENT-DEPENDENT - HAND-TAILOR EVERY LINE WITH "@@"
  130. @@ THEN EITHER DELETE THE "@@" MESSAGE OR CHANGE TO "#"
  131. #
  132. # Assumes that all files are named  function-name.c
  133. # For complexities like atopi(#2.c, copy the last one to
  134. # a simple name like atopi.c
  135. #
  136. # Note: Successful result of a test is recorded by creation of
  137. # a file named <pgm-name>.ok; see cmpok.c for further info.
  138.  
  139. # Configuration
  140. RM = del    @@ what command removes a file
  141. CC = cc    @@ the compile command
  142. CFLAGS =     @@ what options to pass to the compile command
  143. O = obj    @@ the file "extension" for object files
  144. X = exe    @@ the file "extension" for executable files
  145. NOLINK = -c    @@ the CC option that says "don't link"
  146. LIB = lib    @@ the library/archive command
  147. LIBADD = lib -a    @@ library/archive command to add a module
  148. L = a    @@ the file "extension" for object libraries
  149. RUN =     @@ command prefix (if any) for executing a program
  150. .C.O = $(CC) $(CFLAGS) $(NOLINK) $&        @@ rule for making p.c into p.o
  151. .C.EXE = $(CC) $(CFLAGS) -o $*.$X $&    @@ rule for making p.c into p.exe
  152. .EXE.OK = $(RUN) $*.$X     @@ rule for making p.exe into p.ok
  153.  
  154.  
  155. COMMON = rdslib.$L
  156. ST_MAIN = st_main.$O st_close.$O st_pop.$O st_push.$O 
  157. T_MAIN = t_main.$O q_pop.$O q_close.$O q_insert.$O  q_push.$O q_append.$O q_r_insert.$O
  158. SCREEN = screen86.$O
  159.  
  160. all : atopi.ok  st_main.ok t_main.ok t2_main.ok tr_main.ok dq_main.ok dq2_main.ok plot_m.$X run_cars.$X rec_main.$X crhash.$X part_menu.$X part_tmenu.$X part_hmenu.$X
  161.     touch uptodate.all
  162.  
  163. rdslib.$L : itoa.$O fgetsnn.$O getsnn.$O getreply.$O getpstr.$O getplin.$O plot_trk.$O reverse.$O strfit.$O error.$O fixstr.$O
  164.     $(LIB) rdslib.$L getreply.$O getpstr.$O getplin.$O getsnn.$O fgetsnn.$O
  165.     $(LIBADD) rdslib.$L itoa.$O plot_trk.$O reverse.$O strfit.$O error.$O fixstr.$O
  166.  
  167. mu_lib.$L : mu_lib.$O mu_ask.$O mu_chv.$O mu_str.$O mu_sval.$O mu_pr.$O mu_do.$O mu_reply.$O 
  168.     $(LIB) mu_lib.$L  mu_lib.$O mu_ask.$O mu_chv.$O mu_str.$O mu_sval.$O mu_pr.$O mu_do.$O mu_reply.$O 
  169.  
  170. dq_lib.$L : dq_lib.$O dq_open.$O dq_close.$O dq_detach.$O dq_r_insert.$O dq_pop.$O dq_insert.$O dq_find.$O dq_first.$O
  171.     $(LIB) dq_lib.$L dq_lib.$O dq_open.$O dq_close.$O dq_detach.$O dq_r_insert.$O dq_pop.$O dq_insert.$O dq_find.$O dq_first.$O
  172.  
  173. tr_lib.$L : tr_delete.$O tr_lnext.$O tr_lfind.$O tr_lpfind.$O tr_insert.$O tr_detach.$O tr_close.$O tr_lfirst.$O
  174.     $(LIB) tr_lib.$L tr_delete.$O tr_lnext.$O tr_lfind.$O tr_lpfind.$O tr_insert.$O tr_detach.$O tr_close.$O tr_lfirst.$O
  175.  
  176. rec_lib.$L : rec_hfind.$O rec_havail.$O rec_open.$O rec_close.$O rec_get.$O rec_put.$O 
  177.     $(LIB) rec_lib.$L  rec_hfind.$O rec_havail.$O rec_open.$O rec_close.$O rec_get.$O rec_put.$O 
  178.  
  179. menu_lib.$L : chg_menu.$O add_menu.$O acd_menu.$O del_menu.$O
  180.     $(LIB) menu_lib.$L chg_menu.$O add_menu.$O acd_menu.$O del_menu.$O
  181.  
  182. tr_main.$X : tr_main.$O tr_lib.$L $(COMMON)
  183.     $(CC) $(CFLAGS) -o tr_main.$X tr_main.$O tr_lib.$L $(COMMON)
  184.  
  185. tr_main.ok : tr_main.$X
  186.     $(RUN) tr_main.$X >tr_main.out
  187.     cmpok tr_main
  188.  
  189. part_menu.$X : part_menu.$O mu_lib.$O menu_lib.$L part_db.$O $(SCREEN) $(COMMON)
  190.     $(CC) $(CFLAGS) -o part_menu.$X part_menu.$O mu_lib.$O menu_lib.$L part_db.$O $(SCREEN) $(COMMON)
  191.  
  192. part_tmenu.$X : part_tmenu.$O mu_lib.$O menu_lib.$L part_dbt.$O tr_lib.$L $(SCREEN) $(COMMON)
  193.     $(CC) $(CFLAGS) -o part_tmenu.$X part_tmenu.$O mu_lib.$O menu_lib.$L part_dbt.$O tr_lib.$L $(SCREEN) $(CO