Skip to content

Commit

Permalink
Revert "CWEB - release 4.3, 2021-04-16."
Browse files Browse the repository at this point in the history
This reverts commit e7e5d52.

CWEB 4.3 is seriously broken and should not be used for production.
  • Loading branch information
ascherer committed May 2, 2021
1 parent e7e5d52 commit d144765
Show file tree
Hide file tree
Showing 38 changed files with 1,024 additions and 1,741 deletions.
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[Git-archive]
.gitattributes export-ignore
README.md export-ignore
my-changes.md export-ignore
testthings.w export-ignore
indentation.w export-ignore
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of CWEB.
# It is distributed WITHOUT ANY WARRANTY, express or implied.
# Version 4.3 --- April 2021
# Version 4.2 --- February 2021

# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth

Expand Down Expand Up @@ -74,14 +74,14 @@ CWEAVE = ./cweave
CTANGLE = ./ctangle
SOURCES = cweave.w common.w ctangle.w
ALL = common.w ctangle.w cweave.w prod.w \
Makefile README common.c common.h ctangle.c \
Makefile common.c common.h ctangle.c \
cwebman.tex cwebmac.tex comm-vms.ch ctang-vms.ch \
cweav-vms.ch comm-man.ch ctang-man.ch cweav-man.ch \
comm-pc.ch ctang-pc.ch cweav-pc.ch comm-amiga.ch \
comm-bs.ch ctang-bs.ch cweav-bs.ch makefile.bs \
comm-ql.ch ctang-ql.ch cweav-ql.ch readme.ql \
comm-w32.ch ctang-w32.ch cweav-w32.ch \
comm-os2.ch comm-mac.ch cweb.1 cweb.el c++lib.w iso_types.w
comm-os2.ch comm-mac.ch cweb.1 cweb.el c++lib.w README

.SUFFIXES: .dvi .tex .w .pdf

Expand Down Expand Up @@ -183,8 +183,6 @@ install: all
- mkdir $(CWEBINPUTS)
$(CP) c++lib.w $(CWEBINPUTS)
chmod 644 $(CWEBINPUTS)/c++lib.w
$(CP) iso_types.w $(CWEBINPUTS)
chmod 644 $(CWEBINPUTS)/iso_types.w

floppy: $(ALL) examples
bar cvhf /dev/rfd0 $(ALL) examples
Expand Down
8 changes: 3 additions & 5 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% This file is part of CWEB.
% The CWEB programs by Silvio Levy are based on programs by D. E. Knuth.
% They are distributed WITHOUT ANY WARRANTY, express or implied.
% This README file last updated April 2021 by Andreas Scherer
% This README file last updated February 2021 by Andreas Scherer

% Copyright (C) 1987,1990,1993,2000,2016 Silvio Levy and Donald E. Knuth

Expand Down Expand Up @@ -66,16 +66,14 @@ makefile.bs
prod.w
readme.ql
c++lib.w
iso_types.w

The file cwebman.tex is the user manual.
The examples directory contains additional examples of the use of CWEB.
The files common.c and ctangle.c are used for bootstrapping.
The file cweb.1 is a manual page.
The file cweb.el is suggested for GNU-Emacs users.
The files c++lib.w and iso_types.w are for C++ users (say `@i c++lib.w'
and/or `@i iso_types.w' at beginning of program).
The files *-man.ch are used if you want to make the full 243-page CWEB manual.
The file c++lib.w is for C++ users (say `@i c++lib.w' at beginning of program).
The files *-man.ch are used if you want to make the full 240-page CWEB manual.
The files *-bs.ch are used instead of *-pc.ch if you are doing BIG programs.
You can use makefile.bs to make CWEB with *-bs.ch.
The files *-ql.ch are for QDOS/SMSQ systems; see readme.ql for further info.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cweb 4.3
# cweb 4.2

people have been accumulating several decades of experience with
[cweb](http://www-cs-faculty.stanford.edu/~uno/cweb.html), and we know that
Expand All @@ -16,7 +16,7 @@ in fact, now to be found in this cweb development project.
besides for further development, this ‘project’ is used as an – obviously
incomplete – repository of original release versions of levy/knuth
[cweb](http://www-cs-faculty.stanford.edu/~uno/cweb.html). you can either
compile these sources directly or stick the recent version “cweb-4.3” into my
compile these sources directly or stick the recent version “cweb-4.2” into my
[cwebbin](https://github.com/ascherer/cwebbin), which introduces convenient
extensions and prepares cweb for inclusion in the “tex live” distribution.

Expand Down
2 changes: 1 addition & 1 deletion comm-amiga.ch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ An omitted change file argument means that |"/dev/null"| should be used,
An omitted change file argument means that |"nil:"| should be used,
@z
@x section 75
@x section 76
strcpy(change_file_name,"/dev/null");
@y
strcpy(change_file_name,"nil:");
Expand Down
34 changes: 17 additions & 17 deletions comm-bs.ch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ by using "huge" pointers.
(Update attempt by Andreas Scherer, 31 Jan 2021. Good luck!)


@x Section 9.
@x Section 6.
for section names */

@<Common code...@>=
Expand Down Expand Up @@ -50,7 +50,7 @@ typedef struct name_info {
union {
void huge* equiv_member;
void huge* xref_member;
} ptr_union; /* info corresponding to names */
} ptr_union; /* 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;
Expand Down Expand Up @@ -136,23 +136,23 @@ name_pointer p)

@x Section 57.
static name_pointer
add_section_name( /* install a new node in the tree */
add_section_name(@t\1\1@> /* install a new node in the tree */
name_pointer par, /* parent of new node */
int c, /* right or left? */
char *first, /* first character of section name */
char *last, /* last character of section name, plus one */
boolean ispref) /* are we adding a prefix or a full name? */
int ispref@t\2\2@>) /* are we adding a prefix or a full name? */
{
name_pointer p=name_ptr; /* new node */
char *s=first_chunk(p);
@y
static name_pointer
add_section_name( /* install a new node in the tree */
add_section_name(@t\1\1@> /* install a new node in the tree */
name_pointer par, /* parent of new node */
int c, /* right or left? */
char huge* first, /* first character of section name */
char huge* last, /* last character of section name, plus one */
boolean ispref) /* are we adding a prefix or a full name? */
int ispref@t\2\2@>) /* are we adding a prefix or a full name? */
{
name_pointer p=name_ptr; /* new node */
char huge* s=first_chunk(p);
Expand All @@ -161,39 +161,39 @@ boolean ispref) /* are we adding a prefix or a full name? */

@x Section 58.
static void
extend_section_name(
extend_section_name(@t\1\1@>
name_pointer p, /* name to be extended */
char *first, /* beginning of extension text */
char *last, /* one beyond end of extension text */
boolean ispref) /* are we adding a prefix or a full name? */
int ispref@t\2\2@>) /* are we adding a prefix or a full name? */
{
char *s;
@y
static void
extend_section_name(
extend_section_name(@t\1\1@>
name_pointer p, /* name to be extended */
char huge* first, /* beginning of extension text */
char huge* last, /* one beyond end of extension text */
boolean ispref) /* are we adding a prefix or a full name? */
int ispref@t\2\2@>) /* are we adding a prefix or a full name? */
{
char huge* s;
@z


@x Section 63.
static int section_name_cmp(
@x Section 64.
static int section_name_cmp(@t\1\1@>
char **pfirst, /* pointer to beginning of comparison string */
int len, /* length of string */
name_pointer r) /* section name being compared */
name_pointer r@t\2\2@>) /* section name being compared */
{
char *first=*pfirst; /* beginning of comparison string */
name_pointer q=r+1; /* access to subsequent chunks */
char *ss, *s=first_chunk(r);
@y
static int section_name_cmp(
static int section_name_cmp(@t\1\1@>
char huge** pfirst, /* pointer to beginning of comparison string */
int len, /* length of string */
name_pointer r) /* section name being compared */
name_pointer r@t\2\2@>) /* section name being compared */
{
char huge* first=*pfirst; /* beginning of comparison string */
name_pointer q=r+1; /* access to subsequent chunks */
Expand All @@ -208,14 +208,14 @@ An omitted change file argument means that |"NUL"| should be used,
@z


@x Section 75.
@x Section 76.
strcpy(change_file_name,"/dev/null");
@y
strcpy(change_file_name,"NUL");
@z


@x Section 75.
@x Section 76.
else if (*s=='/') dot_pos=NULL,name_pos=++s;
@y
else if (*s == ':' || *s == '\\' || *s == '/')
Expand Down
49 changes: 28 additions & 21 deletions comm-mac.ch
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@ No changes to CTANGLE or CWEAVE are needed.
(Contributed 13 Oct 2000 by [email protected]; slightly edited by Don Knuth)
@x in limbo, change the title page document to specify Mac version
\centerline{(Version 4.3)}
\centerline{(Version 4.2)}
@y
\centerline{(Version 4.3 for MacOS)}
\centerline{(Version 4.2 for MacOS)}
@z
@x section 23: Make input_ln accept \n, \r, \n\r, or \r\n as line endings
@x sections 23/24: Make input_ln accept \n, \r, \n\r, or \r\n as line endings
@ In the unlikely event that your standard I/O library does not
support |feof|, |getc|, and |ungetc| you may have to change things here.
@^system dependencies@>
@c
static boolean input_ln( /* copies a line into |buffer| or returns |false| */
FILE *fp) /* what file to read from */
@<Predecl...@>=
static boolean input_ln(FILE *);@/
@ @c
static boolean input_ln(@t\1\1@> /* copies a line into |buffer| or returns |false| */
FILE *fp@t\2\2@>) /* what file to read from */
{
register int c=EOF; /* character read; initialized so some compilers won't complain */
register char *k; /* where next character goes */
if (feof(fp)) return false; /* we have hit end-of-file */
limit = k = buffer; /* beginning of buffer */
register int c=EOF; /* character read; initialized so some compilers won't complain */
register char *k; /* where next character goes */
if (feof(fp)) return false; /* we have hit end-of-file */
limit = k = buffer; /* beginning of buffer */
while (k<=buffer_end && (c=getc(fp)) != EOF && c!='\n')
if ((*(k++) = c) != ' ') limit = k;
if (k>buffer_end)
if ((c=getc(fp))!=EOF && c!='\n') {
ungetc(c,fp); loc=buffer; err_print("! Input line too long");
@.Input line too long@>
}
if (c==EOF && limit==buffer) return false; /* there was nothing after
if (c==EOF && limit==buffer) return false; /* there was nothing after
the last newline */
return true;
}
Expand All @@ -42,14 +45,17 @@ line endings, so that \.{CWEB} will works with ASCII files stored in
\UNIX/, {\mc DOS} or {\mc MAC} format.
@^system dependencies@>

@c
static boolean input_ln( /* copies a line into |buffer| or returns |false| */
FILE *fp) /* what file to read from */
@<Predecl...@>=
static boolean input_ln(FILE *);@/

@ @c
static boolean input_ln(@t\1\1@> /* copies a line into |buffer| or returns |false| */
FILE *fp@t\2\2@>) /* what file to read from */
{
register int c=EOF; /* character read; initialized so some compilers won't complain */
register char *k; /* where next character goes */
if (feof(fp)) return false; /* we have hit end-of-file */
limit = k = buffer; /* beginning of buffer */
register char *k; /* where next character goes */
if (feof(fp)) return false; /* we have hit end-of-file */
limit = k = buffer; /* beginning of buffer */
while (true) {
c = getc(fp);
if (c==EOF) return limit!=buffer; /* |false|, if there was nothing after
Expand All @@ -71,7 +77,7 @@ FILE *fp) /* what file to read from */
}
@z

@x section 27, simply return if no change file was specified
@x section 28, simply return if no change file was specified
change_limit=change_buffer; /* this value is used if the change file ends */
@<Skip over comment lines in the change file; |return| if end of file@>@;
@y
Expand Down Expand Up @@ -115,19 +121,20 @@ An omitted change file argument means that |"/dev/null"| should be used,
@y
An omitted change file argument means that no change file should be used,
@z
@x section 75, make change file name empty when it is unspecified

@x section 76, make change file name empty when it is unspecified
strcpy(change_file_name,"/dev/null");
@y
change_file_name[0]='\0'; /* empty string */
@z
@x section 75, use the Metrowerks |ccommand| to access command lines
@x section 76, use the Metrowerks |ccommand| to access command lines
while (--argc > 0) {
@y
argc = ccommand (&argv); /* use Mac interface to command line */
@^system dependencies@>
while (--argc > 0) {
@z
@x section 75, use the path separator constant
@x section 76, use the path separator constant
else if (*s=='/') dot_pos=NULL,name_pos=++s;
@y
else if (*s==PATH_SEP) dot_pos=NULL,name_pos=++s;
Expand Down
4 changes: 2 additions & 2 deletions comm-os2.ch
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ An omitted change file argument means that |"/dev/null"| should be used,
An omitted change file argument means that |"NUL"| should be used,
@z
@x section 75
@x section 76
strcpy(change_file_name,"/dev/null");
@y
strcpy(change_file_name,"NUL");
@z
@x section 75 (this change copied from comm-pc.ch)
@x section 76 (this change copied from comm-pc.ch)
else if (*s=='/') dot_pos=NULL,name_pos=++s;
@y
else if (*s == ':' || *s == '\\' || *s == '/')
Expand Down
4 changes: 2 additions & 2 deletions comm-pc.ch
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ An omitted change file argument means that |"/dev/null"| should be used,
An omitted change file argument means that |"NUL"| should be used,
@z
@x section 75
@x section 76
strcpy(change_file_name,"/dev/null");
@y
strcpy(change_file_name,"NUL");
@z
@x section 75 (this change copied from comm-bs.ch, July 94)
@x section 76 (this change copied from comm-bs.ch, July 94)
else if (*s=='/') dot_pos=NULL,name_pos=++s;
@y
else if (*s == ':' || *s == '\\' || *s == '/')
Expand Down
8 changes: 4 additions & 4 deletions comm-ql.ch
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ ex <dev_>cc;'-v -h -c -=500000 -DCWEBINPUTS=flp2_ common_c'
@x
\def\v{\char'174} % vertical (|) in typewriter font

\def\title{Common code for CTANGLE and CWEAVE (Version 4.3)}
\def\title{Common code for CTANGLE and CWEAVE (Version 4.2)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
\centerline{(Version 4.3)}
\centerline{(Version 4.2)}
\vfill}
\def\botofcontents{\vfill
\noindent
@y
\def\v{\char'174} % vertical (|) in typewriter font
\def\title{Common code for CTANGLE and CWEAVE (QL Version 4.3)}
\def\title{Common code for CTANGLE and CWEAVE (QL Version 4.2)}
\def\topofcontents{\null\vfill
\centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
{\ttitlefont CWEAVE}}
\vskip 15pt
\centerline{(Version 4.3)}
\centerline{(Version 4.2)}
\vfill}
\def\botofcontents{\vfill
\noindent
Expand Down
4 changes: 2 additions & 2 deletions comm-vms.ch
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ modified:
@x section 68 (01-FEB-1992 ST)
programs are started. Here, for instance, we pass the operating system
a status of |EXIT_SUCCESS| if and only if only harmless messages were printed.
a status of 0 if and only if only harmless messages were printed.
@y
programs are started. Here, for instance, we pass VAX/VMS
a status of |SS$_NORMAL| if and only if only harmless
Expand Down Expand Up @@ -67,7 +67,7 @@ An omitted change file argument means that the
null device |"NL:"| should be used, when no changes are desired.
@z

@x section 75 (1987 BL) (01-FEB-1992 ST) (05-APR-1992 DEK)
@x section 76 (1987 BL) (01-FEB-1992 ST) (05-APR-1992 DEK)
strcpy(change_file_name,"/dev/null");
@y
strcpy(change_file_name,"NL:");
Expand Down
Loading

0 comments on commit d144765

Please sign in to comment.