home *** CD-ROM | disk | FTP | other *** search
- -*-Web-*-
- This file, COMMON-P.HCH, is part of CWEB-p.
- It is a changefile for COMMON.H, Version 3.0.
-
- Authors and Contributors:
- (H2B) Hans-Hermann Bode, Universität Osnabrück,
- (hhbode@@dosuni1.rz.uni-osnabrueck.de or HHBODE@@DOSUNI1.BITNET).
-
- (KG) Klaus Guntermann, TH Darmstadt,
- (guntermann@@iti.informatik.th-darmstadt.de).
-
- (AS) Andreas Scherer,
- Abt-Wolf-Straße 17, 96215 Lichtenfels, Germany.
-
- (CS) Carsten Steger, Universität München,
- carsten.steger@informatik.tu-muenchen.de
-
- Caveat utilitor: Some of the source code introduced by this change file is
- made conditional to the use of specific compilers on specific systems.
- This applies to places marked with `#ifdef __TURBOC__' and `#ifdef _AMIGA'.
-
- Run WMERGE with the masterfile COMMON.H and this changefile COMMON-P.HCH
- to produce COMMON-P.H needed in the MAKEFILEs.
-
- This program is distributed WITHOUT ANY WARRANTY, express or implied.
-
- The following copyright notice extends to this changefile only, not to the
- masterfile COMMON.H.
-
- Copyright (C) 1993 Andreas Scherer
- Copyright (C) 1991, 1993 Carsten Steger
- Copyright (C) 1991, 1992, 1993 Hans-Hermann Bode
-
- Permission is granted to make and distribute verbatim copies of this
- document provided that the copyright notice and this permission notice
- are preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of this
- document under the conditions for verbatim copying, provided that the
- entire resulting derived work is distributed under the terms of a
- permission notice identical to this one.
-
- Version history:
-
- Version Date Author Comment
- a1/t1 10 Oct 1991 H2B First attempt for COMMON.H 2.0.
- p2 13 Feb 1992 H2B Updated for COMMON.H 2.1, ANSI and Turbo
- changefiles merged together.
- p3 14 Apr 1992 H2B Nothing changed but source and target names.
- p4 21 Jun 1992 H2B Nothing changed.
- p5 18 Jul 1992 H2B Extensions for C++ implemented.
- p5a 24 Jul 1992 KG adaptions for other ANSI C compiler
- p5b 29 Jul 1992 H2B Minor correction for |__TURBOC__|.
- p6 06 Sep 1992 H2B |dot_dot_dot| added.
- p6a 15 Mar 1993 AS adaptions for SAS/C 6.0
- p6b 28 Jul 1993 AS new patch level due to minor changes
- p6c 04 Sep 1993 AS new patch level due to major changes
- p6d 09 Oct 1993 AS Updated for COMMON.H 2.8. (This was p7 for me)
- p7 13 Nov 1992 H2B Converted to master change file, updated for
- common.h 2.8. [Not released.]
- p7.5 29 Nov 1992 H2B Updated for common.h 2.9beta. [Not released.]
- p8 04 Dec 1992 H2B Updated for common.h 2.9++ (stuff went into
- the source file). [Not released.]
- p8a 10 Mar 1993 H2B Restructured for public release. [Not released.]
- p8b 15 Apr 1993 H2B Updated for common.h 3.0beta. [Not released.]
- p8c 21 Jun 1993 H2B Updated for final common.h 3.0.
- p8d 25 Oct 1993 AS Incorporated with Amiga version 2.8 [p7] and
- updated to version 3.0.
- ------------------------------------------------------------------------------
- @x l.1
- % This file is part of CWEB.
- % This program by Silvio Levy and Donald E. Knuth
- % is based on a program by Knuth.
- % It is distributed WITHOUT ANY WARRANTY, express or implied.
- % Version 3.0 --- June 1993
- @y
- % This file, common.h, is part of CWEB-p.
- % This program by Silvio Levy and Donald E. Knuth
- % is based on a program by Knuth.
- % It is distributed WITHOUT ANY WARRANTY, express or implied.
- % Version 2.1 -- Don Knuth, January 1992
- % Version 2.1 [p5] --- Hans-Hermann Bode, July 1992
- % Version 2.1 [p5a] --- Klaus Guntermann, July 1992
- % Version 2.1 [p5b] --- Hans-Hermann Bode, July 1992
- % Version 2.1 [p6] --- Hans-Hermann Bode, September 1992
- % Version 2.1 [p6a] --- Andreas Scherer, March 1993
- % Version 2.1 [p6b] --- Andreas Scherer, July 1993
- % Version 2.1 [p6c] --- Andreas Scherer, September 1993
- % Version 2.8 --- Don Knuth, September 1992
- % Version 2.8 [p7] --- Andreas Scherer, October 1993
- % Version 3.0 --- Don Knuth, June 1993
- % Version 3.0 [p8c] --- Hans-Hermann Bode, June 1993
- % Version 3.0 [p8d] --- Andreas Scherer, October 1993
- @z
- ------------------------------------------------------------------------------
- @x l.7
- % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
- @y
- % Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
- % Copyright (C) 1991,1992,1993 Hans-Hermann Bode
- % Copyright (C) 1991,1993 Carsten Steger
- % Copyright (C) 1993 Andreas Scherer
- @z
- ------------------------------------------------------------------------------
- @x l.18
- % Please send comments, suggestions, etc. to levy@@geom.umn.edu.
- @y
- % Please send comments, suggestions, etc. to levy@@geom.umn.edu.
- % If related to changes specific for MSDOS, however,
- % send them to Hans-Hermann Bode,
- % hhbode@@dosuni1.rz.uni-osnabrueck.de or HHBODE@@DOSUNI1.BITNET.
- % If related to changes specific for AMIGA, however,
- % send them to Andreas Scherer,
- % Abt-Wolf-Straße 17, 96215 Lichtenfels, Germany.
- @z
- ------------------------------------------------------------------------------
- @x l.24
- First comes general stuff:
-
- @y
- First comes general stuff.
- In {\mc TURBO} \CEE/, we use |huge| pointers instead of large arrays.
- @^system dependencies@>
-
- @f far int
- @f huge int
- @f HUGE int
- @#
- @z
- ------------------------------------------------------------------------------
- @x l.31
- typedef char unsigned eight_bits;
- @y
- #ifdef _AMIGA
- typedef unsigned char eight_bits;
- #else
- typedef char unsigned eight_bits;
- #endif
- @z
- ------------------------------------------------------------------------------
- @x l.33
- extern int phase; /* which phase are we in? */
- @y
- extern int phase; /* which phase are we in? */
- #ifdef __TURBOC__
- #define HUGE huge
- #else
- #define HUGE
- #endif
- @z
- ------------------------------------------------------------------------------
- @x l.36
- #include <stdio.h>
- @y
- #include <stdio.h>
- #ifdef __TURBOC__
- #include <io.h>
- #endif
- @z
- ------------------------------------------------------------------------------
- @x l.81
- typedef struct name_info {
- char *byte_start; /* beginning of the name in |byte_mem| */
- struct name_info *link;
- union {
- struct name_info *Rlink; /* right link in binary search tree for section
- names */
- char Ilk; /* used by identifiers in \.{CWEAVE} only */
- } dummy;
- char *equiv_or_xref; /* info corresponding to names */
- } name_info; /* contains information about an identifier or section name */
- typedef name_info *name_pointer; /* pointer into array of \&{name\_info}s */
- typedef name_pointer *hash_pointer;
- extern char byte_mem[]; /* characters of names */
- extern char *byte_mem_end; /* end of |byte_mem| */
- extern name_info name_dir[]; /* information about names */
- extern name_pointer name_dir_end; /* end of |name_dir| */
- extern name_pointer name_ptr; /* first unused position in |byte_start| */
- extern char *byte_ptr; /* first unused position in |byte_mem| */
- @y
- typedef struct name_info {
- char HUGE *byte_start; /* beginning of the name in |byte_mem| */
- struct name_info HUGE *link;
- union {
- struct name_info HUGE *Rlink; /* right link in binary search tree for section
- names */
- char Ilk; /* used by identifiers in \.{WEAVE} only */
- } dummy;
- char HUGE *equiv_or_xref; /* info corresponding to names */
- } name_info; /* contains information about an identifier or section name */
- typedef name_info HUGE *name_pointer; /* pointer into array of |name_info|s */
- typedef name_pointer *hash_pointer;
- #ifdef __TURBOC__
- extern char HUGE *byte_mem; /* characters of names */
- extern name_info HUGE *name_dir; /* information about names */
- #else
- extern char byte_mem[]; /* characters of names */
- extern name_info name_dir[]; /* information about names */
- #endif
- extern char HUGE *byte_mem_end; /* end of |byte_mem| */
- extern name_pointer name_dir_end; /* end of |name_dir| */
- extern name_pointer name_ptr; /* first unused position in |byte_start| */
- extern char HUGE *byte_ptr; /* first unused position in |byte_mem| */
- #ifdef __TURBOC__
- void far *allocsafe(unsigned long nunits,unsigned long unitsz);
- #endif
- @z
- ------------------------------------------------------------------------------
- @x l.102
- extern name_pointer id_lookup(); /* looks up a string in the identifier table */
- extern name_pointer section_lookup(); /* finds section name */
- extern void print_section_name(), sprint_section_name();
- @y
- extern name_pointer id_lookup(char *,char *,char);
- /* looks up a string in the identifier table */
- extern void print_section_name(name_pointer);@/
- extern void sprint_section_name(char *,name_pointer);@/
- extern void print_prefix_name(name_pointer);@/
- extern name_pointer section_lookup(char *,char *,int);@/
- extern name_pointer prefix_lookup(char *,char *); /* finds section name given a prefix */
- extern int names_match(name_pointer,char *,int,eight_bits);@/
- extern void init_p(name_pointer,eight_bits);@/
- extern void init_node(name_pointer);@/
- @z
- ------------------------------------------------------------------------------
- @x l.110
- @d fatal_message 3 /* |history| value when we had to stop prematurely */
- @d mark_harmless {if (history==spotless) history=harmless_message;}
- @d mark_error history=error_message
- @d confusion(s) fatal("! This can't happen: ",s)
-
- @<Common...@>=
- extern history; /* indicates how bad this run was */
- extern err_print(); /* print error message and context */
- extern wrap_up(); /* indicate |history| and exit */
- extern void fatal(); /* issue error message and die */
- extern void overflow(); /* succumb because a table has overflowed */
- @y
- @d fatal_message 3 /* |history| value when we had to stop prematurely */
- @d mark_harmless {if (history==spotless) history=harmless_message;}
- @d mark_error history=error_message
- @d confusion(s) fatal("! This can't happen: ",s)
-
- @<Common...@>=
- extern history; /* indicates how bad this run was */
- extern void err_print(char *); /* prints error message and context */
- extern void wrap_up(void); /* indicate |history| and exit */
- extern void fatal(char *,char *); /* issue error message and die */
- extern void overflow(char *); /* succumb because a table has overflowed */
- @z
- ------------------------------------------------------------------------------
- AmigaDOS erlaubt Pfadnamen mit bis zu 255 Zeichen L"ange.
- @x l.124
- @d max_file_name_length 60
- @y
- @d max_file_name_length 256
- @z
- ------------------------------------------------------------------------------
- @x l.146
- extern reset_input(); /* initialize to read the web file and change file */
- extern get_line(); /* inputs the next line */
- extern check_complete(); /* checks that all changes were picked up */
- @y
- extern void reset_input(void); /* initialize to read the web file and change file */
- extern boolean get_line(void); /* inputs the next line */
- extern void check_complete(void); /* checks that all changes were picked up */
- @z
- ------------------------------------------------------------------------------
- @x l.158
- @ Code related to command line arguments:
- @d show_banner flags['b'] /* should the banner line be printed? */
- @d show_progress flags['p'] /* should progress reports be printed? */
- @d show_happiness flags['h'] /* should lack of errors be announced? */
- @y
- @ Code related to command line arguments:
- @d show_banner flags['b'] /* should the banner line be printed? */
- @d show_happiness flags['h'] /* should lack of errors be announced? */
- @d show_progress flags['p'] /* should progress reports be printed? */
- @d use_amiga_keywords flags['a'] /* should Amiga/SAS C keywords be used? */
- @d use_german_macros flags['g'] /* should the output be German? */
- @d indent_param_decl flags['i'] /* should formal parameter declarations be indented? */
- @z
- ------------------------------------------------------------------------------
- @x l.166
- extern boolean flags[]; /* an option for each 7-bit code */
- @y
- extern boolean flags[]; /* an option for each 8-bit code */
- @z
- ------------------------------------------------------------------------------
- @x l.185
- extern void common_init();
- @y
- extern void common_init(void);
- extern void print_stats(void);
- @z
- ------------------------------------------------------------------------------
-