home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / dev / misc / cweb / common-p.hch < prev    next >
Text File  |  1993-12-21  |  12KB  |  297 lines

  1.                                 -*-Web-*-
  2. This file, COMMON-P.HCH, is part of CWEB-p.
  3. It is a changefile for COMMON.H, Version 3.0.
  4.  
  5. Authors and Contributors:
  6. (H2B) Hans-Hermann Bode, Universität Osnabrück,
  7.   (hhbode@@dosuni1.rz.uni-osnabrueck.de or HHBODE@@DOSUNI1.BITNET).
  8.  
  9. (KG) Klaus Guntermann, TH Darmstadt,
  10.   (guntermann@@iti.informatik.th-darmstadt.de).
  11.  
  12. (AS) Andreas Scherer,
  13.   Abt-Wolf-Straße 17, 96215 Lichtenfels, Germany.
  14.  
  15. (CS) Carsten Steger, Universität München,
  16.   carsten.steger@informatik.tu-muenchen.de
  17.  
  18. Caveat utilitor:  Some of the source code introduced by this change file is
  19. made conditional to the use of specific compilers on specific systems.
  20. This applies to places marked with `#ifdef __TURBOC__' and `#ifdef _AMIGA'.
  21.  
  22. Run WMERGE with the masterfile COMMON.H and this changefile COMMON-P.HCH
  23. to produce COMMON-P.H needed in the MAKEFILEs.
  24.  
  25. This program is distributed WITHOUT ANY WARRANTY, express or implied.
  26.  
  27. The following copyright notice extends to this changefile only, not to the
  28. masterfile COMMON.H.
  29.  
  30. Copyright (C) 1993 Andreas Scherer
  31. Copyright (C) 1991, 1993 Carsten Steger
  32. Copyright (C) 1991, 1992, 1993 Hans-Hermann Bode
  33.  
  34. Permission is granted to make and distribute verbatim copies of this
  35. document provided that the copyright notice and this permission notice
  36. are preserved on all copies.
  37.  
  38. Permission is granted to copy and distribute modified versions of this
  39. document under the conditions for verbatim copying, provided that the
  40. entire resulting derived work is distributed under the terms of a
  41. permission notice identical to this one.
  42.  
  43. Version history:
  44.  
  45. Version    Date        Author    Comment
  46. a1/t1    10 Oct 1991    H2B    First attempt for COMMON.H 2.0.
  47. p2    13 Feb 1992    H2B    Updated for COMMON.H 2.1, ANSI and Turbo
  48.                 changefiles merged together.
  49. p3    14 Apr 1992    H2B    Nothing changed but source and target names.
  50. p4    21 Jun 1992    H2B    Nothing changed.
  51. p5    18 Jul 1992    H2B    Extensions for C++ implemented.
  52. p5a    24 Jul 1992    KG    adaptions for other ANSI C compiler
  53. p5b    29 Jul 1992    H2B    Minor correction for |__TURBOC__|.
  54. p6    06 Sep 1992    H2B    |dot_dot_dot| added.
  55. p6a     15 Mar 1993     AS      adaptions for SAS/C 6.0
  56. p6b     28 Jul 1993     AS      new patch level due to minor changes
  57. p6c    04 Sep 1993    AS    new patch level due to major changes
  58. p6d    09 Oct 1993    AS    Updated for COMMON.H 2.8. (This was p7 for me)
  59. p7    13 Nov 1992    H2B    Converted to master change file, updated for
  60.                 common.h 2.8. [Not released.]
  61. p7.5    29 Nov 1992    H2B    Updated for common.h 2.9beta. [Not released.]
  62. p8    04 Dec 1992    H2B    Updated for common.h 2.9++ (stuff went into
  63.                 the source file). [Not released.]
  64. p8a    10 Mar 1993    H2B    Restructured for public release. [Not released.]
  65. p8b    15 Apr 1993    H2B    Updated for common.h 3.0beta. [Not released.]
  66. p8c    21 Jun 1993    H2B    Updated for final common.h 3.0.
  67. p8d    25 Oct 1993    AS    Incorporated with Amiga version 2.8 [p7] and
  68.                 updated to version 3.0.
  69. ------------------------------------------------------------------------------
  70. @x l.1
  71. % This file is part of CWEB.
  72. % This program by Silvio Levy and Donald E. Knuth
  73. % is based on a program by Knuth.
  74. % It is distributed WITHOUT ANY WARRANTY, express or implied.
  75. % Version 3.0 --- June 1993
  76. @y
  77. % This file, common.h, is part of CWEB-p.
  78. % This program by Silvio Levy and Donald E. Knuth
  79. % is based on a program by Knuth.
  80. % It is distributed WITHOUT ANY WARRANTY, express or implied.
  81. % Version 2.1 -- Don Knuth, January 1992
  82. % Version 2.1 [p5] --- Hans-Hermann Bode, July 1992
  83. % Version 2.1 [p5a] --- Klaus Guntermann, July 1992
  84. % Version 2.1 [p5b] --- Hans-Hermann Bode, July 1992
  85. % Version 2.1 [p6] --- Hans-Hermann Bode, September 1992
  86. % Version 2.1 [p6a] --- Andreas Scherer, March 1993
  87. % Version 2.1 [p6b] --- Andreas Scherer, July 1993
  88. % Version 2.1 [p6c] --- Andreas Scherer, September 1993
  89. % Version 2.8 --- Don Knuth, September 1992
  90. % Version 2.8 [p7] --- Andreas Scherer, October 1993
  91. % Version 3.0 --- Don Knuth, June 1993
  92. % Version 3.0 [p8c] --- Hans-Hermann Bode, June 1993
  93. % Version 3.0 [p8d] --- Andreas Scherer, October 1993
  94. @z
  95. ------------------------------------------------------------------------------
  96. @x l.7
  97. % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  98. @y
  99. % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  100. % Copyright (C) 1991,1992,1993 Hans-Hermann Bode
  101. % Copyright (C) 1991,1993 Carsten Steger
  102. % Copyright (C) 1993 Andreas Scherer
  103. @z
  104. ------------------------------------------------------------------------------
  105. @x l.18
  106. % Please send comments, suggestions, etc. to levy@@geom.umn.edu.
  107. @y
  108. % Please send comments, suggestions, etc. to levy@@geom.umn.edu.
  109. % If related to changes specific for MSDOS, however,
  110. % send them to Hans-Hermann Bode,
  111. % hhbode@@dosuni1.rz.uni-osnabrueck.de or HHBODE@@DOSUNI1.BITNET.
  112. % If related to changes specific for AMIGA, however,
  113. % send them to Andreas Scherer,
  114. % Abt-Wolf-Straße 17, 96215 Lichtenfels, Germany.
  115. @z
  116. ------------------------------------------------------------------------------
  117. @x l.24
  118. First comes general stuff:
  119.  
  120. @y
  121. First comes general stuff.
  122. In {\mc TURBO} \CEE/, we use |huge| pointers instead of large arrays.
  123. @^system dependencies@>
  124.  
  125. @f far int
  126. @f huge int
  127. @f HUGE int
  128. @#
  129. @z
  130. ------------------------------------------------------------------------------
  131. @x l.31
  132. typedef char unsigned eight_bits;
  133. @y
  134. #ifdef _AMIGA
  135. typedef unsigned char eight_bits;
  136. #else
  137. typedef char unsigned eight_bits;
  138. #endif
  139. @z
  140. ------------------------------------------------------------------------------
  141. @x l.33
  142. extern int phase; /* which phase are we in? */
  143. @y
  144. extern int phase; /* which phase are we in? */
  145. #ifdef __TURBOC__
  146. #define HUGE huge
  147. #else
  148. #define HUGE
  149. #endif
  150. @z
  151. ------------------------------------------------------------------------------
  152. @x l.36
  153. #include <stdio.h>
  154. @y
  155. #include <stdio.h>
  156. #ifdef __TURBOC__
  157. #include <io.h>
  158. #endif
  159. @z
  160. ------------------------------------------------------------------------------
  161. @x l.81
  162. typedef struct name_info {
  163.   char *byte_start; /* beginning of the name in |byte_mem| */
  164.   struct name_info *link;
  165.   union {
  166.     struct name_info *Rlink; /* right link in binary search tree for section
  167.       names */
  168.     char Ilk; /* used by identifiers in \.{CWEAVE} only */
  169.   } dummy;
  170.   char *equiv_or_xref; /* info corresponding to names */
  171. } name_info; /* contains information about an identifier or section name */
  172. typedef name_info *name_pointer; /* pointer into array of \&{name\_info}s */
  173. typedef name_pointer *hash_pointer;
  174. extern char byte_mem[]; /* characters of names */
  175. extern char *byte_mem_end; /* end of |byte_mem| */
  176. extern name_info name_dir[]; /* information about names */
  177. extern name_pointer name_dir_end; /* end of |name_dir| */
  178. extern name_pointer name_ptr; /* first unused position in |byte_start| */
  179. extern char *byte_ptr; /* first unused position in |byte_mem| */
  180. @y
  181. typedef struct name_info {
  182.   char HUGE *byte_start; /* beginning of the name in |byte_mem| */
  183.   struct name_info HUGE *link;
  184.   union {
  185.     struct name_info HUGE *Rlink; /* right link in binary search tree for section
  186.       names */  
  187.     char Ilk; /* used by identifiers in \.{WEAVE} only */
  188.   } dummy;
  189.   char HUGE *equiv_or_xref; /* info corresponding to names */
  190. } name_info; /* contains information about an identifier or section name */
  191. typedef name_info HUGE *name_pointer; /* pointer into array of |name_info|s */
  192. typedef name_pointer *hash_pointer;
  193. #ifdef __TURBOC__
  194. extern char HUGE *byte_mem; /* characters of names */
  195. extern name_info HUGE *name_dir; /* information about names */
  196. #else
  197. extern char byte_mem[]; /* characters of names */
  198. extern name_info name_dir[]; /* information about names */
  199. #endif
  200. extern char HUGE *byte_mem_end; /* end of |byte_mem| */
  201. extern name_pointer name_dir_end; /* end of |name_dir| */
  202. extern name_pointer name_ptr; /* first unused position in |byte_start| */
  203. extern char HUGE *byte_ptr; /* first unused position in |byte_mem| */
  204. #ifdef __TURBOC__
  205. void far *allocsafe(unsigned long nunits,unsigned long unitsz);
  206. #endif
  207. @z
  208. ------------------------------------------------------------------------------
  209. @x l.102
  210. extern name_pointer id_lookup(); /* looks up a string in the identifier table */
  211. extern name_pointer section_lookup(); /* finds section name */
  212. extern void print_section_name(), sprint_section_name();