I removed backup files and executables.
Unified · Split
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | % This file is part of CWEB. |
| 2 | 2 | % The CWEB programs by Silvio Levy are based on programs by D. E. Knuth. |
| 3 | 3 | % They are distributed WITHOUT ANY WARRANTY, express or implied. |
| 4 | −% This README file last updated May 2000 by Don Knuth | |
| 4 | +% This README file last updated January 2016 by Don Knuth | |
| 5 | 5 | |
| 6 | −% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth | |
| 6 | +% Copyright (C) 1987,1990,1993,2000,2016 Silvio Levy and Donald E. Knuth | |
| 7 | 7 | |
| 8 | 8 | % Permission is granted to make and distribute verbatim copies of this |
| 9 | 9 | % document provided that the copyright notice and this permission notice |
| @@ -14,7 +14,13 @@ · 4 unmodified lines | ||
| 14 | 14 | % entire resulting derived work is given a different name and distributed |
| 15 | 15 | % under the terms of a permission notice identical to this one. |
| 16 | 16 | |
| 17 | −% Please send comments, suggestions, etc. to levy@math.berkeley.edu. | |
| 17 | +% Please send comments, suggestions, etc. to tex-k@tug.org, and people | |
| 18 | +% there will verify and forward bug reports. | |
| 19 | +% | |
| 20 | +% DEK takes no responsibility for the changefiles; they should be | |
| 21 | +% maintained independently. His job is to correct errors in | |
| 22 | +% ctangle.w, cweave.w, common.w, cwebmac.tex, cwebman.tex, | |
| 23 | +% and in the files of examples/*.w, nothing more. | |
| 18 | 24 | |
| 19 | 25 | This directory contains the following files: |
| 20 | 26 | |
| @@ -1,23 +1,23 @@ | ||
| 1 | 1 | /*1:*/ |
| 2 | −#line 58 "common.w" | |
| 2 | +#line 58 "./common.w" | |
| 3 | 3 | |
| 4 | 4 | /*5:*/ |
| 5 | −#line 102 "common.w" | |
| 5 | +#line 102 "./common.w" | |
| 6 | 6 | |
| 7 | 7 | #include <ctype.h> |
| 8 | 8 | |
| 9 | 9 | /*:5*//*8:*/ |
| 10 | −#line 165 "common.w" | |
| 10 | +#line 165 "./common.w" | |
| 11 | 11 | |
| 12 | 12 | #include <stdio.h> |
| 13 | 13 | |
| 14 | 14 | /*:8*//*22:*/ |
| 15 | −#line 471 "common.w" | |
| 15 | +#line 471 "./common.w" | |
| 16 | 16 | |
| 17 | 17 | #include <stdlib.h> |
| 18 | 18 | |
| 19 | 19 | /*:22*/ |
| 20 | −#line 59 "common.w" | |
| 20 | +#line 59 "./common.w" | |
| 21 | 21 | |
| 22 | 22 | #define ctangle 0 |
| 23 | 23 | #define cweave 1 \ |
| @@ -121,16 +121,16 @@ err_print("! Include file name too long") ;goto restart;} \ · 97 unmodified lines | ||
| 121 | 121 | #define C_putc(c) putc(c,C_file) \ |
| 122 | 122 | |
| 123 | 123 | |
| 124 | −#line 60 "common.w" | |
| 124 | +#line 60 "./common.w" | |
| 125 | 125 | |
| 126 | 126 | /*2:*/ |
| 127 | −#line 73 "common.w" | |
| 127 | +#line 73 "./common.w" | |
| 128 | 128 | |
| 129 | 129 | typedef short boolean; |
| 130 | 130 | boolean program; |
| 131 | 131 | |
| 132 | 132 | /*:2*//*7:*/ |
| 133 | −#line 159 "common.w" | |
| 133 | +#line 159 "./common.w" | |
| 134 | 134 | |
| 135 | 135 | char buffer[long_buf_size]; |
| 136 | 136 | char*buffer_end= buffer+buf_size-2; |
| @@ -138,7 +138,7 @@ char*limit= buffer; · 1 unmodified line | ||
| 138 | 138 | char*loc= buffer; |
| 139 | 139 | |
| 140 | 140 | /*:7*//*10:*/ |
| 141 | −#line 214 "common.w" | |
| 141 | +#line 214 "./common.w" | |
| 142 | 142 | |
| 143 | 143 | int include_depth; |
| 144 | 144 | FILE*file[max_include_depth]; |
| @@ -155,7 +155,7 @@ boolean changing; · 10 unmodified lines | ||
| 155 | 155 | boolean web_file_open= 0; |
| 156 | 156 | |
| 157 | 157 | /*:10*//*20:*/ |
| 158 | −#line 418 "common.w" | |
| 158 | +#line 418 "./common.w" | |
| 159 | 159 | |
| 160 | 160 | typedef unsigned short sixteen_bits; |
| 161 | 161 | sixteen_bits section_count; |
| @@ -165,17 +165,17 @@ boolean change_pending; · 3 unmodified lines | ||
| 165 | 165 | boolean print_where= 0; |
| 166 | 166 | |
| 167 | 167 | /*:20*//*27:*/ |
| 168 | −#line 594 "common.w" | |
| 168 | +#line 594 "./common.w" | |
| 169 | 169 | |
| 170 | 170 | typedef struct name_info{ |
| 171 | 171 | char*byte_start; |
| 172 | 172 | /*31:*/ |
| 173 | −#line 631 "common.w" | |
| 173 | +#line 631 "./common.w" | |
| 174 | 174 | |
| 175 | 175 | struct name_info*link; |
| 176 | 176 | |
| 177 | 177 | /*:31*//*40:*/ |
| 178 | −#line 730 "common.w" | |
| 178 | +#line 730 "./common.w" | |
| 179 | 179 | |
| 180 | 180 | union{ |
| 181 | 181 | struct name_info*Rlink; |
| @@ -184,12 +184,12 @@ char Ilk; · 2 unmodified lines | ||
| 184 | 184 | }dummy; |
| 185 | 185 | |
| 186 | 186 | /*:40*//*55:*/ |
| 187 | −#line 1062 "common.w" | |
| 187 | +#line 1062 "./common.w" | |
| 188 | 188 | |
| 189 | 189 | char*equiv_or_xref; |
| 190 | 190 | |
| 191 | 191 | /*:55*/ |
| 192 | −#line 597 "common.w" | |
| 192 | +#line 597 "./common.w" | |
| 193 | 193 | |
| 194 | 194 | }name_info; |
| 195 | 195 | typedef name_info*name_pointer; |
| @@ -199,13 +199,13 @@ name_info name_dir[max_names]; · 3 unmodified lines | ||
| 199 | 199 | name_pointer name_dir_end= name_dir+max_names-1; |
| 200 | 200 | |
| 201 | 201 | /*:27*//*29:*/ |
| 202 | −#line 617 "common.w" | |
| 202 | +#line 617 "./common.w" | |
| 203 | 203 | |
| 204 | 204 | name_pointer name_ptr; |
| 205 | 205 | char*byte_ptr; |
| 206 | 206 | |
| 207 | 207 | /*:29*//*32:*/ |
| 208 | −#line 644 "common.w" | |
| 208 | +#line 644 "./common.w" | |
| 209 | 209 | |
| 210 | 210 | typedef name_pointer*hash_pointer; |
| 211 | 211 | name_pointer hash[hash_size]; |
| @@ -213,12 +213,12 @@ hash_pointer hash_end= hash+hash_size-1; · 1 unmodified line | ||
| 213 | 213 | hash_pointer h; |
| 214 | 214 | |
| 215 | 215 | /*:32*//*56:*/ |
| 216 | −#line 1082 "common.w" | |
| 216 | +#line 1082 "./common.w" | |
| 217 | 217 | |
| 218 | 218 | int history= spotless; |
| 219 | 219 | |
| 220 | 220 | /*:56*//*67:*/ |
| 221 | −#line 1220 "common.w" | |
| 221 | +#line 1220 "./common.w" | |
| 222 | 222 | |
| 223 | 223 | int argc; |
| 224 | 224 | char**argv; |
| @@ -229,7 +229,7 @@ char scn_file_name[max_file_name_length]; · 4 unmodified lines | ||
| 229 | 229 | boolean flags[128]; |
| 230 | 230 | |
| 231 | 231 | /*:67*//*77:*/ |
| 232 | −#line 1370 "common.w" | |
| 232 | +#line 1370 "./common.w" | |
| 233 | 233 | |
| 234 | 234 | FILE*C_file; |
| 235 | 235 | FILE*tex_file; |
| @@ -238,64 +238,64 @@ FILE*scn_file; · 2 unmodified lines | ||
| 238 | 238 | FILE*active_file; |
| 239 | 239 | |
| 240 | 240 | /*:77*/ |
| 241 | −#line 61 "common.w" | |
| 241 | +#line 61 "./common.w" | |
| 242 | 242 | |
| 243 | 243 | /*3:*/ |
| 244 | −#line 83 "common.w" | |
| 244 | +#line 83 "./common.w" | |
| 245 | 245 | int phase; |
| 246 | 246 | |
| 247 | 247 | /*:3*//*11:*/ |
| 248 | −#line 240 "common.w" | |
| 248 | +#line 240 "./common.w" | |
| 249 | 249 | |
| 250 | 250 | char change_buffer[buf_size]; |
| 251 | 251 | char*change_limit; |
| 252 | 252 | |
| 253 | 253 | /*:11*/ |
| 254 | −#line 62 "common.w" | |
| 254 | +#line 62 "./common.w" | |
| 255 | 255 | |
| 256 | 256 | /*33:*/ |
| 257 | −#line 650 "common.w" | |
| 257 | +#line 650 "./common.w" | |
| 258 | 258 | |
| 259 | 259 | extern int names_match(); |
| 260 | 260 | |
| 261 | 261 | /*:33*//*38:*/ |
| 262 | −#line 703 "common.w" | |
| 262 | +#line 703 "./common.w" | |
| 263 | 263 | |
| 264 | 264 | void init_p(); |
| 265 | 265 | |
| 266 | 266 | /*:38*//*46:*/ |
| 267 | −#line 852 "common.w" | |
| 267 | +#line 852 "./common.w" | |
| 268 | 268 | |
| 269 | 269 | extern void init_node(); |
| 270 | 270 | |
| 271 | 271 | /*:46*//*53:*/ |
| 272 | −#line 1017 "common.w" | |
| 272 | +#line 1017 "./common.w" | |
| 273 | 273 | |
| 274 | 274 | int section_name_cmp(); |
| 275 | 275 | |
| 276 | 276 | /*:53*//*57:*/ |
| 277 | −#line 1092 "common.w" | |
| 277 | +#line 1092 "./common.w" | |
| 278 | 278 | |
| 279 | 279 | void err_print(); |
| 280 | 280 | |
| 281 | 281 | /*:57*//*60:*/ |
| 282 | −#line 1140 "common.w" | |
| 282 | +#line 1140 "./common.w" | |
| 283 | 283 | |
| 284 | 284 | int wrap_up(); |
| 285 | 285 | extern void print_stats(); |
| 286 | 286 | |
| 287 | 287 | /*:60*//*63:*/ |
| 288 | −#line 1173 "common.w" | |
| 288 | +#line 1173 "./common.w" | |
| 289 | 289 | |
| 290 | 290 | void fatal(),overflow(); |
| 291 | 291 | |
| 292 | 292 | /*:63*//*69:*/ |
| 293 | −#line 1251 "common.w" | |
| 293 | +#line 1251 "./common.w" | |
| 294 | 294 | |
| 295 | 295 | void scan_args(); |
| 296 | 296 | |
| 297 | 297 | /*:69*//*81:*/ |
| 298 | −#line 1411 "common.w" | |
| 298 | +#line 1411 "./common.w" | |
| 299 | 299 | |
| 300 | 300 | extern int strlen(); |
| 301 | 301 | extern int strcmp(); |
| @@ -304,45 +304,45 @@ extern int strncmp(); · 2 unmodified lines | ||
| 304 | 304 | extern char*strncpy(); |
| 305 | 305 | |
| 306 | 306 | /*:81*/ |
| 307 | −#line 63 "common.w" | |
| 307 | +#line 63 "./common.w" | |
| 308 | 308 | |
| 309 | 309 | |
| 310 | 310 | /*:1*//*4:*/ |
| 311 | −#line 89 "common.w" | |
| 311 | +#line 89 "./common.w" | |
| 312 | 312 | |
| 313 | 313 | void |
| 314 | 314 | common_init() |
| 315 | 315 | { |
| 316 | 316 | /*30:*/ |
| 317 | −#line 621 "common.w" | |
| 317 | +#line 621 "./common.w" | |
| 318 | 318 | |
| 319 | 319 | name_dir->byte_start= byte_ptr= byte_mem; |
| 320 | 320 | name_ptr= name_dir+1; |
| 321 | 321 | name_ptr->byte_start= byte_mem; |
| 322 | 322 | |
| 323 | 323 | /*:30*//*34:*/ |
| 324 | −#line 655 "common.w" | |
| 324 | +#line 655 "./common.w" | |
| 325 | 325 | |
| 326 | 326 | for(h= hash;h<=hash_end;*h++= NULL); |
| 327 | 327 | |
| 328 | 328 | /*:34*//*41:*/ |
| 329 | −#line 737 "common.w" | |
| 329 | +#line 737 "./common.w" | |
| 330 | 330 | |
| 331 | 331 | root= NULL; |
| 332 | 332 | |
| 333 | 333 | /*:41*/ |
| 334 | −#line 93 "common.w" | |
| 334 | +#line 93 "./common.w" | |
| 335 | 335 | ; |
| 336 | 336 | /*68:*/ |
| 337 | −#line 1233 "common.w" | |
| 337 | +#line 1233 "./common.w" | |
| 338 | 338 | |
| 339 | 339 | show_banner= show_happiness= show_progress= 1; |
| 340 | 340 | |
| 341 | 341 | /*:68*/ |
| 342 | −#line 94 "common.w" | |
| 342 | +#line 94 "./common.w" | |
| 343 | 343 | ; |
| 344 | 344 | /*78:*/ |
| 345 | −#line 1377 "common.w" | |
| 345 | +#line 1377 "./common.w" | |
| 346 | 346 | |
| 347 | 347 | scan_args(); |
| 348 | 348 | if(program==ctangle){ |
| @@ -356,12 +356,12 @@ fatal("! Cannot open output file ",tex_file_name); · 7 unmodified lines | ||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | /*:78*/ |
| 359 | −#line 95 "common.w" | |
| 359 | +#line 95 "./common.w" | |
| 360 | 360 | ; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /*:4*//*9:*/ |
| 364 | −#line 172 "common.w" | |
| 364 | +#line 172 "./common.w" | |
| 365 | 365 | |
| 366 | 366 | int input_ln(fp) |
| 367 | 367 | FILE*fp; |
| @@ -383,14 +383,14 @@ return(1); · 15 unmodified lines | ||
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /*:9*//*12:*/ |
| 386 | −#line 251 "common.w" | |
| 386 | +#line 251 "./common.w" | |
| 387 | 387 | |
| 388 | 388 | void |
| 389 | 389 | prime_the_change_buffer() |
| 390 | 390 | { |
| 391 | 391 | change_limit= change_buffer; |
| 392 | 392 | /*13:*/ |
| 393 | −#line 265 "common.w" | |
| 393 | +#line 265 "./common.w" | |
| 394 | 394 | |
| 395 | 395 | while(1){ |
| 396 | 396 | change_line++; |
| @@ -407,10 +407,10 @@ err_print("! Missing @x in change file"); · 10 unmodified lines | ||
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /*:13*/ |
| 410 | −#line 256 "common.w" | |
| 410 | +#line 256 "./common.w" | |
| 411 | 411 | ; |
| 412 | 412 | /*14:*/ |
| 413 | −#line 282 "common.w" | |
| 413 | +#line 282 "./common.w" | |
| 414 | 414 | |
| 415 | 415 | do{ |
| 416 | 416 | change_line++; |
| @@ -422,10 +422,10 @@ return; · 5 unmodified lines | ||
| 422 | 422 | }while(limit==buffer); |
| 423 | 423 | |
| 424 | 424 | /*:14*/ |
| 425 | −#line 257 "common.w" | |
| 425 | +#line 257 "./common.w" | |
| 426 | 426 | ; |
| 427 | 427 | /*15:*/ |
| 428 | −#line 292 "common.w" | |
| 428 | +#line 292 "./common.w" | |
| 429 | 429 | |
| 430 | 430 | { |
| 431 | 431 | change_limit= change_buffer+(limit-buffer); |
| @@ -433,12 +433,12 @@ strncpy(change_buffer,buffer,limit-buffer+1); · 1 unmodified line | ||
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /*:15*/ |
| 436 | −#line 258 "common.w" | |
| 436 | +#line 258 "./common.w" | |
| 437 | 437 | ; |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | /*:12*//*16:*/ |
| 441 | −#line 320 "common.w" | |
| 441 | +#line 320 "./common.w" | |
| 442 | 442 | |
| 443 | 443 | void |
| 444 | 444 | check_change() |
| @@ -461,7 +461,7 @@ return; · 16 unmodified lines | ||
| 461 | 461 | if(limit> buffer+1&&buffer[0]=='@'){ |
| 462 | 462 | char xyz_code= xisupper(buffer[1])?tolower(buffer[1]):buffer[1]; |
| 463 | 463 | /*17:*/ |
| 464 | −#line 358 "common.w" | |
| 464 | +#line 358 "./common.w" | |
| 465 | 465 | |
| 466 | 466 | if(xyz_code=='x'||xyz_code=='z'){ |
| 467 | 467 | loc= buffer+2;err_print("! Where is the matching @y?"); |
| @@ -479,11 +479,11 @@ return; · 11 unmodified lines | ||
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | /*:17*/ |
| 482 | −#line 342 "common.w" | |
| 482 | +#line 342 "./common.w" | |
| 483 | 483 | ; |
| 484 | 484 | } |
| 485 | 485 | /*15:*/ |
| 486 | −#line 292 "common.w" | |
| 486 | +#line 292 "./common.w" | |
| 487 | 487 | |
| 488 | 488 | { |
| 489 | 489 | change_limit= change_buffer+(limit-buffer); |
| @@ -491,7 +491,7 @@ strncpy(change_buffer,buffer,limit-buffer+1); · 1 unmodified line | ||
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | /*:15*/ |
| 494 | −#line 344 "common.w" | |
| 494 | +#line 344 "./common.w" | |
| 495 | 495 | ; |
| 496 | 496 | changing= 0;cur_line++; |
| 497 | 497 | while(!input_ln(cur_file)){ |
| @@ -507,14 +507,14 @@ if(lines_dont_match)n++; · 9 unmodified lines | ||
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /*:16*//*18:*/ |
| 510 | −#line 378 "common.w" | |
| 510 | +#line 378 "./common.w" | |
| 511 | 511 | |
| 512 | 512 | void |
| 513 | 513 | reset_input() |
| 514 | 514 | { |
| 515 | 515 | limit= buffer;loc= buffer+1;buffer[0]= ' '; |
| 516 | 516 | /*19:*/ |
| 517 | −#line 393 "common.w" | |
| 517 | +#line 393 "./common.w" | |
| 518 | 518 | |
| 519 | 519 | if((web_file= fopen(web_file_name,"r"))==NULL){ |
| 520 | 520 | strcpy(web_file_name,alt_web_file_name); |
| @@ -528,7 +528,7 @@ if((change_file= fopen(change_file_name,"r"))==NULL) · 7 unmodified lines | ||
| 528 | 528 | fatal("! Cannot open change file ",change_file_name); |
| 529 | 529 | |
| 530 | 530 | /*:19*/ |
| 531 | −#line 383 "common.w" | |
| 531 | +#line 383 "./common.w" | |
| 532 | 532 | ; |
| 533 | 533 | include_depth= 0;cur_line= 0;change_line= 0; |
| 534 | 534 | change_depth= include_depth; |
| @@ -537,14 +537,14 @@ limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= 0; · 2 unmodified lines | ||
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | /*:18*//*21:*/ |
| 540 | −#line 426 "common.w" | |
| 540 | +#line 426 "./common.w" | |
| 541 | 541 | |
| 542 | 542 | int get_line() |
| 543 | 543 | { |
| 544 | 544 | restart: |
| 545 | 545 | if(changing&&include_depth==change_depth) |
| 546 | 546 | /*25:*/ |
| 547 | −#line 537 "common.w" | |
| 547 | +#line 537 "./common.w" | |
| 548 | 548 | { |
| 549 | 549 | change_line++; |
| 550 | 550 | if(!input_ln(change_file)){ |
| @@ -575,11 +575,11 @@ prime_the_change_buffer();changing= !changing;print_where= 1; · 24 unmodified lines | ||
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | /*:25*/ |
| 578 | −#line 431 "common.w" | |
| 578 | +#line 431 "./common.w" | |
| 579 | 579 | ; |
| 580 | 580 | if(!changing||include_depth> change_depth){ |
| 581 | 581 | /*24:*/ |
| 582 | −#line 520 "common.w" | |
| 582 | +#line 520 "./common.w" | |
| 583 | 583 | { |
| 584 | 584 | cur_line++; |
| 585 | 585 | while(!input_ln(cur_file)){ |
| @@ -598,7 +598,7 @@ if(change_limit> change_buffer)check_change(); · 12 unmodified lines | ||
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | /*:24*/ |
| 601 | −#line 433 "common.w" | |
| 601 | +#line 433 "./common.w" | |
| 602 | 602 | ; |
| 603 | 603 | if(changing&&include_depth==change_depth)goto restart; |
| 604 | 604 | } |
| @@ -619,7 +619,7 @@ goto restart; · 14 unmodified lines | ||
| 619 | 619 | } |
| 620 | 620 | include_depth++; |
| 621 | 621 | /*23:*/ |
| 622 | −#line 474 "common.w" | |
| 622 | +#line 474 "./common.w" | |
| 623 | 623 | { |
| 624 | 624 | char temp_file_name[max_file_name_length]; |
| 625 | 625 | char*cur_file_name_end= cur_file_name+max_file_name_length-1; |
| @@ -667,14 +667,14 @@ include_depth--;err_print("! Cannot open include file");goto restart; · 41 unmodified lines | ||
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | /*:23*/ |
| 670 | −#line 452 "common.w" | |
| 670 | +#line 452 "./common.w" | |
| 671 | 671 | ; |
| 672 | 672 | } |
| 673 | 673 | return 1; |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | /*:21*//*26:*/ |
| 677 | −#line 569 "common.w" | |
| 677 | +#line 569 "./common.w" | |
| 678 | 678 | |
| 679 | 679 | void |
| 680 | 680 | check_complete(){ |
| @@ -688,7 +688,7 @@ err_print("! Change file entry did not match"); · 7 unmodified lines | ||
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | /*:26*//*35:*/ |
| 691 | −#line 660 "common.w" | |
| 691 | +#line 660 "./common.w" | |
| 692 | 692 | |
| 693 | 693 | name_pointer |
| 694 | 694 | id_lookup(first,last,t) |
| @@ -703,17 +703,17 @@ name_pointer p; · 8 unmodified lines | ||
| 703 | 703 | if(last==NULL)for(last= first;*last!='\0';last++); |
| 704 | 704 | l= last-first; |
| 705 | 705 | /*36:*/ |
| 706 | −#line 683 "common.w" | |
| 706 | +#line 683 "./common.w" | |
| 707 | 707 | |
| 708 | 708 | h= (unsigned char)*i; |
| 709 | 709 | while(++i<last)h= (h+h+(int)((unsigned char)*i))%hash_size; |
| 710 | 710 | |
| 711 | 711 | |
| 712 | 712 | /*:36*/ |
| 713 | −#line 673 "common.w" | |
| 713 | +#line 673 "./common.w" | |
| 714 | 714 | ; |
| 715 | 715 | /*37:*/ |
| 716 | −#line 691 "common.w" | |
| 716 | +#line 691 "./common.w" | |
| 717 | 717 | |
| 718 | 718 | p= hash[h]; |
| 719 | 719 | while(p&&!names_match(p,first,l,t))p= p->link; |
| @@ -723,10 +723,10 @@ p->link= hash[h];hash[h]= p; · 3 unmodified lines | ||
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | /*:37*/ |
| 726 | −#line 674 "common.w" | |
| 726 | +#line 674 "./common.w" | |
| 727 | 727 | ; |
| 728 | 728 | if(p==name_ptr)/*39:*/ |
| 729 | −#line 706 "common.w" | |
| 729 | +#line 706 "./common.w" | |
| 730 | 730 | { |
| 731 | 731 | if(byte_ptr+l> byte_mem_end)overflow("byte memory"); |
| 732 | 732 | if(name_ptr>=name_dir_end)overflow("name"); |
| @@ -736,13 +736,13 @@ if(program==cweave)init_p(p,t); · 3 unmodified lines | ||
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | /*:39*/ |
| 739 | −#line 675 "common.w" | |
| 739 | +#line 675 "./common.w" | |
| 740 | 740 | ; |
| 741 | 741 | return(p); |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | /*:35*//*42:*/ |
| 745 | −#line 764 "common.w" | |
| 745 | +#line 764 "./common.w" | |
| 746 | 746 | |
| 747 | 747 | void |
| 748 | 748 | print_section_name(p) |
| @@ -763,7 +763,7 @@ if(q)term_write("...",3); · 14 unmodified lines | ||
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | /*:42*//*43:*/ |
| 766 | −#line 783 "common.w" | |
| 766 | +#line 783 "./common.w" | |
| 767 | 767 | |
| 768 | 768 | void |
| 769 | 769 | sprint_section_name(dest,p) |
| @@ -786,7 +786,7 @@ s= p->byte_start; · 16 unmodified lines | ||
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | /*:43*//*44:*/ |
| 789 | −#line 804 "common.w" | |
| 789 | +#line 804 "./common.w" | |
| 790 | 790 | |
| 791 | 791 | void |
| 792 | 792 | print_prefix_name(p) |
| @@ -799,7 +799,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); · 6 unmodified lines | ||
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | /*:44*//*45:*/ |
| 802 | −#line 825 "common.w" | |
| 802 | +#line 825 "./common.w" | |
| 803 | 803 | |
| 804 | 804 | int web_strcmp(j,j_len,k,k_len) |
| 805 | 805 | char*j,*k; |
| @@ -815,7 +815,7 @@ else return greater; · 9 unmodified lines | ||
| 815 | 815 | } |
| 816 | 816 | |
| 817 | 817 | /*:45*//*47:*/ |
| 818 | −#line 855 "common.w" | |
| 818 | +#line 855 "./common.w" | |
| 819 | 819 | |
| 820 | 820 | name_pointer |
| 821 | 821 | add_section_name(par,c,first,last,ispref) |
| @@ -846,7 +846,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); · 24 unmodified lines | ||
| 846 | 846 | } |
| 847 | 847 | |
| 848 | 848 | /*:47*//*48:*/ |
| 849 | −#line 884 "common.w" | |
| 849 | +#line 884 "./common.w" | |
| 850 | 850 | |
| 851 | 851 | void |
| 852 | 852 | extend_section_name(p,first,last,ispref) |
| @@ -870,7 +870,7 @@ if(ispref)*(byte_ptr-1)= ' '; · 17 unmodified lines | ||
| 870 | 870 | } |
| 871 | 871 | |
| 872 | 872 | /*:48*//*49:*/ |
| 873 | −#line 912 "common.w" | |
| 873 | +#line 912 "./common.w" | |
| 874 | 874 | |
| 875 | 875 | name_pointer |
| 876 | 876 | section_lookup(first,last,ispref) |
| @@ -885,7 +885,7 @@ name_pointer par= NULL; · 8 unmodified lines | ||
| 885 | 885 | |
| 886 | 886 | int name_len= last-first+1; |
| 887 | 887 | /*50:*/ |
| 888 | −#line 936 "common.w" | |
| 888 | +#line 936 "./common.w" | |
| 889 | 889 | |
| 890 | 890 | while(p){ |
| 891 | 891 | c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p)); |
| @@ -912,19 +912,19 @@ p= q,q= NULL; · 20 unmodified lines | ||
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | /*:50*/ |
| 915 | −#line 926 "common.w" | |
| 915 | +#line 926 "./common.w" | |
| 916 | 916 | ; |
| 917 | 917 | /*51:*/ |
| 918 | −#line 961 "common.w" | |
| 918 | +#line 961 "./common.w" | |
| 919 | 919 | |
| 920 | 920 | if(r==NULL) |
| 921 | 921 | return add_section_name(par,c,first,last+1,ispref); |
| 922 | 922 | |
| 923 | 923 | /*:51*/ |
| 924 | −#line 927 "common.w" | |
| 924 | +#line 927 "./common.w" | |
| 925 | 925 | ; |
| 926 | 926 | /*52:*/ |
| 927 | −#line 969 "common.w" | |
| 927 | +#line 969 "./common.w" | |
| 928 | 928 | |
| 929 | 929 | switch(section_name_cmp(&first,name_len,r)){ |
| 930 | 930 | |
| @@ -958,12 +958,12 @@ return r; · 27 unmodified lines | ||
| 958 | 958 | } |
| 959 | 959 | |
| 960 | 960 | /*:52*/ |
| 961 | −#line 928 "common.w" | |
| 961 | +#line 928 "./common.w" | |
| 962 | 962 | ; |
| 963 | 963 | } |
| 964 | 964 | |
| 965 | 965 | /*:49*//*54:*/ |
| 966 | −#line 1020 "common.w" | |
| 966 | +#line 1020 "./common.w" | |
| 967 | 967 | |
| 968 | 968 | int section_name_cmp(pfirst,len,r) |
| 969 | 969 | char**pfirst; |
| @@ -997,7 +997,7 @@ default:return c; · 27 unmodified lines | ||
| 997 | 997 | } |
| 998 | 998 | |
| 999 | 999 | /*:54*//*58:*/ |
| 1000 | −#line 1095 "common.w" | |
| 1000 | +#line 1095 "./common.w" | |
| 1001 | 1001 | |
| 1002 | 1002 | void |
| 1003 | 1003 | err_print(s) |
| @@ -1006,7 +1006,7 @@ char*s; · 2 unmodified lines | ||
| 1006 | 1006 | char*k,*l; |
| 1007 | 1007 | printf(*s=='!'?"\n%s":"%s",s); |
| 1008 | 1008 | if(web_file_open)/*59:*/ |
| 1009 | −#line 1115 "common.w" | |
| 1009 | +#line 1115 "./common.w" | |
| 1010 | 1010 | |
| 1011 | 1011 | {if(changing&&include_depth==change_depth) |
| 1012 | 1012 | printf(". (l. %d of change file)\n",change_line); |
| @@ -1026,20 +1026,20 @@ putchar(' '); · 13 unmodified lines | ||
| 1026 | 1026 | } |
| 1027 | 1027 | |
| 1028 | 1028 | /*:59*/ |
| 1029 | −#line 1102 "common.w" | |
| 1029 | +#line 1102 "./common.w" | |
| 1030 | 1030 | ; |
| 1031 | 1031 | update_terminal;mark_error; |
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | /*:58*//*61:*/ |
| 1035 | −#line 1150 "common.w" | |
| 1035 | +#line 1150 "./common.w" | |
| 1036 | 1036 | |
| 1037 | 1037 | int wrap_up(){ |
| 1038 | 1038 | putchar('\n'); |
| 1039 | 1039 | if(show_stats) |
| 1040 | 1040 | print_stats(); |
| 1041 | 1041 | /*62:*/ |
| 1042 | −#line 1160 "common.w" | |
| 1042 | +#line 1160 "./common.w" | |
| 1043 | 1043 | |
| 1044 | 1044 | switch(history){ |
| 1045 | 1045 | case spotless:if(show_happiness)printf("(No errors were found.)\n");break; |
| @@ -1051,14 +1051,14 @@ case fatal_message:printf("(That was a fatal error, my friend.)\n"); · 5 unmodified lines | ||
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | /*:62*/ |
| 1054 | −#line 1155 "common.w" | |
| 1054 | +#line 1155 "./common.w" | |
| 1055 | 1055 | ; |
| 1056 | 1056 | if(history> harmless_message)return(1); |
| 1057 | 1057 | else return(0); |
| 1058 | 1058 | } |
| 1059 | 1059 | |
| 1060 | 1060 | /*:61*//*64:*/ |
| 1061 | −#line 1179 "common.w" | |
| 1061 | +#line 1179 "./common.w" | |
| 1062 | 1062 | void |
| 1063 | 1063 | fatal(s,t) |
| 1064 | 1064 | char*s,*t; |
| @@ -1069,7 +1069,7 @@ history= fatal_message;exit(wrap_up()); · 4 unmodified lines | ||
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | /*:64*//*65:*/ |
| 1072 | −#line 1190 "common.w" | |
| 1072 | +#line 1190 "./common.w" | |
| 1073 | 1073 | void |
| 1074 | 1074 | overflow(t) |
| 1075 | 1075 | char*t; |
| @@ -1079,7 +1079,7 @@ printf("\n! Sorry, %s capacity exceeded",t);fatal("",""); · 3 unmodified lines | ||
| 1079 | 1079 | |
| 1080 | 1080 | |
| 1081 | 1081 | /*:65*//*70:*/ |
| 1082 | −#line 1254 "common.w" | |
| 1082 | +#line 1254 "./common.w" | |
| 1083 | 1083 | |
| 1084 | 1084 | void |
| 1085 | 1085 | scan_args() |
| @@ -1093,7 +1093,7 @@ boolean flag_change; · 7 unmodified lines | ||
| 1093 | 1093 | |
| 1094 | 1094 | while(--argc> 0){ |
| 1095 | 1095 | if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*74:*/ |
| 1096 | −#line 1344 "common.w" | |
| 1096 | +#line 1344 "./common.w" | |
| 1097 | 1097 | |
| 1098 | 1098 | { |
| 1099 | 1099 | if(**argv=='-')flag_change= 0; |
| @@ -1103,7 +1103,7 @@ flags[*dot_pos]= flag_change; · 3 unmodified lines | ||
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | /*:74*/ |
| 1106 | −#line 1266 "common.w" | |
| 1106 | +#line 1266 "./common.w" | |
| 1107 | 1107 | |
| 1108 | 1108 | else{ |
| 1109 | 1109 | s= name_pos= *argv;dot_pos= NULL; |
| @@ -1113,17 +1113,17 @@ else if(*s=='/')dot_pos= NULL,name_pos= ++s; · 3 unmodified lines | ||
| 1113 | 1113 | else s++; |
| 1114 | 1114 | } |
| 1115 | 1115 | if(!found_web)/*71:*/ |
| 1116 | −#line 1292 "common.w" | |
| 1116 | +#line 1292 "./common.w" | |
| 1117 | 1117 | |
| 1118 | 1118 | { |
| 1119 | 1119 | if(s-*argv> max_file_name_length-5) |
| 1120 | 1120 | /*76:*/ |
| 1121 | −#line 1364 "common.w" | |
| 1121 | +#line 1364 "./common.w" | |
| 1122 | 1122 | fatal("! Filename too long\n",*argv); |
| 1123 | 1123 | |
| 1124 | 1124 | |
| 1125 | 1125 | /*:76*/ |
| 1126 | −#line 1295 "common.w" | |
| 1126 | +#line 1295 "./common.w" | |
| 1127 | 1127 | ; |
| 1128 | 1128 | if(dot_pos==NULL) |
| 1129 | 1129 | sprintf(web_file_name,"%s.w",*argv); |
| @@ -1140,22 +1140,22 @@ found_web= 1; · 10 unmodified lines | ||
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | 1142 | /*:71*/ |
| 1143 | −#line 1275 "common.w" | |
| 1143 | +#line 1275 "./common.w" | |
| 1144 | 1144 | |
| 1145 | 1145 | else if(!found_change)/*72:*/ |
| 1146 | −#line 1310 "common.w" | |
| 1146 | +#line 1310 "./common.w" | |
| 1147 | 1147 | |
| 1148 | 1148 | { |
| 1149 | 1149 | if(strcmp(*argv,"-")==0)found_change= -1; |
| 1150 | 1150 | else{ |
| 1151 | 1151 | if(s-*argv> max_file_name_length-4) |
| 1152 | 1152 | /*76:*/ |
| 1153 | −#line 1364 "common.w" | |
| 1153 | +#line 1364 "./common.w" | |
| 1154 | 1154 | fatal("! Filename too long\n",*argv); |
| 1155 | 1155 | |
| 1156 | 1156 | |
| 1157 | 1157 | /*:76*/ |
| 1158 | −#line 1315 "common.w" | |
| 1158 | +#line 1315 "./common.w" | |
| 1159 | 1159 | ; |
| 1160 | 1160 | if(dot_pos==NULL) |
| 1161 | 1161 | sprintf(change_file_name,"%s.ch",*argv); |
| @@ -1165,20 +1165,20 @@ found_change= 1; · 3 unmodified lines | ||
| 1165 | 1165 | } |
| 1166 | 1166 | |
| 1167 | 1167 | /*:72*/ |
| 1168 | −#line 1276 "common.w" | |
| 1168 | +#line 1276 "./common.w" | |
| 1169 | 1169 | |
| 1170 | 1170 | else if(!found_out)/*73:*/ |
| 1171 | −#line 1323 "common.w" | |
| 1171 | +#line 1323 "./common.w" | |
| 1172 | 1172 | |
| 1173 | 1173 | { |
| 1174 | 1174 | if(s-*argv> max_file_name_length-5) |
| 1175 | 1175 | /*76:*/ |
| 1176 | −#line 1364 "common.w" | |
| 1176 | +#line 1364 "./common.w" | |
| 1177 | 1177 | fatal("! Filename too long\n",*argv); |
| 1178 | 1178 | |
| 1179 | 1179 | |
| 1180 | 1180 | /*:76*/ |
| 1181 | −#line 1326 "common.w" | |
| 1181 | +#line 1326 "./common.w" | |
| 1182 | 1182 | ; |
| 1183 | 1183 | if(dot_pos==NULL){ |
| 1184 | 1184 | sprintf(tex_file_name,"%s.tex",*argv); |
| @@ -1198,10 +1198,10 @@ found_out= 1; · 13 unmodified lines | ||
| 1198 | 1198 | } |
| 1199 | 1199 | |
| 1200 | 1200 | /*:73*/ |
| 1201 | −#line 1277 "common.w" | |
| 1201 | +#line 1277 "./common.w" | |
| 1202 | 1202 | |
| 1203 | 1203 | else/*75:*/ |
| 1204 | −#line 1352 "common.w" | |
| 1204 | +#line 1352 "./common.w" | |
| 1205 | 1205 | |
| 1206 | 1206 | { |
| 1207 | 1207 | if(program==ctangle) |
| @@ -1215,12 +1215,12 @@ else fatal( · 7 unmodified lines | ||
| 1215 | 1215 | } |
| 1216 | 1216 | |
| 1217 | 1217 | /*:75*/ |
| 1218 | −#line 1278 "common.w" | |
| 1218 | +#line 1278 "./common.w" | |
| 1219 | 1219 | ; |
| 1220 | 1220 | } |
| 1221 | 1221 | } |
| 1222 | 1222 | if(!found_web)/*75:*/ |
| 1223 | −#line 1352 "common.w" | |
| 1223 | +#line 1352 "./common.w" | |
| 1224 | 1224 | |
| 1225 | 1225 | { |
| 1226 | 1226 | if(program==ctangle) |
| @@ -1234,7 +1234,7 @@ else fatal( · 7 unmodified lines | ||
| 1234 | 1234 | } |
| 1235 | 1235 | |
| 1236 | 1236 | /*:75*/ |
| 1237 | −#line 1281 "common.w" | |
| 1237 | +#line 1281 "./common.w" | |
| 1238 | 1238 | ; |
| 1239 | 1239 | if(found_change<=0)strcpy(change_file_name,"/dev/null"); |
| 1240 | 1240 | } |
| @@ -101,7 +101,7 @@ extern char byte_mem[]; /* characters of names */ · 100 unmodified lines | ||
| 101 | 101 | extern char *byte_mem_end; /* end of |byte_mem| */ |
| 102 | 102 | extern name_info name_dir[]; /* information about names */ |
| 103 | 103 | extern name_pointer name_dir_end; /* end of |name_dir| */ |
| 104 | −extern name_pointer name_ptr; /* first unused position in |byte_start| */ | |
| 104 | +extern name_pointer name_ptr; /* first unused position in |name_dir| */ | |
| 105 | 105 | extern char *byte_ptr; /* first unused position in |byte_mem| */ |
| 106 | 106 | extern name_pointer hash[]; /* heads of hash lists */ |
| 107 | 107 | extern hash_pointer hash_end; /* end of |hash| */ |
| @@ -615,7 +615,7 @@ usually have |name_ptr->byte_start==byte_ptr|, and certainly · 614 unmodified lines | ||
| 615 | 615 | we want to keep |name_ptr<=name_dir_end| and |byte_ptr<=byte_mem_end|. |
| 616 | 616 | |
| 617 | 617 | @<Defini...@>= |
| 618 | −name_pointer name_ptr; /* first unused position in |byte_start| */ | |
| 618 | +name_pointer name_ptr; /* first unused position in |name_dir| */ | |
| 619 | 619 | char *byte_ptr; /* first unused position in |byte_mem| */ |
| 620 | 620 | |
| 621 | 621 | @ @<Init...@>= |
| @@ -93,7 +93,7 @@ extern char byte_mem[]; /* characters of names */ · 92 unmodified lines | ||
| 93 | 93 | extern char *byte_mem_end; /* end of |byte_mem| */ |
| 94 | 94 | extern name_info name_dir[]; /* information about names */ |
| 95 | 95 | extern name_pointer name_dir_end; /* end of |name_dir| */ |
| 96 | −extern name_pointer name_ptr; /* first unused position in |byte_start| */ | |
| 96 | +extern name_pointer name_ptr; /* first unused position in |name_dir| */ | |
| 97 | 97 | extern char *byte_ptr; /* first unused position in |byte_mem| */ |
| 98 | 98 | extern name_pointer hash[]; /* heads of hash lists */ |
| 99 | 99 | extern hash_pointer hash_end; /* end of |hash| */ |
| @@ -126,7 +126,7 @@ extern char huge byte_mem[]; /* characters of names */ · 26 unmodified lines | ||
| 126 | 126 | extern char huge* byte_mem_end; /* end of |byte_mem| */ |
| 127 | 127 | extern name_info name_dir[]; /* information about names */ |
| 128 | 128 | extern name_pointer name_dir_end; /* end of |name_dir| */ |
| 129 | −extern name_pointer name_ptr; /* first unused position in |byte_start| */ | |
| 129 | +extern name_pointer name_ptr; /* first unused position in |name_dir| */ | |
| 130 | 130 | extern char huge* byte_ptr; /* first unused position in |byte_mem| */ |
| 131 | 131 | extern name_pointer hash[]; /* heads of hash lists */ |
| 132 | 132 | extern hash_pointer hash_end; /* end of |hash| */ |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include <ctype.h> |
| 13 | 13 | #include <stdlib.h> |
| 14 | − | |
| 14 | +#include <string.h> | |
| 15 | 15 | /*:62*/ |
| 16 | 16 | #line 65 "ctangle.w" |
| 17 | 17 | |
| @@ -366,11 +366,11 @@ extern sixteen_bits section_count; · 348 unmodified lines | ||
| 366 | 366 | /*2:*/ |
| 367 | 367 | #line 77 "ctangle.w" |
| 368 | 368 | |
| 369 | −extern int strlen(); | |
| 370 | −extern int strcmp(); | |
| 371 | −extern char*strcpy(); | |
| 372 | −extern int strncmp(); | |
| 373 | −extern char*strncpy(); | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | 374 | |
| 375 | 375 | /*:2*//*41:*/ |
| 376 | 376 | #line 533 "ctangle.w" |
| @@ -49,7 +49,7 @@ extern char byte_mem[]; /* characters of names */ · 48 unmodified lines | ||
| 49 | 49 | extern char *byte_mem_end; /* end of |byte_mem| */ |
| 50 | 50 | extern name_info name_dir[]; /* information about names */ |
| 51 | 51 | extern name_pointer name_dir_end; /* end of |name_dir| */ |
| 52 | −extern name_pointer name_ptr; /* first unused position in |byte_start| */ | |
| 52 | +extern name_pointer name_ptr; /* first unused position in |name_dir| */ | |
| 53 | 53 | extern char *byte_ptr; /* first unused position in |byte_mem| */ |
| 54 | 54 | extern name_pointer hash[]; /* heads of hash lists */ |
| 55 | 55 | extern hash_pointer hash_end; /* end of |hash| */ |
| @@ -82,7 +82,7 @@ extern char huge byte_mem[]; /* characters of names */ · 26 unmodified lines | ||
| 82 | 82 | extern char huge* byte_mem_end; /* end of |byte_mem| */ |
| 83 | 83 | extern name_info name_dir[]; /* information about names */ |
| 84 | 84 | extern name_pointer name_dir_end; /* end of |name_dir| */ |
| 85 | −extern name_pointer name_ptr; /* first unused position in |byte_start| */ | |
| 85 | +extern name_pointer name_ptr; /* first unused position in |name_dir| */ | |
| 86 | 86 | extern char huge* byte_ptr; /* first unused position in |byte_mem| */ |
| 87 | 87 | extern name_pointer hash[]; /* heads of hash lists */ |
| 88 | 88 | extern hash_pointer hash_end; /* end of |hash| */ |
| @@ -110,6 +110,8 @@ otherwise do an ordinary Meta-y." · 109 unmodified lines | ||
| 110 | 110 | (insert ch) |
| 111 | 111 | (setq arg (1- arg))))) |
| 112 | 112 | (global-set-key "\M-\"" 'ditto) |
| 113 | +; If "ditto" suddenly fails to work, you have probably set goal-column | |
| 114 | +; inadvertently. To unset it, say C-u C-x C-n. | |
| 113 | 115 | |
| 114 | 116 | ;; OK, here's part (2): Changes to TeX mode. |
| 115 | 117 | ; The WEB modes below are very much like TeX mode, but some improvements were |
| @@ -210,6 +212,7 @@ for relative module movement. The automatic \" feature is disabled." · 94 unmodified lines | ||
| 210 | 212 | (modify-syntax-entry ?% "@") |
| 211 | 213 | (setq mode-name "CWEB") |
| 212 | 214 | (setq major-mode 'cweb-mode) |
| 215 | + (setq tex-fontify-script nil) ;; needed in GNU Emacs version 22? | |
| 213 | 216 | (run-hooks 'cweb-mode-hook)) |
| 214 | 217 | (setq auto-mode-alist (cons '("\\.w$" . cweb-mode) auto-mode-alist)) |
| 215 | 218 | (setq auto-mode-alist (cons '("\\.ch$" . cweb-mode) auto-mode-alist)) |
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | % standard macros for CWEB listings (in addition to plain.tex) |
| 2 | −% Version 3.67 --- July 2006 | |
| 2 | +% Version 3.68 --- January 2016 | |
| 3 | 3 | \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros |
| 4 | −\xdef\fmtversion{\fmtversion+CWEB3.67} | |
| 5 | −\chardef\cwebversion=3 \chardef\cwebrevision=67 | |
| 4 | +\xdef\fmtversion{\fmtversion+CWEB3.68} | |
| 5 | +\chardef\cwebversion=3 \chardef\cwebrevision=68 | |
| 6 | 6 | \newif\ifpdf |
| 7 | 7 | \ifx\pdf+\pdftrue\fi |
| 8 | 8 | % Uncomment the following line if you want PDF goodies to be the default |
| @@ -278,7 +278,8 @@ · 269 unmodified lines | ||
| 278 | 278 | \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50 |
| 279 | 279 | \noindent{\let\*=\lapstar\bf\secstar.\quad}% |
| 280 | 280 | \ifpdftex\smash{\raise\baselineskip\hbox to0pt{% |
| 281 | − \let\*=\empty\pdfdest num \secstar fith}} | |
| 281 | +% \let\*=\empty\pdfdest num \secstar fith}} % bad space in versions < 3.68 | |
| 282 | + \let\*=\empty\pdfdest num \secstar fith}}% changed in version 3.68 | |
| 282 | 283 | \else\ifpdf\smash{\raise\baselineskip\hbox to0pt{% |
| 283 | 284 | \let\*=\empty\special{% |
| 284 | 285 | pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi} |
| @@ -340,7 +341,7 @@ · 55 unmodified lines | ||
| 340 | 341 | \def\T#1{\leavevmode % octal, hex or decimal constant |
| 341 | 342 | \hbox{$\def\?{\kern.2em}% |
| 342 | 343 | % \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67 |
| 343 | − \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant | |
| 344 | + \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67 | |
| 344 | 345 | \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) |
| 345 | 346 | \let\~=\oct \let\^=\hex {#1}$}} |
| 346 | 347 | \def\U{\note{This code is used in section}} % xref for use of a section |
| @@ -457,6 +458,7 @@ · 110 unmodified lines | ||
| 457 | 458 | \def\fin{\par\vfill\eject % this is done when we are ending the index |
| 458 | 459 | \ifpagesaved\null\vfill\eject\fi % output a null index column |
| 459 | 460 | \if L\lr\else\null\vfill\eject\fi % finish the current page |
| 461 | + \ifpdftex \makebookmarks \fi % added in Version 3.68 | |
| 460 | 462 | \parfillskip 0pt plus 1fil |
| 461 | 463 | \def\grouptitle{NAMES OF THE SECTIONS} |
| 462 | 464 | \let\topsecno=\nullsec |
| @@ -470,7 +472,8 @@ · 7 unmodified lines | ||
| 470 | 472 | \def\Us{\note{Used in sections}} % crossref for uses of a section |
| 471 | 473 | \def\I{\par\hangindent 2em}\let\*=* |
| 472 | 474 | \ifacro \def\outsecname{Names of the sections} \let\Xpdf\X |
| 473 | − \ifpdftex \makebookmarks \pdfdest name {NOS} fitb | |
| 475 | +% \ifpdftex \makebookmarks \pdfdest name {NOS} fitb % in versions < 3.68 | |
| 476 | + \ifpdftex \pdfdest name {NOS} fitb % changed in version 3.68 | |
| 474 | 477 | \pdfoutline goto name {NOS} count -\secno {\outsecname} |
| 475 | 478 | \def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.% |
| 476 | 479 | {\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}% |
| @@ -1514,7 +1514,7 @@ is to explain some of the possibilities. · 1513 unmodified lines | ||
| 1514 | 1514 | |
| 1515 | 1515 | \point 1. Four fonts have been declared in addition to the standard fonts of |
| 1516 | 1516 | \.{PLAIN} format: You can say `\.{\{\\mc UNIX\}}' to get {\mc UNIX} in |
| 1517 | −xmedium-size caps; you can say `\.{\{\\sc STUFF\}}' to get {\sc STUFF} | |
| 1517 | +medium-size caps; you can say `\.{\{\\sc STUFF\}}' to get {\sc STUFF} | |
| 1518 | 1518 | in small caps; and you can select the largish fonts \.{\\titlefont} |
| 1519 | 1519 | and \.{\\ttitlefont} in the title of your document, where \.{\\ttitlefont} |
| 1520 | 1520 | is a typewriter style of type. There are macros \.{\\UNIX/} and \.{\\CEE/} |
| @@ -14,19 +14,20 @@ if(cc=='\\'&&c==cc) c= '\0';} \ · 13 unmodified lines | ||
| 14 | 14 | #define ignore_line 7 \ |
| 15 | 15 | |
| 16 | 16 | /*2:*/ |
| 17 | −#line 47 "extex.w" | |
| 17 | +#line 47 "./extex.w" | |
| 18 | 18 | |
| 19 | 19 | #include <stdio.h> |
| 20 | 20 | #include <ctype.h> |
| 21 | +#include <string.h> | |
| 21 | 22 | extern void exit(); |
| 22 | 23 | |
| 23 | 24 | /*3:*/ |
| 24 | −#line 75 "extex.w" | |
| 25 | +#line 76 "./extex.w" | |
| 25 | 26 | |
| 26 | 27 | int c; |
| 27 | 28 | |
| 28 | 29 | /*:3*//*14:*/ |
| 29 | −#line 233 "extex.w" | |
| 30 | +#line 234 "./extex.w" | |
| 30 | 31 | |
| 31 | 32 | char ptab[]= {0,1,1,1,1,0, |
| 32 | 33 | 1,1,1,1,1,0,0,1, |
| @@ -39,7 +40,7 @@ char ptab[]= {0,1,1,1,1,0, · 6 unmodified lines | ||
| 39 | 40 | 0,0,0,1,1,1,0}; |
| 40 | 41 | |
| 41 | 42 | /*:14*//*17:*/ |
| 42 | −#line 290 "extex.w" | |
| 43 | +#line 291 "./extex.w" | |
| 43 | 44 | |
| 44 | 45 | char wtab[]= {start_section,nop,nop,nop,nop,nop,nop,nop, |
| 45 | 46 | start_name,nop,start_section,nop,nop,nop,start_index,nop, |
| @@ -55,10 +56,10 @@ nop,ignore_line,nop,nop,ignore_line,nop,nop,nop, · 9 unmodified lines | ||
| 55 | 56 | start_C,start_insert,nop,start_C,start_insert}; |
| 56 | 57 | |
| 57 | 58 | /*:17*/ |
| 58 | −#line 52 "extex.w" | |
| 59 | +#line 53 "./extex.w" | |
| 59 | 60 | |
| 60 | 61 | /*6:*/ |
| 61 | −#line 109 "extex.w" | |
| 62 | +#line 110 "./extex.w" | |
| 62 | 63 | |
| 63 | 64 | int get() |
| 64 | 65 | {register int x; |
| @@ -68,7 +69,7 @@ return x; · 3 unmodified lines | ||
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | /*:6*//*12:*/ |
| 71 | −#line 188 "extex.w" | |
| 72 | +#line 189 "./extex.w" | |
| 72 | 73 | |
| 73 | 74 | int controlseq() |
| 74 | 75 | { |
| @@ -83,7 +84,7 @@ if(l==1)b= c; · 8 unmodified lines | ||
| 83 | 84 | } |
| 84 | 85 | if(l==0)c= getchar(); |
| 85 | 86 | /*13:*/ |
| 86 | −#line 208 "extex.w" | |
| 87 | +#line 209 "./extex.w" | |
| 87 | 88 | |
| 88 | 89 | if((a>='"'&&a<='~'&&ptab[a-'"']==l)|| |
| 89 | 90 | (l==2&&(pair('a','e')||pair('A','E') |
| @@ -107,13 +108,13 @@ return 1; · 17 unmodified lines | ||
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | /*:13*/ |
| 110 | −#line 202 "extex.w" | |
| 111 | +#line 203 "./extex.w" | |
| 111 | 112 | ; |
| 112 | 113 | return 0; |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | 116 | /*:12*/ |
| 116 | −#line 53 "extex.w" | |
| 117 | +#line 54 "./extex.w" | |
| 117 | 118 | |
| 118 | 119 | |
| 119 | 120 | int main(argc,argv) |
| @@ -121,7 +122,7 @@ int argc; · 1 unmodified line | ||
| 121 | 122 | char*argv[]; |
| 122 | 123 | { |
| 123 | 124 | /*4:*/ |
| 124 | −#line 78 "extex.w" | |
| 125 | +#line 79 "./extex.w" | |
| 125 | 126 | |
| 126 | 127 | int web; |
| 127 | 128 | int comment; |
| @@ -130,17 +131,17 @@ int save_skipping; · 2 unmodified lines | ||
| 130 | 131 | register int cc; |
| 131 | 132 | |
| 132 | 133 | /*:4*/ |
| 133 | −#line 59 "extex.w" | |
| 134 | +#line 60 "./extex.w" | |
| 134 | 135 | ; |
| 135 | 136 | if(strlen(*argv)>=6&&strcmp(*argv+strlen(*argv)-6,"excweb")==0){ |
| 136 | 137 | web= 1; |
| 137 | 138 | /*15:*/ |
| 138 | −#line 248 "extex.w" | |
| 139 | +#line 249 "./extex.w" | |
| 139 | 140 | |
| 140 | 141 | ptab[12]= 1; |
| 141 | 142 | |
| 142 | 143 | /*:15*/ |
| 143 | −#line 62 "extex.w" | |
| 144 | +#line 63 "./extex.w" | |
| 144 | 145 | ; |
| 145 | 146 | }else web= 0; |
| 146 | 147 | comment= skipping= c= 0; |
| @@ -148,7 +149,7 @@ main_cycle:if(c)goto big_switch; · 1 unmodified line | ||
| 148 | 149 | restart:c= get(); |
| 149 | 150 | big_switch:switch(c){ |
| 150 | 151 | /*5:*/ |
| 151 | −#line 94 "extex.w" | |
| 152 | +#line 95 "./extex.w" | |
| 152 | 153 | |
| 153 | 154 | case'%':discard_to('\n');goto restart; |
| 154 | 155 | case'$':c= getchar(); |
| @@ -160,7 +161,7 @@ while(getchar()!='$'); · 5 unmodified lines | ||
| 160 | 161 | goto restart; |
| 161 | 162 | |
| 162 | 163 | /*:5*//*7:*/ |
| 163 | −#line 121 "extex.w" | |
| 164 | +#line 122 "./extex.w" | |
| 164 | 165 | |
| 165 | 166 | case'a':case'A': |
| 166 | 167 | case'b':case'B': |
| @@ -191,13 +192,13 @@ case'z':case'Z': · 24 unmodified lines | ||
| 191 | 192 | goto out_word; |
| 192 | 193 | |
| 193 | 194 | /*:7*//*11:*/ |
| 194 | −#line 184 "extex.w" | |
| 195 | +#line 185 "./extex.w" | |
| 195 | 196 | |
| 196 | 197 | case'\\':if(controlseq())goto control_seq_in_word; |
| 197 | 198 | goto main_cycle; |
| 198 | 199 | |
| 199 | 200 | /*:11*//*16:*/ |
| 200 | −#line 262 "extex.w" | |
| 201 | +#line 263 "./extex.w" | |
| 201 | 202 | |
| 202 | 203 | case'@':if(web)goto do_web; |
| 203 | 204 | goto restart; |
| @@ -215,13 +216,13 @@ goto skip_C; · 11 unmodified lines | ||
| 215 | 216 | goto big_switch; |
| 216 | 217 | |
| 217 | 218 | /*:16*/ |
| 218 | −#line 68 "extex.w" | |
| 219 | +#line 69 "./extex.w" | |
| 219 | 220 | |
| 220 | 221 | case EOF:exit(0); |
| 221 | 222 | default:goto restart; |
| 222 | 223 | } |
| 223 | 224 | /*8:*/ |
| 224 | −#line 154 "extex.w" | |
| 225 | +#line 155 "./extex.w" | |
| 225 | 226 | |
| 226 | 227 | out_word:putchar(c); |
| 227 | 228 | continue_word:c= getchar(); |
| @@ -239,13 +240,13 @@ end_word:putchar('\n'); · 11 unmodified lines | ||
| 239 | 240 | goto main_cycle; |
| 240 | 241 | |
| 241 | 242 | /*:8*//*10:*/ |
| 242 | −#line 180 "extex.w" | |
| 243 | +#line 181 "./extex.w" | |
| 243 | 244 | |
| 244 | 245 | control_seq_in_word:if(!c)goto continue_word; |
| 245 | 246 | goto checkout_word; |
| 246 | 247 | |
| 247 | 248 | /*:10*//*18:*/ |
| 248 | −#line 306 "extex.w" | |
| 249 | +#line 307 "./extex.w" | |
| 249 | 250 | |
| 250 | 251 | do_web:c= getchar(); |
| 251 | 252 | if(c<' '||c> 't')goto restart; |
| @@ -264,7 +265,7 @@ goto restart; · 12 unmodified lines | ||
| 264 | 265 | } |
| 265 | 266 | |
| 266 | 267 | /*:18*//*19:*/ |
| 267 | −#line 328 "extex.w" | |
| 268 | +#line 329 "./extex.w" | |
| 268 | 269 | |
| 269 | 270 | skip_C:save_skipping= 2; |
| 270 | 271 | skip_C_prime:skipping= 1; |
| @@ -303,7 +304,7 @@ default:continue; · 32 unmodified lines | ||
| 303 | 304 | } |
| 304 | 305 | |
| 305 | 306 | /*:19*/ |
| 306 | −#line 72 "extex.w" | |
| 307 | +#line 73 "./extex.w" | |
| 307 | 308 | ; |
| 308 | 309 | } |
| 309 | 310 | |
| @@ -47,6 +47,7 @@ any other programs that simulate finite-state automata.) · 46 unmodified lines | ||
| 47 | 47 | @c |
| 48 | 48 | #include <stdio.h> |
| 49 | 49 | #include <ctype.h> |
| 50 | +#include <string.h> | |
| 50 | 51 | extern void exit(); /* system routine that terminates execution */ |
| 51 | 52 | @# |
| 52 | 53 | @<Global variables@>@; |
| @@ -33,20 +33,20 @@ history= fatal_message;exit(wrap_up() ) ; \ · 32 unmodified lines | ||
| 33 | 33 | #define update_terminal fflush(stderr) \ |
| 34 | 34 | |
| 35 | 35 | /*1:*/ |
| 36 | −#line 15 "wmerge.w" | |
| 36 | +#line 15 "./wmerge.w" | |
| 37 | 37 | |
| 38 | 38 | #include <stdio.h> |
| 39 | 39 | #include <stdlib.h> |
| 40 | 40 | #include <ctype.h> |
| 41 | 41 | /*2:*/ |
| 42 | −#line 37 "wmerge.w" | |
| 42 | +#line 37 "./wmerge.w" | |
| 43 | 43 | |
| 44 | 44 | typedef short boolean; |
| 45 | 45 | typedef unsigned char eight_bits; |
| 46 | 46 | typedef char ASCII; |
| 47 | 47 | |
| 48 | 48 | /*:2*//*5:*/ |
| 49 | −#line 70 "wmerge.w" | |
| 49 | +#line 70 "./wmerge.w" | |
| 50 | 50 | |
| 51 | 51 | ASCII buffer[buf_size]; |
| 52 | 52 | ASCII*buffer_end= buffer+buf_size-2; |
| @@ -54,7 +54,7 @@ ASCII*limit; · 1 unmodified line | ||
| 54 | 54 | ASCII*loc; |
| 55 | 55 | |
| 56 | 56 | /*:5*//*7:*/ |
| 57 | −#line 136 "wmerge.w" | |
| 57 | +#line 136 "./wmerge.w" | |
| 58 | 58 | |
| 59 | 59 | int include_depth; |
| 60 | 60 | FILE*file[max_include_depth]; |
| @@ -71,18 +71,18 @@ boolean changing; · 10 unmodified lines | ||
| 71 | 71 | boolean web_file_open= 0; |
| 72 | 72 | |
| 73 | 73 | /*:7*//*8:*/ |
| 74 | −#line 162 "wmerge.w" | |
| 74 | +#line 162 "./wmerge.w" | |
| 75 | 75 | |
| 76 | 76 | char change_buffer[buf_size]; |
| 77 | 77 | char*change_limit; |
| 78 | 78 | |
| 79 | 79 | /*:8*//*23:*/ |
| 80 | −#line 486 "wmerge.w" | |
| 80 | +#line 486 "./wmerge.w" | |
| 81 | 81 | |
| 82 | 82 | int history= spotless; |
| 83 | 83 | |
| 84 | 84 | /*:23*//*30:*/ |
| 85 | −#line 584 "wmerge.w" | |
| 85 | +#line 584 "./wmerge.w" | |
| 86 | 86 | |
| 87 | 87 | int argc; |
| 88 | 88 | char**argv; |
| @@ -90,40 +90,40 @@ char out_file_name[max_file_name_length]; · 1 unmodified line | ||
| 90 | 90 | boolean flags[128]; |
| 91 | 91 | |
| 92 | 92 | /*:30*//*40:*/ |
| 93 | −#line 700 "wmerge.w" | |
| 93 | +#line 700 "./wmerge.w" | |
| 94 | 94 | |
| 95 | 95 | FILE*out_file; |
| 96 | 96 | |
| 97 | 97 | /*:40*/ |
| 98 | −#line 19 "wmerge.w" | |
| 98 | +#line 19 "./wmerge.w" | |
| 99 | 99 | |
| 100 | 100 | /*3:*/ |
| 101 | −#line 47 "wmerge.w" | |
| 101 | +#line 47 "./wmerge.w" | |
| 102 | 102 | |
| 103 | −extern int strlen(); | |
| 103 | +extern size_t strlen(); | |
| 104 | 104 | extern char*strcpy(); |
| 105 | 105 | extern int strncmp(); |
| 106 | 106 | extern char*strncpy(); |
| 107 | 107 | |
| 108 | 108 | /*:3*//*4:*/ |
| 109 | −#line 53 "wmerge.w" | |
| 109 | +#line 53 "./wmerge.w" | |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | /*:4*//*24:*/ |
| 113 | −#line 498 "wmerge.w" | |
| 113 | +#line 498 "./wmerge.w" | |
| 114 | 114 | |
| 115 | 115 | void err_print(); |
| 116 | 116 | |
| 117 | 117 | /*:24*//*32:*/ |
| 118 | −#line 608 "wmerge.w" | |
| 118 | +#line 608 "./wmerge.w" | |
| 119 | 119 | |
| 120 | 120 | void scan_args(); |
| 121 | 121 | |
| 122 | 122 | /*:32*/ |
| 123 | −#line 20 "wmerge.w" | |
| 123 | +#line 20 "./wmerge.w" | |
| 124 | 124 | |
| 125 | 125 | /*6:*/ |
| 126 | −#line 95 "wmerge.w" | |
| 126 | +#line 95 "./wmerge.w" | |
| 127 | 127 | |
| 128 | 128 | input_ln(fp) |
| 129 | 129 | FILE*fp; |
| @@ -145,14 +145,14 @@ return(1); · 15 unmodified lines | ||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /*:6*//*9:*/ |
| 148 | −#line 173 "wmerge.w" | |
| 148 | +#line 173 "./wmerge.w" | |
| 149 | 149 | |
| 150 | 150 | void |
| 151 | 151 | prime_the_change_buffer() |
| 152 | 152 | { |
| 153 | 153 | change_limit= change_buffer; |
| 154 | 154 | /*10:*/ |
| 155 | −#line 187 "wmerge.w" | |
| 155 | +#line 187 "./wmerge.w" | |
| 156 | 156 | |
| 157 | 157 | while(1){ |
| 158 | 158 | change_line++; |
| @@ -169,10 +169,10 @@ err_print("! Missing @x in change file"); · 10 unmodified lines | ||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /*:10*/ |
| 172 | −#line 178 "wmerge.w" | |
| 172 | +#line 178 "./wmerge.w" | |
| 173 | 173 | ; |
| 174 | 174 | /*11:*/ |
| 175 | −#line 204 "wmerge.w" | |
| 175 | +#line 204 "./wmerge.w" | |
| 176 | 176 | |
| 177 | 177 | do{ |
| 178 | 178 | change_line++; |
| @@ -184,10 +184,10 @@ return; · 5 unmodified lines | ||
| 184 | 184 | }while(limit==buffer); |
| 185 | 185 | |
| 186 | 186 | /*:11*/ |
| 187 | −#line 179 "wmerge.w" | |
| 187 | +#line 179 "./wmerge.w" | |
| 188 | 188 | ; |
| 189 | 189 | /*12:*/ |
| 190 | −#line 214 "wmerge.w" | |
| 190 | +#line 214 "./wmerge.w" | |
| 191 | 191 | |
| 192 | 192 | { |
| 193 | 193 | change_limit= change_buffer+(limit-buffer); |
| @@ -195,12 +195,12 @@ strncpy(change_buffer,buffer,limit-buffer+1); · 1 unmodified line | ||
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /*:12*/ |
| 198 | −#line 180 "wmerge.w" | |
| 198 | +#line 180 "./wmerge.w" | |
| 199 | 199 | ; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /*:9*//*13:*/ |
| 203 | −#line 232 "wmerge.w" | |
| 203 | +#line 232 "./wmerge.w" | |
| 204 | 204 | |
| 205 | 205 | void |
| 206 | 206 | check_change() |
| @@ -218,7 +218,7 @@ return; · 11 unmodified lines | ||
| 218 | 218 | if(limit> buffer+1&&buffer[0]=='@'){ |
| 219 | 219 | char xyz_code= isupper(buffer[1])?tolower(buffer[1]):buffer[1]; |
| 220 | 220 | /*14:*/ |
| 221 | −#line 265 "wmerge.w" | |
| 221 | +#line 265 "./wmerge.w" | |
| 222 | 222 | |
| 223 | 223 | if(xyz_code=='x'||xyz_code=='z'){ |
| 224 | 224 | loc= buffer+2;err_print("! Where is the matching @y?"); |
| @@ -236,11 +236,11 @@ return; · 11 unmodified lines | ||
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | /*:14*/ |
| 239 | −#line 249 "wmerge.w" | |
| 239 | +#line 249 "./wmerge.w" | |
| 240 | 240 | ; |
| 241 | 241 | } |
| 242 | 242 | /*12:*/ |
| 243 | −#line 214 "wmerge.w" | |
| 243 | +#line 214 "./wmerge.w" | |
| 244 | 244 | |
| 245 | 245 | { |
| 246 | 246 | change_limit= change_buffer+(limit-buffer); |
| @@ -248,7 +248,7 @@ strncpy(change_buffer,buffer,limit-buffer+1); · 1 unmodified line | ||
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /*:12*/ |
| 251 | −#line 251 "wmerge.w" | |
| 251 | +#line 251 "./wmerge.w" | |
| 252 | 252 | ; |
| 253 | 253 | changing= 0;cur_line++; |
| 254 | 254 | while(!input_ln(cur_file)){ |
| @@ -264,14 +264,14 @@ if(lines_dont_match)n++; · 9 unmodified lines | ||
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | /*:13*//*15:*/ |
| 267 | −#line 284 "wmerge.w" | |
| 267 | +#line 284 "./wmerge.w" | |
| 268 | 268 | |
| 269 | 269 | void |
| 270 | 270 | reset_input() |
| 271 | 271 | { |
| 272 | 272 | limit= buffer;loc= buffer+1;buffer[0]= ' '; |
| 273 | 273 | /*16:*/ |
| 274 | −#line 299 "wmerge.w" | |
| 274 | +#line 299 "./wmerge.w" | |
| 275 | 275 | |
| 276 | 276 | if((web_file= fopen(web_file_name,"r"))==NULL){ |
| 277 | 277 | strcpy(web_file_name,alt_web_file_name); |
| @@ -285,7 +285,7 @@ if((change_file= fopen(change_file_name,"r"))==NULL) · 7 unmodified lines | ||
| 285 | 285 | fatal("! Cannot open change file ",change_file_name); |
| 286 | 286 | |
| 287 | 287 | /*:16*/ |
| 288 | −#line 289 "wmerge.w" | |
| 288 | +#line 289 "./wmerge.w" | |
| 289 | 289 | ; |
| 290 | 290 | include_depth= 0;cur_line= 0;change_line= 0; |
| 291 | 291 | change_depth= include_depth; |
| @@ -294,14 +294,14 @@ limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= 0; · 2 unmodified lines | ||
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /*:15*//*17:*/ |
| 297 | −#line 317 "wmerge.w" | |
| 297 | +#line 317 "./wmerge.w" | |
| 298 | 298 | |
| 299 | 299 | int get_line() |
| 300 | 300 | { |
| 301 | 301 | restart: |
| 302 | 302 | if(changing&&include_depth==change_depth) |
| 303 | 303 | /*21:*/ |
| 304 | −#line 431 "wmerge.w" | |
| 304 | +#line 431 "./wmerge.w" | |
| 305 | 305 | { |
| 306 | 306 | change_line++; |
| 307 | 307 | if(!input_ln(change_file)){ |
| @@ -326,11 +326,11 @@ prime_the_change_buffer();changing= !changing; · 18 unmodified lines | ||
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /*:21*/ |
| 329 | −#line 322 "wmerge.w" | |
| 329 | +#line 322 "./wmerge.w" | |
| 330 | 330 | ; |
| 331 | 331 | if(!changing||include_depth> change_depth){ |
| 332 | 332 | /*20:*/ |
| 333 | −#line 415 "wmerge.w" | |
| 333 | +#line 415 "./wmerge.w" | |
| 334 | 334 | { |
| 335 | 335 | cur_line++; |
| 336 | 336 | while(!input_ln(cur_file)){ |
| @@ -348,7 +348,7 @@ if(change_limit> change_buffer)check_change(); · 11 unmodified lines | ||
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /*:20*/ |
| 351 | −#line 324 "wmerge.w" | |
| 351 | +#line 324 "./wmerge.w" | |
| 352 | 352 | ; |
| 353 | 353 | if(changing&&include_depth==change_depth)goto restart; |
| 354 | 354 | } |
| @@ -369,7 +369,7 @@ goto restart; · 14 unmodified lines | ||
| 369 | 369 | } |
| 370 | 370 | include_depth++; |
| 371 | 371 | /*19:*/ |
| 372 | −#line 369 "wmerge.w" | |
| 372 | +#line 369 "./wmerge.w" | |
| 373 | 373 | { |
| 374 | 374 | char temp_file_name[max_file_name_length]; |
| 375 | 375 | char*cur_file_name_end= cur_file_name+max_file_name_length-1; |
| @@ -417,7 +417,7 @@ include_depth--;err_print("! Cannot open include file");goto restart; · 41 unmodified lines | ||
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | /*:19*/ |
| 420 | −#line 343 "wmerge.w" | |
| 420 | +#line 343 "./wmerge.w" | |
| 421 | 421 | ; |
| 422 | 422 | } |
| 423 | 423 | return 1; |
| @@ -431,7 +431,7 @@ putc('\n',out_file); · 7 unmodified lines | ||
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | /*:17*//*22:*/ |
| 434 | −#line 457 "wmerge.w" | |
| 434 | +#line 457 "./wmerge.w" | |
| 435 | 435 | |
| 436 | 436 | void |
| 437 | 437 | check_complete(){ |
| @@ -445,7 +445,7 @@ err_print("! Change file entry did not match"); · 7 unmodified lines | ||
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /*:22*//*25:*/ |
| 448 | −#line 502 "wmerge.w" | |
| 448 | +#line 502 "./wmerge.w" | |
| 449 | 449 | |
| 450 | 450 | void |
| 451 | 451 | err_print(s) |
| @@ -454,7 +454,7 @@ char*s; · 2 unmodified lines | ||
| 454 | 454 | char*k,*l; |
| 455 | 455 | fprintf(stderr,*s=='!'?"\n%s":"%s",s); |
| 456 | 456 | if(web_file_open)/*26:*/ |
| 457 | −#line 523 "wmerge.w" | |
| 457 | +#line 523 "./wmerge.w" | |
| 458 | 458 | |
| 459 | 459 | {if(changing&&include_depth==change_depth) |
| 460 | 460 | fprintf(stderr,". (l. %d of change file)\n",change_line); |
| @@ -473,18 +473,18 @@ putc('\n',stderr); · 12 unmodified lines | ||
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | /*:26*/ |
| 476 | −#line 509 "wmerge.w" | |
| 476 | +#line 509 "./wmerge.w" | |
| 477 | 477 | |
| 478 | 478 | else putc('\n',stderr); |
| 479 | 479 | update_terminal;mark_error; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | /*:25*//*28:*/ |
| 483 | −#line 555 "wmerge.w" | |
| 483 | +#line 555 "./wmerge.w" | |
| 484 | 484 | |
| 485 | 485 | wrap_up(){ |
| 486 | 486 | /*29:*/ |
| 487 | −#line 562 "wmerge.w" | |
| 487 | +#line 562 "./wmerge.w" | |
| 488 | 488 | |
| 489 | 489 | switch(history){ |
| 490 | 490 | case spotless:if(show_happiness)fprintf(stderr,"(No errors were found.)\n");break; |
| @@ -496,14 +496,14 @@ case fatal_message:fprintf(stderr,"(That was a fatal error, my friend.)\n"); · 5 unmodified lines | ||
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | /*:29*/ |
| 499 | −#line 557 "wmerge.w" | |
| 499 | +#line 557 "./wmerge.w" | |
| 500 | 500 | ; |
| 501 | 501 | if(history> harmless_message)return(1); |
| 502 | 502 | else return(0); |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | /*:28*//*33:*/ |
| 506 | −#line 612 "wmerge.w" | |
| 506 | +#line 612 "./wmerge.w" | |
| 507 | 507 | |
| 508 | 508 | void |
| 509 | 509 | scan_args() |
| @@ -516,7 +516,7 @@ boolean flag_change; · 6 unmodified lines | ||
| 516 | 516 | |
| 517 | 517 | while(--argc> 0){ |
| 518 | 518 | if(**(++argv)=='-'||**argv=='+')/*37:*/ |
| 519 | −#line 682 "wmerge.w" | |
| 519 | +#line 682 "./wmerge.w" | |
| 520 | 520 | |
| 521 | 521 | { |
| 522 | 522 | if(**argv=='-')flag_change= 0; |
| @@ -526,7 +526,7 @@ flags[*dot_pos]= flag_change; · 3 unmodified lines | ||
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | /*:37*/ |
| 529 | −#line 623 "wmerge.w" | |
| 529 | +#line 623 "./wmerge.w" | |
| 530 | 530 | |
| 531 | 531 | else{ |
| 532 | 532 | s= *argv;dot_pos= NULL; |
| @@ -536,16 +536,16 @@ else if(*s=='/')dot_pos= NULL,++s; · 3 unmodified lines | ||
| 536 | 536 | else s++; |
| 537 | 537 | } |
| 538 | 538 | if(!found_web)/*34:*/ |
| 539 | −#line 648 "wmerge.w" | |
| 539 | +#line 648 "./wmerge.w" | |
| 540 | 540 | |
| 541 | 541 | { |
| 542 | 542 | if(s-*argv> max_file_name_length-5) |
| 543 | 543 | /*39:*/ |
| 544 | −#line 695 "wmerge.w" | |
| 544 | +#line 695 "./wmerge.w" | |
| 545 | 545 | fatal("! Filename too long\n",*argv); |
| 546 | 546 | |
| 547 | 547 | /*:39*/ |
| 548 | −#line 651 "wmerge.w" | |
| 548 | +#line 651 "./wmerge.w" | |
| 549 | 549 | ; |
| 550 | 550 | if(dot_pos==NULL) |
| 551 | 551 | sprintf(web_file_name,"%s.w",*argv); |
| @@ -559,19 +559,19 @@ found_web= 1; · 7 unmodified lines | ||
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | /*:34*/ |
| 562 | −#line 631 "wmerge.w" | |
| 562 | +#line 631 "./wmerge.w" | |
| 563 | 563 | |
| 564 | 564 | else if(!found_change)/*35:*/ |
| 565 | −#line 663 "wmerge.w" | |
| 565 | +#line 663 "./wmerge.w" | |
| 566 | 566 | |
| 567 | 567 | { |
| 568 | 568 | if(s-*argv> max_file_name_length-4) |
| 569 | 569 | /*39:*/ |
| 570 | −#line 695 "wmerge.w" | |
| 570 | +#line 695 "./wmerge.w" | |
| 571 | 571 | fatal("! Filename too long\n",*argv); |
| 572 | 572 | |
| 573 | 573 | /*:39*/ |
| 574 | −#line 666 "wmerge.w" | |
| 574 | +#line 666 "./wmerge.w" | |
| 575 | 575 | ; |
| 576 | 576 | if(dot_pos==NULL) |
| 577 | 577 | sprintf(change_file_name,"%s.ch",*argv); |
| @@ -580,19 +580,19 @@ found_change= 1; · 2 unmodified lines | ||
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | /*:35*/ |
| 583 | −#line 632 "wmerge.w" | |
| 583 | +#line 632 "./wmerge.w" | |
| 584 | 584 | |
| 585 | 585 | else if(!found_out)/*36:*/ |
| 586 | −#line 673 "wmerge.w" | |
| 586 | +#line 673 "./wmerge.w" | |
| 587 | 587 | |
| 588 | 588 | { |
| 589 | 589 | if(s-*argv> max_file_name_length-5) |
| 590 | 590 | /*39:*/ |
| 591 | −#line 695 "wmerge.w" | |
| 591 | +#line 695 "./wmerge.w" | |
| 592 | 592 | fatal("! Filename too long\n",*argv); |
| 593 | 593 | |
| 594 | 594 | /*:39*/ |
| 595 | −#line 676 "wmerge.w" | |
| 595 | +#line 676 "./wmerge.w" | |
| 596 | 596 | ; |
| 597 | 597 | if(dot_pos==NULL)sprintf(out_file_name,"%s.out",*argv); |
| 598 | 598 | else strcpy(out_file_name,*argv); |
| @@ -600,50 +600,50 @@ found_out= 1; · 1 unmodified line | ||
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | /*:36*/ |
| 603 | −#line 633 "wmerge.w" | |
| 603 | +#line 633 "./wmerge.w" | |
| 604 | 604 | |
| 605 | 605 | else/*38:*/ |
| 606 | −#line 690 "wmerge.w" | |
| 606 | +#line 690 "./wmerge.w" | |
| 607 | 607 | |
| 608 | 608 | { |
| 609 | 609 | fatal("! Usage: wmerge webfile[.w] [changefile[.ch] [outfile[.out]]]\n","") |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | /*:38*/ |
| 613 | −#line 634 "wmerge.w" | |
| 613 | +#line 634 "./wmerge.w" | |
| 614 | 614 | ; |
| 615 | 615 | } |
| 616 | 616 | } |
| 617 | 617 | if(!found_web)/*38:*/ |
| 618 | −#line 690 "wmerge.w" | |
| 618 | +#line 690 "./wmerge.w" | |
| 619 | 619 | |
| 620 | 620 | { |
| 621 | 621 | fatal("! Usage: wmerge webfile[.w] [changefile[.ch] [outfile[.out]]]\n","") |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /*:38*/ |
| 625 | −#line 637 "wmerge.w" | |
| 625 | +#line 637 "./wmerge.w" | |
| 626 | 626 | ; |
| 627 | 627 | if(!found_change)strcpy(change_file_name,"/dev/null"); |
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | /*:33*/ |
| 631 | −#line 21 "wmerge.w" | |
| 631 | +#line 21 "./wmerge.w" | |
| 632 | 632 | |
| 633 | 633 | main(ac,av) |
| 634 | 634 | int ac;char**av; |
| 635 | 635 | { |
| 636 | 636 | argc= ac;argv= av; |
| 637 | 637 | /*31:*/ |
| 638 | −#line 592 "wmerge.w" | |
| 638 | +#line 592 "./wmerge.w" | |
| 639 | 639 | |
| 640 | 640 | show_banner= show_happiness= 1; |
| 641 | 641 | |
| 642 | 642 | /*:31*/ |
| 643 | −#line 26 "wmerge.w" | |
| 643 | +#line 26 "./wmerge.w" | |
| 644 | 644 | ; |
| 645 | 645 | /*41:*/ |
| 646 | −#line 703 "wmerge.w" | |
| 646 | +#line 703 "./wmerge.w" | |
| 647 | 647 | |
| 648 | 648 | scan_args(); |
| 649 | 649 | if(out_file_name[0]=='\0')out_file= stdout; |
| @@ -652,7 +652,7 @@ fatal("! Cannot open output file ",out_file_name); · 2 unmodified lines | ||
| 652 | 652 | |
| 653 | 653 | |
| 654 | 654 | /*:41*/ |
| 655 | −#line 27 "wmerge.w" | |
| 655 | +#line 27 "./wmerge.w" | |
| 656 | 656 | ; |
| 657 | 657 | reset_input(); |
| 658 | 658 | while(get_line()) |
| @@ -45,7 +45,7 @@ are not as standard as the names of the functions. (There's confusion · 44 unmodified lines | ||
| 45 | 45 | between \.{<string.h>} and \.{<strings.h>}.) |
| 46 | 46 | |
| 47 | 47 | @<Predecl...@>= |
| 48 | −extern int strlen(); /* length of string */ | |
| 48 | +extern size_t strlen(); /* length of string */ | |
| 49 | 49 | extern char* strcpy(); /* copy one string to another */ |
| 50 | 50 | extern int strncmp(); /* compare up to $n$ string characters */ |
| 51 | 51 | extern char* strncpy(); /* copy up to $n$ string characters */ |
| @@ -9,17 +9,18 @@ · 8 unmodified lines | ||
| 9 | 9 | return x;} \ |
| 10 | 10 | |
| 11 | 11 | /*3:*/ |
| 12 | −#line 92 "wordtest.w" | |
| 12 | +#line 92 "./wordtest.w" | |
| 13 | 13 | |
| 14 | 14 | #include <stdio.h> |
| 15 | +#include <stdlib.h> | |
| 15 | 16 | |
| 16 | 17 | /*4:*/ |
| 17 | −#line 107 "wordtest.w" | |
| 18 | +#line 108 "./wordtest.w" | |
| 18 | 19 | |
| 19 | 20 | typedef unsigned char byte; |
| 20 | 21 | |
| 21 | 22 | /*:4*//*9:*/ |
| 22 | −#line 195 "wordtest.w" | |
| 23 | +#line 196 "./wordtest.w" | |
| 23 | 24 | |
| 24 | 25 | typedef struct node_struct{ |
| 25 | 26 | struct node_struct*left,*right; |
| @@ -28,7 +29,7 @@ unsigned long rank; · 2 unmodified lines | ||
| 28 | 29 | }node; |
| 29 | 30 | |
| 30 | 31 | /*:9*//*20:*/ |
| 31 | −#line 391 "wordtest.w" | |
| 32 | +#line 392 "./wordtest.w" | |
| 32 | 33 | |
| 33 | 34 | typedef struct filenode_struct{ |
| 34 | 35 | struct filenode_struct*link; |
| @@ -40,14 +41,14 @@ byte*endword; · 5 unmodified lines | ||
| 40 | 41 | }filenode; |
| 41 | 42 | |
| 42 | 43 | /*:20*/ |
| 43 | −#line 95 "wordtest.w" | |
| 44 | +#line 96 "./wordtest.w" | |
| 44 | 45 | |
| 45 | 46 | int main(argc,argv) |
| 46 | 47 | int argc; |
| 47 | 48 | char*argv[]; |
| 48 | 49 | { |
| 49 | 50 | /*5:*/ |
| 50 | −#line 110 "wordtest.w" | |
| 51 | +#line 111 "./wordtest.w" | |
| 51 | 52 | |
| 52 | 53 | int targc; |
| 53 | 54 | byte**targv; |
| @@ -59,12 +60,12 @@ register int c; · 5 unmodified lines | ||
| 59 | 60 | register byte*u,*v; |
| 60 | 61 | |
| 61 | 62 | /*:5*//*12:*/ |
| 62 | −#line 251 "wordtest.w" | |
| 63 | +#line 252 "./wordtest.w" | |
| 63 | 64 | |
| 64 | 65 | unsigned long current_rank= 0; |
| 65 | 66 | |
| 66 | 67 | /*:12*//*16:*/ |
| 67 | −#line 309 "wordtest.w" | |
| 68 | +#line 310 "./wordtest.w" | |
| 68 | 69 | |
| 69 | 70 | node*next_node= NULL,*bad_node= NULL; |
| 70 | 71 | byte*next_string= NULL,*bad_string= NULL; |
| @@ -73,23 +74,23 @@ byte*buffer; · 2 unmodified lines | ||
| 73 | 74 | int l; |
| 74 | 75 | |
| 75 | 76 | /*:16*//*22:*/ |
| 76 | −#line 409 "wordtest.w" | |
| 77 | +#line 410 "./wordtest.w" | |
| 77 | 78 | |
| 78 | 79 | filenode*curfile; |
| 79 | 80 | filenode*f; |
| 80 | 81 | |
| 81 | 82 | /*:22*/ |
| 82 | −#line 100 "wordtest.w" | |
| 83 | +#line 101 "./wordtest.w" | |
| 83 | 84 | ; |
| 84 | 85 | /*6:*/ |
| 85 | −#line 122 "wordtest.w" | |
| 86 | +#line 123 "./wordtest.w" | |
| 86 | 87 | |
| 87 | 88 | for(c= 0;c<256;c++)ord[c]= c; |
| 88 | 89 | delta= 0; |
| 89 | 90 | targc= argc-1;targv= (byte**)argv+1; |
| 90 | 91 | while(targc&&**targv=='-'){ |
| 91 | 92 | /*7:*/ |
| 92 | −#line 139 "wordtest.w" | |
| 93 | +#line 140 "./wordtest.w" | |
| 93 | 94 | |
| 94 | 95 | switch((*targv)[1]){ |
| 95 | 96 | case'a':for(c= delta,u= *targv+2;*u;u++)ord[*u]= ++c;break; |
| @@ -110,7 +111,7 @@ return-1; · 14 unmodified lines | ||
| 110 | 111 | } |
| 111 | 112 | |
| 112 | 113 | /*:7*/ |
| 113 | −#line 127 "wordtest.w" | |
| 114 | +#line 128 "./wordtest.w" | |
| 114 | 115 | ; |
| 115 | 116 | targc--;targv++; |
| 116 | 117 | } |
| @@ -119,7 +120,7 @@ else{ · 2 unmodified lines | ||
| 119 | 120 | breakchar= '\0'; |
| 120 | 121 | for(c= 255;c;c--)if(ord[c]<0)breakchar= c; |
| 121 | 122 | if(!breakchar)/*8:*/ |
| 122 | −#line 158 "wordtest.w" | |
| 123 | +#line 159 "./wordtest.w" | |
| 123 | 124 | |
| 124 | 125 | { |
| 125 | 126 | ord['\n']= -1; |
| @@ -128,11 +129,11 @@ for(c= 1;c<=26;c++)ord['a'-1+c]= 'A'-1+c; · 2 unmodified lines | ||
| 128 | 129 | } |
| 129 | 130 | |
| 130 | 131 | /*:8*/ |
| 131 | −#line 134 "wordtest.w" | |
| 132 | +#line 135 "./wordtest.w" | |
| 132 | 133 | ; |
| 133 | 134 | } |
| 134 | 135 | /*21:*/ |
| 135 | −#line 401 "wordtest.w" | |
| 136 | +#line 402 "./wordtest.w" | |
| 136 | 137 | |
| 137 | 138 | if(targc){ |
| 138 | 139 | curfile= (filenode*)calloc(targc,sizeof(filenode)); |
| @@ -142,10 +143,10 @@ f->link= curfile; · 3 unmodified lines | ||
| 142 | 143 | }else curfile= NULL; |
| 143 | 144 | |
| 144 | 145 | /*:21*/ |
| 145 | −#line 136 "wordtest.w" | |
| 146 | +#line 137 "./wordtest.w" | |
| 146 | 147 | ; |
| 147 | 148 | for(;targc;targc--,targv++)/*23:*/ |
| 148 | −#line 413 "wordtest.w" | |
| 149 | +#line 414 "./wordtest.w" | |
| 149 | 150 | |
| 150 | 151 | { |
| 151 | 152 | curfile->dfile= fopen((char*)*targv,"r"); |
| @@ -161,20 +162,20 @@ curfile= curfile->link; · 9 unmodified lines | ||
| 161 | 162 | } |
| 162 | 163 | |
| 163 | 164 | /*:23*/ |
| 164 | −#line 137 "wordtest.w" | |
| 165 | +#line 138 "./wordtest.w" | |
| 165 | 166 | ; |
| 166 | 167 | |
| 167 | 168 | /*:6*/ |
| 168 | −#line 101 "wordtest.w" | |
| 169 | +#line 102 "./wordtest.w" | |
| 169 | 170 | ; |
| 170 | 171 | /*17:*/ |
| 171 | −#line 319 "wordtest.w" | |
| 172 | +#line 320 "./wordtest.w" | |
| 172 | 173 | |
| 173 | 174 | buffer= (byte*)malloc(max_length+1); |
| 174 | 175 | if(buffer==NULL)out_of_mem(-5); |
| 175 | 176 | while(1){ |
| 176 | 177 | /*18:*/ |
| 177 | −#line 332 "wordtest.w" | |
| 178 | +#line 333 "./wordtest.w" | |
| 178 | 179 | |
| 179 | 180 | u= buffer;l= 0; |
| 180 | 181 | while(l<max_length){ |
| @@ -196,11 +197,11 @@ l++; · 15 unmodified lines | ||
| 196 | 197 | *u= breakchar; |
| 197 | 198 | |
| 198 | 199 | /*:18*/ |
| 199 | −#line 323 "wordtest.w" | |
| 200 | +#line 324 "./wordtest.w" | |
| 200 | 201 | ; |
| 201 | 202 | if(l){ |
| 202 | 203 | /*10:*/ |
| 203 | −#line 213 "wordtest.w" | |
| 204 | +#line 214 "./wordtest.w" | |
| 204 | 205 | |
| 205 | 206 | {register node*p= root; |
| 206 | 207 | while(p){ |
| @@ -212,10 +213,10 @@ else p= p->right; · 5 unmodified lines | ||
| 212 | 213 | } |
| 213 | 214 | |
| 214 | 215 | /*:10*/ |
| 215 | −#line 325 "wordtest.w" | |
| 216 | +#line 326 "./wordtest.w" | |
| 216 | 217 | ; |
| 217 | 218 | /*11:*/ |
| 218 | −#line 235 "wordtest.w" | |
| 219 | +#line 236 "./wordtest.w" | |
| 219 | 220 | |
| 220 | 221 | {register node*p,**q,**qq,*r; |
| 221 | 222 | current_rank+= PHICLONE; |
| @@ -227,7 +228,7 @@ if(ord[*u]<ord[*v])q= &(p->left),p= *q; · 5 unmodified lines | ||
| 227 | 228 | else q= &(p->right),p= *q; |
| 228 | 229 | } |
| 229 | 230 | /*14:*/ |
| 230 | −#line 285 "wordtest.w" | |
| 231 | +#line 286 "./wordtest.w" | |
| 231 | 232 | |
| 232 | 233 | if(next_node==bad_node){ |
| 233 | 234 | next_node= (node*)calloc(NODES_PER_BLOCK,sizeof(node)); |
| @@ -236,7 +237,7 @@ bad_node= next_node+NODES_PER_BLOCK; · 2 unmodified lines | ||
| 236 | 237 | } |
| 237 | 238 | r= next_node++; |
| 238 | 239 | /*15:*/ |
| 239 | −#line 295 "wordtest.w" | |
| 240 | +#line 296 "./wordtest.w" | |
| 240 | 241 | |
| 241 | 242 | if(next_string+l+1>=bad_string){int block_size= CHARS_PER_BLOCK+l+1; |
| 242 | 243 | next_string= (byte*)malloc(block_size); |
| @@ -249,16 +250,16 @@ for(u= buffer,v= next_string;ord[*u]> 0;u++,v++)*v= *u; · 6 unmodified lines | ||
| 249 | 250 | next_string= v+1; |
| 250 | 251 | |
| 251 | 252 | /*:15*/ |
| 252 | −#line 293 "wordtest.w" | |
| 253 | +#line 294 "./wordtest.w" | |
| 253 | 254 | ; |
| 254 | 255 | |
| 255 | 256 | /*:14*/ |
| 256 | −#line 245 "wordtest.w" | |
| 257 | +#line 246 "./wordtest.w" | |
| 257 | 258 | ; |
| 258 | 259 | r->rank= current_rank; |
| 259 | 260 | *q= r; |
| 260 | 261 | /*13:*/ |
| 261 | −#line 259 "wordtest.w" | |
| 262 | +#line 260 "./wordtest.w" | |
| 262 | 263 | |
| 263 | 264 | q= &(r->left);qq= &(r->right); |
| 264 | 265 | while(p){ |
| @@ -276,12 +277,12 @@ p= *q; · 11 unmodified lines | ||
| 276 | 277 | *q= *qq= NULL; |
| 277 | 278 | |
| 278 | 279 | /*:13*/ |
| 279 | −#line 248 "wordtest.w" | |
| 280 | +#line 249 "./wordtest.w" | |
| 280 | 281 | ; |
| 281 | 282 | } |
| 282 | 283 | |
| 283 | 284 | /*:11*/ |
| 284 | −#line 326 "wordtest.w" | |
| 285 | +#line 327 "./wordtest.w" | |
| 285 | 286 | ; |
| 286 | 287 | found:; |
| 287 | 288 | } |
| @@ -289,10 +290,10 @@ found:; · 1 unmodified line | ||
| 289 | 290 | done:; |
| 290 | 291 | |
| 291 | 292 | /*:17*/ |
| 292 | −#line 102 "wordtest.w" | |
| 293 | +#line 103 "./wordtest.w" | |
| 293 | 294 | ; |
| 294 | 295 | /*19:*/ |
| 295 | −#line 358 "wordtest.w" | |
| 296 | +#line 359 "./wordtest.w" | |
| 296 | 297 | |
| 297 | 298 | if(root!=NULL){register node*p,*q; |
| 298 | 299 | p= root; |
| @@ -305,7 +306,7 @@ root= p; · 6 unmodified lines | ||
| 305 | 306 | p= q; |
| 306 | 307 | } |
| 307 | 308 | visit:/*25:*/ |
| 308 | −#line 437 "wordtest.w" | |
| 309 | +#line 438 "./wordtest.w" | |
| 309 | 310 | |
| 310 | 311 | while(curfile!=NULL){ |
| 311 | 312 | for(u= p->keyword,v= curfile->curword;ord[*u]==ord[*v];u++,v++); |
| @@ -313,10 +314,10 @@ if(*u=='\0'&&*v==breakchar)goto word_done; · 1 unmodified line | ||
| 313 | 314 | |
| 314 | 315 | if(ord[*u]<ord[*v])break; |
| 315 | 316 | /*27:*/ |
| 316 | −#line 452 "wordtest.w" | |
| 317 | +#line 453 "./wordtest.w" | |
| 317 | 318 | |
| 318 | 319 | /*28:*/ |
| 319 | −#line 472 "wordtest.w" | |
| 320 | +#line 473 "./wordtest.w" | |
| 320 | 321 | |
| 321 | 322 | v= curfile->curword; |
| 322 | 323 | l= max_length; |
| @@ -342,7 +343,7 @@ break; · 19 unmodified lines | ||
| 342 | 343 | } |
| 343 | 344 | if(u==w){ |
| 344 | 345 | /*29:*/ |
| 345 | −#line 504 "wordtest.w" | |
| 346 | +#line 505 "./wordtest.w" | |
| 346 | 347 | |
| 347 | 348 | if(ferror(curfile->dfile)){ |
| 348 | 349 | fprintf(stderr,"%s: File read error on dictionary file!\n",*argv); |
| @@ -363,7 +364,7 @@ curfile->limit= curfile->buf+fread(curfile->buf,1,BUFSIZ,curfile->dfile); · 14 unmodified lines | ||
| 363 | 364 | curfile->pos= curfile->buf; |
| 364 | 365 | |
| 365 | 366 | /*:29*/ |
| 366 | −#line 497 "wordtest.w" | |
| 367 | +#line 498 "./wordtest.w" | |
| 367 | 368 | ; |
| 368 | 369 | }else curfile->pos= u+1; |
| 369 | 370 | } |
| @@ -372,15 +373,15 @@ curfile->endword= v; · 2 unmodified lines | ||
| 372 | 373 | update_done:; |
| 373 | 374 | |
| 374 | 375 | /*:28*/ |
| 375 | −#line 453 "wordtest.w" | |
| 376 | +#line 454 "./wordtest.w" | |
| 376 | 377 | ; |
| 377 | 378 | /*30:*/ |
| 378 | −#line 523 "wordtest.w" | |
| 379 | +#line 524 "./wordtest.w" | |
| 379 | 380 | |
| 380 | 381 | if(curfile!=NULL){filenode*sentinel= curfile; |
| 381 | 382 | for(f= curfile->link;f!=sentinel;f= f->link) |
| 382 | 383 | /*31:*/ |
| 383 | −#line 529 "wordtest.w" | |
| 384 | +#line 530 "./wordtest.w" | |
| 384 | 385 | |
| 385 | 386 | { |
| 386 | 387 | *f->endword= '\0'; |
| @@ -390,31 +391,31 @@ if(ord[*u]<ord[*v])curfile= f; · 3 unmodified lines | ||
| 390 | 391 | } |
| 391 | 392 | |
| 392 | 393 | /*:31*/ |
| 393 | −#line 526 "wordtest.w" | |
| 394 | +#line 527 "./wordtest.w" | |
| 394 | 395 | ; |
| 395 | 396 | } |
| 396 | 397 | |
| 397 | 398 | /*:30*/ |
| 398 | −#line 455 "wordtest.w" | |
| 399 | +#line 456 "./wordtest.w" | |
| 399 | 400 | ; |
| 400 | 401 | |
| 401 | 402 | /*:27*/ |
| 402 | −#line 443 "wordtest.w" | |
| 403 | +#line 444 "./wordtest.w" | |
| 403 | 404 | ; |
| 404 | 405 | } |
| 405 | 406 | /*26:*/ |
| 406 | −#line 448 "wordtest.w" | |
| 407 | +#line 449 "./wordtest.w" | |
| 407 | 408 | |
| 408 | 409 | for(u= p->keyword;*u;u++)putchar(*u); |
| 409 | 410 | putchar(breakchar); |
| 410 | 411 | |
| 411 | 412 | /*:26*/ |
| 412 | −#line 445 "wordtest.w" | |
| 413 | +#line 446 "./wordtest.w" | |
| 413 | 414 | |
| 414 | 415 | word_done:; |
| 415 | 416 | |
| 416 | 417 | /*:25*/ |
| 417 | −#line 369 "wordtest.w" | |
| 418 | +#line 370 "./wordtest.w" | |
| 418 | 419 | ; |
| 419 | 420 | if(p->right==NULL){ |
| 420 | 421 | if(root==NULL)break; |
| @@ -426,7 +427,7 @@ goto visit; · 5 unmodified lines | ||
| 426 | 427 | } |
| 427 | 428 | |
| 428 | 429 | /*:19*/ |
| 429 | −#line 103 "wordtest.w" | |
| 430 | +#line 104 "./wordtest.w" | |
| 430 | 431 | ; |
| 431 | 432 | return 0; |
| 432 | 433 | } |
| @@ -91,6 +91,7 @@ a nonzero value is returned. · 90 unmodified lines | ||
| 91 | 91 | |
| 92 | 92 | @p |
| 93 | 93 | #include <stdio.h> |
| 94 | +#include <stdlib.h> | |
| 94 | 95 | @# |
| 95 | 96 | @<Typedefs@>@; |
| 96 | 97 | int main(argc,argv) |