home *** CD-ROM | disk | FTP | other *** search
- -*-Web-*-
- This file, WMERGE-P.CH, is part of CWEB-p. It is a changefile written by
- Hans-Hermann Bode (HHBODE@@DOSUNI1.BITNET or
- hhbode@@dosuni1.rz.uni-osnabrueck.de) for WMERGE.W that provides changes
- appropriate for ANSI-C compilers and for the Turbo-C++ compiler. The latter
- will become effective only if the symbol __TURBOC__ is defined, which
- automatically is the case when compiled with Turbo C++. Also there are some
- changes appropriate for the SAS/C 6.0 compiler. These will become
- effective only if the symbol __SASC is defined, which automatically is the
- case when compiled with SAS/C 6.0 or higher.
-
- This program is distributed WITHOUT ANY WARRANTY, express or implied.
-
- The following copyright notice extends to this changefile only, not to the
- masterfile.
-
- Copyright (C) 1992 Hans-Hermann Bode
-
- The following copyright notice extends to the SAS/C specific changes only,
- not to the masterfile.
-
- Copyright (C) 1993 Andreas Scherer
-
- 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
- p2 13 Feb 1992 H2B First hack.
- p3 16 Apr 1992 H2B Change of |@@i| allowed, /dev/null in case
- replaced by nul.
- p4 21 Jun 1992 H2B Nothing changed.
- p5 21 Jul 1992 H2B Nothing changed.
- p5a 30 Jul 1992 KG remove one #include <stdio.h>,
- use strchr instead of index and
- include <string.h> for |strchr| declaration
- p5b 06 Aug 1992 KG fixed a typo
- p6 06 Sep 1992 H2B Nothing changed.
- p6a 15 Mar 1993 AS SAS/C 6.0 support
- ------------------------------------------------------------------------------
- The |index| function is not ANSI but |strchr| is equivalent.
- |strchr| should be declared in <string.h>
- Also avoid ';' between functions, and make definition of main conform
- to ANSI C.
- @x l.9
- #include <stdio.h>
- @<Definitions@>@;
- @<Functions@>;
- @y
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- @<Definitions@>@;
- @<Prototypes@>@;
- @<Functions@>@;
- @z
- ------------------------------------------------------------------------------
- @x l.26
- @ @<Definitions@>=
- typedef short boolean;
- typedef char unsigned eight_bits;
- typedef char ASCII; /* type of characters inside \.{WEB} */
- @y
- @ @<Definitions@>=
- typedef short boolean;
- #ifdef __SASC
- typedef unsigned char eight_bits;
- #else
- typedef char unsigned eight_bits;
- #endif
- typedef char ASCII; /* type of characters inside \.{WEB} */
- @z
- ------------------------------------------------------------------------------
- @x l. 75
- these will make {\bf caddr\_t} be treated in the same way as |int|.
-
- @<Func...@>=
- #include <stdio.h>
- @y
- these will make {\bf caddr\_t} be treated in the same way as |int|.
-
- The file \.{stdio.h} has been included already at the very beginning.
- @<Func...@>=
- @z
- ------------------------------------------------------------------------------
- @x l.180
- @ We do not allow includes in a change file, so as to avoid confusion.
- @y
- @ We do not allow includes in a change file, so as to avoid confusion.
- Actually, the following check will be applied to comment lines in the change
- file only, since otherwise \.{@@i} commands could never be changed.
- @z
- ------------------------------------------------------------------------------
- We like to be able to change @@i commands, also.
- @x l.230
- if (limit>buffer+1 && buffer[0]==@'@@')
- @<Check for erron...@>;
- @y
- @z
- ------------------------------------------------------------------------------
- SAS/C defines `putchar' as a macro and reports a warning about multiple
- macro expansion. The resulting `wmerge' is definitively wrong; it leaves
- every second letter out.
- @x l.329
- put_line()
- {
- char *ptr=buffer;
- while (ptr<limit) putchar(*ptr++);
- putchar('\n');
- }
- @y
- put_line()
- {
- char *ptr=buffer;
- while (ptr<limit)
- {
- putchar(*ptr);
- *ptr++;
- }
- putchar('\n');
- }
- @z
- ------------------------------------------------------------------------------
- We like to be able to change @@i commands, also.
- @x l.391
- @<Check for erron...@>;
- @y
- @z
- ------------------------------------------------------------------------------
- @x l.540
- An omitted change file argument means that |'/dev/null'| should be used,
- @y
- An omitted change file argument means that |'/dev/null'| or---on {\mc
- MS-DOS} systems---|'nul'| or---on {\mc AMIGA} systems---|'NIL:'|
- should be used,
- @z
- ------------------------------------------------------------------------------
- |index| is a BSD function, not used in ANSI C.
- To avoid conflicting declarations when using prototypes,
- remove the declaration here.
- @x l.544
- char *dot_pos, *index(); /* position of |'.'| in the argument */
- @y
- char *dot_pos; /* position of |'.'| in the argument */
- @z
- ------------------------------------------------------------------------------
- use the standard conforming |strchr| instead of BSD's |index|
- @x l.574
- if ((dot_pos=index(*argv,'.'))==NULL)
- @y
- if ((dot_pos=strchr(*argv,'.'))==NULL)
- @z
-
- @x l.586
- if ((dot_pos=index(*argv,'.'))==NULL)
- @y
- if ((dot_pos=strchr(*argv,'.'))==NULL)
- @z
- ------------------------------------------------------------------------------
- @x l.593
- @ @<Set up null...@>= strcpy(change_file_name,"/dev/null");
- @y
- @ @<Set up null...@>=
- #if defined( __TURBOC__ )
- strcpy(change_file_name,"nul");
- #elif defined( __SASC )
- strcpy(change_file_name,"NIL:");
- #else
- strcpy(change_file_name,"/dev/null");
- #endif
- @z
- ------------------------------------------------------------------------------
- @x l.???
- @* Index.
- @y
- @<Proto...@>=
- int input_ln(FILE *fp);
- int prime_the_change_buffer(void);
- int check_change(void);
- int reset_input(void);
- int get_line(void);
- int put_line(void);
- int check_complete(void);
- int err_print(char *s);
- int wrap_up(void);
- int scan_args(int argc,char **argv);
- int main(int argc,char **argv);
-
- @* Index.
- @z
- ------------------------------------------------------------------------------
-