Back to index

tetex-bin  3.0
Classes | Defines | Typedefs | Functions | Variables
ctangle.c File Reference
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  name_info
struct  text
struct  output_state
union  name_info.dummy

Defines

#define banner   "This is CTANGLE (Version 3.64)\n" \
#define max_bytes   90000 \
#define max_toks   270000
#define max_names   4000 \
#define max_texts   2500
#define hash_size   353
#define longest_name   10000
#define stack_size   50
#define buf_size   100 \
#define ctangle   0
#define cweave   1 \
#define and_and   04
#define lt_lt   020
#define gt_gt   021
#define plus_plus   013
#define minus_minus   01
#define minus_gt   031
#define not_eq   032
#define lt_eq   034
#define gt_eq   035
#define eq_eq   036
#define or_or   037
#define dot_dot_dot   016
#define colon_colon   06
#define period_ast   026
#define minus_gt_ast   027 \
#define xisalpha(c)   (isalpha(c) &&((eight_bits) c<0200) )
#define xisdigit(c)   (isdigit(c) &&((eight_bits) c<0200) )
#define xisspace(c)   (isspace(c) &&((eight_bits) c<0200) )
#define xislower(c)   (islower(c) &&((eight_bits) c<0200) )
#define xisupper(c)   (isupper(c) &&((eight_bits) c<0200) )
#define xisxdigit(c)   (isxdigit(c) &&((eight_bits) c<0200) ) \
#define length(c)   (c+1) ->byte_start-(c) ->byte_start
#define print_id(c)   term_write((c) ->byte_start,length((c) ) )
#define llink   link
#define rlink   dummy.Rlink
#define root   name_dir->rlink \
#define chunk_marker   0 \
#define spotless   0
#define harmless_message   1
#define error_message   2
#define fatal_message   3
#define mark_harmless   {if(history==spotless) history= harmless_message;}
#define mark_error   history= error_message
#define confusion(s)   fatal("! This can't happen: ",s) \
#define max_file_name_length   60
#define cur_file   file[include_depth]
#define cur_file_name   file_name[include_depth]
#define web_file_name   file_name[0]
#define cur_line   line[include_depth] \
#define show_banner   flags['b']
#define show_progress   flags['p']
#define show_happiness   flags['h'] \
#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 equiv   equiv_or_xref \
#define section_flag   max_texts \
#define string   02
#define join   0177
#define output_defs_flag   (2*024000-1) \
#define cur_end   cur_state.end_field
#define cur_byte   cur_state.byte_field
#define cur_name   cur_state.name_field
#define cur_repl   cur_state.repl_field
#define cur_section   cur_state.section_field \
#define section_number   0201
#define identifier   0202 \
#define normal   0
#define num_or_id   1
#define post_slash   2
#define unbreakable   3
#define verbatim   4 \
#define max_files   256
#define translit_length   10 \
#define ignore   0
#define ord   0302
#define control_text   0303
#define translit_code   0304
#define output_defs_code   0305
#define format_code   0306
#define definition   0307
#define begin_C   0310
#define section_name   0311
#define new_section   0312 \
#define constant   03 \
#define isxalpha(c)   ((c) =='_'||(c) =='$') \
#define ishigh(c)
#define compress(c)   if(loc++<=limit) return(c) \
#define macro   0
#define app_repl(c)   {if(tok_ptr==tok_mem_end) overflow("token") ;*tok_ptr++= c;} \

Typedefs

typedef short boolean
typedef char unsigned eight_bits
typedef struct name_info name_info
typedef name_infoname_pointer
typedef name_pointerhash_pointer
typedef unsigned short sixteen_bits
typedef texttext_pointer
typedef output_statestack_pointer

Functions

name_pointer id_lookup ()
name_pointer section_lookup ()
void print_section_name ()
void sprint_section_name ()
 err_print ()
 wrap_up ()
void fatal ()
void overflow ()
 reset_input ()
 get_line ()
 check_complete ()
void common_init ()
int strlen ()
int strcmp ()
char * strcpy ()
int strncmp ()
char * strncpy ()
void phase_two ()
void output_defs ()
static void out_char ()
void phase_one ()
void skip_limbo ()
int main (int ac, char **av)
int names_match (name_pointer p, char *first, int l)
void init_node (name_pointer node)
void init_p ()
void store_two_bytes (sixteen_bits x)
void push_level (name_pointer p)
void pop_level (int flag)
void get_output ()
void flush_buffer ()
static void out_char (eight_bits cur_char)
eight_bits skip_ahead ()
int skip_comment (boolean is_long_comment)
eight_bits get_next ()
void scan_repl (eight_bits t)
void scan_section ()
void print_stats ()

Variables

boolean program
int phase
char section_text [longest_name+1]
char * section_text_end = section_text+longest_name
char * id_first
char * id_loc
char buffer []
char * buffer_end
char * loc
char * limit
char byte_mem []
char * byte_mem_end
name_info name_dir []
name_pointer name_dir_end
name_pointer name_ptr
char * byte_ptr
name_pointer hash []
hash_pointer hash_end
hash_pointer h
 history
 include_depth
FILEfile []
FILEchange_file
char C_file_name []
char tex_file_name []
char idx_file_name []
char scn_file_name []
char file_name [][max_file_name_length]
char change_file_name []
 line []
 change_line
boolean input_has_ended
boolean changing
boolean web_file_open
sixteen_bits section_count
boolean changed_section []
boolean change_pending
boolean print_where
int argc
char ** argv
boolean flags []
FILEC_file
FILEtex_file
FILEidx_file
FILEscn_file
FILEactive_file
text text_info [max_texts]
text_pointer text_info_end = text_info+max_texts-1
text_pointer text_ptr
eight_bits tok_mem [max_toks]
eight_bitstok_mem_end = tok_mem+max_toks-1
eight_bitstok_ptr
text_pointer last_unnamed
output_state cur_state
output_state stack [stack_size+1]
stack_pointer stack_ptr
stack_pointer stack_end = stack+stack_size
int cur_val
eight_bits out_state
boolean protect
name_pointer output_files [max_files]
name_pointercur_out_file
name_pointerend_output_files
name_pointeran_output_file
char cur_section_name_char
char output_file_name [longest_name]
boolean output_defs_seen = 0
char translit [128][translit_length]
eight_bits ccode [256]
boolean comment_continues = 0
name_pointer cur_section_name
int no_where
text_pointer cur_text
eight_bits next_control

Class Documentation

struct name_info

Definition at line 174 of file ctangleboot.c.

Collaboration diagram for name_info:
Class Members
char * byte_start
union name_info dummy
union name_info dummy
union name_info dummy
union name_info dummy
char * equiv_or_xref
struct name_info * link
struct text

Definition at line 281 of file ctangleboot.c.

Class Members
sixteen_bits text_link
eight_bits * tok_start
struct output_state

Definition at line 290 of file ctangleboot.c.

Collaboration diagram for output_state:
Class Members
eight_bits * byte_field
eight_bits * end_field
name_pointer name_field
text_pointer repl_field
sixteen_bits section_field
union name_info.dummy

Definition at line 172 of file ctangle.c.

Class Members
char Ilk
struct name_info * Rlink

Define Documentation

#define and_and   04

Definition at line 34 of file ctangle.c.

#define app_repl (   c)    {if(tok_ptr==tok_mem_end) overflow("token") ;*tok_ptr++= c;} \

Definition at line 137 of file ctangle.c.

#define banner   "This is CTANGLE (Version 3.64)\n" \

Definition at line 18 of file ctangle.c.

#define begin_C   0310

Definition at line 123 of file ctangle.c.

#define buf_size   100 \

Definition at line 29 of file ctangle.c.

#define C_printf (   c,
  a 
)    fprintf(C_file,c,a)

Definition at line 87 of file ctangle.c.

#define C_putc (   c)    putc(c,C_file) \

Definition at line 88 of file ctangle.c.

#define chunk_marker   0 \

Definition at line 63 of file ctangle.c.

#define colon_colon   06

Definition at line 46 of file ctangle.c.

#define compress (   c)    if(loc++<=limit) return(c) \

Definition at line 134 of file ctangle.c.

#define confusion (   s)    fatal("! This can't happen: ",s) \

Definition at line 71 of file ctangle.c.

#define constant   03 \

Definition at line 127 of file ctangle.c.

#define control_text   0303

Definition at line 118 of file ctangle.c.

#define ctangle   0

Definition at line 31 of file ctangle.c.

#define cur_byte   cur_state.byte_field

Definition at line 99 of file ctangle.c.

#define cur_end   cur_state.end_field

Definition at line 98 of file ctangle.c.

#define cur_file   file[include_depth]

Definition at line 74 of file ctangle.c.

Definition at line 75 of file ctangle.c.

#define cur_line   line[include_depth] \

Definition at line 77 of file ctangle.c.

#define cur_name   cur_state.name_field

Definition at line 100 of file ctangle.c.

#define cur_repl   cur_state.repl_field

Definition at line 101 of file ctangle.c.

#define cur_section   cur_state.section_field \

Definition at line 102 of file ctangle.c.

#define cweave   1 \

Definition at line 32 of file ctangle.c.

#define definition   0307

Definition at line 122 of file ctangle.c.

#define dot_dot_dot   016

Definition at line 45 of file ctangle.c.

#define eq_eq   036

Definition at line 43 of file ctangle.c.

#define equiv   equiv_or_xref \

Definition at line 90 of file ctangle.c.

#define error_message   2

Definition at line 67 of file ctangle.c.

#define fatal_message   3

Definition at line 68 of file ctangle.c.

#define format_code   0306

Definition at line 121 of file ctangle.c.

#define gt_eq   035

Definition at line 42 of file ctangle.c.

#define gt_gt   021

Definition at line 36 of file ctangle.c.

#define harmless_message   1

Definition at line 66 of file ctangle.c.

#define hash_size   353

Definition at line 26 of file ctangle.c.

#define identifier   0202 \

Definition at line 105 of file ctangle.c.

#define ignore   0

Definition at line 116 of file ctangle.c.

#define ishigh (   c)
Value:
((unsigned char) (c) > 0177)  \
 \

Definition at line 131 of file ctangle.c.

#define isxalpha (   c)    ((c) =='_'||(c) =='$') \

Definition at line 129 of file ctangle.c.

#define join   0177

Definition at line 95 of file ctangle.c.

#define length (   c)    (c+1) ->byte_start-(c) ->byte_start

Definition at line 57 of file ctangle.c.

#define llink   link

Definition at line 59 of file ctangle.c.

#define longest_name   10000

Definition at line 27 of file ctangle.c.

#define lt_eq   034

Definition at line 41 of file ctangle.c.

#define lt_lt   020

Definition at line 35 of file ctangle.c.

#define macro   0

Definition at line 136 of file ctangle.c.

Definition at line 70 of file ctangle.c.

Definition at line 69 of file ctangle.c.

#define max_bytes   90000 \

Definition at line 20 of file ctangle.c.

#define max_file_name_length   60

Definition at line 73 of file ctangle.c.

#define max_files   256

Definition at line 113 of file ctangle.c.

#define max_names   4000 \

Definition at line 23 of file ctangle.c.

#define max_texts   2500

Definition at line 25 of file ctangle.c.

#define max_toks   270000

Definition at line 22 of file ctangle.c.

#define minus_gt   031

Definition at line 39 of file ctangle.c.

#define minus_gt_ast   027 \

Definition at line 48 of file ctangle.c.

#define minus_minus   01

Definition at line 38 of file ctangle.c.

#define new_line   putchar('\n')

Definition at line 84 of file ctangle.c.

#define new_section   0312 \

Definition at line 125 of file ctangle.c.

#define normal   0

Definition at line 107 of file ctangle.c.

#define not_eq   032

Definition at line 40 of file ctangle.c.

#define num_or_id   1

Definition at line 108 of file ctangle.c.

#define or_or   037

Definition at line 44 of file ctangle.c.

#define ord   0302

Definition at line 117 of file ctangle.c.

#define output_defs_code   0305

Definition at line 120 of file ctangle.c.

#define output_defs_flag   (2*024000-1) \

Definition at line 96 of file ctangle.c.

#define period_ast   026

Definition at line 47 of file ctangle.c.

#define plus_plus   013

Definition at line 37 of file ctangle.c.

#define post_slash   2

Definition at line 109 of file ctangle.c.

#define print_id (   c)    term_write((c) ->byte_start,length((c) ) )

Definition at line 58 of file ctangle.c.

#define putxchar   putchar

Definition at line 85 of file ctangle.c.

#define rlink   dummy.Rlink

Definition at line 60 of file ctangle.c.

#define root   name_dir->rlink \

Definition at line 61 of file ctangle.c.

#define section_flag   max_texts \

Definition at line 92 of file ctangle.c.

#define section_name   0311

Definition at line 124 of file ctangle.c.

#define section_number   0201

Definition at line 104 of file ctangle.c.

#define show_banner   flags['b']

Definition at line 79 of file ctangle.c.

#define show_happiness   flags['h'] \

Definition at line 81 of file ctangle.c.

#define show_progress   flags['p']

Definition at line 80 of file ctangle.c.

#define spotless   0

Definition at line 65 of file ctangle.c.

#define stack_size   50

Definition at line 28 of file ctangle.c.

#define string   02

Definition at line 94 of file ctangle.c.

#define term_write (   a,
  b 
)    fflush(stdout) ,fwrite(a,sizeof(char) ,b,stdout)

Definition at line 86 of file ctangle.c.

#define translit_code   0304

Definition at line 119 of file ctangle.c.

#define translit_length   10 \

Definition at line 114 of file ctangle.c.

#define unbreakable   3

Definition at line 110 of file ctangle.c.

#define update_terminal   fflush(stdout)

Definition at line 83 of file ctangle.c.

#define verbatim   4 \

Definition at line 111 of file ctangle.c.

#define web_file_name   file_name[0]

Definition at line 76 of file ctangle.c.

#define xisalpha (   c)    (isalpha(c) &&((eight_bits) c<0200) )

Definition at line 50 of file ctangle.c.

#define xisdigit (   c)    (isdigit(c) &&((eight_bits) c<0200) )

Definition at line 51 of file ctangle.c.

#define xislower (   c)    (islower(c) &&((eight_bits) c<0200) )

Definition at line 53 of file ctangle.c.

#define xisspace (   c)    (isspace(c) &&((eight_bits) c<0200) )

Definition at line 52 of file ctangle.c.

#define xisupper (   c)    (isupper(c) &&((eight_bits) c<0200) )

Definition at line 54 of file ctangle.c.

#define xisxdigit (   c)    (isxdigit(c) &&((eight_bits) c<0200) ) \

Definition at line 55 of file ctangle.c.


Typedef Documentation

typedef short boolean

Definition at line 145 of file ctangle.c.

typedef char unsigned eight_bits

Definition at line 146 of file ctangle.c.

Definition at line 180 of file ctangle.c.

typedef struct name_info name_info

Definition at line 179 of file ctangle.c.

typedef unsigned short sixteen_bits

Definition at line 228 of file ctangle.c.

Definition at line 278 of file ctangle.c.

typedef text* text_pointer

Definition at line 266 of file ctangle.c.


Function Documentation

Definition at line 680 of file common.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 314 of file common.c.

{
/*30:*/
#line 621 "common.w"

name_dir->byte_start= byte_ptr= byte_mem;
name_ptr= name_dir+1;
name_ptr->byte_start= byte_mem;

/*:30*//*34:*/
#line 655 "common.w"

for(h= hash;h<=hash_end;*h++= NULL);

/*:34*//*41:*/
#line 737 "common.w"

root= NULL;

/*:41*/
#line 93 "common.w"
;
/*68:*/
#line 1233 "common.w"

show_banner= show_happiness= show_progress= 1;

/*:68*/
#line 94 "common.w"
;
/*78:*/
#line 1377 "common.w"

scan_args();
if(program==ctangle){
if((C_file= fopen(C_file_name,"w"))==NULL)
fatal("! Cannot open output file ",C_file_name);

}
else{
if((tex_file= fopen(tex_file_name,"w"))==NULL)
fatal("! Cannot open output file ",tex_file_name);
}

/*:78*/
#line 95 "common.w"
;
}

Here is the call graph for this function:

Here is the caller graph for this function:

err_print ( )
void fatal ( )

Definition at line 596 of file ctangle.c.

{
C_putc('\n');
if(cur_line%100==0&&show_progress){
printf(".");
if(cur_line%500==0)printf("%d",cur_line);
update_terminal;
}
cur_line++;
}

Here is the call graph for this function:

Here is the caller graph for this function:

get_line ( )

Definition at line 542 of file common.c.

{
restart:
if(changing&&include_depth==change_depth)
/*25:*/
#line 537 "common.w"
{
change_line++;
if(!input_ln(change_file)){
err_print("! Change file ended without @z");

buffer[0]= '@';buffer[1]= 'z';limit= buffer+2;
}
if(limit> buffer){
if(change_pending){
if_section_start_make_pending(0);
if(change_pending){
changed_section[section_count]= 1;change_pending= 0;
}
}
*limit= ' ';
if(buffer[0]=='@'){
if(xisupper(buffer[1]))buffer[1]= tolower(buffer[1]);
if(buffer[1]=='x'||buffer[1]=='y'){
loc= buffer+2;
err_print("! Where is the matching @z?");

}
else if(buffer[1]=='z'){
prime_the_change_buffer();changing= !changing;print_where= 1;
}
}
}
}

/*:25*/
#line 431 "common.w"
;
if(!changing||include_depth> change_depth){
/*24:*/
#line 520 "common.w"
{
cur_line++;
while(!input_ln(cur_file)){
print_where= 1;
if(include_depth==0){input_has_ended= 1;break;}
else{
fclose(cur_file);include_depth--;
if(changing&&include_depth==change_depth)break;
cur_line++;
}
}
if(!changing&&!input_has_ended)
if(limit-buffer==change_limit-change_buffer)
if(buffer[0]==change_buffer[0])
if(change_limit> change_buffer)check_change();
}

/*:24*/
#line 433 "common.w"
;
if(changing&&include_depth==change_depth)goto restart;
}
if(input_has_ended)return 0;
loc= buffer;*limit= ' ';
if(buffer[0]=='@'&&(buffer[1]=='i'||buffer[1]=='I')){
loc= buffer+2;*limit= '"';
while(*loc==' '||*loc=='\t')loc++;
if(loc>=limit){
err_print("! Include file name not given");

goto restart;
}
if(include_depth>=max_include_depth-1){
err_print("! Too many nested includes");

goto restart;
}
include_depth++;
/*23:*/
#line 474 "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;
int l;

if(*loc=='"'){
loc++;
while(*loc!='"'&&k<=cur_file_name_end)*k++= *loc++;
if(loc==limit)k= cur_file_name_end+1;
}else
while(*loc!=' '&&*loc!='\t'&&*loc!='"'&&k<=cur_file_name_end)*k++= *loc++;
if(k> cur_file_name_end)too_long();

*k= '\0';
if((cur_file= fopen(cur_file_name,"r"))!=NULL){
cur_line= 0;print_where= 1;
goto restart;
}
kk= getenv("CWEBINPUTS");
if(kk!=NULL){
if((l= strlen(kk))> max_file_name_length-2)too_long();
strcpy(temp_file_name,kk);
}
else{
#ifdef CWEBINPUTS
if((l= strlen(CWEBINPUTS))> max_file_name_length-2)too_long();
strcpy(temp_file_name,CWEBINPUTS);
#else
l= 0;
#endif 
}
if(l> 0){
if(k+l+2>=cur_file_name_end)too_long();

for(;k>=cur_file_name;k--)*(k+l+1)= *k;
strcpy(cur_file_name,temp_file_name);
cur_file_name[l]= '/';
if((cur_file= fopen(cur_file_name,"r"))!=NULL){
cur_line= 0;print_where= 1;
goto restart;
}
}
include_depth--;err_print("! Cannot open include file");goto restart;
}

/*:23*/
#line 452 "common.w"
;
}
return 1;
}

Here is the call graph for this function:

Definition at line 877 of file ctangle.c.

{
static int preprocessing= 0;
eight_bits c;
while(1){
if(loc> limit){
if(preprocessing&&*(limit-1)!='\\')preprocessing= 0;
if(get_line()==0)return(new_section);
else if(print_where&&!no_where){
print_where= 0;
/*77:*/
#line 1225 "ctangle.w"

store_two_bytes(0150000);
if(changing)id_first= change_file_name;
else id_first= cur_file_name;
id_loc= id_first+strlen(id_first);
if(changing)store_two_bytes((sixteen_bits)change_line);
else store_two_bytes((sixteen_bits)cur_line);
{int a= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a/0400)+0200);
app_repl(a%0400);}

/*:77*/
#line 912 "ctangle.w"
;
}
else return('\n');
}
c= *loc;
if(comment_continues||(c=='/'&&(*(loc+1)=='*'||*(loc+1)=='/'))){
skip_comment(comment_continues||*(loc+1)=='*');

if(comment_continues)return('\n');
else continue;
}
loc++;
if(xisdigit(c)||c=='.')/*66:*/
#line 978 "ctangle.w"
{
id_first= loc-1;
if(*id_first=='.'&&!xisdigit(*loc))goto mistake;
if(*id_first=='0'){
if(*loc=='x'||*loc=='X'){
loc++;while(xisxdigit(*loc))loc++;goto found;
}
}
while(xisdigit(*loc))loc++;
if(*loc=='.'){
loc++;
while(xisdigit(*loc))loc++;
}
if(*loc=='e'||*loc=='E'){
if(*++loc=='+'||*loc=='-')loc++;
while(xisdigit(*loc))loc++;
}
found:while(*loc=='u'||*loc=='U'||*loc=='l'||*loc=='L'
||*loc=='f'||*loc=='F')loc++;
id_loc= loc;
return(constant);
}

/*:66*/
#line 924 "ctangle.w"

else if(c=='\''||c=='"'||(c=='L'&&(*loc=='\''||*loc=='"')))
/*67:*/
#line 1006 "ctangle.w"
{
char delim= c;
id_first= section_text+1;
id_loc= section_text;*++id_loc= delim;
if(delim=='L'){
delim= *loc++;*++id_loc= delim;
}
while(1){
if(loc>=limit){
if(*(limit-1)!='\\'){
err_print("! String didn't end");loc= limit;break;

}
if(get_line()==0){
err_print("! Input ended in middle of string");loc= buffer;break;

}
else if(++id_loc<=section_text_end)*id_loc= '\n';

}
if((c= *loc++)==delim){
if(++id_loc<=section_text_end)*id_loc= c;
break;
}
if(c=='\\'){
if(loc>=limit)continue;
if(++id_loc<=section_text_end)*id_loc= '\\';
c= *loc++;
}
if(++id_loc<=section_text_end)*id_loc= c;
}
if(id_loc>=section_text_end){
printf("\n! String too long: ");

term_write(section_text+1,25);
err_print("...");
}
id_loc++;
return(string);
}

/*:67*/
#line 926 "ctangle.w"

else if(isalpha(c)||isxalpha(c)||ishigh(c))
/*65:*/
#line 972 "ctangle.w"
{
id_first= --loc;
while(isalpha(*++loc)||isdigit(*loc)||isxalpha(*loc)||ishigh(*loc));
id_loc= loc;return(identifier);
}

/*:65*/
#line 928 "ctangle.w"

else if(c=='@')/*68:*/
#line 1050 "ctangle.w"
{
c= ccode[(eight_bits)*loc++];
switch(c){
case ignore:continue;
case translit_code:err_print("! Use @l in limbo only");continue;

case control_text:while((c= skip_ahead())=='@');

if(*(loc-1)!='>')
err_print("! Double @ should be used in control text");

continue;
case section_name:
cur_section_name_char= *(loc-1);
/*70:*/
#line 1098 "ctangle.w"
{
char*k;
/*72:*/
#line 1118 "ctangle.w"

k= section_text;
while(1){
if(loc> limit&&get_line()==0){
err_print("! Input ended in section name");

loc= buffer+1;break;
}
c= *loc;
/*73:*/
#line 1142 "ctangle.w"

if(c=='@'){
c= *(loc+1);
if(c=='>'){
loc+= 2;break;
}
if(ccode[(eight_bits)c]==new_section){
err_print("! Section name didn't end");break;

}
if(ccode[(eight_bits)c]==section_name){
err_print("! Nesting of section names not allowed");break;

}
*(++k)= '@';loc++;
}

/*:73*/
#line 1127 "ctangle.w"
;
loc++;if(k<section_text_end)k++;
if(xisspace(c)){
c= ' ';if(*(k-1)==' ')k--;
}
*k= c;
}
if(k>=section_text_end){
printf("\n! Section name too long: ");

term_write(section_text+1,25);
printf("...");mark_harmless;
}
if(*k==' '&&k> section_text)k--;

/*:72*/
#line 1100 "ctangle.w"
;
if(k-section_text> 3&&strncmp(k-2,"...",3)==0)
cur_section_name= section_lookup(section_text+1,k-3,1);
else cur_section_name= section_lookup(section_text+1,k,0);
if(cur_section_name_char=='(')
/*40:*/
#line 516 "ctangle.w"

{
for(an_output_file= cur_out_file;
an_output_file<end_output_files;an_output_file++)
if(*an_output_file==cur_section_name)break;
if(an_output_file==end_output_files){
if(cur_out_file> output_files)
*--cur_out_file= cur_section_name;
else{
overflow("output files");
}
}
}

/*:40*/
#line 1106 "ctangle.w"
;
return(section_name);
}

/*:70*/
#line 1064 "ctangle.w"
;
case string:/*74:*/
#line 1164 "ctangle.w"
{
id_first= loc++;*(limit+1)= '@';*(limit+2)= '>';
while(*loc!='@'||*(loc+1)!='>')loc++;
if(loc>=limit)err_print("! Verbatim string didn't end");

id_loc= loc;loc+= 2;
return(string);
}

/*:74*/
#line 1065 "ctangle.w"
;
case ord:/*69:*/
#line 1077 "ctangle.w"

id_first= loc;
if(*loc=='\\'){
if(*++loc=='\'')loc++;
}
while(*loc!='\''){
if(*loc=='@'){
if(*(loc+1)!='@')
err_print("! Double @ should be used in ASCII constant");

else loc++;
}
loc++;
if(loc> limit){
err_print("! String didn't end");loc= limit-1;break;

}
}
loc++;
return(ord);

/*:69*/
#line 1066 "ctangle.w"
;
default:return(c);
}
}

/*:68*/
#line 929 "ctangle.w"

else if(xisspace(c)){
if(!preprocessing||loc> limit)continue;

else return(' ');
}
else if(c=='#'&&loc==buffer+1)preprocessing= 1;
mistake:/*64:*/
#line 950 "ctangle.w"

switch(c){
case'+':if(*loc=='+')compress(plus_plus);break;
case'-':if(*loc=='-'){compress(minus_minus);}
else if(*loc=='>')if(*(loc+1)=='*'){loc++;compress(minus_gt_ast);}
else compress(minus_gt);break;
case'.':if(*loc=='*'){compress(period_ast);}
else if(*loc=='.'&&*(loc+1)=='.'){
loc++;compress(dot_dot_dot);
}
break;
case':':if(*loc==':')compress(colon_colon);break;
case'=':if(*loc=='=')compress(eq_eq);break;
case'>':if(*loc=='='){compress(gt_eq);}
else if(*loc=='>')compress(gt_gt);break;
case'<':if(*loc=='='){compress(lt_eq);}
else if(*loc=='<')compress(lt_lt);break;
case'&':if(*loc=='&')compress(and_and);break;
case'|':if(*loc=='|')compress(or_or);break;
case'!':if(*loc=='=')compress(not_eq);break;
}

/*:64*/
#line 936 "ctangle.w"

return(c);
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 549 of file ctangle.c.

{
sixteen_bits a;
restart:if(stack_ptr==stack)return;
if(cur_byte==cur_end){
cur_val= -((int)cur_section);
pop_level(1);
if(cur_val==0)goto restart;
out_char(section_number);return;
}
a= *cur_byte++;
if(out_state==verbatim&&a!=string&&a!=constant&&a!='\n')
C_putc(a);
else if(a<0200)out_char(a);
else{
a= (a-0200)*0400+*cur_byte++;
switch(a/024000){
case 0:cur_val= a;out_char(identifier);break;
case 1:if(a==output_defs_flag)output_defs();
else/*34:*/
#line 423 "ctangle.w"

{
a-= 024000;
if((a+name_dir)->equiv!=(char*)text_info)push_level(a+name_dir);
else if(a!=0){
printf("\n! Not present: <");
print_section_name(a+name_dir);err_print(">");

}
goto restart;
}

/*:34*/
#line 412 "ctangle.w"
;
break;
default:cur_val= a-050000;if(cur_val> 0)cur_section= cur_val;
out_char(section_number);
}
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 492 of file ctangle.c.

{
node->equiv= (char*)text_info;
}
void init_p ( )

Definition at line 498 of file ctangle.c.

{}

Here is the caller graph for this function:

int main ( int  ac,
char**  av 
)

Definition at line 407 of file ctangle.c.

{
argc= ac;argv= av;
program= ctangle;
/*18:*/
#line 167 "ctangle.w"

text_info->tok_start= tok_ptr= tok_mem;
text_ptr= text_info+1;text_ptr->tok_start= tok_mem;


/*:18*//*20:*/
#line 177 "ctangle.w"

name_dir->equiv= (char*)text_info;

/*:20*//*24:*/
#line 230 "ctangle.w"
last_unnamed= text_info;text_info->text_link= 0;

/*:24*//*39:*/
#line 512 "ctangle.w"

cur_out_file= end_output_files= output_files+max_files;

/*:39*//*52:*/
#line 713 "ctangle.w"

{
int i;
for(i= 0;i<128;i++)sprintf(translit[i],"X%02X",(unsigned)(128+i));
}

/*:52*//*57:*/
#line 792 "ctangle.w"
{
int c;
for(c= 0;c<256;c++)ccode[c]= ignore;
ccode[' ']= ccode['\t']= ccode['\n']= ccode['\v']= ccode['\r']= ccode['\f']
= ccode['*']= new_section;
ccode['@']= '@';ccode['=']= string;
ccode['d']= ccode['D']= definition;
ccode['f']= ccode['F']= ccode['s']= ccode['S']= format_code;
ccode['c']= ccode['C']= ccode['p']= ccode['P']= begin_C;
ccode['^']= ccode[':']= ccode['.']= ccode['t']= ccode['T']= 
ccode['q']= ccode['Q']= control_text;
ccode['h']= ccode['H']= output_defs_code;
ccode['l']= ccode['L']= translit_code;
ccode['&']= join;
ccode['<']= ccode['(']= section_name;
ccode['\'']= ord;
}

/*:57*//*71:*/
#line 1116 "ctangle.w"
section_text[0]= ' ';

/*:71*/
#line 98 "ctangle.w"
;
common_init();
if(show_banner)printf(banner);
phase_one();
phase_two();
return wrap_up();
}

Here is the call graph for this function:

int names_match ( name_pointer  p,
char*  first,
int  l 
)

Definition at line 479 of file ctangle.c.

{
if(length(p)!=l)return 0;
return!strncmp(first,p->byte_start,l);
}

Here is the call graph for this function:

static void out_char ( ) [static]

Here is the caller graph for this function:

static void out_char ( eight_bits  cur_char) [static]

Definition at line 724 of file ctangle.c.

{
char*j,*k;
restart:
switch(cur_char){
case'\n':if(protect&&out_state!=verbatim)C_putc(' ');
if(protect||out_state==verbatim)C_putc('\\');
flush_buffer();if(out_state!=verbatim)out_state= normal;break;
/*53:*/
#line 719 "ctangle.w"

case identifier:
if(out_state==num_or_id)C_putc(' ');
j= (cur_val+name_dir)->byte_start;
k= (cur_val+name_dir+1)->byte_start;
while(j<k){
if((unsigned char)(*j)<0200)C_putc(*j);

else C_printf("%s",translit[(unsigned char)(*j)-0200]);
j++;
}
out_state= num_or_id;break;

/*:53*/
#line 662 "ctangle.w"
;
/*54:*/
#line 732 "ctangle.w"

case section_number:
if(cur_val> 0)C_printf("/*%d:*/",cur_val);
else if(cur_val<0)C_printf("/*:%d*/",-cur_val);
else if(protect){
cur_byte+= 4;
cur_char= '\n';
goto restart;
}else{
sixteen_bits a;
a= 0400**cur_byte++;
a+= *cur_byte++;
C_printf("\n#line %d \"",a);

cur_val= *cur_byte++;
cur_val= 0400*(cur_val-0200)+*cur_byte++;
for(j= (cur_val+name_dir)->byte_start,k= (cur_val+name_dir+1)->byte_start;
j<k;j++){
if(*j=='\\'||*j=='"')C_putc('\\');
C_putc(*j);
}
C_printf("%s","\"\n");
}
break;

/*:54*/
#line 663 "ctangle.w"
;
/*50:*/
#line 681 "ctangle.w"

case plus_plus:C_putc('+');C_putc('+');out_state= normal;break;
case minus_minus:C_putc('-');C_putc('-');out_state= normal;break;
case minus_gt:C_putc('-');C_putc('>');out_state= normal;break;
case gt_gt:C_putc('>');C_putc('>');out_state= normal;break;
case eq_eq:C_putc('=');C_putc('=');out_state= normal;break;
case lt_lt:C_putc('<');C_putc('<');out_state= normal;break;
case gt_eq:C_putc('>');C_putc('=');out_state= normal;break;
case lt_eq:C_putc('<');C_putc('=');out_state= normal;break;
case not_eq:C_putc('!');C_putc('=');out_state= normal;break;
case and_and:C_putc('&');C_putc('&');out_state= normal;break;
case or_or:C_putc('|');C_putc('|');out_state= normal;break;
case dot_dot_dot:C_putc('.');C_putc('.');C_putc('.');out_state= normal;
break;
case colon_colon:C_putc(':');C_putc(':');out_state= normal;break;
case period_ast:C_putc('.');C_putc('*');out_state= normal;break;
case minus_gt_ast:C_putc('-');C_putc('>');C_putc('*');out_state= normal;
break;

/*:50*/
#line 664 "ctangle.w"
;
case'=':case'>':C_putc(cur_char);C_putc(' ');
out_state= normal;break;
case join:out_state= unbreakable;break;
case constant:if(out_state==verbatim){
out_state= num_or_id;break;
}
if(out_state==num_or_id)C_putc(' ');out_state= verbatim;break;
case string:if(out_state==verbatim)out_state= normal;
else out_state= verbatim;break;
case'/':C_putc('/');out_state= post_slash;break;
case'*':if(out_state==post_slash)C_putc(' ');

default:C_putc(cur_char);out_state= normal;break;
}
}

Here is the call graph for this function:

Definition at line 684 of file ctangle.c.

{
sixteen_bits a;
push_level(NULL);
for(cur_text= text_info+1;cur_text<text_ptr;cur_text++)
if(cur_text->text_link==0){
cur_byte= cur_text->tok_start;
cur_end= (cur_text+1)->tok_start;
C_printf("%s","#define ");
out_state= normal;
protect= 1;
while(cur_byte<cur_end){
a= *cur_byte++;
if(cur_byte==cur_end&&a=='\n')break;
if(out_state==verbatim&&a!=string&&a!=constant&&a!='\n')
C_putc(a);

else if(a<0200)out_char(a);
else{
a= (a-0200)*0400+*cur_byte++;
if(a<024000){
cur_val= a;out_char(identifier);
}
else if(a<050000){confusion("macro defs have strange char");}
else{
cur_val= a-050000;cur_section= cur_val;out_char(section_number);
}

}
}
protect= 0;
flush_buffer();
}
pop_level(0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1482 of file ctangle.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 611 of file ctangle.c.

           {
web_file_open= 0;
cur_line= 1;
/*29:*/
#line 325 "ctangle.w"

stack_ptr= stack+1;cur_name= name_dir;cur_repl= text_info->text_link+text_info;
cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;cur_section= 0;

/*:29*/
#line 541 "ctangle.w"
;
/*44:*/
#line 595 "ctangle.w"

if(!output_defs_seen)
output_defs();

/*:44*/
#line 542 "ctangle.w"
;
if(text_info->text_link==0&&cur_out_file==end_output_files){
printf("\n! No program text was specified.");mark_harmless;

}
else{
if(cur_out_file==end_output_files){
if(show_progress)
printf("\nWriting the output file (%s):",C_file_name);
}
else{
if(show_progress){
printf("\nWriting the output files:");

printf(" (%s)",C_file_name);
update_terminal;
}
if(text_info->text_link==0)goto writeloop;
}
while(stack_ptr> stack)get_output();
flush_buffer();
writeloop:/*43:*/
#line 572 "ctangle.w"

for(an_output_file= end_output_files;an_output_file> cur_out_file;){
an_output_file--;
sprint_section_name(output_file_name,*an_output_file);
fclose(C_file);
C_file= fopen(output_file_name,"w");
if(C_file==0)fatal("! Cannot open output file:",output_file_name);

printf("\n(%s)",output_file_name);update_terminal;
cur_line= 1;
stack_ptr= stack+1;
cur_name= (*an_output_file);
cur_repl= (text_pointer)cur_name->equiv;
cur_byte= cur_repl->tok_start;
cur_end= (cur_repl+1)->tok_start;
while(stack_ptr> stack)get_output();
flush_buffer();
}

/*:43*/
#line 563 "ctangle.w"
;
if(show_happiness)printf("\nDone.");
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pop_level ( int  flag)

Definition at line 533 of file ctangle.c.

{
if(flag&&cur_repl->text_link<section_flag){
cur_repl= cur_repl->text_link+text_info;
cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
return;
}
stack_ptr--;
if(stack_ptr> stack)cur_state= *stack_ptr;
}

Here is the caller graph for this function:

Definition at line 1554 of file ctangle.c.

             {
printf("\nMemory usage statistics:\n");
printf("%ld names (out of %ld)\n",
(long)(name_ptr-name_dir),(long)max_names);
printf("%ld replacement texts (out of %ld)\n",
(long)(text_ptr-text_info),(long)max_texts);
printf("%ld bytes (out of %ld)\n",
(long)(byte_ptr-byte_mem),(long)max_bytes);
printf("%ld tokens (out of %ld)\n",
(long)(tok_ptr-tok_mem),(long)max_toks);
}

Here is the call graph for this function:

Definition at line 516 of file ctangle.c.

{
if(stack_ptr==stack_end)overflow("stack");
*stack_ptr= cur_state;
stack_ptr++;
if(p!=NULL){
cur_name= p;cur_repl= (text_pointer)p->equiv;
cur_byte= cur_repl->tok_start;cur_end= (cur_repl+1)->tok_start;
cur_section= 0;
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 513 of file common.c.

{
limit= buffer;loc= buffer+1;buffer[0]= ' ';
/*19:*/
#line 393 "common.w"

if((web_file= fopen(web_file_name,"r"))==NULL){
strcpy(web_file_name,alt_web_file_name);
if((web_file= fopen(web_file_name,"r"))==NULL)
fatal("! Cannot open input file ",web_file_name);
}


web_file_open= 1;
if((change_file= fopen(change_file_name,"r"))==NULL)
fatal("! Cannot open change file ",change_file_name);

/*:19*/
#line 383 "common.w"
;
include_depth= 0;cur_line= 0;change_line= 0;
change_depth= include_depth;
changing= 1;prime_the_change_buffer();changing= !changing;
limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1187 of file ctangle.c.

{
sixteen_bits a;
if(t==section_name){/*77:*/
#line 1225 "ctangle.w"

store_two_bytes(0150000);
if(changing)id_first= change_file_name;
else id_first= cur_file_name;
id_loc= id_first+strlen(id_first);
if(changing)store_two_bytes((sixteen_bits)change_line);
else store_two_bytes((sixteen_bits)cur_line);
{int a= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a/0400)+0200);
app_repl(a%0400);}

/*:77*/
#line 1205 "ctangle.w"
;}
while(1)switch(a= get_next()){
/*78:*/
#line 1235 "ctangle.w"

case identifier:a= id_lookup(id_first,id_loc,0)-name_dir;
app_repl((a/0400)+0200);
app_repl(a%0400);break;
case section_name:if(t!=section_name)goto done;
else{
/*79:*/
#line 1268 "ctangle.w"
{
char*try_loc= loc;
while(*try_loc==' '&&try_loc<limit)try_loc++;
if(*try_loc=='+'&&try_loc<limit)try_loc++;
while(*try_loc==' '&&try_loc<limit)try_loc++;
if(*try_loc=='=')err_print("! Missing `@ ' before a named section");



}

/*:79*/
#line 1241 "ctangle.w"
;
a= cur_section_name-name_dir;
app_repl((a/0400)+0250);
app_repl(a%0400);
/*77:*/
#line 1225 "ctangle.w"

store_two_bytes(0150000);
if(changing)id_first= change_file_name;
else id_first= cur_file_name;
id_loc= id_first+strlen(id_first);
if(changing)store_two_bytes((sixteen_bits)change_line);
else store_two_bytes((sixteen_bits)cur_line);
{int a= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a/0400)+0200);
app_repl(a%0400);}

/*:77*/
#line 1245 "ctangle.w"
;break;
}
case output_defs_code:if(t!=section_name)err_print("! Misplaced @h");

else{
output_defs_seen= 1;
a= output_defs_flag;
app_repl((a/0400)+0200);
app_repl(a%0400);
/*77:*/
#line 1225 "ctangle.w"

store_two_bytes(0150000);
if(changing)id_first= change_file_name;
else id_first= cur_file_name;
id_loc= id_first+strlen(id_first);
if(changing)store_two_bytes((sixteen_bits)change_line);
else store_two_bytes((sixteen_bits)cur_line);
{int a= id_lookup(id_first,id_loc,0)-name_dir;app_repl((a/0400)+0200);
app_repl(a%0400);}

/*:77*/
#line 1254 "ctangle.w"
;
}
break;
case constant:case string:
/*80:*/
#line 1279 "ctangle.w"

app_repl(a);
while(id_first<id_loc){
if(*id_first=='@'){
if(*(id_first+1)=='@')id_first++;
else err_print("! Double @ should be used in string");

}
app_repl(*id_first++);
}
app_repl(a);break;

/*:80*/
#line 1258 "ctangle.w"
;
case ord:
/*81:*/
#line 1295 "ctangle.w"
{
int c= (eight_bits)*id_first;
if(c=='\\'){
c= *++id_first;
if(c>='0'&&c<='7'){
c-= '0';
if(*(id_first+1)>='0'&&*(id_first+1)<='7'){
c= 8*c+*(++id_first)-'0';
if(*(id_first+1)>='0'&&*(id_first+1)<='7'&&c<32)
c= 8*c+*(++id_first)-'0';
}
}
else switch(c){
case't':c= '\t';break;
case'n':c= '\n';break;
case'b':c= '\b';break;
case'f':c= '\f';break;
case'v':c= '\v';break;
case'r':c= '\r';break;
case'a':c= '\7';break;
case'?':c= '?';break;
case'x':
if(xisdigit(*(id_first+1)))c= *(++id_first)-'0';
else if(xisxdigit(*(id_first+1))){
++id_first;
c= toupper(*id_first)-'A'+10;
}
if(xisdigit(*(id_first+1)))c= 16*c+*(++id_first)-'0';
else if(xisxdigit(*(id_first+1))){
++id_first;
c= 16*c+toupper(*id_first)-'A'+10;
}
break;
case'\\':c= '\\';break;
case'\'':c= '\'';break;
case'\"':c= '\"';break;
default:err_print("! Unrecognized escape sequence");

}
}

app_repl(constant);
if(c>=100)app_repl('0'+c/100);
if(c>=10)app_repl('0'+(c/10)%10);
app_repl('0'+c%10);
app_repl(constant);
}
break;

/*:81*/
#line 1260 "ctangle.w"
;
case definition:case format_code:case begin_C:if(t!=section_name)goto done;
else{
err_print("! @d, @f and @c are ignored in C text");continue;

}
case new_section:goto done;

/*:78*/
#line 1210 "ctangle.w"

case')':app_repl(a);
if(t==macro)app_repl(' ');
break;
default:app_repl(a);
}
done:next_control= (eight_bits)a;
if(text_ptr> text_info_end)overflow("text");
cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1371 of file ctangle.c.

{
name_pointer p;
text_pointer q;
sixteen_bits a;
section_count++;no_where= 1;
if(*(loc-1)=='*'&&show_progress){
printf("*%d",section_count);update_terminal;
}
next_control= 0;
while(1){
/*84:*/
#line 1396 "ctangle.w"

while(next_control<definition)

if((next_control= skip_ahead())==section_name){
loc-= 2;next_control= get_next();
}

/*:84*/
#line 1371 "ctangle.w"
;
if(next_control==definition){
/*85:*/
#line 1403 "ctangle.w"
{
while((next_control= get_next())=='\n');
if(next_control!=identifier){
err_print("! Definition flushed, must start with identifier");

continue;
}
app_repl(((a= id_lookup(id_first,id_loc,0)-name_dir)/0400)+0200);

app_repl(a%0400);
if(*loc!='('){
app_repl(string);app_repl(' ');app_repl(string);
}
scan_repl(macro);
cur_text->text_link= 0;
}

/*:85*/
#line 1373 "ctangle.w"

continue;
}
if(next_control==begin_C){
p= name_dir;break;
}
if(next_control==section_name){
p= cur_section_name;
/*86:*/
#line 1428 "ctangle.w"

while((next_control= get_next())=='+');
if(next_control!='='&&next_control!=eq_eq)
continue;

/*:86*/
#line 1381 "ctangle.w"
;
break;
}
return;
}
no_where= print_where= 0;
/*87:*/
#line 1433 "ctangle.w"

/*88:*/
#line 1438 "ctangle.w"

store_two_bytes((sixteen_bits)(0150000+section_count));


/*:88*/
#line 1434 "ctangle.w"
;
scan_repl(section_name);
/*89:*/
#line 1442 "ctangle.w"

if(p==name_dir||p==0){
(last_unnamed)->text_link= cur_text-text_info;last_unnamed= cur_text;
}
else if(p->equiv==(char*)text_info)p->equiv= (char*)cur_text;

else{
q= (text_pointer)p->equiv;
while(q->text_link<section_flag)
q= q->text_link+text_info;
q->text_link= cur_text-text_info;
}
cur_text->text_link= section_flag;


/*:89*/
#line 1436 "ctangle.w"
;

/*:87*/
#line 1387 "ctangle.w"
;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 825 of file ctangle.c.

{
eight_bits c;
while(1){
if(loc> limit&&(get_line()==0))return(new_section);
*(limit+1)= '@';
while(*loc!='@')loc++;
if(loc<=limit){
loc++;c= ccode[(eight_bits)*loc];loc++;
if(c!=ignore||*(loc-1)=='>')return(c);
}
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

int skip_comment ( boolean  is_long_comment)

Definition at line 842 of file ctangle.c.

{
char c;
while(1){
if(loc> limit){
if(is_long_comment){
if(get_line())return(comment_continues= 1);
else{
err_print("! Input ended in mid-comment");

return(comment_continues= 0);
}
}
else return(comment_continues= 0);
}
c= *(loc++);
if(is_long_comment&&c=='*'&&*loc=='/'){
loc++;return(comment_continues= 0);
}
if(c=='@'){
if(ccode[(eight_bits)*loc]==new_section){
err_print("! Section name ended in mid-comment");loc--;

return(comment_continues= 0);
}
else loc++;
}
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1496 of file ctangle.c.

{
char c;
while(1){
if(loc> limit&&get_line()==0)return;
*(limit+1)= '@';
while(*loc!='@')loc++;
if(loc++<=limit){
c= *loc++;
if(ccode[(eight_bits)c]==new_section)break;
switch(ccode[(eight_bits)c]){
case translit_code:/*94:*/
#line 1507 "ctangle.w"

while(xisspace(*loc)&&loc<limit)loc++;
loc+= 3;
if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2))
||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
err_print("! Improper hex number following @l");

else{
unsigned i;
char*beg;
sscanf(loc-3,"%x",&i);
while(xisspace(*loc)&&loc<limit)loc++;
beg= loc;
while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||*loc=='_'))loc++;
if(loc-beg>=translit_length)
err_print("! Replacement string in @l too long");

else{
strncpy(translit[i-0200],beg,loc-beg);
translit[i-0200][loc-beg]= '\0';
}
}

/*:94*/
#line 1491 "ctangle.w"
;break;
case format_code:case'@':break;
case control_text:if(c=='q'||c=='Q'){
while((c= skip_ahead())=='@');
if(*(loc-1)!='>')
err_print("! Double @ should be used in control text");

break;
}
default:err_print("! Double @ should be used in limbo");

}
}
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 504 of file ctangle.c.

{
if(tok_ptr+2> tok_mem_end)overflow("token");
*tok_ptr++= x>>8;
*tok_ptr++= x&0377;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int strcmp ( )
char* strcpy ( )
int strlen ( )
int strncmp ( )
char* strncpy ( )
wrap_up ( )

Definition at line 554 of file ctie.c.

{
/*34:*/
#line 682 "./ctie.w"

switch(history){
case spotless:
printf("\n(No errors were found.)\n");break;
case troublesome:
printf("\n(Pardon me, but I think I spotted something wrong.)\n");break;
case fatal:printf("(That was a fatal error, my friend.)\n");
}


/*:34*/
#line 666 "./ctie.w"
;
if(history> spotless)return 1;
else return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 252 of file cwebboot.c.

Definition at line 322 of file ctangle.c.

Definition at line 236 of file cwebboot.c.

char** argv

Definition at line 237 of file cwebboot.c.

char buffer[]

Definition at line 1914 of file png.h.

char* buffer_end

Definition at line 149 of file cwebboot.c.

char byte_mem[]

Definition at line 209 of file cwebboot.c.

char* byte_mem_end

Definition at line 210 of file cwebboot.c.

char* byte_ptr

Definition at line 218 of file cwebboot.c.

Definition at line 247 of file cwebboot.c.

char C_file_name[]

Definition at line 238 of file cwebboot.c.

Definition at line 339 of file ctangle.c.

Definition at line 158 of file cwebboot.c.

Definition at line 161 of file cwebboot.c.

Definition at line 164 of file cwebboot.c.

Definition at line 176 of file cwebboot.c.

Definition at line 175 of file cwebboot.c.

Definition at line 167 of file cwebboot.c.

Definition at line 344 of file ctangle.c.

Definition at line 322 of file ctangle.c.

Definition at line 349 of file ctangle.c.

Definition at line 323 of file ctangle.c.

Definition at line 301 of file ctangle.c.

Definition at line 355 of file ctangle.c.

Definition at line 310 of file ctangle.c.

Definition at line 322 of file ctangle.c.

FILE* file[]

Definition at line 157 of file cwebboot.c.

Definition at line 159 of file cwebboot.c.

Definition at line 1530 of file png.h.

Definition at line 302 of file gd.h.

Definition at line 224 of file cwebboot.c.

Definition at line 225 of file cwebboot.c.

Definition at line 158 of file ctie-k.c.

char* id_first

Definition at line 155 of file ctangle.c.

char* id_loc

Definition at line 156 of file ctangle.c.

Definition at line 249 of file cwebboot.c.

char idx_file_name[]

Definition at line 240 of file cwebboot.c.

Definition at line 156 of file cwebboot.c.

Definition at line 182 of file ctie-k.c.

Definition at line 296 of file ctangle.c.

char* limit

Definition at line 150 of file cwebboot.c.

line[]

Definition at line 176 of file t1part.c.

char* loc

Definition at line 151 of file cwebboot.c.

Definition at line 211 of file cwebboot.c.

Definition at line 212 of file cwebboot.c.

Definition at line 217 of file cwebboot.c.

Definition at line 356 of file ctangle.c.

Definition at line 350 of file ctangle.c.

Definition at line 315 of file ctangle.c.

Definition at line 329 of file ctangle.c.

Definition at line 324 of file ctangle.c.

Definition at line 321 of file ctangle.c.

Definition at line 261 of file cwebboot.c.

Definition at line 178 of file cwebboot.c.

Definition at line 143 of file cwebboot.c.

Definition at line 316 of file ctangle.c.

Definition at line 250 of file cwebboot.c.

char scn_file_name[]

Definition at line 241 of file cwebboot.c.

Definition at line 361 of file ctangle.c.

Definition at line 153 of file ctangle.c.

Definition at line 154 of file ctangle.c.

Definition at line 303 of file ctangle.c.

Definition at line 305 of file ctangle.c.

Definition at line 304 of file ctangle.c.

Definition at line 248 of file cwebboot.c.

char tex_file_name[]

Definition at line 239 of file cwebboot.c.

Definition at line 286 of file ctangle.c.

Definition at line 287 of file ctangle.c.

Definition at line 288 of file ctangle.c.

Definition at line 289 of file ctangle.c.

Definition at line 290 of file ctangle.c.

Definition at line 291 of file ctangle.c.

Definition at line 334 of file ctangle.c.

Definition at line 168 of file cwebboot.c.