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