summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/ctangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/ctangle.c')
-rw-r--r--Build/source/texk/web2c/cwebdir/ctangle.c95
1 files changed, 47 insertions, 48 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ctangle.c b/Build/source/texk/web2c/cwebdir/ctangle.c
index f77ce669f57..de0a05a39c6 100644
--- a/Build/source/texk/web2c/cwebdir/ctangle.c
+++ b/Build/source/texk/web2c/cwebdir/ctangle.c
@@ -17,8 +17,8 @@
#define banner "This is CTANGLE (Version 4.0)" \
-#define ctangle 0
-#define cweave 1 \
+#define ctangle false
+#define cweave true \
#define and_and 04
#define lt_lt 020
@@ -48,8 +48,7 @@
#define llink link
#define rlink dummy.Rlink
#define root name_dir->rlink \
-
-#define chunk_marker 0 \
+ \
#define spotless 0
#define harmless_message 1
@@ -172,7 +171,7 @@ extern char*loc;
extern char*limit;
/*:6*//*7:*/
-#line 103 "common.h"
+#line 102 "common.h"
typedef struct name_info{
char*byte_start;
@@ -197,12 +196,12 @@ extern hash_pointer hash_end;
extern hash_pointer h;
/*:7*//*9:*/
-#line 147 "common.h"
+#line 146 "common.h"
extern int history;
/*:9*//*11:*/
-#line 167 "common.h"
+#line 166 "common.h"
extern int include_depth;
extern FILE*file[];
@@ -222,7 +221,7 @@ extern boolean changing;
extern boolean web_file_open;
/*:11*//*13:*/
-#line 191 "common.h"
+#line 190 "common.h"
extern sixteen_bits section_count;
extern boolean changed_section[];
@@ -230,14 +229,14 @@ extern boolean change_pending;
extern boolean print_where;
/*:13*//*14:*/
-#line 204 "common.h"
+#line 203 "common.h"
extern int argc;
extern char**argv;
extern boolean flags[];
/*:14*//*15:*/
-#line 216 "common.h"
+#line 215 "common.h"
extern FILE*C_file;
extern FILE*tex_file;
@@ -318,7 +317,7 @@ char output_file_name[longest_name+1];
/*:45*//*52:*/
#line 586 "ctangle.w"
-boolean output_defs_seen= 0;
+boolean output_defs_seen= false;
/*:52*//*57:*/
#line 695 "ctangle.w"
@@ -333,13 +332,13 @@ eight_bits ccode[256];
/*:62*//*66:*/
#line 834 "ctangle.w"
-boolean comment_continues= 0;
+boolean comment_continues= false;
/*:66*//*68:*/
#line 873 "ctangle.w"
name_pointer cur_section_name;
-int no_where;
+boolean no_where;
/*:68*//*82:*/
#line 1187 "ctangle.w"
@@ -356,7 +355,7 @@ extern sixteen_bits section_count;
#line 71 "ctangle.w"
/*8:*/
-#line 126 "common.h"
+#line 125 "common.h"
extern boolean names_match(name_pointer,const char*,size_t,eight_bits);
extern name_pointer id_lookup(const char*,const char*,char);
@@ -369,7 +368,7 @@ extern void print_section_name(name_pointer);
extern void sprint_section_name(char*,name_pointer);
/*:8*//*10:*/
-#line 150 "common.h"
+#line 149 "common.h"
extern int wrap_up(void);
extern void err_print(const char*);
@@ -377,14 +376,14 @@ extern void fatal(const char*,const char*);
extern void overflow(const char*);
/*:10*//*12:*/
-#line 185 "common.h"
+#line 184 "common.h"
extern boolean get_line(void);
extern void check_complete(void);
extern void reset_input(void);
/*:12*//*16:*/
-#line 224 "common.h"
+#line 223 "common.h"
extern void common_init(void);
extern void print_stats(void);
@@ -398,7 +397,7 @@ static void store_two_bytes(sixteen_bits);
#line 310 "ctangle.w"
static void push_level(name_pointer);
-static void pop_level(int);
+static void pop_level(boolean);
/*:34*//*38:*/
#line 369 "ctangle.w"
@@ -537,7 +536,7 @@ const char*first,
size_t l,
eight_bits t)
{(void)t;
-if(length(p)!=l)return 0;
+if(length(p)!=l)return false;
return!strncmp(first,p->byte_start,l);
}
@@ -587,7 +586,7 @@ cur_section= 0;
static void
pop_level(
-int flag)
+boolean flag)
{
if(flag&&cur_repl->text_link<section_flag){
cur_repl= cur_repl->text_link+text_info;
@@ -608,7 +607,7 @@ sixteen_bits a;
restart:if(stack_ptr==stack)return;
if(cur_byte==cur_end){
cur_val= -((int)cur_section);
-pop_level(1);
+pop_level(true);
if(cur_val==0)goto restart;
out_char(section_number);return;
}
@@ -665,7 +664,7 @@ cur_line++;
static void
phase_two(void){
-web_file_open= 0;
+web_file_open= false;
cur_line= 1;
/*33:*/
#line 299 "ctangle.w"
@@ -750,7 +749,7 @@ cur_byte= cur_text->tok_start;
cur_end= (cur_text+1)->tok_start;
C_printf("%s","#define ");
out_state= normal;
-protect= 1;
+protect= true;
while(cur_byte<cur_end){
a= *cur_byte++;
if(cur_byte==cur_end&&a=='\n')break;
@@ -770,10 +769,10 @@ cur_val= a-050000;cur_section= cur_val;out_char(section_number);
}
}
-protect= 0;
+protect= false;
flush_buffer();
}
-pop_level(0);
+pop_level(false);
}
/*:54*//*55:*/
@@ -884,8 +883,8 @@ static eight_bits
skip_ahead(void)
{
eight_bits c;
-while(1){
-if(loc> limit&&(get_line()==0))return(new_section);
+while(true){
+if(loc> limit&&(get_line()==false))return(new_section);
*(limit+1)= '@';
while(*loc!='@')loc++;
if(loc<=limit){
@@ -902,27 +901,27 @@ static boolean skip_comment(
boolean is_long_comment)
{
char c;
-while(1){
+while(true){
if(loc> limit){
if(is_long_comment){
-if(get_line())return(comment_continues= 1);
+if(get_line())return(comment_continues= true);
else{
err_print("! Input ended in mid-comment");
-return(comment_continues= 0);
+return(comment_continues= false);
}
}
-else return(comment_continues= 0);
+else return(comment_continues= false);
}
c= *(loc++);
if(is_long_comment&&c=='*'&&*loc=='/'){
-loc++;return(comment_continues= 0);
+loc++;return(comment_continues= false);
}
if(c=='@'){
if(ccode[(eight_bits)*loc]==new_section){
err_print("! Section name ended in mid-comment");loc--;
-return(comment_continues= 0);
+return(comment_continues= false);
}
else loc++;
}
@@ -937,12 +936,12 @@ get_next(void)
{
static int preprocessing= 0;
eight_bits c;
-while(1){
+while(true){
if(loc> limit){
if(preprocessing&&*(limit-1)!='\\')preprocessing= 0;
-if(get_line()==0)return(new_section);
+if(get_line()==false)return(new_section);
else if(print_where&&!no_where){
-print_where= 0;
+print_where= false;
/*85:*/
#line 1220 "ctangle.w"
@@ -1013,13 +1012,13 @@ if(delim=='L'||delim=='u'||delim=='U'){
if(delim=='u'&&*loc=='8'){*++id_loc= *loc++;}
delim= *loc++;*++id_loc= delim;
}
-while(1){
+while(true){
if(loc>=limit){
if(*(limit-1)!='\\'){
err_print("! String didn't end");loc= limit;break;
}
-if(get_line()==0){
+if(get_line()==false){
err_print("! Input ended in middle of string");loc= buffer;break;
}
@@ -1087,8 +1086,8 @@ char*k;
#line 1110 "ctangle.w"
k= section_text;
-while(1){
-if(loc> limit&&get_line()==0){
+while(true){
+if(loc> limit&&get_line()==false){
err_print("! Input ended in section name");
loc= buffer+1;break;
@@ -1272,7 +1271,7 @@ app_repl(a_l%0400);}
/*:85*/
#line 1200 "ctangle.w"
}
-while(1)switch(a= get_next()){
+while(true)switch(a= get_next()){
/*86:*/
#line 1233 "ctangle.w"
@@ -1322,7 +1321,7 @@ break;
case output_defs_code:if(t!=section_name)err_print("! Misplaced @h");
else{
-output_defs_seen= 1;
+output_defs_seen= true;
a= output_defs_flag;
app_repl((a/0400)+0200);
app_repl(a%0400);
@@ -1448,12 +1447,12 @@ scan_section(void)
name_pointer p;
text_pointer q;
sixteen_bits a;
-section_count++;no_where= 1;
+section_count++;no_where= true;
if(*(loc-1)=='*'&&show_progress){
printf("*%d",section_count);update_terminal;
}
next_control= 0;
-while(1){
+while(true){
/*93:*/
#line 1397 "ctangle.w"
@@ -1483,7 +1482,7 @@ if(*loc!='('){
app_repl(string);app_repl(' ');app_repl(string);
}
scan_repl(macro);
-cur_text->text_link= 0;
+cur_text->text_link= macro;
}
/*:94*/
@@ -1510,7 +1509,7 @@ break;
}
return;
}
-no_where= print_where= 0;
+no_where= print_where= false;
/*96:*/
#line 1434 "ctangle.w"
@@ -1571,8 +1570,8 @@ static void
skip_limbo(void)
{
char c;
-while(1){
-if(loc> limit&&get_line()==0)return;
+while(true){
+if(loc> limit&&get_line()==false)return;
*(limit+1)= '@';
while(*loc!='@')loc++;
if(loc++<=limit){