diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2021-04-16 12:49:28 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2021-04-16 12:49:28 +0000 |
commit | 611b225a456949639e46d4ccb7d458761c3dc818 (patch) | |
tree | 23077732a961b5fcd9c25530d594a0ac2cd6fb1a /Build/source/texk/web2c/cwebdir/twinx.ch | |
parent | 296df34bd02be9e066be5af0f934d493916b2c67 (diff) |
[CWEB] New release 4.3.
This release introduces new features to CWEB 4:
* Former option '-t' is now called '-c'.
- New option '-t' for CWEAVE when dealing with 'typename' in
C++ templates.
- New option '-k' for CTANGLE to keep '-separators in numeric
literals.
* Support for "variadic macros" along "variadic functions".
* @d is printed similar to #define (and vice versa):
- '#' is no longer printed in boldface.
- Spacing is similar in most cases.
* Support for extended C99/C++ numeric literals:
- hexadecimal, octal, and -- new! -- binary numbers.
- NOTE: 'cwebmac.tex 4.3' is NOT compatible with CWEAVE 4.2 and older
and vice versa.
* Long parameter lists in ANSI function definitions are indented similar
to old-style function parameters.
- Option '-i' works similar for old-style and modern function headers.
* Additional C99/C++ keywords -- from 'alignas' to 'thread_local' -- are
supported internally.
* '@i'nclude file 'iso_types.w' for numeric types (in addition to
'c++lib.w').
* Countless code modifications, including some corrections amd
improvements.
Thanks and cudos to Github user "@texdraft" for numerous contributions
to this feature release!
git-svn-id: svn://tug.org/texlive/trunk@58884 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/twinx.ch')
-rw-r--r-- | Build/source/texk/web2c/cwebdir/twinx.ch | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/cwebdir/twinx.ch b/Build/source/texk/web2c/cwebdir/twinx.ch new file mode 100644 index 00000000000..00513c0c2c6 --- /dev/null +++ b/Build/source/texk/web2c/cwebdir/twinx.ch @@ -0,0 +1,156 @@ +Changes for the TWINX utility from the CTWILL tarball. + +This minimal set of changes tries to satisfy the GCC compiler +and it fixes a few minor issues. See the comments after '@x'. + +This file is not copyrighted and can be used freely. + +Limbo. + +@x l.1 +\datethis +@y +\datethis +\let\maybe=\iffalse % print only sections that change +@z + +Section 1. + +@x l.10 Standard C interface. +#include <stdio.h> +@y +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +@z + +@x l.15 +main(argc,argv) + int argc; + char *argv[]; +@y +int main( + int argc, + char *argv[]) +@z + +@x l.21 + f=fopen(*++argv,"r"); + if (!f) +@y + if((f=fopen(*++argv,"r"))==NULL) +@z + +@x l.28 + f=fopen(*argv,"r"); + if (!f) +@y + if((f=fopen(*argv,"r"))==NULL) +@z + +Section 3. + +@x l.49 Document minor change in behavior. +@ @<Scan file |f|...@>= +@y +@ For your convenience, \.{TWINX} grabs the first ``word'' in \.{\\title} and +turns it into uppercase form. + +@<Scan file |f|...@>= +@z + +@x l.57 FIX: Fetch only the first word from the '\title'. + for (p=buf+11,q=title;*p && *p!='}';p++) *q++=*p; +@y + for (p=buf+11,q=title;*p&&*p!=' '&&*p!='}';p++) *q++=toupper(*p); +@z + +Section 4. + +@x l.96 +@<Type...@>= +@y +@s node_struct int + +@<Type...@>= +@z + +@x l.102 Compiler warning. + char *id; +@y + const char *id; +@z + +Section 5. + +@x l.115 +char *save_string(s) + char *s; +@y +char *save_string( + char *s) +@z + +Section 6. + +@x l.145 +node *new_node() +@y +node *new_node(void) +@z + +Section 11. + +@x l.216 FIX: Don't count masked braces. + if (*p=='{') bal++; + else if (*p=='}') bal--; +@y + switch (*p) { + case '\\': *q++=*p++; break; + case '{': bal++; break; + case '}': bal--; break; + } +@z + +Section 17. + +@x l.347 +int compare(p,q) + node *p,*q; +@y +int compare( + node *p, node *q) +@z + +Section 19. + +@x l.379 Compiler warning. + for (j=1;collate[j];j++) ord[collate[j]]=j; +@y + for (j=1;collate[j];j++) ord[(int)collate[j]]=j; +@z + +Section 20. + +@x l.390 +collapse(p,q) + node *p,*q; +@y +void collapse( + node *p, node *q) +@z + +Section 22. + +@x l.414 Compiler warning. +{@+register char *p=x->id; +@y +{@+register const char *p=x->id; +@z + +@x l.434 FIX: Don't mask already masked underscore. + if (*p=='_') putchar('\\'); +@y + if (*p=='_'&&*(p-1)!='\\') putchar('\\'); +@z |