summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/common.c')
-rw-r--r--Build/source/texk/web2c/cwebdir/common.c331
1 files changed, 164 insertions, 167 deletions
diff --git a/Build/source/texk/web2c/cwebdir/common.c b/Build/source/texk/web2c/cwebdir/common.c
index 7dd0f0c0838..52c0d37dde7 100644
--- a/Build/source/texk/web2c/cwebdir/common.c
+++ b/Build/source/texk/web2c/cwebdir/common.c
@@ -1,8 +1,8 @@
/*1:*/
-#line 66 "common.w"
+#line 62 "common.w"
/*3:*/
-#line 46 "common.h"
+#line 44 "common.h"
#include <ctype.h>
#include <stdbool.h>
@@ -13,7 +13,7 @@
#include <string.h>
/*:3*/
-#line 67 "common.w"
+#line 63 "common.w"
#define ctangle false
#define cweave true \
@@ -34,12 +34,18 @@
#define period_ast 026
#define minus_gt_ast 027 \
-#define xisalpha(c) (isalpha((eight_bits) c) &&((eight_bits) c<0200) )
-#define xisdigit(c) (isdigit((eight_bits) c) &&((eight_bits) c<0200) )
-#define xisspace(c) (isspace((eight_bits) c) &&((eight_bits) c<0200) )
-#define xislower(c) (islower((eight_bits) c) &&((eight_bits) c<0200) )
-#define xisupper(c) (isupper((eight_bits) c) &&((eight_bits) c<0200) )
-#define xisxdigit(c) (isxdigit((eight_bits) c) &&((eight_bits) c<0200) ) \
+#define compress(c) if(loc++<=limit) return c \
+
+#define xisalpha(c) (isalpha((eight_bits) (c) ) &&((eight_bits) (c) <0200) )
+#define xisdigit(c) (isdigit((eight_bits) (c) ) &&((eight_bits) (c) <0200) )
+#define xisspace(c) (isspace((eight_bits) (c) ) &&((eight_bits) (c) <0200) )
+#define xislower(c) (islower((eight_bits) (c) ) &&((eight_bits) (c) <0200) )
+#define xisupper(c) (isupper((eight_bits) (c) ) &&((eight_bits) (c) <0200) )
+#define xisxdigit(c) (isxdigit((eight_bits) (c) ) &&((eight_bits) (c) <0200) )
+#define isxalpha(c) ((c) =='_'||(c) =='$') \
+
+#define ishigh(c) ((eight_bits) (c) > 0177) \
+ \
#define max_include_depth 10 \
@@ -74,10 +80,7 @@
#define update_terminal fflush(stdout)
#define new_line putchar('\n')
-#define putxchar putchar
-#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout)
-#define C_printf(c,a) fprintf(C_file,c,a)
-#define C_putc(c) putc(c,C_file) \
+#define term_write(a,b) fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout) \
#define max_bytes 1000000 \
@@ -94,7 +97,8 @@
#define lines_dont_match (change_limit-change_buffer!=limit-buffer|| \
strncmp(buffer,change_buffer,(size_t) (limit-buffer) ) ) \
-#define if_section_start_make_pending(b) {*limit= '!'; \
+#define if_section_start_make_pending(b) { \
+*limit= '!'; \
for(loc= buffer;xisspace(*loc) ;loc++) ; \
*limit= ' '; \
if(*loc=='@'&&(xisspace(*(loc+1) ) ||*(loc+1) =='*') ) change_pending= b; \
@@ -121,10 +125,10 @@ err_print("! Include file name too long") ;goto restart;} \
#define flag_change (**argv!='-')
-#line 68 "common.w"
+#line 64 "common.w"
/*2:*/
-#line 37 "common.h"
+#line 35 "common.h"
typedef bool boolean;
typedef uint8_t eight_bits;
@@ -141,7 +145,7 @@ extern char*id_first;
extern char*id_loc;
/*:4*//*5:*/
-#line 88 "common.h"
+#line 92 "common.h"
extern char buffer[];
extern char*buffer_end;
@@ -149,7 +153,7 @@ extern char*loc;
extern char*limit;
/*:5*//*6:*/
-#line 105 "common.h"
+#line 109 "common.h"
extern int include_depth;
extern FILE*file[];
@@ -165,7 +169,7 @@ extern boolean changing;
extern boolean web_file_open;
/*:6*//*8:*/
-#line 125 "common.h"
+#line 129 "common.h"
extern sixteen_bits section_count;
extern boolean changed_section[];
@@ -173,7 +177,7 @@ extern boolean change_pending;
extern boolean print_where;
/*:8*//*9:*/
-#line 139 "common.h"
+#line 143 "common.h"
typedef struct name_info{
char*byte_start;
@@ -198,12 +202,12 @@ extern hash_pointer hash_end;
extern hash_pointer h;
/*:9*//*11:*/
-#line 183 "common.h"
+#line 187 "common.h"
extern int history;
/*:11*//*13:*/
-#line 199 "common.h"
+#line 203 "common.h"
extern int argc;
extern char**argv;
@@ -214,7 +218,7 @@ extern char scn_file_name[];
extern boolean flags[];
/*:13*//*14:*/
-#line 215 "common.h"
+#line 217 "common.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -223,20 +227,20 @@ extern FILE*scn_file;
extern FILE*active_file;
/*:14*/
-#line 69 "common.w"
+#line 65 "common.w"
/*18:*/
-#line 83 "common.w"
+#line 79 "common.w"
boolean program;
/*:18*//*19:*/
-#line 92 "common.w"
+#line 88 "common.w"
int phase;
/*:19*//*21:*/
-#line 130 "common.w"
+#line 126 "common.w"
char section_text[longest_name+1];
char*section_text_end= section_text+longest_name;
@@ -244,7 +248,7 @@ char*id_first;
char*id_loc;
/*:21*//*22:*/
-#line 150 "common.w"
+#line 146 "common.w"
char buffer[long_buf_size];
char*buffer_end= buffer+buf_size-2;
@@ -252,7 +256,7 @@ char*loc= buffer;
char*limit= buffer;
/*:22*//*25:*/
-#line 194 "common.w"
+#line 190 "common.w"
int include_depth;
FILE*file[max_include_depth];
@@ -269,13 +273,13 @@ boolean changing;
boolean web_file_open= false;
/*:25*//*26:*/
-#line 220 "common.w"
+#line 216 "common.w"
static char change_buffer[buf_size];
static char*change_limit;
/*:26*//*37:*/
-#line 399 "common.w"
+#line 396 "common.w"
sixteen_bits section_count;
boolean changed_section[max_sections];
@@ -284,7 +288,7 @@ boolean change_pending;
boolean print_where= false;
/*:37*//*43:*/
-#line 596 "common.w"
+#line 593 "common.w"
char byte_mem[max_bytes];
char*byte_mem_end= byte_mem+max_bytes-1;
@@ -292,25 +296,25 @@ name_info name_dir[max_names];
name_pointer name_dir_end= name_dir+max_names-1;
/*:43*//*44:*/
-#line 607 "common.w"
+#line 604 "common.w"
char*byte_ptr;
name_pointer name_ptr;
/*:44*//*46:*/
-#line 627 "common.w"
+#line 624 "common.w"
name_pointer hash[hash_size];
hash_pointer hash_end= hash+hash_size-1;
hash_pointer h;
/*:46*//*65:*/
-#line 1014 "common.w"
+#line 1006 "common.w"
int history= spotless;
/*:65*//*73:*/
-#line 1135 "common.w"
+#line 1129 "common.w"
int argc;
char**argv;
@@ -321,7 +325,7 @@ char scn_file_name[max_file_name_length];
boolean flags[128];
/*:73*//*83:*/
-#line 1282 "common.w"
+#line 1273 "common.w"
FILE*C_file;
FILE*tex_file;
@@ -330,22 +334,22 @@ FILE*scn_file;
FILE*active_file;
/*:83*/
-#line 70 "common.w"
+#line 66 "common.w"
/*7:*/
-#line 119 "common.h"
+#line 123 "common.h"
extern boolean get_line(void);
extern void check_complete(void);
extern void reset_input(void);
/*:7*//*10:*/
-#line 162 "common.h"
+#line 166 "common.h"
extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,char);
-extern name_pointer section_lookup(char*,char*,int);
+extern name_pointer section_lookup(char*,char*,boolean);
extern void init_node(name_pointer);
extern void init_p(name_pointer,eight_bits);
extern void print_prefix_name(name_pointer);
@@ -353,7 +357,7 @@ extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
/*:10*//*12:*/
-#line 186 "common.h"
+#line 190 "common.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -361,50 +365,50 @@ extern void fatal(const char*,const char*);
extern void overflow(const char*);
/*:12*//*15:*/
-#line 223 "common.h"
+#line 225 "common.h"
extern void common_init(void);
extern void print_stats(void);
/*:15*//*24:*/
-#line 180 "common.w"
+#line 176 "common.w"
static boolean input_ln(FILE*);
/*:24*//*28:*/
-#line 241 "common.w"
+#line 237 "common.w"
static void prime_the_change_buffer(void);
/*:28*//*33:*/
-#line 340 "common.w"
+#line 337 "common.w"
static void check_change(void);
/*:33*//*55:*/
-#line 774 "common.w"
+#line 767 "common.w"
static int web_strcmp(char*,int,char*,int);
-static name_pointer add_section_name(name_pointer,int,char*,char*,int);
-static void extend_section_name(name_pointer,char*,char*,int);
+static name_pointer add_section_name(name_pointer,int,char*,char*,boolean);
+static void extend_section_name(name_pointer,char*,char*,boolean);
/*:55*//*64:*/
-#line 1002 "common.w"
+#line 994 "common.w"
static int section_name_cmp(char**,int,name_pointer);
/*:64*//*76:*/
-#line 1197 "common.w"
+#line 1190 "common.w"
static void scan_args(void);
/*:76*/
-#line 71 "common.w"
+#line 67 "common.w"
/*:1*//*20:*/
-#line 99 "common.w"
+#line 95 "common.w"
void
common_init(void)
{
/*45:*/
-#line 611 "common.w"
+#line 608 "common.w"
name_dir->byte_start= byte_ptr= byte_mem;
name_ptr= name_dir+1;
@@ -412,24 +416,24 @@ name_ptr->byte_start= byte_mem;
root= NULL;
/*:45*//*47:*/
-#line 634 "common.w"
+#line 631 "common.w"
for(h= hash;h<=hash_end;*h++= NULL);
/*:47*/
-#line 103 "common.w"
+#line 99 "common.w"
/*74:*/
-#line 1148 "common.w"
+#line 1142 "common.w"
show_banner= show_happiness= show_progress= make_xrefs= true;
show_stats= false;
/*:74*/
-#line 104 "common.w"
+#line 100 "common.w"
/*84:*/
-#line 1289 "common.w"
+#line 1280 "common.w"
scan_args();
if(program==ctangle){
@@ -443,12 +447,12 @@ fatal("! Cannot open output file ",tex_file_name);
}
/*:84*/
-#line 105 "common.w"
+#line 101 "common.w"
}
/*:20*//*23:*/
-#line 160 "common.w"
+#line 156 "common.w"
static boolean input_ln(
FILE*fp)
@@ -470,14 +474,14 @@ return true;
}
/*:23*//*27:*/
-#line 231 "common.w"
+#line 227 "common.w"
static void
prime_the_change_buffer(void)
{
change_limit= change_buffer;
/*29:*/
-#line 247 "common.w"
+#line 243 "common.w"
while(true){
change_line++;
@@ -494,10 +498,10 @@ err_print("! Missing @x in change file");
}
/*:29*/
-#line 236 "common.w"
+#line 232 "common.w"
/*30:*/
-#line 264 "common.w"
+#line 260 "common.w"
do{
change_line++;
@@ -509,10 +513,10 @@ return;
}while(limit==buffer);
/*:30*/
-#line 237 "common.w"
+#line 233 "common.w"
/*31:*/
-#line 274 "common.w"
+#line 270 "common.w"
{
change_limit= change_buffer+(ptrdiff_t)(limit-buffer);
@@ -520,12 +524,12 @@ strncpy(change_buffer,buffer,(size_t)(limit-buffer+1));
}
/*:31*/
-#line 238 "common.w"
+#line 234 "common.w"
}
/*:27*//*32:*/
-#line 302 "common.w"
+#line 299 "common.w"
static void
check_change(void)
@@ -538,7 +542,7 @@ if_section_start_make_pending(true);
if(!change_pending)changed_section[section_count]= true;
}
while(true){
-changing= true;print_where= true;change_line++;
+changing= print_where= true;change_line++;
if(!input_ln(change_file)){
err_print("! Change file ended before @y");
@@ -548,7 +552,7 @@ return;
if(limit> buffer+1&&buffer[0]=='@'){
char xyz_code= xisupper(buffer[1])?tolower((eight_bits)buffer[1]):buffer[1];
/*34:*/
-#line 342 "common.w"
+#line 339 "common.w"
if(xyz_code=='x'||xyz_code=='z'){
loc= buffer+2;err_print("! Where is the matching @y?");
@@ -566,11 +570,11 @@ return;
}
/*:34*/
-#line 324 "common.w"
+#line 321 "common.w"
}
/*31:*/
-#line 274 "common.w"
+#line 270 "common.w"
{
change_limit= change_buffer+(ptrdiff_t)(limit-buffer);
@@ -578,7 +582,7 @@ strncpy(change_buffer,buffer,(size_t)(limit-buffer+1));
}
/*:31*/
-#line 326 "common.w"
+#line 323 "common.w"
changing= false;cur_line++;
while(!input_ln(cur_file)){
@@ -594,14 +598,14 @@ if(lines_dont_match)n++;
}
/*:32*//*35:*/
-#line 362 "common.w"
+#line 359 "common.w"
void
reset_input(void)
{
limit= buffer;loc= buffer+1;buffer[0]= ' ';
/*36:*/
-#line 377 "common.w"
+#line 374 "common.w"
if((web_file= fopen(web_file_name,"r"))==NULL){
strcpy(web_file_name,alt_web_file_name);
@@ -615,23 +619,23 @@ if((change_file= fopen(change_file_name,"r"))==NULL)
fatal("! Cannot open change file ",change_file_name);
/*:36*/
-#line 367 "common.w"
+#line 364 "common.w"
-include_depth= 0;cur_line= 0;change_line= 0;
+include_depth= cur_line= change_line= 0;
change_depth= include_depth;
-changing= 1;prime_the_change_buffer();changing= !changing;
+changing= true;prime_the_change_buffer();changing= !changing;
limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false;
}
/*:35*//*38:*/
-#line 406 "common.w"
+#line 403 "common.w"
boolean get_line(void)
{
restart:
if(changing&&include_depth==change_depth)
/*41:*/
-#line 514 "common.w"
+#line 511 "common.w"
{
change_line++;
if(!input_ln(change_file)){
@@ -662,11 +666,11 @@ prime_the_change_buffer();changing= !changing;print_where= true;
}
/*:41*/
-#line 411 "common.w"
+#line 408 "common.w"
if(!changing||include_depth> change_depth){
/*40:*/
-#line 497 "common.w"
+#line 494 "common.w"
{
cur_line++;
while(!input_ln(cur_file)){
@@ -685,7 +689,7 @@ if(change_limit> change_buffer)check_change();
}
/*:40*/
-#line 413 "common.w"
+#line 410 "common.w"
if(changing&&include_depth==change_depth)goto restart;
}
@@ -706,11 +710,11 @@ goto restart;
}
include_depth++;
/*39:*/
-#line 451 "common.w"
+#line 448 "common.w"
{
char temp_file_name[max_file_name_length];
char*cur_file_name_end= cur_file_name+max_file_name_length-1;
-char*k= cur_file_name,*kk;
+char*kk,*k= cur_file_name;
int l;
if(*loc=='"'){
@@ -754,14 +758,14 @@ include_depth--;err_print("! Cannot open include file");goto restart;
}
/*:39*/
-#line 432 "common.w"
+#line 429 "common.w"
}
return true;
}
/*:38*//*42:*/
-#line 546 "common.w"
+#line 543 "common.w"
void
check_complete(void){
@@ -775,7 +779,7 @@ err_print("! Change file entry did not match");
}
/*:42*//*48:*/
-#line 639 "common.w"
+#line 636 "common.w"
name_pointer
id_lookup(
@@ -790,17 +794,17 @@ name_pointer p;
if(last==NULL)for(last= first;*last!='\0';last++);
l= (int)(last-first);
/*49:*/
-#line 662 "common.w"
+#line 659 "common.w"
h= (eight_bits)*i;
while(++i<last)h= (h+h+(int)((eight_bits)*i))%hash_size;
/*:49*/
-#line 652 "common.w"
+#line 649 "common.w"
/*50:*/
-#line 670 "common.w"
+#line 667 "common.w"
p= hash[h];
while(p&&!names_match(p,first,l,t))p= p->link;
@@ -810,10 +814,10 @@ p->link= hash[h];hash[h]= p;
}
/*:50*/
-#line 653 "common.w"
+#line 650 "common.w"
if(p==name_ptr)/*51:*/
-#line 681 "common.w"
+#line 679 "common.w"
{
if(byte_ptr+l> byte_mem_end)overflow("byte memory");
if(name_ptr>=name_dir_end)overflow("name");
@@ -823,13 +827,13 @@ init_p(p,t);
}
/*:51*/
-#line 654 "common.w"
+#line 651 "common.w"
return p;
}
/*:48*//*52:*/
-#line 713 "common.w"
+#line 711 "common.w"
void
print_section_name(
@@ -839,18 +843,16 @@ char*ss,*s= first_chunk(p);
name_pointer q= p+1;
while(p!=name_dir){
ss= (p+1)->byte_start-1;
-if(*ss==' '&&ss>=s){
-term_write(s,(size_t)(ss-s));p= q->link;q= p;
-}else{
-term_write(s,(size_t)(ss+1-s));p= name_dir;q= NULL;
-}
+if(*ss==' '&&ss>=s)p= q->link,q= p;
+else ss++,p= name_dir,q= NULL;
+term_write(s,(size_t)(ss-s));
s= p->byte_start;
}
if(q)term_write("...",3);
}
/*:52*//*53:*/
-#line 732 "common.w"
+#line 728 "common.w"
void
sprint_section_name(
@@ -861,11 +863,8 @@ char*ss,*s= first_chunk(p);
name_pointer q= p+1;
while(p!=name_dir){
ss= (p+1)->byte_start-1;
-if(*ss==' '&&ss>=s){
-p= q->link;q= p;
-}else{
-ss++;p= name_dir;
-}
+if(*ss==' '&&ss>=s)p= q->link,q= p;
+else ss++,p= name_dir;
strncpy(dest,s,(size_t)(ss-s)),dest+= ss-s;
s= p->byte_start;
}
@@ -873,7 +872,7 @@ s= p->byte_start;
}
/*:53*//*54:*/
-#line 753 "common.w"
+#line 746 "common.w"
void
print_prefix_name(
@@ -886,7 +885,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3);
}
/*:54*//*56:*/
-#line 779 "common.w"
+#line 772 "common.w"
static int web_strcmp(
char*j,
@@ -904,7 +903,7 @@ else return greater;
}
/*:56*//*57:*/
-#line 808 "common.w"
+#line 801 "common.w"
static name_pointer
add_section_name(
@@ -912,7 +911,7 @@ name_pointer par,
int c,
char*first,
char*last,
-int ispref)
+boolean ispref)
{
name_pointer p= name_ptr;
char*s= first_chunk(p);
@@ -928,21 +927,20 @@ name_ptr->link= name_dir;
}
set_prefix_length(p,name_len);
strncpy(s,first,name_len);
-p->llink= NULL;
-p->rlink= NULL;
+p->llink= p->rlink= NULL;
init_node(p);
return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p);
}
/*:57*//*58:*/
-#line 837 "common.w"
+#line 829 "common.w"
static void
extend_section_name(
name_pointer p,
char*first,
char*last,
-int ispref)
+boolean ispref)
{
char*s;
name_pointer q= p+1;
@@ -959,14 +957,14 @@ if(ispref)*(byte_ptr-1)= ' ';
}
/*:58*//*59:*/
-#line 865 "common.w"
+#line 857 "common.w"
name_pointer
section_lookup(
char*first,char*last,
-int ispref)
+boolean ispref)
{
-int c= 0;
+int c= less;
name_pointer p= root;
name_pointer q= NULL;
name_pointer r= NULL;
@@ -974,7 +972,7 @@ name_pointer par= NULL;
int name_len= (int)(last-first)+1;
/*60:*/
-#line 889 "common.w"
+#line 881 "common.w"
while(p){
c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p));
@@ -1001,19 +999,19 @@ p= q,q= NULL;
}
/*:60*/
-#line 879 "common.w"
+#line 871 "common.w"
/*61:*/
-#line 914 "common.w"
+#line 906 "common.w"
if(r==NULL)
return add_section_name(par,c,first,last+1,ispref);
/*:61*/
-#line 880 "common.w"
+#line 872 "common.w"
/*62:*/
-#line 922 "common.w"
+#line 914 "common.w"
switch(section_name_cmp(&first,name_len,r)){
@@ -1026,16 +1024,16 @@ err_print(">");
}
else if(name_len<prefix_length(r))set_prefix_length(r,name_len);
-case equal:return r;
+case equal:break;
case extension:if(!ispref||first<=last)
extend_section_name(r,first,last+1,ispref);
-return r;
+break;
case bad_extension:
fputs("\n! New name extends <",stdout);
print_section_name(r);
err_print(">");
-return r;
+break;
default:
fputs("\n! Section name incompatible with <",stdout);
@@ -1043,16 +1041,16 @@ print_prefix_name(r);
fputs(">,\n which abbreviates <",stdout);
print_section_name(r);
err_print(">");
-return r;
}
+return r;
/*:62*/
-#line 881 "common.w"
+#line 873 "common.w"
}
/*:59*//*63:*/
-#line 970 "common.w"
+#line 962 "common.w"
static int section_name_cmp(
char**pfirst,
@@ -1062,12 +1060,12 @@ name_pointer r)
char*first= *pfirst;
name_pointer q= r+1;
char*ss,*s= first_chunk(r);
-int c;
-int ispref;
+int c= less;
+boolean ispref;
while(true){
ss= (r+1)->byte_start-1;
-if(*ss==' '&&ss>=r->byte_start)ispref= 1,q= q->link;
-else ispref= 0,ss++,q= name_dir;
+if(*ss==' '&&ss>=r->byte_start)ispref= true,q= q->link;
+else ispref= false,ss++,q= name_dir;
switch(c= web_strcmp(first,len,s,ss-s)){
case equal:if(q==name_dir)
if(ispref){
@@ -1086,7 +1084,7 @@ default:return c;
}
/*:63*//*66:*/
-#line 1024 "common.w"
+#line 1016 "common.w"
void
err_print(
@@ -1095,7 +1093,7 @@ const char*s)
char*k,*l;
printf(*s=='!'?"\n%s":"%s",s);
if(web_file_open)/*67:*/
-#line 1044 "common.w"
+#line 1036 "common.w"
{if(changing&&include_depth==change_depth)
printf(". (l. %d of change file)\n",change_line);
@@ -1106,7 +1104,7 @@ if(l> buffer){
for(k= buffer;k<l;k++)
if(*k=='\t')putchar(' ');
else putchar(*k);
-putchar('\n');
+new_line;
for(k= buffer;k<l;k++)putchar(' ');
}
for(k= l;k<limit;k++)putchar(*k);
@@ -1115,39 +1113,41 @@ putchar(' ');
}
/*:67*/
-#line 1031 "common.w"
+#line 1023 "common.w"
update_terminal;mark_error;
}
/*:66*//*68:*/
-#line 1076 "common.w"
+#line 1068 "common.w"
int wrap_up(void){
if(show_progress)new_line;
if(show_stats)
print_stats();
/*69:*/
-#line 1086 "common.w"
+#line 1078 "common.w"
switch(history){
-case spotless:if(show_happiness)puts("(No errors were found.)");break;
+case spotless:
+if(show_happiness)puts("(No errors were found.)");break;
case harmless_message:
puts("(Did you see the warning message above?)");break;
case error_message:
puts("(Pardon me, but I think I spotted something wrong.)");break;
-case fatal_message:puts("(That was a fatal error, my friend.)");
+case fatal_message:default:
+puts("(That was a fatal error, my friend.)");
}
/*:69*/
-#line 1081 "common.w"
+#line 1073 "common.w"
if(history> harmless_message)return EXIT_FAILURE;
else return EXIT_SUCCESS;
}
/*:68*//*70:*/
-#line 1102 "common.w"
+#line 1096 "common.w"
void
fatal(
const char*s,const char*t)
@@ -1158,7 +1158,7 @@ history= fatal_message;exit(wrap_up());
}
/*:70*//*71:*/
-#line 1113 "common.w"
+#line 1107 "common.w"
void
overflow(
const char*t)
@@ -1168,7 +1168,7 @@ printf("\n! Sorry, %s capacity exceeded",t);fatal("","");
/*:71*//*75:*/
-#line 1167 "common.w"
+#line 1161 "common.w"
static void
scan_args(void)
@@ -1182,35 +1182,32 @@ boolean found_web= false,found_change= false,found_out= false;
strcpy(change_file_name,"/dev/null");
while(--argc> 0){
if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/
-#line 1258 "common.w"
+#line 1251 "common.w"
-{
for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++)
flags[(eight_bits)*dot_pos]= flag_change;
-}
/*:80*/
-#line 1179 "common.w"
+#line 1173 "common.w"
else{
s= name_pos= *argv;dot_pos= NULL;
-while(*s){
+while(*s)
if(*s=='.')dot_pos= s++;
else if(*s=='/')dot_pos= NULL,name_pos= ++s;
else s++;
-}
if(!found_web)/*77:*/
-#line 1206 "common.w"
+#line 1199 "common.w"
{
if(s-*argv> max_file_name_length-5)
/*82:*/
-#line 1276 "common.w"
+#line 1267 "common.w"
fatal("! Filename too long\n",*argv);
/*:82*/
-#line 1209 "common.w"
+#line 1202 "common.w"
if(dot_pos==NULL)
sprintf(web_file_name,"%s.w",*argv);
@@ -1227,21 +1224,21 @@ found_web= true;
}
/*:77*/
-#line 1188 "common.w"
+#line 1181 "common.w"
else if(!found_change)/*78:*/
-#line 1224 "common.w"
+#line 1217 "common.w"
{
if(strcmp(*argv,"-")!=0){
if(s-*argv> max_file_name_length-4)
/*82:*/
-#line 1276 "common.w"
+#line 1267 "common.w"
fatal("! Filename too long\n",*argv);
/*:82*/
-#line 1228 "common.w"
+#line 1221 "common.w"
if(dot_pos==NULL)
sprintf(change_file_name,"%s.ch",*argv);
@@ -1251,20 +1248,20 @@ found_change= true;
}
/*:78*/
-#line 1189 "common.w"
+#line 1182 "common.w"
else if(!found_out)/*79:*/
-#line 1236 "common.w"
+#line 1229 "common.w"
{
if(s-*argv> max_file_name_length-5)
/*82:*/
-#line 1276 "common.w"
+#line 1267 "common.w"
fatal("! Filename too long\n",*argv);
/*:82*/
-#line 1239 "common.w"
+#line 1232 "common.w"
if(dot_pos==NULL){
sprintf(tex_file_name,"%s.tex",*argv);
@@ -1284,10 +1281,10 @@ found_out= true;
}
/*:79*/
-#line 1190 "common.w"
+#line 1183 "common.w"
else/*81:*/
-#line 1264 "common.w"
+#line 1255 "common.w"
{
if(program==ctangle)
@@ -1301,12 +1298,12 @@ else fatal(
}
/*:81*/
-#line 1191 "common.w"
+#line 1184 "common.w"
}
}
if(!found_web)/*81:*/
-#line 1264 "common.w"
+#line 1255 "common.w"
{
if(program==ctangle)
@@ -1320,7 +1317,7 @@ else fatal(
}
/*:81*/
-#line 1194 "common.w"
+#line 1187 "common.w"
}