History

CWEB — Release 3.64, 2002-07-12.

Andreas Scherer committed 15 years ago

Commit f6febbe1 parent f6c448327 files · +800 −384Browse files

Unified · Split

27 files
  1. Makefile +2 −1
  2. README +5 −1
  3. comm-mac.ch +2 −2
  4. comm-man.ch +1 −1
  5. comm-ql.ch +4 −4
  6. comm-w32.ch +94 −0
  7. common.c +93 −87
  8. common.w +18 −12
  9. ctang-bs.ch +2 −2
  10. ctang-man.ch +1 −1
  11. ctang-pc.ch +2 −2
  12. ctang-ql.ch +4 −4
  13. ctang-vms.ch +2 −2
  14. ctang-w32.ch +66 −0
  15. ctangle.c +61 −60
  16. ctangle.w +28 −27
  17. cweav-bs.ch +2 −2
  18. cweav-man.ch +1 −1
  19. cweav-pc.ch +2 −2
  20. cweav-ql.ch +4 −4
  21. cweav-vms.ch +2 −2
  22. cweav-w32.ch +52 −0
  23. cweave.w +8 −10
  24. cweb.1 +76 −44
  25. cwebmac.tex +178 −79
  26. cwebman.tex +61 −13
  27. examples/wmerge.w +29 −21
Makefile+2−1
@@ -1,6 +1,6 @@
1# This file is part of CWEB.1# This file is part of CWEB.
2# It is distributed WITHOUT ANY WARRANTY, express or implied.2# It is distributed WITHOUT ANY WARRANTY, express or implied.
3# Version 3.63 --- January 20013# Version 3.64 --- February 2002
4 4
5# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth5# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
6 6
@@ -78,6 +78,7 @@ ALL = common.w ctangle.w cweave.w prod.w \ · 71 unmodified lines
78 comm-pc.ch ctang-pc.ch cweav-pc.ch comm-amiga.ch \78 comm-pc.ch ctang-pc.ch cweav-pc.ch comm-amiga.ch \
79 comm-bs.ch ctang-bs.ch cweav-bs.ch makefile.bs \79 comm-bs.ch ctang-bs.ch cweav-bs.ch makefile.bs \
80 comm-ql.ch ctang-ql.ch cweav-ql.ch readme.ql \80 comm-ql.ch ctang-ql.ch cweav-ql.ch readme.ql \
81 comm-w32.ch ctang-w32.ch cweav-w32.ch \
81 comm-os2.ch comm-mac.ch cweb.1 cweb.el c++lib.w README82 comm-os2.ch comm-mac.ch cweb.1 cweb.el c++lib.w README
82 83
83.SUFFIXES: .dvi .tex .w .pdf84.SUFFIXES: .dvi .tex .w .pdf
README+5−1
@@ -27,6 +27,7 @@ comm-man.ch · 26 unmodified lines
27comm-pc.ch27comm-pc.ch
28comm-ql.ch28comm-ql.ch
29comm-vms.ch29comm-vms.ch
30comm-w32.ch
30common.c31common.c
31common.h32common.h
32common.w33common.w
@@ -35,6 +36,7 @@ ctang-man.ch · 2 unmodified lines
35ctang-pc.ch36ctang-pc.ch
36ctang-ql.ch37ctang-ql.ch
37ctang-vms.ch38ctang-vms.ch
39ctang-w32.ch
38ctangle.c40ctangle.c
39ctangle.w41ctangle.w
40cweav-bs.ch42cweav-bs.ch
@@ -42,6 +44,7 @@ cweav-man.ch · 1 unmodified line
42cweav-pc.ch44cweav-pc.ch
43cweav-ql.ch45cweav-ql.ch
44cweav-vms.ch46cweav-vms.ch
47cweave-w32.ch
45cweave.w48cweave.w
46cweb.149cweb.1
47cweb.el50cweb.el
@@ -59,10 +62,11 @@ The files common.c and ctangle.c are used for bootstrapping. · 11 unmodified lines
59The file cweb.1 is a manual page.62The file cweb.1 is a manual page.
60The file cweb.el is suggested for GNU-Emacs users.63The file cweb.el is suggested for GNU-Emacs users.
61The file c++lib.w is for C++ users (say `@i c++lib.w' at beginning of program).64The file c++lib.w is for C++ users (say `@i c++lib.w' at beginning of program).
62The files *-man.ch are used if you want to make the full 237-page CWEB manual.65The files *-man.ch are used if you want to make the full 239-page CWEB manual.
63The files *-bs.ch are used instead of *-pc.ch if you are doing BIG programs.66The files *-bs.ch are used instead of *-pc.ch if you are doing BIG programs.
64You can use makefile.bs to make CWEB with *-bs.ch.67You can use makefile.bs to make CWEB with *-bs.ch.
65The files *-ql.ch are for QDOS/SMSQ systems; see readme.ql for further info.68The files *-ql.ch are for QDOS/SMSQ systems; see readme.ql for further info.
69The files *-w32.ch use __fastcall conventions on win32 systems.
66The file comm-mac.ch is for Macintosh conventions.70The file comm-mac.ch is for Macintosh conventions.
67The other files named *.ch are sample change files for local customization.71The other files named *.ch are sample change files for local customization.
68 72
comm-mac.ch+2−2
@@ -4,9 +4,9 @@ No changes to CTANGLE or CWEAVE are needed. · 3 unmodified lines
4(Contributed 13 Oct 2000 by AndPio@aol.com; slightly edited by Don Knuth)4(Contributed 13 Oct 2000 by AndPio@aol.com; slightly edited by Don Knuth)
5 5
6@x in limbo, change the title page document to specify Mac version6@x in limbo, change the title page document to specify Mac version
7 \centerline{(Version 3.61)}7 \centerline{(Version 3.64)}
8@y8@y
9 \centerline{(Version 3.61 for MacOS)}9 \centerline{(Version 3.64 for MacOS)}
10@z10@z
11 11
12@x section 9: Make input_ln accept \n, \r, \n\r, or \r\n as line endings12@x section 9: Make input_ln accept \n, \r, \n\r, or \r\n as line endings
comm-man.ch+1−1
@@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one. · 15 unmodified lines
16}16}
17@y17@y
18\def\botofcontents{\vfill\titlefalse}18\def\botofcontents{\vfill\titlefalse}
19\def\contentspagenumber{27}19\def\contentspagenumber{28}
20\def\title{APPENDIX D: COMMON}20\def\title{APPENDIX D: COMMON}
21\let\K=\leftarrow21\let\K=\leftarrow
22@z22@z
comm-ql.ch+4−4
@@ -10,24 +10,24 @@ ex <dev_>cc;'-v -h -c -=500000 -DCWEBINPUTS=flp2_ common_c' · 9 unmodified lines
10@x10@x
11\def\v{\char'174} % vertical (|) in typewriter font11\def\v{\char'174} % vertical (|) in typewriter font
12 12
13\def\title{Common code for CTANGLE and CWEAVE (Version 3.61)}13\def\title{Common code for CTANGLE and CWEAVE (Version 3.64)}
14\def\topofcontents{\null\vfill14\def\topofcontents{\null\vfill
15 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and15 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
16 {\ttitlefont CWEAVE}}16 {\ttitlefont CWEAVE}}
17 \vskip 15pt17 \vskip 15pt
18 \centerline{(Version 3.61)}18 \centerline{(Version 3.64)}
19 \vfill}19 \vfill}
20\def\botofcontents{\vfill20\def\botofcontents{\vfill
21\noindent21\noindent
22@y22@y
23\def\v{\char'174} % vertical (|) in typewriter font23\def\v{\char'174} % vertical (|) in typewriter font
24 24
25\def\title{Common code for CTANGLE and CWEAVE (QL Version 3.61)}25\def\title{Common code for CTANGLE and CWEAVE (QL Version 3.64)}
26\def\topofcontents{\null\vfill26\def\topofcontents{\null\vfill
27 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and27 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
28 {\ttitlefont CWEAVE}}28 {\ttitlefont CWEAVE}}
29 \vskip 15pt29 \vskip 15pt
30 \centerline{(Version 3.61)}30 \centerline{(Version 3.64)}
31 \vfill}31 \vfill}
32\def\botofcontents{\vfill32\def\botofcontents{\vfill
33\noindent33\noindent
comm-w32.ch+94−0
@@ -0,0 +1,94 @@
1This is the change file for CWEB's COMMON under Win32
2(Contributed by Fabrice Popineau, February 2002 <Fabrice.Popineau@supelec.fr>)
3
4The Microsoft C compiler included in Visual Studio allows for different
5parameter passing conventions than the standard one. This is actually
6specified with the Intel IA32 architecture. There exist three
7calling conventions under the IA32 architecture as defined by Intel.
8
9One of them is the standard C calling convention: Parameters are passed on
10the stack, calling function is responsible to unstack arguments. Names are
11decorated with a prefixed underscore. It is called the __cdecl convention.
12
13Another calling convention is the __fastcall convention. The first two 32bits
14arguments are passed on the stack. The called function is responsible for
15stack maintenance. Names are decorated with an @ sign as prefix, and another
16@ sign followed by the size of the arguments as suffix.
17
18The third one is the __stdcall convention and is basically the Pascal calling
19convention.
20
21Using the __fastcall convention is usually faster on Intel architecture. Names
22are decorated because obviously a __cdecl function can't behave the same way
23as a __fastcall one of the same prototype. So the new full prototype includes
24the keyword __cdecl or __fastcall. A compiler option allows to compile all
25functions using one or the other calling convention. If you compile using
26__fastcall, then you are bound to explicitly declare a few functions as
27__cdecl : the ones that are passed to the C library (like function pointers
28for qsort() or signal()) or functions that replace functions from the C
29library, because the standard headers have a __cdecl prototype for these
30functions. Also, you cannot declare a library function without giving it the
31exact prototype used in the library headers files. So you'd better use the
32header files to be safe.
33
34Admittedly, this is not vital for cweb, except that I build the whole texlive
35set of programs using the __fastcall convention.
36
37@x
38@<Include files@>=
39#include <ctype.h>
40@y
41@<Include files@>=
42#include <ctype.h>
43#include <string.h>
44@z
45
46@x
47@ @<Predec...@>=
48extern int names_match();
49@y
50@ @<Predec...@>=
51extern int __cdecl names_match();
52@z
53
54@x
55@<Pred...@>=
56void init_p();
57@y
58@<Pred...@>=
59void __cdecl init_p();
60@z
61
62@x section 69
63An omitted change file argument means that |"/dev/null"| should be used,
64@y
65An omitted change file argument means that |"NUL"| should be used,
66@z
67
68@x section 70 (this change copied from comm-bs.ch, July 94)
69 else if (*s=='/') dot_pos=NULL,name_pos=++s;
70@y
71 else if (*s == ':' || *s == '\\' || *s == '/')
72 dot_pos=NULL,name_pos=++s;
73@z
74
75@x section 70
76 if (found_change<=0) strcpy(change_file_name,"/dev/null");
77@y
78 if (found_change<=0) strcpy(change_file_name,"NUL");
79@z
80
81@x
82@ We predeclare several standard system functions here instead of including
83their system header files, because the names of the header files are not as
84standard as the names of the functions. (For example, some \CEE/ environments
85have \.{<string.h>} where others have \.{<strings.h>}.)
86
87@<Predecl...@>=
88extern int strlen(); /* length of string */
89extern int strcmp(); /* compare strings lexicographically */
90extern char* strcpy(); /* copy one string to another */
91extern int strncmp(); /* compare up to $n$ string characters */
92extern char* strncpy(); /* copy up to $n$ string characters */
93@y
94@z
common.c+93−87
@@ -12,7 +12,7 @@ · 11 unmodified lines
12#include <stdio.h> 12#include <stdio.h>
13 13
14/*:8*//*22:*/14/*:8*//*22:*/
15#line 470 "common.w"15#line 471 "common.w"
16 16
17#include <stdlib.h> 17#include <stdlib.h>
18 18
@@ -165,17 +165,17 @@ boolean change_pending; · 146 unmodified lines
165boolean print_where= 0;165boolean print_where= 0;
166 166
167/*:20*//*27:*/167/*:20*//*27:*/
168#line 588 "common.w"168#line 594 "common.w"
169 169
170typedef struct name_info{170typedef struct name_info{
171char*byte_start;171char*byte_start;
172/*31:*/172/*31:*/
173#line 625 "common.w"173#line 631 "common.w"
174 174
175struct name_info*link;175struct name_info*link;
176 176
177/*:31*//*40:*/177/*:31*//*40:*/
178#line 724 "common.w"178#line 730 "common.w"
179 179
180union{180union{
181struct name_info*Rlink;181struct name_info*Rlink;
@@ -184,12 +184,12 @@ char Ilk; · 2 unmodified lines
184}dummy;184}dummy;
185 185
186/*:40*//*55:*/186/*:40*//*55:*/
187#line 1056 "common.w"187#line 1062 "common.w"
188 188
189char*equiv_or_xref;189char*equiv_or_xref;
190 190
191/*:55*/191/*:55*/
192#line 591 "common.w"192#line 597 "common.w"
193 193
194}name_info;194}name_info;
195typedef name_info*name_pointer;195typedef name_info*name_pointer;
@@ -199,13 +199,13 @@ name_info name_dir[max_names]; · 3 unmodified lines
199name_pointer name_dir_end= name_dir+max_names-1;199name_pointer name_dir_end= name_dir+max_names-1;
200 200
201/*:27*//*29:*/201/*:27*//*29:*/
202#line 611 "common.w"202#line 617 "common.w"
203 203
204name_pointer name_ptr;204name_pointer name_ptr;
205char*byte_ptr;205char*byte_ptr;
206 206
207/*:29*//*32:*/207/*:29*//*32:*/
208#line 638 "common.w"208#line 644 "common.w"
209 209
210typedef name_pointer*hash_pointer;210typedef name_pointer*hash_pointer;
211name_pointer hash[hash_size];211name_pointer hash[hash_size];
@@ -213,12 +213,12 @@ hash_pointer hash_end= hash+hash_size-1; · 1 unmodified line
213hash_pointer h;213hash_pointer h;
214 214
215/*:32*//*56:*/215/*:32*//*56:*/
216#line 1076 "common.w"216#line 1082 "common.w"
217 217
218int history= spotless;218int history= spotless;
219 219
220/*:56*//*67:*/220/*:56*//*67:*/
221#line 1214 "common.w"221#line 1220 "common.w"
222 222
223int argc;223int argc;
224char**argv;224char**argv;
@@ -229,7 +229,7 @@ char scn_file_name[max_file_name_length]; · 4 unmodified lines
229boolean flags[128];229boolean flags[128];
230 230
231/*:67*//*77:*/231/*:67*//*77:*/
232#line 1364 "common.w"232#line 1370 "common.w"
233 233
234FILE*C_file;234FILE*C_file;
235FILE*tex_file;235FILE*tex_file;
@@ -254,48 +254,48 @@ char*change_limit; · 18 unmodified lines
254#line 62 "common.w"254#line 62 "common.w"
255 255
256/*33:*/256/*33:*/
257#line 644 "common.w"257#line 650 "common.w"
258 258
259extern int names_match();259extern int names_match();
260 260
261/*:33*//*38:*/261/*:33*//*38:*/
262#line 697 "common.w"262#line 703 "common.w"
263 263
264void init_p();264void init_p();
265 265
266/*:38*//*46:*/266/*:38*//*46:*/
267#line 846 "common.w"267#line 852 "common.w"
268 268
269extern void init_node();269extern void init_node();
270 270
271/*:46*//*53:*/271/*:46*//*53:*/
272#line 1011 "common.w"272#line 1017 "common.w"
273 273
274int section_name_cmp();274int section_name_cmp();
275 275
276/*:53*//*57:*/276/*:53*//*57:*/
277#line 1086 "common.w"277#line 1092 "common.w"
278 278
279void err_print();279void err_print();
280 280
281/*:57*//*60:*/281/*:57*//*60:*/
282#line 1134 "common.w"282#line 1140 "common.w"
283 283
284int wrap_up();284int wrap_up();
285extern void print_stats();285extern void print_stats();
286 286
287/*:60*//*63:*/287/*:60*//*63:*/
288#line 1167 "common.w"288#line 1173 "common.w"
289 289
290void fatal(),overflow();290void fatal(),overflow();
291 291
292/*:63*//*69:*/292/*:63*//*69:*/
293#line 1245 "common.w"293#line 1251 "common.w"
294 294
295void scan_args();295void scan_args();
296 296
297/*:69*//*81:*/297/*:69*//*81:*/
298#line 1405 "common.w"298#line 1411 "common.w"
299 299
300extern int strlen();300extern int strlen();
301extern int strcmp();301extern int strcmp();
@@ -314,19 +314,19 @@ void · 12 unmodified lines
314common_init()314common_init()
315{315{
316/*30:*/316/*30:*/
317#line 615 "common.w"317#line 621 "common.w"
318 318
319name_dir->byte_start= byte_ptr= byte_mem;319name_dir->byte_start= byte_ptr= byte_mem;
320name_ptr= name_dir+1;320name_ptr= name_dir+1;
321name_ptr->byte_start= byte_mem;321name_ptr->byte_start= byte_mem;
322 322
323/*:30*//*34:*/323/*:30*//*34:*/
324#line 649 "common.w"324#line 655 "common.w"
325 325
326for(h= hash;h<=hash_end;*h++= NULL);326for(h= hash;h<=hash_end;*h++= NULL);
327 327
328/*:34*//*41:*/328/*:34*//*41:*/
329#line 731 "common.w"329#line 737 "common.w"
330 330
331root= NULL;331root= NULL;
332 332
@@ -334,7 +334,7 @@ root= NULL; · 1 unmodified line
334#line 93 "common.w"334#line 93 "common.w"
335;335;
336/*68:*/336/*68:*/
337#line 1227 "common.w"337#line 1233 "common.w"
338 338
339show_banner= show_happiness= show_progress= 1;339show_banner= show_happiness= show_progress= 1;
340 340
@@ -342,7 +342,7 @@ show_banner= show_happiness= show_progress= 1; · 1 unmodified line
342#line 94 "common.w"342#line 94 "common.w"
343;343;
344/*78:*/344/*78:*/
345#line 1371 "common.w"345#line 1377 "common.w"
346 346
347scan_args();347scan_args();
348if(program==ctangle){348if(program==ctangle){
@@ -428,7 +428,7 @@ return; · 79 unmodified lines
428#line 292 "common.w"428#line 292 "common.w"
429 429
430{430{
431change_limit= change_buffer-buffer+limit;431change_limit= change_buffer+(limit-buffer);
432strncpy(change_buffer,buffer,limit-buffer+1);432strncpy(change_buffer,buffer,limit-buffer+1);
433}433}
434 434
@@ -459,15 +459,15 @@ change_limit= change_buffer;changing= 0; · 24 unmodified lines
459return;459return;
460}460}
461if(limit> buffer+1&&buffer[0]=='@'){461if(limit> buffer+1&&buffer[0]=='@'){
462if(xisupper(buffer[1]))buffer[1]= tolower(buffer[1]);462char xyz_code= xisupper(buffer[1])?tolower(buffer[1]):buffer[1];
463/*17:*/463/*17:*/
464#line 358 "common.w"464#line 358 "common.w"
465 465
466if(buffer[1]=='x'||buffer[1]=='z'){466if(xyz_code=='x'||xyz_code=='z'){
467loc= buffer+2;err_print("! Where is the matching @y?");467loc= buffer+2;err_print("! Where is the matching @y?");
468 468
469}469}
470else if(buffer[1]=='y'){470else if(xyz_code=='y'){
471if(n> 0){471if(n> 0){
472loc= buffer+2;472loc= buffer+2;
473printf("\n! Hmm... %d ",n);473printf("\n! Hmm... %d ",n);
@@ -486,7 +486,7 @@ return; · 12 unmodified lines
486#line 292 "common.w"486#line 292 "common.w"
487 487
488{488{
489change_limit= change_buffer-buffer+limit;489change_limit= change_buffer+(limit-buffer);
490strncpy(change_buffer,buffer,limit-buffer+1);490strncpy(change_buffer,buffer,limit-buffer+1);
491}491}
492 492
@@ -544,7 +544,7 @@ int get_line() · 51 unmodified lines
544restart:544restart:
545if(changing&&include_depth==change_depth)545if(changing&&include_depth==change_depth)
546/*25:*/546/*25:*/
547#line 531 "common.w"547#line 537 "common.w"
548{548{
549change_line++;549change_line++;
550if(!input_ln(change_file)){550if(!input_ln(change_file)){
@@ -579,7 +579,7 @@ prime_the_change_buffer();changing= !changing;print_where= 1; · 28 unmodified lines
579;579;
580if(!changing||include_depth> change_depth){580if(!changing||include_depth> change_depth){
581/*24:*/581/*24:*/
582#line 514 "common.w"582#line 520 "common.w"
583{583{
584cur_line++;584cur_line++;
585while(!input_ln(cur_file)){585while(!input_ln(cur_file)){
@@ -602,10 +602,11 @@ if(change_limit> change_buffer)check_change(); · 16 unmodified lines
602;602;
603if(changing&&include_depth==change_depth)goto restart;603if(changing&&include_depth==change_depth)goto restart;
604}604}
605if(input_has_ended)return 0;
605loc= buffer;*limit= ' ';606loc= buffer;*limit= ' ';
606if(*buffer=='@'&&(*(buffer+1)=='i'||*(buffer+1)=='I')){607if(buffer[0]=='@'&&(buffer[1]=='i'||buffer[1]=='I')){
607loc= buffer+2;608loc= buffer+2;*limit= '"';
608while(loc<=limit&&(*loc==' '||*loc=='\t'||*loc=='"'))loc++;609while(*loc==' '||*loc=='\t')loc++;
609if(loc>=limit){610if(loc>=limit){
610err_print("! Include file name not given");611err_print("! Include file name not given");
611 612
@@ -618,13 +619,18 @@ goto restart; · 6 unmodified lines
618}619}
619include_depth++;620include_depth++;
620/*23:*/621/*23:*/
621#line 473 "common.w"622#line 474 "common.w"
622{623{
623char temp_file_name[max_file_name_length];624char temp_file_name[max_file_name_length];
624char*cur_file_name_end= cur_file_name+max_file_name_length-1;625char*cur_file_name_end= cur_file_name+max_file_name_length-1;
625char*k= cur_file_name,*kk;626char*k= cur_file_name,*kk;
626int l;627int l;
627 628
629if(*loc=='"'){
630loc++;
631while(*loc!='"'&&k<=cur_file_name_end)*k++= *loc++;
632if(loc==limit)k= cur_file_name_end+1;
633}else
628while(*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end)*k++= *loc++;634while(*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end)*k++= *loc++;
629if(k> cur_file_name_end)too_long();635if(k> cur_file_name_end)too_long();
630 636
@@ -661,14 +667,14 @@ include_depth--;err_print("! Cannot open include file");goto restart; · 30 unmodified lines
661}667}
662 668
663/*:23*/669/*:23*/
664#line 451 "common.w"670#line 452 "common.w"
665;671;
666}672}
667return(!input_has_ended);673return 1;
668}674}
669 675
670/*:21*//*26:*/676/*:21*//*26:*/
671#line 563 "common.w"677#line 569 "common.w"
672 678
673void679void
674check_complete(){680check_complete(){
@@ -682,7 +688,7 @@ err_print("! Change file entry did not match"); · 7 unmodified lines
682}688}
683 689
684/*:26*//*35:*/690/*:26*//*35:*/
685#line 654 "common.w"691#line 660 "common.w"
686 692
687name_pointer693name_pointer
688id_lookup(first,last,t)694id_lookup(first,last,t)
@@ -697,17 +703,17 @@ name_pointer p; · 8 unmodified lines
697if(last==NULL)for(last= first;*last!='\0';last++);703if(last==NULL)for(last= first;*last!='\0';last++);
698l= last-first;704l= last-first;
699/*36:*/705/*36:*/
700#line 677 "common.w"706#line 683 "common.w"
701 707
702h= (unsigned char)*i;708h= (unsigned char)*i;
703while(++i<last)h= (h+h+(int)((unsigned char)*i))%hash_size;709while(++i<last)h= (h+h+(int)((unsigned char)*i))%hash_size;
704 710
705 711
706/*:36*/712/*:36*/
707#line 667 "common.w"713#line 673 "common.w"
708;714;
709/*37:*/715/*37:*/
710#line 685 "common.w"716#line 691 "common.w"
711 717
712p= hash[h];718p= hash[h];
713while(p&&!names_match(p,first,l,t))p= p->link;719while(p&&!names_match(p,first,l,t))p= p->link;
@@ -717,10 +723,10 @@ p->link= hash[h];hash[h]= p; · 3 unmodified lines
717}723}
718 724
719/*:37*/725/*:37*/
720#line 668 "common.w"726#line 674 "common.w"
721;727;
722if(p==name_ptr)/*39:*/728if(p==name_ptr)/*39:*/
723#line 700 "common.w"729#line 706 "common.w"
724{730{
725if(byte_ptr+l> byte_mem_end)overflow("byte memory");731if(byte_ptr+l> byte_mem_end)overflow("byte memory");
726if(name_ptr>=name_dir_end)overflow("name");732if(name_ptr>=name_dir_end)overflow("name");
@@ -730,13 +736,13 @@ if(program==cweave)init_p(p,t); · 3 unmodified lines
730}736}
731 737
732/*:39*/738/*:39*/
733#line 669 "common.w"739#line 675 "common.w"
734;740;
735return(p);741return(p);
736}742}
737 743
738/*:35*//*42:*/744/*:35*//*42:*/
739#line 758 "common.w"745#line 764 "common.w"
740 746
741void747void
742print_section_name(p)748print_section_name(p)
@@ -757,7 +763,7 @@ if(q)term_write("...",3); · 14 unmodified lines
757}763}
758 764
759/*:42*//*43:*/765/*:42*//*43:*/
760#line 777 "common.w"766#line 783 "common.w"
761 767
762void768void
763sprint_section_name(dest,p)769sprint_section_name(dest,p)
@@ -780,7 +786,7 @@ s= p->byte_start; · 16 unmodified lines
780}786}
781 787
782/*:43*//*44:*/788/*:43*//*44:*/
783#line 798 "common.w"789#line 804 "common.w"
784 790
785void791void
786print_prefix_name(p)792print_prefix_name(p)
@@ -793,7 +799,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); · 6 unmodified lines
793}799}
794 800
795/*:44*//*45:*/801/*:44*//*45:*/
796#line 819 "common.w"802#line 825 "common.w"
797 803
798int web_strcmp(j,j_len,k,k_len)804int web_strcmp(j,j_len,k,k_len)
799char*j,*k;805char*j,*k;
@@ -809,7 +815,7 @@ else return greater; · 9 unmodified lines
809}815}
810 816
811/*:45*//*47:*/817/*:45*//*47:*/
812#line 849 "common.w"818#line 855 "common.w"
813 819
814name_pointer820name_pointer
815add_section_name(par,c,first,last,ispref)821add_section_name(par,c,first,last,ispref)
@@ -840,7 +846,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); · 24 unmodified lines
840}846}
841 847
842/*:47*//*48:*/848/*:47*//*48:*/
843#line 878 "common.w"849#line 884 "common.w"
844 850
845void851void
846extend_section_name(p,first,last,ispref)852extend_section_name(p,first,last,ispref)
@@ -864,7 +870,7 @@ if(ispref)*(byte_ptr-1)= ' '; · 17 unmodified lines
864}870}
865 871
866/*:48*//*49:*/872/*:48*//*49:*/
867#line 906 "common.w"873#line 912 "common.w"
868 874
869name_pointer875name_pointer
870section_lookup(first,last,ispref)876section_lookup(first,last,ispref)
@@ -879,7 +885,7 @@ name_pointer par= NULL; · 8 unmodified lines
879 885
880int name_len= last-first+1;886int name_len= last-first+1;
881/*50:*/887/*50:*/
882#line 930 "common.w"888#line 936 "common.w"
883 889
884while(p){890while(p){
885c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p));891c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p));
@@ -906,19 +912,19 @@ p= q,q= NULL; · 20 unmodified lines
906}912}
907 913
908/*:50*/914/*:50*/
909#line 920 "common.w"915#line 926 "common.w"
910;916;
911/*51:*/917/*51:*/
912#line 955 "common.w"918#line 961 "common.w"
913 919
914if(r==NULL)920if(r==NULL)
915return add_section_name(par,c,first,last+1,ispref);921return add_section_name(par,c,first,last+1,ispref);
916 922
917/*:51*/923/*:51*/
918#line 921 "common.w"924#line 927 "common.w"
919;925;
920/*52:*/926/*52:*/
921#line 963 "common.w"927#line 969 "common.w"
922 928
923switch(section_name_cmp(&first,name_len,r)){929switch(section_name_cmp(&first,name_len,r)){
924 930
@@ -952,12 +958,12 @@ return r; · 27 unmodified lines
952}958}
953 959
954/*:52*/960/*:52*/
955#line 922 "common.w"961#line 928 "common.w"
956;962;
957}963}
958 964
959/*:49*//*54:*/965/*:49*//*54:*/
960#line 1014 "common.w"966#line 1020 "common.w"
961 967
962int section_name_cmp(pfirst,len,r)968int section_name_cmp(pfirst,len,r)
963char**pfirst;969char**pfirst;
@@ -991,7 +997,7 @@ default:return c; · 27 unmodified lines
991}997}
992 998
993/*:54*//*58:*/999/*:54*//*58:*/
994#line 1089 "common.w"1000#line 1095 "common.w"
995 1001
996void1002void
997err_print(s)1003err_print(s)
@@ -1000,7 +1006,7 @@ char*s; · 2 unmodified lines
1000char*k,*l;1006char*k,*l;
1001printf(*s=='!'?"\n%s":"%s",s);1007printf(*s=='!'?"\n%s":"%s",s);
1002if(web_file_open)/*59:*/1008if(web_file_open)/*59:*/
1003#line 1109 "common.w"1009#line 1115 "common.w"
1004 1010
1005{if(changing&&include_depth==change_depth)1011{if(changing&&include_depth==change_depth)
1006printf(". (l. %d of change file)\n",change_line);1012printf(". (l. %d of change file)\n",change_line);
@@ -1020,20 +1026,20 @@ putchar(' '); · 13 unmodified lines
1020}1026}
1021 1027
1022/*:59*/1028/*:59*/
1023#line 1096 "common.w"1029#line 1102 "common.w"
1024;1030;
1025update_terminal;mark_error;1031update_terminal;mark_error;
1026}1032}
1027 1033
1028/*:58*//*61:*/1034/*:58*//*61:*/
1029#line 1144 "common.w"1035#line 1150 "common.w"
1030 1036
1031int wrap_up(){1037int wrap_up(){
1032putchar('\n');1038putchar('\n');
1033if(show_stats)1039if(show_stats)
1034print_stats();1040print_stats();
1035/*62:*/1041/*62:*/
1036#line 1154 "common.w"1042#line 1160 "common.w"
1037 1043
1038switch(history){1044switch(history){
1039case spotless:if(show_happiness)printf("(No errors were found.)\n");break;1045case spotless:if(show_happiness)printf("(No errors were found.)\n");break;
@@ -1045,14 +1051,14 @@ case fatal_message:printf("(That was a fatal error, my friend.)\n"); · 5 unmodified lines
1045}1051}
1046 1052
1047/*:62*/1053/*:62*/
1048#line 1149 "common.w"1054#line 1155 "common.w"
1049;1055;
1050if(history> harmless_message)return(1);1056if(history> harmless_message)return(1);
1051else return(0);1057else return(0);
1052}1058}
1053 1059
1054/*:61*//*64:*/1060/*:61*//*64:*/
1055#line 1173 "common.w"1061#line 1179 "common.w"
1056void1062void
1057fatal(s,t)1063fatal(s,t)
1058char*s,*t;1064char*s,*t;
@@ -1063,7 +1069,7 @@ history= fatal_message;exit(wrap_up()); · 4 unmodified lines
1063}1069}
1064 1070
1065/*:64*//*65:*/1071/*:64*//*65:*/
1066#line 1184 "common.w"1072#line 1190 "common.w"
1067void1073void
1068overflow(t)1074overflow(t)
1069char*t;1075char*t;
@@ -1073,7 +1079,7 @@ printf("\n! Sorry, %s capacity exceeded",t);fatal("",""); · 3 unmodified lines
1073 1079
1074 1080
1075/*:65*//*70:*/1081/*:65*//*70:*/
1076#line 1248 "common.w"1082#line 1254 "common.w"
1077 1083
1078void1084void
1079scan_args()1085scan_args()
@@ -1087,7 +1093,7 @@ boolean flag_change; · 7 unmodified lines
1087 1093
1088while(--argc> 0){1094while(--argc> 0){
1089if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*74:*/1095if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*74:*/
1090#line 1338 "common.w"1096#line 1344 "common.w"
1091 1097
1092{1098{
1093if(**argv=='-')flag_change= 0;1099if(**argv=='-')flag_change= 0;
@@ -1097,7 +1103,7 @@ flags[*dot_pos]= flag_change; · 3 unmodified lines
1097}1103}
1098 1104
1099/*:74*/1105/*:74*/
1100#line 1260 "common.w"1106#line 1266 "common.w"
1101 1107
1102else{1108else{
1103s= name_pos= *argv;dot_pos= NULL;1109s= name_pos= *argv;dot_pos= NULL;
@@ -1107,17 +1113,17 @@ else if(*s=='/')dot_pos= NULL,name_pos= ++s; · 3 unmodified lines
1107else s++;1113else s++;
1108}1114}
1109if(!found_web)/*71:*/1115if(!found_web)/*71:*/
1110#line 1286 "common.w"1116#line 1292 "common.w"
1111 1117
1112{1118{
1113if(s-*argv> max_file_name_length-5)1119if(s-*argv> max_file_name_length-5)
1114/*76:*/1120/*76:*/
1115#line 1358 "common.w"1121#line 1364 "common.w"
1116fatal("! Filename too long\n",*argv);1122fatal("! Filename too long\n",*argv);
1117 1123
1118 1124
1119/*:76*/1125/*:76*/
1120#line 1289 "common.w"1126#line 1295 "common.w"
1121;1127;
1122if(dot_pos==NULL)1128if(dot_pos==NULL)
1123sprintf(web_file_name,"%s.w",*argv);1129sprintf(web_file_name,"%s.w",*argv);
@@ -1134,22 +1140,22 @@ found_web= 1; · 10 unmodified lines
1134}1140}
1135 1141
1136/*:71*/1142/*:71*/
1137#line 1269 "common.w"1143#line 1275 "common.w"
1138 1144
1139else if(!found_change)/*72:*/1145else if(!found_change)/*72:*/
1140#line 1304 "common.w"1146#line 1310 "common.w"
1141 1147
1142{1148{
1143if(strcmp(*argv,"-")==0)found_change= -1;1149if(strcmp(*argv,"-")==0)found_change= -1;
1144else{1150else{
1145if(s-*argv> max_file_name_length-4)1151if(s-*argv> max_file_name_length-4)
1146/*76:*/1152/*76:*/
1147#line 1358 "common.w"1153#line 1364 "common.w"
1148fatal("! Filename too long\n",*argv);1154fatal("! Filename too long\n",*argv);
1149 1155
1150 1156
1151/*:76*/1157/*:76*/
1152#line 1309 "common.w"1158#line 1315 "common.w"
1153;1159;
1154if(dot_pos==NULL)1160if(dot_pos==NULL)
1155sprintf(change_file_name,"%s.ch",*argv);1161sprintf(change_file_name,"%s.ch",*argv);
@@ -1159,20 +1165,20 @@ found_change= 1; · 3 unmodified lines
1159}1165}
1160 1166
1161/*:72*/1167/*:72*/
1162#line 1270 "common.w"1168#line 1276 "common.w"
1163 1169
1164else if(!found_out)/*73:*/1170else if(!found_out)/*73:*/
1165#line 1317 "common.w"1171#line 1323 "common.w"
1166 1172
1167{1173{
1168if(s-*argv> max_file_name_length-5)1174if(s-*argv> max_file_name_length-5)
1169/*76:*/1175/*76:*/
1170#line 1358 "common.w"1176#line 1364 "common.w"
1171fatal("! Filename too long\n",*argv);1177fatal("! Filename too long\n",*argv);
1172 1178
1173 1179
1174/*:76*/1180/*:76*/
1175#line 1320 "common.w"1181#line 1326 "common.w"
1176;1182;
1177if(dot_pos==NULL){1183if(dot_pos==NULL){
1178sprintf(tex_file_name,"%s.tex",*argv);1184sprintf(tex_file_name,"%s.tex",*argv);
@@ -1192,10 +1198,10 @@ found_out= 1; · 13 unmodified lines
1192}1198}
1193 1199
1194/*:73*/1200/*:73*/
1195#line 1271 "common.w"1201#line 1277 "common.w"
1196 1202
1197else/*75:*/1203else/*75:*/
1198#line 1346 "common.w"1204#line 1352 "common.w"
1199 1205
1200{1206{
1201if(program==ctangle)1207if(program==ctangle)
@@ -1209,12 +1215,12 @@ else fatal( · 7 unmodified lines
1209}1215}
1210 1216
1211/*:75*/1217/*:75*/
1212#line 1272 "common.w"1218#line 1278 "common.w"
1213;1219;
1214}1220}
1215}1221}
1216if(!found_web)/*75:*/1222if(!found_web)/*75:*/
1217#line 1346 "common.w"1223#line 1352 "common.w"
1218 1224
1219{1225{
1220if(program==ctangle)1226if(program==ctangle)
@@ -1228,7 +1234,7 @@ else fatal( · 7 unmodified lines
1228}1234}
1229 1235
1230/*:75*/1236/*:75*/
1231#line 1275 "common.w"1237#line 1281 "common.w"
1232;1238;
1233if(found_change<=0)strcpy(change_file_name,"/dev/null");1239if(found_change<=0)strcpy(change_file_name,"/dev/null");
1234}1240}
common.w+18−12
@@ -2,7 +2,7 @@ · 1 unmodified line
2% This program by Silvio Levy and Donald E. Knuth2% This program by Silvio Levy and Donald E. Knuth
3% is based on a program by Knuth.3% is based on a program by Knuth.
4% It is distributed WITHOUT ANY WARRANTY, express or implied.4% It is distributed WITHOUT ANY WARRANTY, express or implied.
5% Version 3.61 --- July 2000 (works with later versions too)5% Version 3.64 --- January 2002
6 6
7% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth7% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
8 8
@@ -17,12 +17,12 @@ · 8 unmodified lines
17 17
18\def\v{\char'174} % vertical (|) in typewriter font18\def\v{\char'174} % vertical (|) in typewriter font
19 19
20\def\title{Common code for CTANGLE and CWEAVE (Version 3.61)}20\def\title{Common code for CTANGLE and CWEAVE (Version 3.64)}
21\def\topofcontents{\null\vfill21\def\topofcontents{\null\vfill
22 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and22 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
23 {\ttitlefont CWEAVE}}23 {\ttitlefont CWEAVE}}
24 \vskip 15pt24 \vskip 15pt
25 \centerline{(Version 3.61)}25 \centerline{(Version 3.64)}
26 \vfill}26 \vfill}
27\def\botofcontents{\vfill27\def\botofcontents{\vfill
28\noindent28\noindent
@@ -291,7 +291,7 @@ do { · 262 unmodified lines
291 291
292@ @<Move |buffer| and |limit| to |change_buffer| and |change_limit|@>=292@ @<Move |buffer| and |limit| to |change_buffer| and |change_limit|@>=
293{293{
294 change_limit=change_buffer-buffer+limit;294 change_limit=change_buffer+(limit-buffer);
295 strncpy(change_buffer,buffer,limit-buffer+1);295 strncpy(change_buffer,buffer,limit-buffer+1);
296}296}
297 297
@@ -337,7 +337,7 @@ check_change() /* switches to |change_file| if the buffers match */ · 39 unmodified lines
337 return;337 return;
338 }338 }
339 if (limit>buffer+1 && buffer[0]=='@@') {339 if (limit>buffer+1 && buffer[0]=='@@') {
340 if (xisupper(buffer[1])) buffer[1]=tolower(buffer[1]);340 char xyz_code=xisupper(buffer[1])? tolower(buffer[1]): buffer[1];
341 @<If the current line starts with \.{@@y},341 @<If the current line starts with \.{@@y},
342 report any discrepancies and |return|@>;342 report any discrepancies and |return|@>;
343 }343 }
@@ -356,11 +356,11 @@ check_change() /* switches to |change_file| if the buffers match */ · 12 unmodified lines
356}356}
357 357
358@ @<If the current line starts with \.{@@y}...@>=358@ @<If the current line starts with \.{@@y}...@>=
359if (buffer[1]=='x' || buffer[1]=='z') {359if (xyz_code=='x' || xyz_code=='z') {
360 loc=buffer+2; err_print("! Where is the matching @@y?");360 loc=buffer+2; err_print("! Where is the matching @@y?");
361@.Where is the match...@>361@.Where is the match...@>
362 }362 }
363else if (buffer[1]=='y') {363else if (xyz_code=='y') {
364 if (n>0) {364 if (n>0) {
365 loc=buffer+2;365 loc=buffer+2;
366 printf("\n! Hmm... %d ",n);366 printf("\n! Hmm... %d ",n);
@@ -433,10 +433,11 @@ int get_line() /* inputs the next line */ · 66 unmodified lines
433 @<Read from |cur_file| and maybe turn on |changing|@>;433 @<Read from |cur_file| and maybe turn on |changing|@>;
434 if (changing && include_depth==change_depth) goto restart;434 if (changing && include_depth==change_depth) goto restart;
435 }435 }
436 if (input_has_ended) return 0;
436 loc=buffer; *limit=' ';437 loc=buffer; *limit=' ';
437 if (*buffer=='@@' && (*(buffer+1)=='i' || *(buffer+1)=='I')) {438 if (buffer[0]=='@@' && (buffer[1]=='i' || buffer[1]=='I')) {
438 loc=buffer+2;439 loc=buffer+2; *limit='"';
439 while (loc<=limit && (*loc==' '||*loc=='\t'||*loc=='"')) loc++;440 while (*loc==' '||*loc=='\t') loc++;
440 if (loc>=limit) {441 if (loc>=limit) {
441 err_print("! Include file name not given");442 err_print("! Include file name not given");
442@.Include file name ...@>443@.Include file name ...@>
@@ -450,7 +451,7 @@ int get_line() /* inputs the next line */ · 7 unmodified lines
450 include_depth++; /* push input stack */451 include_depth++; /* push input stack */
451 @<Try to open include file, abort push if unsuccessful, go to |restart|@>;452 @<Try to open include file, abort push if unsuccessful, go to |restart|@>;
452 }453 }
453 return (!input_has_ended);454 return 1;
454}455}
455 456
456@ When an \.{@@i} line is found in the |cur_file|, we must temporarily457@ When an \.{@@i} line is found in the |cur_file|, we must temporarily
@@ -476,7 +477,12 @@ The remainder of the \.{@@i} line after the file name is ignored. · 19 unmodified lines
476 char *k=cur_file_name, *kk;477 char *k=cur_file_name, *kk;
477 int l; /* length of file name */478 int l; /* length of file name */
478 479
479 while (*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end) *k++=*loc++;480 if (*loc=='"') {
481 loc++;
482 while (*loc!='"' && k<=cur_file_name_end) *k++=*loc++;
483 if (loc==limit) k=cur_file_name_end+1; /* unmatched quote is `too long' */
484 } else
485 while (*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end) *k++=*loc++;
480 if (k>cur_file_name_end) too_long();486 if (k>cur_file_name_end) too_long();
481@.Include file name ...@>487@.Include file name ...@>
482 *k='\0';488 *k='\0';
ctang-bs.ch+2−2
@@ -17,12 +17,12 @@ by using "huge" pointers. · 16 unmodified lines
17The ``banner line'' defined here should be changed whenever \.{CTANGLE}17The ``banner line'' defined here should be changed whenever \.{CTANGLE}
18is modified.18is modified.
19 19
20@d banner "This is CTANGLE (Version 3.62)\n"20@d banner "This is CTANGLE (Version 3.64)\n"
21@y21@y
22The ``banner line'' defined here should be changed whenever \.{CTANGLE}22The ``banner line'' defined here should be changed whenever \.{CTANGLE}
23is modified.23is modified.
24 24
25@d banner "This is CTANGLE (Version 3.62pc/big)\n"25@d banner "This is CTANGLE (Version 3.64pc/big)\n"
26@z26@z
27 27
28 28
ctang-man.ch+1−1
@@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one. · 15 unmodified lines
16}16}
17@y17@y
18\def\botofcontents{\vfill\titlefalse}18\def\botofcontents{\vfill\titlefalse}
19\def\contentspagenumber{62}19\def\contentspagenumber{63}
20\def\title{APPENDIX E: CTANGLE}20\def\title{APPENDIX E: CTANGLE}
21\let\K=\leftarrow21\let\K=\leftarrow
22@z22@z
ctang-pc.ch+2−2
@@ -9,9 +9,9 @@ that allows >64K arrays. If you need lots of bytes and toks, try the · 8 unmodified lines
9alternate change files with -bs suffix instead of -pc.9alternate change files with -bs suffix instead of -pc.
10 10
11@x section 111@x section 1
12@d banner "This is CTANGLE (Version 3.62)\n"12@d banner "This is CTANGLE (Version 3.64)\n"
13@y13@y
14@d banner "This is CTANGLE (Version 3.62pc)\n"14@d banner "This is CTANGLE (Version 3.64pc)\n"
15@z15@z
16@x section 416@x section 4
17@d max_bytes 90000 /* the number of bytes in identifiers,17@d max_bytes 90000 /* the number of bytes in identifiers,
ctang-ql.ch+4−4
@@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c -=500000 ctangle_c" · 6 unmodified lines
7 7
8 8
9@x9@x
10\def\title{CTANGLE (Version 3.62)}10\def\title{CTANGLE (Version 3.64)}
11@y11@y
12\def\title{CTANGLE (QL Version 3.62)}12\def\title{CTANGLE (QL Version 3.64)}
13@z13@z
14 14
15@x section 115@x section 1
16@d banner "This is CTANGLE (Version 3.62)\n"16@d banner "This is CTANGLE (Version 3.64)\n"
17@y17@y
18@d banner "This is CTANGLE (QL Version 3.62)\n"18@d banner "This is CTANGLE (QL Version 3.64)\n"
19@z19@z
20 20
21@x21@x
ctang-vms.ch+2−2
@@ -10,9 +10,9 @@ created: · 9 unmodified lines
10(these changes not necessary for initial bootstrapping)10(these changes not necessary for initial bootstrapping)
11 11
12@x section 1 (01-FEB-1992 ST)12@x section 1 (01-FEB-1992 ST)
13@d banner "This is CTANGLE (Version 3.62)\n"13@d banner "This is CTANGLE (Version 3.64)\n"
14@y14@y
15@d banner "This is CTANGLE (VAX/VMS Version 3.62)\n"15@d banner "This is CTANGLE (VAX/VMS Version 3.64)\n"
16@z16@z
17 17
18@x section 6 (from common.h) (01-FEB-1992 ST)18@x section 6 (from common.h) (01-FEB-1992 ST)
ctang-w32.ch+66−0
@@ -0,0 +1,66 @@
1This is the change file for CWEB's CTANGLE under Win32
2(Contributed by Fabrice Popineau, February 2002)
3
4Changes necessary for compiling with Borland C/C++
5
6@x section 1
7@d banner "This is CTANGLE (Version 3.64)\n"
8@y
9@d banner "This is CTANGLE (Version 3.64win32)\n"
10@z
11
12@x
13@ We predeclare several standard system functions here instead of including
14their system header files, because the names of the header files are not as
15standard as the names of the functions. (For example, some \CEE/ environments
16have \.{<string.h>} where others have \.{<strings.h>}.)
17
18@<Predecl...@>=
19extern int strlen(); /* length of string */
20extern int strcmp(); /* compare strings lexicographically */
21extern char* strcpy(); /* copy one string to another */
22extern int strncmp(); /* compare up to $n$ string characters */
23extern char* strncpy(); /* copy up to $n$ string characters */
24@y
25@z
26
27@x
28int names_match(p,first,l)
29name_pointer p; /* points to the proposed match */
30char *first; /* position of first character of string */
31@y
32int __cdecl names_match(p,first,l)
33name_pointer p; /* points to the proposed match */
34char *first; /* position of first character of string */
35@z
36
37@x
38void
39init_node(node)
40name_pointer node;
41{
42 node->equiv=(char *)text_info;
43}
44void
45init_p() {}
46@y
47void
48init_node(node)
49name_pointer node;
50{
51 node->equiv=(char *)text_info;
52}
53void __cdecl
54init_p() {}
55@z
56
57@x
58@ @<Include...@>=
59#include <ctype.h> /* definition of |isalpha|, |isdigit| and so on */
60#include <stdlib.h> /* definition of |exit| */
61@y
62@ @<Include...@>=
63#include <ctype.h> /* definition of |isalpha|, |isdigit| and so on */
64#include <stdlib.h> /* definition of |exit| */
65#include <string.h>
66@z
ctangle.c+61−60
@@ -15,7 +15,7 @@ · 14 unmodified lines
15/*:62*/15/*:62*/
16#line 65 "ctangle.w"16#line 65 "ctangle.w"
17 17
18#define banner "This is CTANGLE (Version 3.62)\n" \18#define banner "This is CTANGLE (Version 3.64)\n" \
19 19
20#define max_bytes 90000 \20#define max_bytes 90000 \
21 21
@@ -350,13 +350,13 @@ name_pointer cur_section_name; · 328 unmodified lines
350int no_where;350int no_where;
351 351
352/*:61*//*75:*/352/*:61*//*75:*/
353#line 1199 "ctangle.w"353#line 1195 "ctangle.w"
354 354
355text_pointer cur_text;355text_pointer cur_text;
356eight_bits next_control;356eight_bits next_control;
357 357
358/*:75*//*82:*/358/*:75*//*82:*/
359#line 1349 "ctangle.w"359#line 1350 "ctangle.w"
360 360
361extern sixteen_bits section_count;361extern sixteen_bits section_count;
362 362
@@ -388,12 +388,12 @@ void output_defs(); · 25 unmodified lines
388static void out_char();388static void out_char();
389 389
390/*:48*//*90:*/390/*:48*//*90:*/
391#line 1456 "ctangle.w"391#line 1457 "ctangle.w"
392 392
393void phase_one();393void phase_one();
394 394
395/*:90*//*92:*/395/*:90*//*92:*/
396#line 1474 "ctangle.w"396#line 1475 "ctangle.w"
397 397
398void skip_limbo();398void skip_limbo();
399 399
@@ -460,7 +460,7 @@ ccode['\'']= ord; · 60 unmodified lines
460}460}
461 461
462/*:57*//*71:*/462/*:57*//*71:*/
463#line 1120 "ctangle.w"463#line 1116 "ctangle.w"
464section_text[0]= ' ';464section_text[0]= ' ';
465 465
466/*:71*/466/*:71*/
@@ -885,7 +885,7 @@ if(get_line()==0)return(new_section); · 418 unmodified lines
885else if(print_where&&!no_where){885else if(print_where&&!no_where){
886print_where= 0;886print_where= 0;
887/*77:*/887/*77:*/
888#line 1229 "ctangle.w"888#line 1225 "ctangle.w"
889 889
890store_two_bytes(0150000);890store_two_bytes(0150000);
891if(changing)id_first= change_file_name;891if(changing)id_first= change_file_name;
@@ -910,13 +910,11 @@ if(comment_continues)return('\n'); · 18 unmodified lines
910else continue;910else continue;
911}911}
912loc++;912loc++;
913if(xisdigit(c)||c=='\\'||c=='.')/*66:*/913if(xisdigit(c)||c=='.')/*66:*/
914#line 978 "ctangle.w"914#line 978 "ctangle.w"
915{915{
916id_first= loc-1;916id_first= loc-1;
917if(*id_first=='.'&&!xisdigit(*loc))goto mistake;917if(*id_first=='.'&&!xisdigit(*loc))goto mistake;
918if(*id_first=='\\')while(xisdigit(*loc))loc++;
919else{
920if(*id_first=='0'){918if(*id_first=='0'){
921if(*loc=='x'||*loc=='X'){919if(*loc=='x'||*loc=='X'){
922loc++;while(xisxdigit(*loc))loc++;goto found;920loc++;while(xisxdigit(*loc))loc++;goto found;
@@ -931,7 +929,6 @@ if(*loc=='e'||*loc=='E'){ · 8 unmodified lines
931if(*++loc=='+'||*loc=='-')loc++;929if(*++loc=='+'||*loc=='-')loc++;
932while(xisdigit(*loc))loc++;930while(xisdigit(*loc))loc++;
933}931}
934}
935found:while(*loc=='u'||*loc=='U'||*loc=='l'||*loc=='L'932found:while(*loc=='u'||*loc=='U'||*loc=='l'||*loc=='L'
936||*loc=='f'||*loc=='F')loc++;933||*loc=='f'||*loc=='F')loc++;
937id_loc= loc;934id_loc= loc;
@@ -943,7 +940,7 @@ return(constant); · 5 unmodified lines
943 940
944else if(c=='\''||c=='"'||(c=='L'&&(*loc=='\''||*loc=='"')))941else if(c=='\''||c=='"'||(c=='L'&&(*loc=='\''||*loc=='"')))
945/*67:*/942/*67:*/
946#line 1009 "ctangle.w"943#line 1006 "ctangle.w"
947{944{
948char delim= c;945char delim= c;
949id_first= section_text+1;946id_first= section_text+1;
@@ -1001,12 +998,11 @@ id_loc= loc;return(identifier); · 51 unmodified lines
1001#line 928 "ctangle.w"998#line 928 "ctangle.w"
1002 999
1003else if(c=='@')/*68:*/1000else if(c=='@')/*68:*/
1004#line 1053 "ctangle.w"1001#line 1050 "ctangle.w"
1005{1002{
1006c= ccode[(eight_bits)*loc++];1003c= ccode[(eight_bits)*loc++];
1007switch(c){1004switch(c){
1008case ignore:continue;1005case ignore:continue;
1009case output_defs_code:output_defs_seen= 1;return(c);
1010case translit_code:err_print("! Use @l in limbo only");continue;1006case translit_code:err_print("! Use @l in limbo only");continue;
1011 1007
1012case control_text:while((c= skip_ahead())=='@');1008case control_text:while((c= skip_ahead())=='@');
@@ -1018,11 +1014,11 @@ continue; · 5 unmodified lines
1018case section_name:1014case section_name:
1019cur_section_name_char= *(loc-1);1015cur_section_name_char= *(loc-1);
1020/*70:*/1016/*70:*/
1021#line 1102 "ctangle.w"1017#line 1098 "ctangle.w"
1022{1018{
1023char*k;1019char*k;
1024/*72:*/1020/*72:*/
1025#line 1122 "ctangle.w"1021#line 1118 "ctangle.w"
1026 1022
1027k= section_text;1023k= section_text;
1028while(1){1024while(1){
@@ -1033,7 +1029,7 @@ loc= buffer+1;break; · 4 unmodified lines
1033}1029}
1034c= *loc;1030c= *loc;
1035/*73:*/1031/*73:*/
1036#line 1146 "ctangle.w"1032#line 1142 "ctangle.w"
1037 1033
1038if(c=='@'){1034if(c=='@'){
1039c= *(loc+1);1035c= *(loc+1);
@@ -1052,7 +1048,7 @@ err_print("! Nesting of section names not allowed");break; · 12 unmodified lines
1052}1048}
1053 1049
1054/*:73*/1050/*:73*/
1055#line 1131 "ctangle.w"1051#line 1127 "ctangle.w"
1056;1052;
1057loc++;if(k<section_text_end)k++;1053loc++;if(k<section_text_end)k++;
1058if(xisspace(c)){1054if(xisspace(c)){
@@ -1069,7 +1065,7 @@ printf("...");mark_harmless; · 10 unmodified lines
1069if(*k==' '&&k> section_text)k--;1065if(*k==' '&&k> section_text)k--;
1070 1066
1071/*:72*/1067/*:72*/
1072#line 1104 "ctangle.w"1068#line 1100 "ctangle.w"
1073;1069;
1074if(k-section_text> 3&&strncmp(k-2,"...",3)==0)1070if(k-section_text> 3&&strncmp(k-2,"...",3)==0)
1075cur_section_name= section_lookup(section_text+1,k-3,1);1071cur_section_name= section_lookup(section_text+1,k-3,1);
@@ -1092,16 +1088,16 @@ overflow("output files"); · 16 unmodified lines
1092}1088}
1093 1089
1094/*:40*/1090/*:40*/
1095#line 1110 "ctangle.w"1091#line 1106 "ctangle.w"
1096;1092;
1097return(section_name);1093return(section_name);
1098}1094}
1099 1095
1100/*:70*/1096/*:70*/
1101#line 1068 "ctangle.w"1097#line 1064 "ctangle.w"
1102;1098;
1103case string:/*74:*/1099case string:/*74:*/
1104#line 1168 "ctangle.w"1100#line 1164 "ctangle.w"
1105{1101{
1106id_first= loc++;*(limit+1)= '@';*(limit+2)= '>';1102id_first= loc++;*(limit+1)= '@';*(limit+2)= '>';
1107while(*loc!='@'||*(loc+1)!='>')loc++;1103while(*loc!='@'||*(loc+1)!='>')loc++;
@@ -1112,10 +1108,10 @@ return(string); · 4 unmodified lines
1112}1108}
1113 1109
1114/*:74*/1110/*:74*/
1115#line 1069 "ctangle.w"1111#line 1065 "ctangle.w"
1116;1112;
1117case ord:/*69:*/1113case ord:/*69:*/
1118#line 1081 "ctangle.w"1114#line 1077 "ctangle.w"
1119 1115
1120id_first= loc;1116id_first= loc;
1121if(*loc=='\\'){1117if(*loc=='\\'){
@@ -1138,7 +1134,7 @@ loc++; · 16 unmodified lines
1138return(ord);1134return(ord);
1139 1135
1140/*:69*/1136/*:69*/
1141#line 1070 "ctangle.w"1137#line 1066 "ctangle.w"
1142;1138;
1143default:return(c);1139default:return(c);
1144}1140}
@@ -1185,7 +1181,7 @@ return(c); · 40 unmodified lines
1185}1181}
1186 1182
1187/*:63*//*76:*/1183/*:63*//*76:*/
1188#line 1203 "ctangle.w"1184#line 1199 "ctangle.w"
1189 1185
1190void1186void
1191scan_repl(t)1187scan_repl(t)
@@ -1193,7 +1189,7 @@ eight_bits t; · 1 unmodified line
1193{1189{
1194sixteen_bits a;1190sixteen_bits a;
1195if(t==section_name){/*77:*/1191if(t==section_name){/*77:*/
1196#line 1229 "ctangle.w"1192#line 1225 "ctangle.w"
1197 1193
1198store_two_bytes(0150000);1194store_two_bytes(0150000);
1199if(changing)id_first= change_file_name;1195if(changing)id_first= change_file_name;
@@ -1205,11 +1201,11 @@ else store_two_bytes((sixteen_bits)cur_line); · 5 unmodified lines
1205app_repl(a%0400);}1201app_repl(a%0400);}
1206 1202
1207/*:77*/1203/*:77*/
1208#line 1209 "ctangle.w"1204#line 1205 "ctangle.w"
1209;}1205;}
1210while(1)switch(a= get_next()){1206while(1)switch(a= get_next()){
1211/*78:*/1207/*78:*/
1212#line 1239 "ctangle.w"1208#line 1235 "ctangle.w"
1213 1209
1214case identifier:a= id_lookup(id_first,id_loc,0)-name_dir;1210case identifier:a= id_lookup(id_first,id_loc,0)-name_dir;
1215app_repl((a/0400)+0200);1211app_repl((a/0400)+0200);
@@ -1217,7 +1213,7 @@ app_repl(a%0400);break; · 1 unmodified line
1217case section_name:if(t!=section_name)goto done;1213case section_name:if(t!=section_name)goto done;
1218else{1214else{
1219/*79:*/1215/*79:*/
1220#line 1267 "ctangle.w"1216#line 1268 "ctangle.w"
1221{1217{
1222char*try_loc= loc;1218char*try_loc= loc;
1223while(*try_loc==' '&&try_loc<limit)try_loc++;1219while(*try_loc==' '&&try_loc<limit)try_loc++;
@@ -1230,13 +1226,13 @@ if(*try_loc=='=')err_print("! Missing `@ ' before a named section"); · 6 unmodified lines
1230}1226}
1231 1227
1232/*:79*/1228/*:79*/
1233#line 1245 "ctangle.w"1229#line 1241 "ctangle.w"
1234;1230;
1235a= cur_section_name-name_dir;1231a= cur_section_name-name_dir;
1236app_repl((a/0400)+0250);1232app_repl((a/0400)+0250);
1237app_repl(a%0400);1233app_repl(a%0400);
1238/*77:*/1234/*77:*/
1239#line 1229 "ctangle.w"1235#line 1225 "ctangle.w"
1240 1236
1241store_two_bytes(0150000);1237store_two_bytes(0150000);
1242if(changing)id_first= change_file_name;1238if(changing)id_first= change_file_name;
@@ -1248,15 +1244,18 @@ else store_two_bytes((sixteen_bits)cur_line); · 5 unmodified lines
1248app_repl(a%0400);}1244app_repl(a%0400);}
1249 1245
1250/*:77*/1246/*:77*/
1251#line 1249 "ctangle.w"1247#line 1245 "ctangle.w"
1252;break;1248;break;
1253}1249}
1254case output_defs_code:1250case output_defs_code:if(t!=section_name)err_print("! Misplaced @h");
1251
1252else{
1253output_defs_seen= 1;
1255a= output_defs_flag;1254a= output_defs_flag;
1256app_repl((a/0400)+0200);1255app_repl((a/0400)+0200);
1257app_repl(a%0400);1256app_repl(a%0400);
1258/*77:*/1257/*77:*/
1259#line 1229 "ctangle.w"1258#line 1225 "ctangle.w"
1260 1259
1261store_two_bytes(0150000);1260store_two_bytes(0150000);
1262if(changing)id_first= change_file_name;1261if(changing)id_first= change_file_name;
@@ -1268,11 +1267,13 @@ else store_two_bytes((sixteen_bits)cur_line); · 5 unmodified lines
1268app_repl(a%0400);}1267app_repl(a%0400);}
1269 1268
1270/*:77*/1269/*:77*/
1271#line 1255 "ctangle.w"1270#line 1254 "ctangle.w"
1272;break;1271;
1272}
1273break;
1273case constant:case string:1274case constant:case string:
1274/*80:*/1275/*80:*/
1275#line 1278 "ctangle.w"1276#line 1279 "ctangle.w"
1276 1277
1277app_repl(a);1278app_repl(a);
1278while(id_first<id_loc){1279while(id_first<id_loc){
@@ -1286,11 +1287,11 @@ app_repl(*id_first++); · 7 unmodified lines
1286app_repl(a);break;1287app_repl(a);break;
1287 1288
1288/*:80*/1289/*:80*/
1289#line 1257 "ctangle.w"1290#line 1258 "ctangle.w"
1290;1291;
1291case ord:1292case ord:
1292/*81:*/1293/*81:*/
1293#line 1294 "ctangle.w"1294#line 1295 "ctangle.w"
1294{1295{
1295int c= (eight_bits)*id_first;1296int c= (eight_bits)*id_first;
1296if(c=='\\'){1297if(c=='\\'){
@@ -1341,7 +1342,7 @@ app_repl(constant); · 44 unmodified lines
1341break;1342break;
1342 1343
1343/*:81*/1344/*:81*/
1344#line 1259 "ctangle.w"1345#line 1260 "ctangle.w"
1345;1346;
1346case definition:case format_code:case begin_C:if(t!=section_name)goto done;1347case definition:case format_code:case begin_C:if(t!=section_name)goto done;
1347else{1348else{
@@ -1351,7 +1352,7 @@ err_print("! @d, @f and @c are ignored in C text");continue; · 3 unmodified lines
1351case new_section:goto done;1352case new_section:goto done;
1352 1353
1353/*:78*/1354/*:78*/
1354#line 1214 "ctangle.w"1355#line 1210 "ctangle.w"
1355 1356
1356case')':app_repl(a);1357case')':app_repl(a);
1357if(t==macro)app_repl(' ');1358if(t==macro)app_repl(' ');
@@ -1364,7 +1365,7 @@ cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; · 6 unmodified lines
1364}1365}
1365 1366
1366/*:76*//*83:*/1367/*:76*//*83:*/
1367#line 1356 "ctangle.w"1368#line 1357 "ctangle.w"
1368 1369
1369void1370void
1370scan_section()1371scan_section()
@@ -1379,7 +1380,7 @@ printf("*%d",section_count);update_terminal; · 8 unmodified lines
1379next_control= 0;1380next_control= 0;
1380while(1){1381while(1){
1381/*84:*/1382/*84:*/
1382#line 1395 "ctangle.w"1383#line 1396 "ctangle.w"
1383 1384
1384while(next_control<definition)1385while(next_control<definition)
1385 1386
@@ -1388,11 +1389,11 @@ loc-= 2;next_control= get_next(); · 2 unmodified lines
1388}1389}
1389 1390
1390/*:84*/1391/*:84*/
1391#line 1370 "ctangle.w"1392#line 1371 "ctangle.w"
1392;1393;
1393if(next_control==definition){1394if(next_control==definition){
1394/*85:*/1395/*85:*/
1395#line 1402 "ctangle.w"1396#line 1403 "ctangle.w"
1396{1397{
1397while((next_control= get_next())=='\n');1398while((next_control= get_next())=='\n');
1398if(next_control!=identifier){1399if(next_control!=identifier){
@@ -1411,7 +1412,7 @@ cur_text->text_link= 0; · 12 unmodified lines
1411}1412}
1412 1413
1413/*:85*/1414/*:85*/
1414#line 1372 "ctangle.w"1415#line 1373 "ctangle.w"
1415 1416
1416continue;1417continue;
1417}1418}
@@ -1421,14 +1422,14 @@ p= name_dir;break; · 3 unmodified lines
1421if(next_control==section_name){1422if(next_control==section_name){
1422p= cur_section_name;1423p= cur_section_name;
1423/*86:*/1424/*86:*/
1424#line 1427 "ctangle.w"1425#line 1428 "ctangle.w"
1425 1426
1426while((next_control= get_next())=='+');1427while((next_control= get_next())=='+');
1427if(next_control!='='&&next_control!=eq_eq)1428if(next_control!='='&&next_control!=eq_eq)
1428continue;1429continue;
1429 1430
1430/*:86*/1431/*:86*/
1431#line 1380 "ctangle.w"1432#line 1381 "ctangle.w"
1432;1433;
1433break;1434break;
1434}1435}
@@ -1436,20 +1437,20 @@ return; · 1 unmodified line
1436}1437}
1437no_where= print_where= 0;1438no_where= print_where= 0;
1438/*87:*/1439/*87:*/
1439#line 1432 "ctangle.w"1440#line 1433 "ctangle.w"
1440 1441
1441/*88:*/1442/*88:*/
1442#line 1437 "ctangle.w"1443#line 1438 "ctangle.w"
1443 1444
1444store_two_bytes((sixteen_bits)(0150000+section_count));1445store_two_bytes((sixteen_bits)(0150000+section_count));
1445 1446
1446 1447
1447/*:88*/1448/*:88*/
1448#line 1433 "ctangle.w"1449#line 1434 "ctangle.w"
1449;1450;
1450scan_repl(section_name);1451scan_repl(section_name);
1451/*89:*/1452/*89:*/
1452#line 1441 "ctangle.w"1453#line 1442 "ctangle.w"
1453 1454
1454if(p==name_dir||p==0){1455if(p==name_dir||p==0){
1455(last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text;1456(last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text;
@@ -1466,16 +1467,16 @@ cur_text->text_link= section_flag; · 10 unmodified lines
1466 1467
1467 1468
1468/*:89*/1469/*:89*/
1469#line 1435 "ctangle.w"1470#line 1436 "ctangle.w"
1470;1471;
1471 1472
1472/*:87*/1473/*:87*/
1473#line 1386 "ctangle.w"1474#line 1387 "ctangle.w"
1474;1475;
1475}1476}
1476 1477
1477/*:83*//*91:*/1478/*:83*//*91:*/
1478#line 1459 "ctangle.w"1479#line 1460 "ctangle.w"
1479 1480
1480void1481void
1481phase_one(){1482phase_one(){
@@ -1489,7 +1490,7 @@ phase= 2; · 7 unmodified lines
1489}1490}
1490 1491
1491/*:91*//*93:*/1492/*:91*//*93:*/
1492#line 1477 "ctangle.w"1493#line 1478 "ctangle.w"
1493 1494
1494void1495void
1495skip_limbo()1496skip_limbo()
@@ -1504,7 +1505,7 @@ c= *loc++; · 8 unmodified lines
1504if(ccode[(eight_bits)c]==new_section)break;1505if(ccode[(eight_bits)c]==new_section)break;
1505switch(ccode[(eight_bits)c]){1506switch(ccode[(eight_bits)c]){
1506case translit_code:/*94:*/1507case translit_code:/*94:*/
1507#line 1506 "ctangle.w"1508#line 1507 "ctangle.w"
1508 1509
1509while(xisspace(*loc)&&loc<limit)loc++;1510while(xisspace(*loc)&&loc<limit)loc++;
1510loc+= 3;1511loc+= 3;
@@ -1529,7 +1530,7 @@ translit[i-0200][loc-beg]= '\0'; · 18 unmodified lines
1529}1530}
1530 1531
1531/*:94*/1532/*:94*/
1532#line 1490 "ctangle.w"1533#line 1491 "ctangle.w"
1533;break;1534;break;
1534case format_code:case'@':break;1535case format_code:case'@':break;
1535case control_text:if(c=='q'||c=='Q'){1536case control_text:if(c=='q'||c=='Q'){
@@ -1547,7 +1548,7 @@ default:err_print("! Double @ should be used in limbo"); · 11 unmodified lines
1547}1548}
1548 1549
1549/*:93*//*95:*/1550/*:93*//*95:*/
1550#line 1532 "ctangle.w"1551#line 1533 "ctangle.w"
1551 1552
1552void1553void
1553print_stats(){1554print_stats(){
ctangle.w+28−27
@@ -2,8 +2,8 @@ · 1 unmodified line
2% This program by Silvio Levy and Donald E. Knuth2% This program by Silvio Levy and Donald E. Knuth
3% is based on a program by Knuth.3% is based on a program by Knuth.
4% It is distributed WITHOUT ANY WARRANTY, express or implied.4% It is distributed WITHOUT ANY WARRANTY, express or implied.
5% Version 3.62 --- September 20005% Version 3.64 --- February 2002
6% (same as Version 3.5 except for minor typographic/stylistic corrections)6% (same as Version 3.5 except for minor corrections)
7% (also quotes backslashes in file names of #line directives)7% (also quotes backslashes in file names of #line directives)
8 8
9% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth9% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
@@ -24,11 +24,11 @@ · 14 unmodified lines
24\mathchardef\RA="3221 % right arrow24\mathchardef\RA="3221 % right arrow
25\mathchardef\BA="3224 % double arrow25\mathchardef\BA="3224 % double arrow
26 26
27\def\title{CTANGLE (Version 3.62)}27\def\title{CTANGLE (Version 3.64)}
28\def\topofcontents{\null\vfill28\def\topofcontents{\null\vfill
29 \centerline{\titlefont The {\ttitlefont CTANGLE} processor}29 \centerline{\titlefont The {\ttitlefont CTANGLE} processor}
30 \vskip 15pt30 \vskip 15pt
31 \centerline{(Version 3.62)}31 \centerline{(Version 3.64)}
32 \vfill}32 \vfill}
33\def\botofcontents{\vfill33\def\botofcontents{\vfill
34\noindent34\noindent
@@ -59,7 +59,7 @@ Joachim Schrod, Lee Wittenberg, and others who have contributed improvements. · 24 unmodified lines
59The ``banner line'' defined here should be changed whenever \.{CTANGLE}59The ``banner line'' defined here should be changed whenever \.{CTANGLE}
60is modified.60is modified.
61 61
62@d banner "This is CTANGLE (Version 3.62)\n"62@d banner "This is CTANGLE (Version 3.64)\n"
63 63
64@c64@c
65@<Include files@>@/65@<Include files@>@/
@@ -921,7 +921,7 @@ get_next() /* produces the next input token */ · 855 unmodified lines
921 else continue;921 else continue;
922 }922 }
923 loc++;923 loc++;
924 if (xisdigit(c) || c=='\\' || c=='.') @<Get a constant@>@;924 if (xisdigit(c) || c=='.') @<Get a constant@>@;
925 else if (c=='\'' || c=='"' || (c=='L'&&(*loc=='\'' || *loc=='"')))925 else if (c=='\'' || c=='"' || (c=='L'&&(*loc=='\'' || *loc=='"')))
926 @<Get a string@>@;926 @<Get a string@>@;
927 else if (isalpha(c) || isxalpha(c) || ishigh(c))927 else if (isalpha(c) || isxalpha(c) || ishigh(c))
@@ -978,24 +978,21 @@ switch(c) { · 50 unmodified lines
978@ @<Get a constant@>= {978@ @<Get a constant@>= {
979 id_first=loc-1;979 id_first=loc-1;
980 if (*id_first=='.' && !xisdigit(*loc)) goto mistake; /* not a constant */980 if (*id_first=='.' && !xisdigit(*loc)) goto mistake; /* not a constant */
981 if (*id_first=='\\') while (xisdigit(*loc)) loc++; /* octal constant */981 if (*id_first=='0') {
982 else {982 if (*loc=='x' || *loc=='X') { /* hex constant */
983 if (*id_first=='0') {983 loc++; while (xisxdigit(*loc)) loc++; goto found;
984 if (*loc=='x' || *loc=='X') { /* hex constant */
985 loc++; while (xisxdigit(*loc)) loc++; goto found;
986 }
987 }984 }
985 }
986 while (xisdigit(*loc)) loc++;
987 if (*loc=='.') {
988 loc++;
989 while (xisdigit(*loc)) loc++;
990 }
991 if (*loc=='e' || *loc=='E') { /* float constant */
992 if (*++loc=='+' || *loc=='-') loc++;
988 while (xisdigit(*loc)) loc++;993 while (xisdigit(*loc)) loc++;
989 if (*loc=='.') {
990 loc++;
991 while (xisdigit(*loc)) loc++;
992 }
993 if (*loc=='e' || *loc=='E') { /* float constant */
994 if (*++loc=='+' || *loc=='-') loc++;
995 while (xisdigit(*loc)) loc++;
996 }
997 }994 }
998 found: while (*loc=='u' || *loc=='U' || *loc=='l' || *loc=='L'995 found: while (*loc=='u' || *loc=='U' || *loc=='l' || *loc=='L'
999 || *loc=='f' || *loc=='F') loc++;996 || *loc=='f' || *loc=='F') loc++;
1000 id_loc=loc;997 id_loc=loc;
1001 return(constant);998 return(constant);
@@ -1054,7 +1051,6 @@ whether there is more work to do. · 52 unmodified lines
1054 c=ccode[(eight_bits)*loc++];1051 c=ccode[(eight_bits)*loc++];
1055 switch(c) {1052 switch(c) {
1056 case ignore: continue;1053 case ignore: continue;
1057 case output_defs_code: output_defs_seen=1; return(c);
1058 case translit_code: err_print("! Use @@l in limbo only"); continue;1054 case translit_code: err_print("! Use @@l in limbo only"); continue;
1059@.Use @@l in limbo...@>1055@.Use @@l in limbo...@>
1060 case control_text: while ((c=skip_ahead())=='@@');1056 case control_text: while ((c=skip_ahead())=='@@');
@@ -1248,11 +1244,16 @@ case section_name: if (t!=section_name) goto done; · 187 unmodified lines
1248 app_repl(a % 0400);1244 app_repl(a % 0400);
1249 @<Insert the line number into |tok_mem|@>; break;1245 @<Insert the line number into |tok_mem|@>; break;
1250 }1246 }
1251case output_defs_code:1247case output_defs_code: if (t!=section_name) err_print("! Misplaced @@h");
1252 a=output_defs_flag;1248@.Misplaced @@h@>
1253 app_repl((a / 0400)+0200);1249 else {
1254 app_repl(a % 0400);1250 output_defs_seen=1;
1255 @<Insert the line number into |tok_mem|@>; break;1251 a=output_defs_flag;
1252 app_repl((a / 0400)+0200);
1253 app_repl(a % 0400);
1254 @<Insert the line number into |tok_mem|@>;
1255 }
1256 break;
1256case constant: case string:1257case constant: case string:
1257 @<Copy a string or verbatim construction or numerical constant@>;1258 @<Copy a string or verbatim construction or numerical constant@>;
1258case ord:1259case ord:
cweav-bs.ch+2−2
@@ -20,12 +20,12 @@ This file contributed by Barry Schwartz, trashman@crud.mn.org, 28 Jun 94. · 19 unmodified lines
20The ``banner line'' defined here should be changed whenever \.{CWEAVE}20The ``banner line'' defined here should be changed whenever \.{CWEAVE}
21is modified.21is modified.
22 22
23@d banner "This is CWEAVE (Version 3.61)\n"23@d banner "This is CWEAVE (Version 3.64)\n"
24@y24@y
25The ``banner line'' defined here should be changed whenever \.{CWEAVE}25The ``banner line'' defined here should be changed whenever \.{CWEAVE}
26is modified.26is modified.
27 27
28@d banner "This is CWEAVE (Version 3.61pc/big)\n"28@d banner "This is CWEAVE (Version 3.64pc/big)\n"
29@z29@z
30 30
31 31
cweav-man.ch+1−1
@@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one. · 15 unmodified lines
16}16}
17@y17@y
18\def\botofcontents{\vfill\titlefalse}18\def\botofcontents{\vfill\titlefalse}
19\def\contentspagenumber{107}19\def\contentspagenumber{109}
20\def\title{APPENDIX F: CWEAVE}20\def\title{APPENDIX F: CWEAVE}
21\let\K=\leftarrow21\let\K=\leftarrow
22@z22@z
cweav-pc.ch+2−2
@@ -11,9 +11,9 @@ that allows >64K arrays. (If you need lots more bytes, try the alternate · 10 unmodified lines
11change files that have -bs in their name instead of -pc.)11change files that have -bs in their name instead of -pc.)
12 12
13@x section 113@x section 1
14@d banner "This is CWEAVE (Version 3.61)\n"14@d banner "This is CWEAVE (Version 3.64)\n"
15@y15@y
16@d banner "This is CWEAVE (Version 3.61pc)\n"16@d banner "This is CWEAVE (Version 3.64pc)\n"
17@z17@z
18 18
19@x section 419@x section 4
cweav-ql.ch+4−4
@@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c =500000 cweave_c" · 6 unmodified lines
7 7
8 8
9@x9@x
10\def\title{CWEAVE (Version 3.61)}10\def\title{CWEAVE (Version 3.64)}
11@y11@y
12\def\title{CWEAVE (QL Version 3.61)}12\def\title{CWEAVE (QL Version 3.64)}
13@z13@z
14 14
15@x section 115@x section 1
16@d banner "This is CWEAVE (Version 3.61)\n"16@d banner "This is CWEAVE (Version 3.64)\n"
17@y17@y
18@d banner "This is CWEAVE (QL Version 3.61)\n"18@d banner "This is CWEAVE (QL Version 3.64)\n"
19@z19@z
20 20
21@x21@x
cweav-vms.ch+2−2
@@ -13,9 +13,9 @@ modified: · 12 unmodified lines
13(also modified by Don Knuth to keep version numbers uptodate)13(also modified by Don Knuth to keep version numbers uptodate)
14 14
15@x section 1 (01-FEB-1992 ST)15@x section 1 (01-FEB-1992 ST)
16@d banner "This is CWEAVE (Version 3.61)\n"16@d banner "This is CWEAVE (Version 3.64)\n"
17@y17@y
18@d banner "This is CWEAVE (VAX/VMS Version 3.61)\n"18@d banner "This is CWEAVE (VAX/VMS Version 3.64)\n"
19@z19@z
20 20
21@x section 6 (from common.h) (01-FEB-1992 ST)21@x section 6 (from common.h) (01-FEB-1992 ST)
cweav-w32.ch+52−0
@@ -0,0 +1,52 @@
1This is the change file for CWEB's CWEAVE under Win32
2(Contributed by Fabrice Popineau, February 2002)
3
4@x section 1
5@d banner "This is CWEAVE (Version 3.64)\n"
6@y
7@d banner "This is CWEAVE (Version 3.64win32)\n"
8@z
9
10@x
11@ We predeclare several standard system functions here instead of including
12their system header files, because the names of the header files are not as
13standard as the names of the functions. (For example, some \CEE/ environments
14have \.{<string.h>} where others have \.{<strings.h>}.)
15
16@<Predecl...@>=
17extern int strlen(); /* length of string */
18extern int strcmp(); /* compare strings lexicographically */
19extern char* strcpy(); /* copy one string to another */
20extern int strncmp(); /* compare up to $n$ string characters */
21extern char* strncpy(); /* copy up to $n$ string characters */
22@y
23@z
24
25@x
26int names_match(p,first,l,t)
27name_pointer p; /* points to the proposed match */
28@y
29int __cdecl names_match(p,first,l,t)
30name_pointer p; /* points to the proposed match */
31@z
32
33@x
34void
35init_p(p,t)
36name_pointer p;
37@y
38void __cdecl
39init_p(p,t)
40name_pointer p;
41@z
42
43@x
44@ @<Include...@>=
45#include <ctype.h> /* definition of |isalpha|, |isdigit| and so on */
46#include <stdlib.h> /* definition of |exit| */
47@y
48@ @<Include...@>=
49#include <ctype.h> /* definition of |isalpha|, |isdigit| and so on */
50#include <stdlib.h> /* definition of |exit| */
51#include <string.h> /* definition of |strncmp| and |strncpy| */
52@z
cweave.w+8−10
@@ -2,7 +2,7 @@ · 1 unmodified line
2% This program by Silvio Levy and Donald E. Knuth2% This program by Silvio Levy and Donald E. Knuth
3% is based on a program by Knuth.3% is based on a program by Knuth.
4% It is distributed WITHOUT ANY WARRANTY, express or implied.4% It is distributed WITHOUT ANY WARRANTY, express or implied.
5% Version 3.61 --- July 20005% Version 3.64 --- February 2002
6% (essentially the same as version 3.6, which added6% (essentially the same as version 3.6, which added
7% recently introduced features of standard C++ to version 3.4)7% recently introduced features of standard C++ to version 3.4)
8 8
@@ -29,11 +29,11 @@ · 20 unmodified lines
29\def\skipxTeX{\\{skip\_\TEX/}}29\def\skipxTeX{\\{skip\_\TEX/}}
30\def\copyxTeX{\\{copy\_\TEX/}}30\def\copyxTeX{\\{copy\_\TEX/}}
31 31
32\def\title{CWEAVE (Version 3.61)}32\def\title{CWEAVE (Version 3.64)}
33\def\topofcontents{\null\vfill33\def\topofcontents{\null\vfill
34 \centerline{\titlefont The {\ttitlefont CWEAVE} processor}34 \centerline{\titlefont The {\ttitlefont CWEAVE} processor}
35 \vskip 15pt35 \vskip 15pt
36 \centerline{(Version 3.61)}36 \centerline{(Version 3.64)}
37 \vfill}37 \vfill}
38\def\botofcontents{\vfill38\def\botofcontents{\vfill
39\noindent39\noindent
@@ -65,7 +65,7 @@ Crusius, and others who have contributed improvements. · 25 unmodified lines
65The ``banner line'' defined here should be changed whenever \.{CWEAVE}65The ``banner line'' defined here should be changed whenever \.{CWEAVE}
66is modified.66is modified.
67 67
68@d banner "This is CWEAVE (Version 3.61)\n"68@d banner "This is CWEAVE (Version 3.64)\n"
69 69
70@c @<Include files@>@/70@c @<Include files@>@/
71@h71@h
@@ -101,7 +101,7 @@ char **av; /* argument values */ · 29 unmodified lines
101{101{
102 argc=ac; argv=av;102 argc=ac; argv=av;
103 program=cweave;103 program=cweave;
104 make_xrefs=force_lines=1; /* controlled by command-line options */104 make_xrefs=force_lines=make_pb=1; /* controlled by command-line options */
105 common_init();105 common_init();
106 @<Set initial values@>;106 @<Set initial values@>;
107 if (show_banner) printf(banner); /* print a ``banner line'' */107 if (show_banner) printf(banner); /* print a ``banner line'' */
@@ -703,7 +703,7 @@ get_next() /* produces the next input token */ · 595 unmodified lines
703 @<Check if we're at the end of a preprocessor command@>;703 @<Check if we're at the end of a preprocessor command@>;
704 if (loc>limit && get_line()==0) return(new_section);704 if (loc>limit && get_line()==0) return(new_section);
705 c=*(loc++);705 c=*(loc++);
706 if (xisdigit(c) || c=='\\' || c=='.') @<Get a constant@>@;706 if (xisdigit(c) || c=='.') @<Get a constant@>@;
707 else if (c=='\'' || c=='"' || (c=='L'&&(*loc=='\'' || *loc=='"'))@|707 else if (c=='\'' || c=='"' || (c=='L'&&(*loc=='\'' || *loc=='"'))@|
708 || (c=='<' && sharp_include_line==1))708 || (c=='<' && sharp_include_line==1))
709 @<Get a string@>@;709 @<Get a string@>@;
@@ -805,7 +805,7 @@ switch(c) { · 95 unmodified lines
805and hexadecimal numbers; it is reasonable to stick to each convention805and hexadecimal numbers; it is reasonable to stick to each convention
806within its realm. Thus the \CEE/ part of a \.{CWEB} file has octals806within its realm. Thus the \CEE/ part of a \.{CWEB} file has octals
807introduced by \.0 and hexadecimals by \.{0x}, but \.{CWEAVE} will print807introduced by \.0 and hexadecimals by \.{0x}, but \.{CWEAVE} will print
808with \TeX/ macros that the user can redefine to fit the context.808with \TEX/ macros that the user can redefine to fit the context.
809In order to simplify such macros, we replace some of the characters.809In order to simplify such macros, we replace some of the characters.
810 810
811Notice that in this section and the next, |id_first| and |id_loc|811Notice that in this section and the next, |id_first| and |id_loc|
@@ -813,9 +813,7 @@ are pointers into the array |section_text|, not into |buffer|. · 1 unmodified line
813 813
814@<Get a constant@>= {814@<Get a constant@>= {
815 id_first=id_loc=section_text+1;815 id_first=id_loc=section_text+1;
816 if (*(loc-1)=='\\') {*id_loc++='~';816 if (*(loc-1)=='0') {
817 while (xisdigit(*loc)) *id_loc++=*loc++;} /* octal constant */
818 else if (*(loc-1)=='0') {
819 if (*loc=='x' || *loc=='X') {*id_loc++='^'; loc++;817 if (*loc=='x' || *loc=='X') {*id_loc++='^'; loc++;
820 while (xisxdigit(*loc)) *id_loc++=*loc++;} /* hex constant */818 while (xisxdigit(*loc)) *id_loc++=*loc++;} /* hex constant */
821 else if (xisdigit(*loc)) {*id_loc++='~';819 else if (xisdigit(*loc)) {*id_loc++='~';
cweb.1+76−44
@@ -1,26 +1,30 @@
1.TH CWEB 1L 6/15/921.TH CWEB 1L 2002-Apr-13
2.
2.SH NAME3.SH NAME
3ctangle, cweave \- translate CWEB to C and/or TeX4ctangle, cweave \- translate CWEB to C and/or TeX
5.
4.SH SYNOPSIS6.SH SYNOPSIS
7.na
5.B ctangle8.B ctangle
6[9[
7.B \-bhp10.B \-bhp
8] [11] [
9.B \+s12.B +s
10] webfile[.w] [changefile[.ch]] [outputfile[.c]]13] webfile[.w] [changefile[.ch]] [outputfile[.c]]
11.br14.br
12.B cweave15.B cweave
13[16[
14.B \-bfhpx17.B \-befhpx
15] [18] [
16.B \+es19.B +s
17] webfile[.w] [changefile[.ch]] [outputfile[.tex]]20] webfile[.w] [changefile[.ch]] [outputfile[.tex]]
18 21.ad
22.
19.SH DESCRIPTION23.SH DESCRIPTION
20The24The
21.I ctangle25.I ctangle
22program converts a CWEB26program converts a CWEB
23source document into a C program that may be compiled in the usual way.27source document into a C\ program that may be compiled in the usual way.
24The output file includes #line specifications so that debugging can be28The output file includes #line specifications so that debugging can be
25done in terms of the CWEB source file.29done in terms of the CWEB source file.
26.PP30.PP
@@ -34,73 +38,101 @@ extensive cross-index information that it gathers automatically. · 7 unmodified lines
34.PP38.PP
35CWEB allows you to prepare a single39CWEB allows you to prepare a single
36document containing all the information that is needed both to produce40document containing all the information that is needed both to produce
37a compilable C program and to produce a well-formatted document41a compilable C\ program and to produce a well-formatted document
38describing the program in as much detail as the writer may desire. The42describing the program in as much detail as the writer may desire.
39user of CWEB ought to be familiar with TeX as well as C.43The user of CWEB ought to be familiar with TeX as well as\ C.
40.PP44.PP
41The command line should have one, two, or three names on it.45The command line should have one, two, or three names on it.
42The first is taken as the CWEB file (and .w is added if there is no46The first is taken as the CWEB file (and .w is added if there is no
43extension). If that file cannot be opened, the extension .web is47extension).
44tried instead. (But .w is recommended, since .web usually implies Pascal.)48If that file cannot be opened, the extension .web is tried instead.
49(But .w is recommended, since .web usually implies Pascal.)
45If there is a second name, it is a change file (and .ch is added if there is50If there is a second name, it is a change file (and .ch is added if there is
46no extension). The change file overrides parts of the WEB file,51no extension).
47as described in the documentation. If there is a third name, it overrides52The change file overrides parts of the WEB file,
53as described in the documentation.
54If there is a third name, it overrides
48the default name of the output file, which is ordinarily the same as55the default name of the output file, which is ordinarily the same as
49the name of the input file (but on the current directory) with the56the name of the input file (but on the current directory) with the
50extension .c or .tex.57extension .c or .tex.
51.PP58.PP
52Options in the command line may be either turned off with -59Options in the command line may be either turned off with\ \-
53(if they are on by default) or turned on with + (if they are off by60(if they are on by default) or turned on with\ + (if they are off by
54default). In fact, the options are processed from left to right,61default).
55so a sequence like -f +f corresponds to +f (which is the default).62In fact, the options are processed from left to right,
63so a sequence like -f\ +f corresponds to +f (which is the default).
56.PP64.PP
57The65The
58.B \-b66.B \-b
59option suppresses the banner line that normally appears on your terminal67option suppresses the banner line that normally appears on your terminal
60when ctangle or cweave begins. The68when ctangle or cweave begins.
69The
61.B \-h70.B \-h
62option suppresses the happy message that normally appears if the processing71option suppresses the happy message that normally appears if the processing
63was successful. The72was successful.
73The
64.B \-p74.B \-p
65option suppresses progress reports (starred module numbers) as the processing75option suppresses progress reports (starred module numbers) as the processing
66takes place. If you say -bhp, you get nothing but error messages.76takes place.
77If you say -bhp, you get nothing but error messages.
67.PP78.PP
68The \+s option prints statistics about memory usage at the end of a run79The
80.B +s
81option prints statistics about memory usage at the end of a run
69(assuming that the programs have been compiled with the -DSTAT switch).82(assuming that the programs have been compiled with the -DSTAT switch).
70.PP83.PP
71The \+e option encloses C material formatted by84There are three other options applicable to
72.I cweave
73in brackets
74\\PB\{...\}, so that special hooks can be used. This is commonly used by
75.I cweb-latex
76, although it can mess up index entries of PDF output if
77module names refer to C objects (as they often do).
78.PP
79There are two other options applicable to
80.I cweave85.I cweave
81only:86only:
82.B \-f87.B \-f
83means do not force a newline after every statement in the formatted output.88means do not force a newline after every statement in the formatted output.
89.B \-e
90inhibits the enclosure of C\ material formatted by
91.I cweave
92in brackets
93\ePB{...}.
94Such brackets are normally inserted so that special hooks
95can be used by
96.I cweb-latex
97and similar programs.
84.B \-x98.B \-x
85means omit the index and table of contents.99means omit the index and table of contents.
86.PP100.
87.SH FILES101.SH FILES
88/usr/local/lib/tex/inputs/cwebmac.tex TeX macros used by cweave output.102.TP
89.br103/usr/local/lib/tex/inputs/cwebmac.tex
90/usr/local/src/cweb/cwebman.tex The user manual.104TeX macros used by cweave output.
91.br105.TP
92/usr/local/src/cweb/examples/wc.w An introductory example.106/usr/local/src/cweb/cwebman.tex
93.br107The user manual.
94/usr/local/lib/cweb Directory for cweb "include" files.108.TP
109/usr/local/src/cweb/examples/wc.w
110An introductory example.
111.TP
112/usr/local/src/cweb/examples/wmerge.w
113Patch program based on CWEB-style change files.
114.TP
115/usr/local/lib/cweb
116Directory for cweb "include" files.
117.
95.SH "SEE ALSO"118.SH "SEE ALSO"
119.TP
96.I Literate Programming120.I Literate Programming
97by D.E. Knuth.121by D. E. Knuth
98.br122.TP
99.I Weaving a Program123.I Weaving a Program
100by Wayne Sewell124by Wayne Sewell
101.br125.TP
126.I The CWEB System of Structured Documentation
127by Donald E. Knuth and Silvio Levy (hardcopy version of cwebman.tex
128and the source code listings)
129.TP
102tex(1), cc(1)130tex(1), cc(1)
103.SH "AUTHORS"131.
104Don Knuth wrote WEB for TeX and Pascal. Silvio Levy designed and developed CWEB132.SH AUTHORS
105by adapting the WEB conventions to C and by recoding everything in CWEB.133Don Knuth wrote WEB for TeX and Pascal.
134Silvio Levy designed and developed CWEB
135by adapting the WEB conventions to\ C and by recoding everything in CWEB.
106Knuth began using CWEB and made further refinements.136Knuth began using CWEB and made further refinements.
137Many other helpers are acknowledged in the CWEB manual.
138
cwebmac.tex+178−79
@@ -1,15 +1,16 @@
1% standard macros for CWEB listings (in addition to plain.tex)1% standard macros for CWEB listings (in addition to plain.tex)
2% Version 3.63 --- January 20012% Version 3.64 --- February 2002
3\ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros3\ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros
4\xdef\fmtversion{\fmtversion+CWEB3.63}4\xdef\fmtversion{\fmtversion+CWEB3.64}
5\chardef\cwebversion=3 \chardef\cwebrevision=64
5\newif\ifpdf6\newif\ifpdf
6\ifx\pdf+\pdftrue\fi7\ifx\pdf+\pdftrue\fi
7% Uncomment the following line if you want PDF goodies to be the default8% Uncomment the following line if you want PDF goodies to be the default
8%\ifx\pdf-\else\pdftrue\fi9%\ifx\pdf-\else\pdftrue\fi
9\def\pdflinkcolor{0 0 1} % the RGB values for hyperlink color10\def\pdflinkcolor{0 0 1} % the RGB values for hyperlink color
10\newif\ifpdftex11\newif\ifpdftex
11\ifx\pdfoutput\undefined \pdftexfalse12\ifx\pdfoutput\undefined \pdftexfalse \else\ifnum\pdfoutput=0 \pdftexfalse
12\else \pdftextrue \pdfoutput=1 \pdfcompresslevel=9 \input pdfcolor \fi13\else \pdftextrue \pdfoutput=1 \input pdfcolor \let\setcolor\pdfsetcolor \fi\fi
13\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi14\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
14 15
15\let\:=\. % preserve a way to get the dot accent16\let\:=\. % preserve a way to get the dot accent
@@ -120,49 +121,52 @@ · 104 unmodified lines
120\def\?{\mathrel?}121\def\?{\mathrel?}
121\def\note#1#2.{\Y\noindent{\hangindent2em%122\def\note#1#2.{\Y\noindent{\hangindent2em%
122 \baselineskip10pt\eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}}123 \baselineskip10pt\eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}}
123% The following are pdf macros124
124\newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD125\newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD
126\newtoks\toksE \newtoks\toksF \newtoks\usersanitizer
125\newcount\countA \countA=0 \newcount\countB \countB=0127\newcount\countA \countA=0 \newcount\countB \countB=0
126\def\thewidth{\the\wd0\space}128\newcount\countC \countC=0
127\def\theheight{\the\ht0\space}129\newif\iftokprocessed \newif\ifTnum \newif\ifinstr
128\def\thedepth{\the\dp0\space}130{\def\\{\global\let\spacechar= }\\ }
131
132\ifacro % The following are pdf macros
133\def\thewidth{\the\wd0 \space}
134\def\theheight{\the\ht\strutbox\space}
135\def\thedepth{\the\dp\strutbox\space}
129\ifpdftex136\ifpdftex
130 \ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14137 \ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14
131 \def\pdflink#1#2{\hbox{\pdfannotlink attr{/Border [0 0 0]} goto num #1138 \def\pdflink#1#2{\hbox{\pdfannotlink height\ht\strutbox depth\dp\strutbox
132 \BlueGreen #1\Black\pdfendlink}}139 attr{/Border [0 0 0]} goto num #1 \BlueGreen #1\Black\pdfendlink}}
133\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%140\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
134 \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight141 \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
135 \space depth \thedepth\space << /Type /Annot /Subtype /Link142 depth \thedepth << /Type /Annot /Subtype /Link
136 /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi143 /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi
137\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA}144\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA}
138\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}145\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}%
139 \def\makenote{\addtokens{\toksB}{\the\toksC}\def\makenote{\toksD={}146 \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={}
140 \toksC={}\let\space\empty}\makenote}\maketoks}}147 \toksC={}\let\space\empty}\makenote}\maketoks}}
141\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}148\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
142\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}149\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}%
143\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}150 \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}}
144\def\maketoks{%151\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|%
145 \expandafter\poptoks\the\toksA|ENDTOKS|152 \ifnum\countB>`9 \countB=0 \fi
146 \ifx\first0\adn0153 \ifnum\countB<`0
147 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3154 \ifnum0=\countC\else\makenote\fi
148 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6155 \ifx\first.\let\next=\maketoksdone\else
149 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9156 \let\next=\maketoks
150 \else157 \addtokens\toksB{\the\toksD}
151 \ifnum0=\countA\else\makenote\fi158 \ifx\first,\addtokens\toksB{\space}\fi
152 \ifx\first.\let\next=\done\else159 \fi
153 \let\next=\maketoks160 \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks
154 \addtokens{\toksB}{\the\toksD}161 \fi
155 \ifx\first,\addtokens{\toksB}{\space}\fi162 \next
156 \fi
157 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
158 \next
159}163}
160\def\makenote{\addtokens{\toksB}%164\def\makenote{\addtokens\toksB
161 {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countA=0}165 {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0}
162\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}166\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
163\def\pdfURL#1#2{\ifpdftex\pdfannotlink attr {/Border [0 0 0]} user {167\def\pdfURL#1#2{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox
164 /Type /Action /Subtype /Link /A << /S /URI /URI (#2) >>168 attr {/Border [0 0 0]} user { /Type /Action /Subtype /Link /A
165 }\BlueGreen #1\Black \pdfendlink169 << /S /URI /URI (#2) >>}\BlueGreen #1\Black \pdfendlink
166 \else \ifpdf{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%170 \else \ifpdf{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
167 \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight171 \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight
168 \space depth \thedepth\space << /Border [0 0 0]172 \space depth \thedepth\space << /Border [0 0 0]
@@ -170,7 +174,105 @@ · 1 unmodified line
170 \else #1 ({\tt#2})\fi\fi}174 \else #1 ({\tt#2})\fi\fi}
171{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL175{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
172{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL176{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
173% End of pdf macros177\def\sanitizecommand#1#2{\addtokens\usersanitizer
178 {\noexpand\dosanitizecommand\noexpand#1{#2}}}
179\def\dosanitizecommand#1#2{\ifx\nxt#1\addF{#2}\fi}
180
181\catcode`\[=1 \catcode`\]=2 \catcode`\{=12 \catcode`\}=12
182 \def\lbchar[{] \def\rbchar[}]
183\catcode`\[=12 \catcode`\]=12 \catcode`\{=1 \catcode`\}=2
184\catcode`\~=12 \def\tildechar{~} \catcode`\~=13
185\catcode`\|=0 |catcode`|\=12 |def|bschar{\} |catcode`|\=0 \catcode`\|=12
186\def\makeoutlinetoks{\Tnumfalse\afterassignment\makeolproctok\let\nxt= }
187\def\makeolnexttok{\afterassignment\makeolproctok\let\nxt= }
188\def\makeolgobbletok{\afterassignment\makeolnexttok\let\nxt= }
189\def\addF#1{\addtokens\toksF{#1}\tokprocessedtrue}
190% now comes a routine to "sanitize" section names, for pdf outlines
191\def\makeolproctok{\tokprocessedfalse
192 \let\next\makeolnexttok % default
193 \ifx\nxt\outlinedone\let\next\outlinedone
194 \else\ifx{\nxt \else\ifx}\nxt \Tnumfalse \instrfalse % skip braces
195 \else\ifx$\nxt % or a $ sign
196 \else\ifx^\nxt \addF^\else\ifx_\nxt \addF_% sanitize ^ and _
197 \else\ifx\nxt\spacechar \addF\space
198 \else\if\noexpand\nxt\relax % we have a control sequence; is it one we know?
199 \ifx\nxt~\addF\space
200 \else\ifx\nxt\onespace\addF\space
201 \else\the\usersanitizer
202 \iftokprocessed\else\makeolproctokctli
203 \iftokprocessed\else\makeolproctokctlii
204 \iftokprocessed\else\makeolproctokctliii % if not recognised, skip it
205 \fi\fi\fi\fi\fi
206 \else % we don't have a control sequence, it's an ordinary char
207 \ifx/\nxt \addF{\string\/}% quote chars special to PDF with backslash
208 \else\ifx(\nxt \addF{\string\(}\else\ifx)\nxt \addF{\string\)}%
209 \else\ifx[\nxt \addF{\string\[}\else\ifx]\nxt \addF{\string\]}%
210 \else\expandafter\makeolproctokchar\meaning\nxt
211 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
212 \next
213}
214\def\makeolproctokchar#1 #2 #3{\addF{#3}}
215\def\makeolproctokctli{%
216 \ifx\nxt\CEE\addF{C}\let\next\makeolgobbletok % \CEE/
217 \else\ifx\nxt\UNIX\addF{UNIX}\let\next\makeolgobbletok % \UNIX/
218 \else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/
219 \else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}%
220 \else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/
221 \else\ifx\nxt\Cee\addF{C}%
222 \else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...}
223 \else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...}
224 % skip \|
225 \else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi
226 \else\ifx\nxt\&\ifinstr\addF&\else\tokprocessedtrue\fi
227 \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77}
228 \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5}
229 \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77}
230 \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi % \T{77\$L}
231 \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar
232 \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}%
233 \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}%
234 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
235}
236\def\makeolproctokctlii{%
237 \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}%
238 \else\ifx\nxt\LL\addF{<<}\else\ifx\nxt\NULL\addF{NULL}%
239 \else\ifx\nxt\AND\addF&\else\ifx\nxt\OR\addF|%
240 \else\ifx\nxt\XOR\addF^\else\ifx\nxt\CM\addF\tildechar
241 \else\ifx\nxt\MOD\addF{\string\%}\else\ifx\nxt\DC\addF{::}%
242 \else\ifx\nxt\PA\addF{.*}\else\ifx\nxt\MGA\addF{->*}%
243 \else\ifx\nxt\this\addF{this}\else\ifx\nxt\?\addF?%
244 \else\ifx\nxt\E\addF{==}\else\ifx\nxt\G\addF{>=}%
245 \else\ifx\nxt\I\addF{!=}\else\ifx\nxt\K\addF{=}%
246 \else\ifx\nxt\l\addF{l}\else\ifx\nxt\L\addF{L}%
247 \else\ifx\nxt\o\addF{o}\else\ifx\nxt\O\addF{O}%
248 \else\ifx\nxt\R\addF!%
249 \else\ifx\nxt\T \Tnumtrue \let\next\makeolgobbletok
250 \tokprocessedtrue % \T{number}
251 \else\ifx\nxt\AM\addF&\else\ifx\nxt\%\addF{\string\%}%
252 \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi
253 \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi
254 \fi\fi\fi\fi\fi\fi
255}
256\def\makeolproctokctliii{%
257 \ifx\nxt\V\addF{||}\else\ifx\nxt\W\addF{&&}\else\ifx\nxt\Z\addF{<=}%
258 \else\ifx\nxt\*\addF*\else\ifx\nxt\Xand\addF{\space and\space}%
259 \else\ifx\nxt\Xandxeq\addF{\space and_eq\space}%
260 \else\ifx\nxt\Xbitand\addF{\space bitand\space}%
261 \else\ifx\nxt\Xbitor\addF{\space bitor\space}%
262 \else\ifx\nxt\Xcompl\addF{\space compl\space}%
263 \else\ifx\nxt\Xnot\addF{\space not\space}%
264 \else\ifx\nxt\Xnotxeq\addF{\space not_eq\space}%
265 \else\ifx\nxt\Xor\addF{\space or\space}%
266 \else\ifx\nxt\Xorxeq\addF{\space or_eq\space}%
267 \else\ifx\nxt\Xxor\addF{\space xor\space}%
268 \else\ifx\nxt\Xxorxeq\addF{\space xor_eq\space}%
269 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
270 \fi\fi\fi\fi\fi
271}
272\def\outlinedone{\edef\outlinest{\global\noexpand\toksE={\the\toksF}}%
273 \outlinest\let\outlinedone=\relax}
274\fi % End of pdf macros
275
174\def\lapstar{\rlap{*}}276\def\lapstar{\rlap{*}}
175\def\stsec{\rightskip=0pt % get out of C mode (cf. \B)277\def\stsec{\rightskip=0pt % get out of C mode (cf. \B)
176 \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50278 \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
@@ -208,13 +310,20 @@ · 31 unmodified lines
208% \L is Polish letter suppressed-L310% \L is Polish letter suppressed-L
209\outer\def\M#1{\MN{#1}\ifon\vfil\penalty-100\vfilneg % beginning of section311\outer\def\M#1{\MN{#1}\ifon\vfil\penalty-100\vfilneg % beginning of section
210 \vskip\intersecskip\startsection\ignorespaces}312 \vskip\intersecskip\startsection\ignorespaces}
211\outer\def\N#1#2#3.{\gdepth=#1\gtitle={#3}\MN{#2}% beginning of starred section313\outer\def\N#1#2#3.{% beginning of starred section
314 \ifacro{\toksF={}\makeoutlinetoks#3\outlinedone\outlinedone}\fi
315 \gdepth=#1\gtitle={#3}\MN{#2}%
212 \ifon\ifnum#1<\secpagedepth \vfil\eject % force page break if depth is small316 \ifon\ifnum#1<\secpagedepth \vfil\eject % force page break if depth is small
213 \else\vfil\penalty-100\vfilneg\vskip\intersecskip\fi\fi317 \else\vfil\penalty-100\vfilneg\vskip\intersecskip\fi\fi
214 \message{*\secno} % progress report318 \message{*\secno} % progress report
215 \edef\next{\write\cont{\ZZ{#3}{#1}{\secno}% write to contents file319 \def\stripprefix##1>{}\def\gtitletoks{#3}%
216 {\noexpand\the\pageno}}}\next % \ZZ{title}{depth}{sec}{page}320 \edef\gtitletoks{\expandafter\stripprefix\meaning\gtitletoks}%
217 \ifpdf\special{pdf: outline #1 << /Title (#3) /Dest321 \edef\next{\write\cont{\ZZ{\gtitletoks}{#1}{\secno}% write to contents file
322 {\noexpand\the\pageno}{\the\toksE}}}\next % \ZZ{title}{depth}{sec}{page}{ss}
323 \ifpdftex\expandafter\xdef\csname curr#1\endcsname{\secno}
324 \ifnum#1>0\countB=#1 \advance\countB by-1
325 \advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi\fi
326 \ifpdf\special{pdf: outline #1 << /Title (\the\toksE) /Dest
218 [ @thispage /FitH @ypos ] >>}\fi327 [ @thispage /FitH @ypos ] >>}\fi
219 \ifon\startsection{\bf#3.\quad}\ignorespaces}328 \ifon\startsection{\bf#3.\quad}\ignorespaces}
220\def\MN#1{\par % common code for \M, \N329\def\MN#1{\par % common code for \M, \N
@@ -245,17 +354,9 @@ · 24 unmodified lines
245\let\ZZ=\let % now you can \write the control sequence \ZZ354\let\ZZ=\let % now you can \write the control sequence \ZZ
246\let\*=*355\let\*=*
247 356
248\let\Xand=\W357\def\Xand{\W} \def\Xandxeq{\MRL{{\AND}{\K}}} \def\Xbitand{\AND}
249\def\Xandxeq{\MRL{{\W}{\K}}}358\def\Xbitor{\OR} \def\Xcompl{\CM} \def\Xnot{\R} \def\Xnotxeq{\I} \def\Xor{\V}
250\let\Xbitand=\AND359\def\Xorxeq{\MRL{{\OR}{\K}}} \def\Xxor{\XOR} \def\Xxorxeq{\MRL{{\XOR}{\K}}}
251\let\Xbitor=\OR
252\let\Xcompl=\CM
253\let\Xnot=\R
254\let\Xnotxeq=\I
255\let\Xor=\V
256\def\Xorxeq{\MRL{{\OR}{\K}}}
257\let\Xxor=\XOR
258\def\Xxorxeq{\MRL{{\XOR}{\K}}}
259 360
260%\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style361%\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
261%\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style362%\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
@@ -268,10 +369,11 @@ · 6 unmodified lines
268\def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue369\def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue
269\newif\ifon \newif\iftitle \newif\ifpagesaved370\newif\ifon \newif\iftitle \newif\ifpagesaved
270 371
271\def\lheader{\mainfont\the\pageno\eightrm\qquad\grouptitle\hfill\title\qquad372\newif\ifheader
272 \mainfont\topsecno} % top line on left-hand pages373\def\lheader{\headertrue\mainfont\the\pageno\eightrm\qquad\grouptitle
273\def\rheader{\mainfont\topsecno\eightrm\qquad\title\hfill\grouptitle374 \hfill\title\qquad\mainfont\topsecno} % top line on left-hand pages
274 \qquad\mainfont\the\pageno} % top line on right-hand pages375\def\rheader{\headertrue\mainfont\topsecno\eightrm\qquad\title\hfill
376 \grouptitle\qquad\mainfont\the\pageno} % top line on right-hand pages
275\def\grouptitle{\let\i=I\let\j=J\uppercase\expandafter{\expandafter377\def\grouptitle{\let\i=I\let\j=J\uppercase\expandafter{\expandafter
276 \takethree\topmark}}378 \takethree\topmark}}
277\def\topsecno{\expandafter\takeone\topmark}379\def\topsecno{\expandafter\takeone\topmark}
@@ -356,18 +458,6 @@ · 78 unmodified lines
356 \if L\lr\else\null\vfill\eject\fi % finish the current page458 \if L\lr\else\null\vfill\eject\fi % finish the current page
357 \parfillskip 0pt plus 1fil459 \parfillskip 0pt plus 1fil
358 \def\grouptitle{NAMES OF THE SECTIONS}460 \def\grouptitle{NAMES OF THE SECTIONS}
359 \ifacro \def\outsecname{Names of the sections} \let\Xpdf\X \fi
360 \ifpdftex \makebookmarks \pdfdest name {NOS} fitb
361 \pdfoutline goto name {NOS} count -\secno {\outsecname}
362 \def\X##1:##2\X{\Xpdf##1:##2\X
363 \firstsecno##1.\toks0{##2}\pdfoutline goto num \the\toksA {\the\toks0}}
364 \else\ifpdf
365 \special{pdf: outline -1 << /Title (\outsecname)
366 /Dest [ @thispage /FitH @ypos ] >>}
367 \def\X##1:##2\X{\Xpdf##1:##2\X
368 \firstsecno##1.\toks0{##2} \special{pdf: outline 0 << /Title
369 (\the\toks0) /A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
370 \fi\fi
371 \let\topsecno=\nullsec461 \let\topsecno=\nullsec
372 \message{Section names:}462 \message{Section names:}
373 \output={\normaloutput\page\lheader\rheader}463 \output={\normaloutput\page\lheader\rheader}
@@ -378,20 +468,29 @@ · 4 unmodified lines
378 \def\U{\note{Used in section}} % crossref for use of a section468 \def\U{\note{Used in section}} % crossref for use of a section
379 \def\Us{\note{Used in sections}} % crossref for uses of a section469 \def\Us{\note{Used in sections}} % crossref for uses of a section
380 \def\I{\par\hangindent 2em}\let\*=*470 \def\I{\par\hangindent 2em}\let\*=*
471 \ifacro \def\outsecname{Names of the sections} \let\Xpdf\X
472 \ifpdftex \makebookmarks \pdfdest name {NOS} fitb
473 \pdfoutline goto name {NOS} count -\secno {\outsecname}
474 \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
475 {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
476 \pdfoutline goto num \the\toksA \expandafter{\the\toksE}}
477 \else\ifpdf
478 \special{pdf: outline -1 << /Title (\outsecname)
479 /Dest [ @thispage /FitH @ypos ] >>}
480 \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
481 {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
482 \special{pdf: outline 0 << /Title (\the\toksE)
483 /A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
484 \fi\fi\fi
381 \readsections}485 \readsections}
382\def\makebookmarks{% read contents info for PDF outlines (twice)486\def\makebookmarks{\let\ZZ=\writebookmarkline \readcontents\relax}
383 \let\ZZ=\scanbookmarkline \readcontents\relax
384 \let\ZZ=\writebookmarkline \readcontents\relax}
385\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%487\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
386 \else \csname#1\endcsname \fi} % Petr Olsak's macros from texinfo.tex488 \else \csname#1\endcsname \fi} % Petr Olsak's macros from texinfo.tex
387\def\advancenumber#1{\countA=\expnumber{#1}\relax \advance\countA by1489\def\advancenumber#1{\countA=\expnumber{#1}\relax \advance\countA by1
388 \expandafter\xdef\csname#1\endcsname{\the\countA}}490 \expandafter\xdef\csname#1\endcsname{\the\countA}}
389\def\scanbookmarkline#1#2#3#4{% remember last level item and add to parent491\def\writebookmarkline#1#2#3#4#5{{%
390 \expandafter\xdef\csname curr#2\endcsname{#3}492 \let\(=\let \let\)=\let \let\[=\let \let\]=\let \let\/=\let
391 \ifnum#2>0\countB=#2 \advance\countB by-1493 \pdfoutline goto num #3 count -\expnumber{chunk#2.#3} {#5}}}
392 \advancenumber{chunk\the\countB.\expnumber{curr\the\countB}}\fi}
393\def\writebookmarkline#1#2#3#4{\pdfoutline goto num #3
394 count -\expnumber{chunk#2.#3}{#1}}
395\def\con{\par\vfill\eject % finish the section names494\def\con{\par\vfill\eject % finish the section names
396% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers495% \ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers
397 \rightskip 0pt \hyphenpenalty 50 \tolerance 200496 \rightskip 0pt \hyphenpenalty 50 \tolerance 200
@@ -405,7 +504,7 @@ · 7 unmodified lines
405 \let\ZZ=\contentsline504 \let\ZZ=\contentsline
406 \readcontents\relax % read the contents info505 \readcontents\relax % read the contents info
407 \botofcontents \end} % print the contents page(s) and terminate506 \botofcontents \end} % print the contents page(s) and terminate
408\def\contentsline#1#2#3#4{\ifnum#2=0 \smallbreak\fi507\def\contentsline#1#2#3#4#5{\ifnum#2=0 \smallbreak\fi
409 \line{\consetup{#2}#1508 \line{\consetup{#2}#1
410 \rm\leaders\hbox to .5em{.\hfil}\hfil509 \rm\leaders\hbox to .5em{.\hfil}\hfil
411 \ \ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}}510 \ \ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}}
cwebman.tex+61−13
@@ -2,6 +2,7 @@ · 1 unmodified line
2 2
3\def\tangref{3} % where the main explanation of CTANGLing is given3\def\tangref{3} % where the main explanation of CTANGLing is given
4\input cwebmac4\input cwebmac
5\acrofalse\pdffalse\pdftexfalse
5\def\page{\box255 } \normalbottom6\def\page{\box255 } \normalbottom
6\parskip 0pt plus 1pt7\parskip 0pt plus 1pt
7\def\RA{\char'31 } % right arrow8\def\RA{\char'31 } % right arrow
@@ -34,7 +35,7 @@ · 26 unmodified lines
34 35
35\def\lheader{\mainfont\the\pageno\hfill\sc\runninghead\hfill}36\def\lheader{\mainfont\the\pageno\hfill\sc\runninghead\hfill}
36\def\rheader{\hfill\sc\runninghead\hfill\mainfont\the\pageno}37\def\rheader{\hfill\sc\runninghead\hfill\mainfont\the\pageno}
37\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 3.63)}38\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 3.64)}
38 39
39% This verbatim mode assumes that ! marks are !! in the text being copied.40% This verbatim mode assumes that ! marks are !! in the text being copied.
40\def\verbatim{\begingroup41\def\verbatim{\begingroup
@@ -48,7 +49,7 @@ · 7 unmodified lines
48\null\vfill49\null\vfill
49\centerline{\titlefont The {\ttitlefont CWEB} System of50\centerline{\titlefont The {\ttitlefont CWEB} System of
50 Structured Documentation}51 Structured Documentation}
51\vskip 18pt\centerline{(Version 3.63 --- January 2001)}52\vskip 18pt\centerline{(Version 3.64 --- February 2002)}
52\vskip 24pt53\vskip 24pt
53\centerline{\authorfont Donald E. Knuth and Silvio Levy}54\centerline{\authorfont Donald E. Knuth and Silvio Levy}
54\vfill55\vfill
@@ -1143,8 +1144,9 @@ $$\vbox{\halign{\.{#}\hfil\cr · 1088 unmodified lines
1143tex "\\let\\pdf+ \\input cob"\cr1144tex "\\let\\pdf+ \\input cob"\cr
1144dvipdfm cob\cr1145dvipdfm cob\cr
1145acroread cob.pdf\cr}}$$1146acroread cob.pdf\cr}}$$
1146instead of invoking \TeX\ in the normal way. (Thanks to Hans Hagen and1147instead of invoking \TeX\ in the normal way. (Thanks to Hans Hagen,
1147C\'esar Augusto Rorato Crusius for the macros that make this work.)1148C\'esar Augusto Rorato Crusius, and Julian Gilbey
1149for the macros that make this work.)
1148Alternatively, thanks to H\`an Th\^e\kern-.3em\raise.3ex\hbox{\'{}} Th\`anh1150Alternatively, thanks to H\`an Th\^e\kern-.3em\raise.3ex\hbox{\'{}} Th\`anh
1149and Andreas Scherer, you can generate \.{cob.pdf} in one step by simply1151and Andreas Scherer, you can generate \.{cob.pdf} in one step by simply
1150saying `\.{pdftex}~\.{cob}'.1152saying `\.{pdftex}~\.{cob}'.
@@ -1493,10 +1495,12 @@ features needed by the output of \.{CWEAVE}. · 342 unmodified lines
1493 1495
1494\vskip6pt1496\vskip6pt
1495\begingroup \def\tt{\eighttt} \baselineskip9pt1497\begingroup \def\tt{\eighttt} \baselineskip9pt
1496\def\printmacs{\input cwebmac}1498\def\printmacs{\begingroup
1497\verbatim1499 \def\do##1{\catcode`##1=12 } \dospecials
1498!printmacs1500 \parskip 0pt \parindent 0pt
1499!endgroup1501 \catcode`\ =13 \catcode`\^^M=13
1502 \tt \verbatimdefs \input cwebmac \endgroup}
1503\printmacs
1500\endgroup1504\endgroup
1501\vfill\eject1505\vfill\eject
1502 1506
@@ -1521,7 +1525,7 @@ it `\.{|identifier|}'. But you can also say `\.{\\\\\{identifier\}}'. The · 18 unmodified lines
1521output will look the same in both cases, but the second alternative1525output will look the same in both cases, but the second alternative
1522doesn't put \\{identifier} into the index, since1526doesn't put \\{identifier} into the index, since
1523it bypasses \.{CWEAVE}'s translation from \CEE/ mode. In the second1527it bypasses \.{CWEAVE}'s translation from \CEE/ mode. In the second
1524case you have to put a backslash before each underline character1528case you must put a backslash before each underline character
1525in the identifier.1529in the identifier.
1526 1530
1527\point 3. To get typewriter-like type, as when referring to `\.{CWEB}', you1531\point 3. To get typewriter-like type, as when referring to `\.{CWEB}', you
@@ -1574,7 +1578,7 @@ $$\lpile{\.{\\def\\topofcontents\{\\null\\vfill}\cr · 46 unmodified lines
1574 \.{ { }\\titlefalse \% include headline on the contents page}\cr1578 \.{ { }\\titlefalse \% include headline on the contents page}\cr
1575 \.{ { }\\def\\rheader\{\\mainfont The \{\\tt CWEAVE\}{ }processor\\hfil\}}\cr1579 \.{ { }\\def\\rheader\{\\mainfont The \{\\tt CWEAVE\}{ }processor\\hfil\}}\cr
1576 \.{ { }\\centerline\{\\titlefont The \{\\ttitlefont CWEAVE\}{ }processor\}}\cr1580 \.{ { }\\centerline\{\\titlefont The \{\\ttitlefont CWEAVE\}{ }processor\}}\cr
1577 \.{ { }\\vskip 15pt \\centerline\{(Version 3.61)\}{ }\\vfill\}}\cr}$$1581 \.{ { }\\vskip 15pt \\centerline\{(Version 3.64)\}{ }\\vfill\}}\cr}$$
1578Redefining \.{\\rheader}, which is the headline for right-hand pages,1582Redefining \.{\\rheader}, which is the headline for right-hand pages,
1579suffices in this case to put the desired information at the top of the1583suffices in this case to put the desired information at the top of the
1580contents page.1584contents page.
@@ -1582,10 +1586,11 @@ contents page. · 1 unmodified line
1582\point 9. Data for the table of contents is written to a file that1586\point 9. Data for the table of contents is written to a file that
1583is read after the indexes have been \TEX/ed; there's one line of data1587is read after the indexes have been \TEX/ed; there's one line of data
1584for every starred section. The file \.{common.toc} might look like this:1588for every starred section. The file \.{common.toc} might look like this:
1585$$\lpile{\.{\\ZZ \{Introduction\}\{0\}\{1\}\{26\}}\cr1589$$\lpile{\.{\\ZZ \{Introduction\}\{0\}\{1\}\{28\}\{\}}\cr
1586 \.{\\ZZ \{The character set\}\{2\}\{5\}\{27\}}\cr}$$1590 \.{\\ZZ \{The character set\}\{2\}\{5\}\{29\}\{\}}\cr}$$
1587and so on. The \.{\\topofcontents} macro could1591and so on. The \.{\\topofcontents} macro could
1588redefine \.{\\ZZ} so that the information appears in any desired format.1592redefine \.{\\ZZ} so that the information appears in any desired format.
1593(See also point~19 below.)
1589 1594
1590\point 10. Sometimes it is necessary or desirable to divide the output of1595\point 10. Sometimes it is necessary or desirable to divide the output of
1591\.{CWEAVE} into subfiles that can be processed separately. For example,1596\.{CWEAVE} into subfiles that can be processed separately. For example,
@@ -1700,7 +1705,7 @@ You can send email to · 108 unmodified lines
1700 \\pdfURL\{the author\}\{mailto:andreas.scherer@@pobox.com\}\cr1705 \\pdfURL\{the author\}\{mailto:andreas.scherer@@pobox.com\}\cr
1701or visit \\pdfURL\{his home page\}\{http://www.pobox.com/%1706or visit \\pdfURL\{his home page\}\{http://www.pobox.com/%
1702 \\TILDE/scherer\}.\cr}}$$1707 \\TILDE/scherer\}.\cr}}$$
1703In a PDF document, the first argument will appear in blue as1708In a {\mc PDF} document, the first argument will appear in blue as
1704clickable text; the Acrobat reader, if correctly configured, will then1709clickable text; the Acrobat reader, if correctly configured, will then
1705redirect those links to the user's browser and open either the1710redirect those links to the user's browser and open either the
1706email client or the HTML viewer. In a hardcopy document, both arguments1711email client or the HTML viewer. In a hardcopy document, both arguments
@@ -1710,4 +1715,47 @@ in a somewhat awkward way, so that \.{CWEAVE} and/or \TeX\ · 3 unmodified lines
1710will not confuse them with formatting controls: Use \.{@@} for \.@1715will not confuse them with formatting controls: Use \.{@@} for \.@
1711and \.{\\TILDE/} for \.\~ and \.{\\UNDER/} for \.\_.1716and \.{\\TILDE/} for \.\~ and \.{\\UNDER/} for \.\_.
1712 1717
1718\point 19. {\mc PDF} documents contain bookmarks that list all the major group
1719titles in the table of contents, some of which will be subsidiary to
1720others if the depth feature of \.{@*} has been used.
1721Such bookmark entries are also known as ``outlines.''
1722Moreover, the final group title, `Names of the sections',
1723can be opened up to list every section name; Acrobat users can therefore
1724navigate easily to any desired section.
1725
1726The macros of \.{cwebmac.tex} are careful to ``sanitize'' all the names
1727that appear as bookmarks, by removing special characters and
1728formatting codes that are inappropriate for the limited typographic
1729capabilities of {\mc PDF} outlines. For example, one section of \.{CWEAVE}
1730is named `Cases for \\{case\_like}', which is represented by the \TeX\ code
1731`\.{Cases} \.{for} \.{\\PB\{\\\\\{case\\\_like\}\}}' in \.{cweave.tex}; its
1732sanitized name is simply `\.{Cases} \.{for} \.{case\_like}'.
1733(When \.{.pdf} files are produced, the fifth parameter of every \.{\\ZZ} in
1734the \.{.toc} file is set to the sanitized form of the first parameter;
1735see point~9 above and point~20 below.)
1736
1737In general, sanitization removes \TeX\ control sequences and braces,
1738except for control sequences defined by \.{CWEB} itself. Such a translation
1739works most of the time, but you can override the defaults and obtain any
1740translation that you want by using \TeX nical tricks. For example, after
1741$$\.{\\sanitizecommand\\foo\{bar\}}$$
1742the control sequence \.{\\foo} will sanitize to `\.{bar}'. And after
1743$$\.{\\def\\kluj\#1\\\\\{foo\}}$$
1744the \TeX\ code `\.{\\kluj bar\\\\}' will print as `foo' but sanitize
1745to `\.{bar}', because the control sequences \.{\\kluj} and
1746\.{\\\\} are removed by sanitization.
1747
1748\point 20. Furthermore, group titles can be converted to an arbitrary
1749sanitized text while also changing their form in running headlines, by
1750using \.{\\ifheader}. Consider, for example, a \.{CWEB} source file that
1751begins with the two lines
1752$$\lpile{\.{\\def\\klujj\#1\\\\\{\\ifheader FOO\\else foo\\fi\}}\cr
1753\.{@*Chinese \\klujj bar\\.}\cr}$$
1754This coding introduces a major group entitled `{\bf Chinese foo}', with
1755running headline `{\eightrm CHINESE FOO}' and table-of-contents entry
1756`Chinese foo'. The corresponding bookmark is, however, `\.{Chinese} \.{bar}'.
1757And the corresponding \.{.toc} file entry is
1758`\.{\\ZZ \{Chinese \\klujj bar\\\\\}\{1\}\{1\}\{1\}\{Chinese bar\}}'.
1759
1713\vfill\end1760\vfill\end
1761
examples/wmerge.w+29−21
@@ -1,10 +1,12 @@
1% Modified 16 Jan 2002 to agree with COMMON version 3.64
2
1\def\9#1{} % this hack is explained in CWEB manual Appendix F113\def\9#1{} % this hack is explained in CWEB manual Appendix F11
2 4
3@* Introduction. This file contains the program \.{wmerge},5@* Introduction. This file contains the program \.{wmerge},
4which takes two or more files and merges them according6which takes two or more files and merges them according
5to the conventions of \.{CWEB}. Namely, it takes an ordinary \.{.w}7to the conventions of \.{CWEB}. Namely, it takes an ordinary \.{.w}
6file and and optional \.{.ch} file and sends the corresponding8file and and optional \.{.ch} file and sends the corresponding
7\.{.w}-style file to standard output (or to a named file), 9\.{.w}-style file to standard output (or to a named file),
8expanding all ``includes''10expanding all ``includes''
9that might be specified by \.{@@i} in the original \.{.w} file.11that might be specified by \.{@@i} in the original \.{.w} file.
10(A more precise description appears in the section on ``command line12(A more precise description appears in the section on ``command line
@@ -88,7 +90,7 @@ which is defined in \.{/usr/include/sys/types.h}, you should let · 77 unmodified lines
88\.{WEAVE} know that this is a type, either by including the \.{.h} file90\.{WEAVE} know that this is a type, either by including the \.{.h} file
89at \.{WEB} time (saying \.{@@i /usr/include/sys/types.h}), or by91at \.{WEB} time (saying \.{@@i /usr/include/sys/types.h}), or by
90using \.{WEB}'s format command (saying \.{@@f caddr\_t int}). Either of92using \.{WEB}'s format command (saying \.{@@f caddr\_t int}). Either of
91these will make {\bf caddr\_t} be treated in the same way as |int|. 93these will make {\bf caddr\_t} be treated in the same way as |int|.
92 94
93@<Func...@>=95@<Func...@>=
94input_ln(fp) /* copies a line into |buffer| or returns 0 */96input_ln(fp) /* copies a line into |buffer| or returns 0 */
@@ -211,7 +213,7 @@ do { · 116 unmodified lines
211 213
212@ @<Move |buffer| and |limit| to |change_buffer| and |change_limit|@>=214@ @<Move |buffer| and |limit| to |change_buffer| and |change_limit|@>=
213{215{
214 change_limit=change_buffer-buffer+limit;216 change_limit=change_buffer+(limit-buffer);
215 strncpy(change_buffer,buffer,limit-buffer+1);217 strncpy(change_buffer,buffer,limit-buffer+1);
216}218}
217 219
@@ -242,7 +244,7 @@ check_change() /* switches to |change_file| if the buffers match */ · 24 unmodified lines
242 return;244 return;
243 }245 }
244 if (limit>buffer+1 && buffer[0]=='@@') {246 if (limit>buffer+1 && buffer[0]=='@@') {
245 if (isupper(buffer[1])) buffer[1]=tolower(buffer[1]);247 char xyz_code=isupper(buffer[1])? tolower(buffer[1]): buffer[1];
246 @<If the current line starts with \.{@@y},248 @<If the current line starts with \.{@@y},
247 report any discrepancies and |return|@>;249 report any discrepancies and |return|@>;
248 }250 }
@@ -261,11 +263,11 @@ check_change() /* switches to |change_file| if the buffers match */ · 12 unmodified lines
261}263}
262 264
263@ @<If the current line starts with \.{@@y}...@>=265@ @<If the current line starts with \.{@@y}...@>=
264if (buffer[1]=='x' || buffer[1]=='z') {266if (xyz_code=='x' || xyz_code=='z') {
265 loc=buffer+2; err_print("! Where is the matching @@y?");267 loc=buffer+2; err_print("! Where is the matching @@y?");
266@.Where is the match...@>268@.Where is the match...@>
267 }269 }
268else if (buffer[1]=='y') {270else if (xyz_code=='y') {
269 if (n>0) {271 if (n>0) {
270 loc=buffer+2;272 loc=buffer+2;
271 fprintf(stderr,"\n! Hmm... %d ",n);273 fprintf(stderr,"\n! Hmm... %d ",n);
@@ -313,7 +315,7 @@ This procedure returns |!input_has_ended| because we often want to · 41 unmodified lines
313check the value of that variable after calling the procedure.315check the value of that variable after calling the procedure.
314 316
315@<Fun...@>=317@<Fun...@>=
316get_line() /* inputs the next line */318int get_line() /* inputs the next line */
317{319{
318 restart:320 restart:
319 if (changing && include_depth==change_depth)321 if (changing && include_depth==change_depth)
@@ -322,10 +324,11 @@ get_line() /* inputs the next line */ · 2 unmodified lines
322 @<Read from |cur_file| and maybe turn on |changing|@>;324 @<Read from |cur_file| and maybe turn on |changing|@>;
323 if (changing && include_depth==change_depth) goto restart;325 if (changing && include_depth==change_depth) goto restart;
324 }326 }
327 if (input_has_ended) return 0;
325 loc=buffer; *limit=' ';328 loc=buffer; *limit=' ';
326 if (*buffer=='@@' && (*(buffer+1)=='i' || *(buffer+1)=='I')) {329 if (buffer[0]=='@@' && (buffer[1]=='i' || buffer[1]=='I')) {
327 loc=buffer+2;330 loc=buffer+2; *limit='"';
328 while (loc<=limit && (*loc==' '||*loc=='\t'||*loc=='"')) loc++;331 while (*loc==' '||*loc=='\t') loc++;
329 if (loc>=limit) {332 if (loc>=limit) {
330 err_print("! Include file name not given");333 err_print("! Include file name not given");
331@.Include file name ...@>334@.Include file name ...@>
@@ -335,11 +338,11 @@ get_line() /* inputs the next line */ · 3 unmodified lines
335 err_print("! Too many nested includes");338 err_print("! Too many nested includes");
336@.Too many nested includes@>339@.Too many nested includes@>
337 goto restart;340 goto restart;
338 } 341 }
339 include_depth++; /* push input stack */342 include_depth++; /* push input stack */
340 @<Try to open include file, abort push if unsuccessful, go to |restart|@>;343 @<Try to open include file, abort push if unsuccessful, go to |restart|@>;
341 }344 }
342 return (!input_has_ended);345 return 1;
343}346}
344 347
345void put_line()348void put_line()
@@ -353,28 +356,33 @@ void put_line() · 7 unmodified lines
353stop reading it and start reading from the named include file. The356stop reading it and start reading from the named include file. The
354\.{@@i} line should give a complete file name with or without357\.{@@i} line should give a complete file name with or without
355double quotes.358double quotes.
356If the environment variable \.{CWEBINPUTS} is set, or if the compiler flag 359If the environment variable \.{CWEBINPUTS} is set, or if the compiler flag
357of the same name was defined at compile time,360of the same name was defined at compile time,
358\.{CWEB} will look for include files in the directory thus named, if361\.{CWEB} will look for include files in the directory thus named, if
359it cannot find them in the current directory.362it cannot find them in the current directory.
360(Colon-separated paths are not supported.)363(Colon-separated paths are not supported.)
361The remainder of the \.{@@i} line after the file name is ignored.364The remainder of the \.{@@i} line after the file name is ignored.
362 365
363@d too_long() {include_depth--; 366@d too_long() {include_depth--;
364 err_print("! Include file name too long"); goto restart;}367 err_print("! Include file name too long"); goto restart;}
365 368
366@ @<Try to open...@>= {369@ @<Try to open...@>= {
367 char temp_file_name[max_file_name_length]; 370 char temp_file_name[max_file_name_length];
368 char *cur_file_name_end=cur_file_name+max_file_name_length-1; 371 char *cur_file_name_end=cur_file_name+max_file_name_length-1;
369 char *k=cur_file_name, *kk;372 char *k=cur_file_name, *kk;
370 int l; /* length of file name */373 int l; /* length of file name */
371 374
372 while (*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end) *k++=*loc++;375 if (*loc=='"') {
376 loc++;
377 while (*loc!='"' && k<=cur_file_name_end) *k++=*loc++;
378 if (loc==limit) k=cur_file_name_end+1; /* unmatched quote is `too long' */
379 } else
380 while (*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end) *k++=*loc++;
373 if (k>cur_file_name_end) too_long();381 if (k>cur_file_name_end) too_long();
374@.Include file name ...@>382@.Include file name ...@>
375 *k='\0';383 *k='\0';
376 if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {384 if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {
377 cur_line=0; 385 cur_line=0;
378 goto restart; /* success */386 goto restart; /* success */
379 }387 }
380 kk=getenv("CWEBINPUTS");388 kk=getenv("CWEBINPUTS");
@@ -387,7 +395,7 @@ The remainder of the \.{@@i} line after the file name is ignored. · 6 unmodified lines
387 if ((l=strlen(CWEBINPUTS))>max_file_name_length-2) too_long();395 if ((l=strlen(CWEBINPUTS))>max_file_name_length-2) too_long();
388 strcpy(temp_file_name,CWEBINPUTS);396 strcpy(temp_file_name,CWEBINPUTS);
389#else397#else
390 l=0; 398 l=0;
391#endif /* |CWEBINPUTS| */399#endif /* |CWEBINPUTS| */
392 }400 }
393 if (l>0) {401 if (l>0) {
@@ -397,7 +405,7 @@ The remainder of the \.{@@i} line after the file name is ignored. · 3 unmodified lines
397 strcpy(cur_file_name,temp_file_name);405 strcpy(cur_file_name,temp_file_name);
398 cur_file_name[l]='/'; /* \UNIX/ pathname separator */406 cur_file_name[l]='/'; /* \UNIX/ pathname separator */
399 if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {407 if ((cur_file=fopen(cur_file_name,"r"))!=NULL) {
400 cur_line=0; 408 cur_line=0;
401 goto restart; /* success */409 goto restart; /* success */
402 }410 }
403 }411 }
@@ -437,7 +445,7 @@ The remainder of the \.{@@i} line after the file name is ignored. · 33 unmodified lines
437@.Where is the match...@>445@.Where is the match...@>
438 }446 }
439 else if (buffer[1]=='z') {447 else if (buffer[1]=='z') {
440 prime_the_change_buffer(); changing=!changing; 448 prime_the_change_buffer(); changing=!changing;
441 }449 }
442 }450 }
443 }451 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t