Back to index

tetex-bin  3.0
Classes | Defines | Typedefs | Functions | Variables
ctangleboot.c File Reference
#include <stdio.h>
#include <kpathsea/kpathsea.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" \
#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   1024
#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 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 P3H (char *, char *, char)
void print_section_name P1H (name_pointer)
void sprint_section_name P2H (char *, name_pointer)
void err_print P1H (char *)
int wrap_up P1H (void)
void fatal P2H (char *, char *)
static void out_char P1H (eight_bits)
int main P2C (int, ac, char **, av)
int names_match P4C (name_pointer, p, char *, first, int, l, char, t)
void init_node P1C (name_pointer, node)
void init_p P2C (name_pointer, p, char, t)
void store_two_bytes P1C (sixteen_bits, x)
void push_level P1C (name_pointer, p)
void pop_level P1C (int, flag)
static void out_char P1C (eight_bits, cur_char)
int skip_comment P1C (boolean, is_long_comment)
void scan_repl P1C (eight_bits, t)

Variables

char * versionstring
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
int history
int 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 []
int line []
int 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 177 of file ctangleboot.c.

Class Members
char Ilk
struct name_info * Rlink

Define Documentation

#define and_and   04

Definition at line 39 of file ctangleboot.c.

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

Definition at line 142 of file ctangleboot.c.

#define banner   "This is CTANGLE, Version 3.64" \

Definition at line 23 of file ctangleboot.c.

#define begin_C   0310

Definition at line 128 of file ctangleboot.c.

#define buf_size   100 \

Definition at line 34 of file ctangleboot.c.

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

Definition at line 92 of file ctangleboot.c.

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

Definition at line 93 of file ctangleboot.c.

#define chunk_marker   0 \

Definition at line 68 of file ctangleboot.c.

#define colon_colon   06

Definition at line 51 of file ctangleboot.c.

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

Definition at line 139 of file ctangleboot.c.

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

Definition at line 76 of file ctangleboot.c.

#define constant   03 \

Definition at line 132 of file ctangleboot.c.

#define control_text   0303

Definition at line 123 of file ctangleboot.c.

#define ctangle   0

Definition at line 36 of file ctangleboot.c.

#define cur_byte   cur_state.byte_field

Definition at line 104 of file ctangleboot.c.

#define cur_end   cur_state.end_field

Definition at line 103 of file ctangleboot.c.

#define cur_file   file[include_depth]

Definition at line 79 of file ctangleboot.c.

Definition at line 80 of file ctangleboot.c.

#define cur_line   line[include_depth] \

Definition at line 82 of file ctangleboot.c.

#define cur_name   cur_state.name_field

Definition at line 105 of file ctangleboot.c.

#define cur_repl   cur_state.repl_field

Definition at line 106 of file ctangleboot.c.

#define cur_section   cur_state.section_field \

Definition at line 107 of file ctangleboot.c.

#define cweave   1 \

Definition at line 37 of file ctangleboot.c.

#define definition   0307

Definition at line 127 of file ctangleboot.c.

#define dot_dot_dot   016

Definition at line 50 of file ctangleboot.c.

#define eq_eq   036

Definition at line 48 of file ctangleboot.c.

#define equiv   equiv_or_xref \

Definition at line 95 of file ctangleboot.c.

Definition at line 72 of file ctangleboot.c.

#define fatal_message   3

Definition at line 73 of file ctangleboot.c.

#define format_code   0306

Definition at line 126 of file ctangleboot.c.

#define gt_eq   035

Definition at line 47 of file ctangleboot.c.

#define gt_gt   021

Definition at line 41 of file ctangleboot.c.

#define harmless_message   1

Definition at line 71 of file ctangleboot.c.

#define hash_size   353

Definition at line 31 of file ctangleboot.c.

#define identifier   0202 \

Definition at line 110 of file ctangleboot.c.

#define ignore   0

Definition at line 121 of file ctangleboot.c.

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

Definition at line 136 of file ctangleboot.c.

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

Definition at line 134 of file ctangleboot.c.

#define join   0177

Definition at line 100 of file ctangleboot.c.

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

Definition at line 62 of file ctangleboot.c.

#define llink   link

Definition at line 64 of file ctangleboot.c.

#define longest_name   10000

Definition at line 32 of file ctangleboot.c.

#define lt_eq   034

Definition at line 46 of file ctangleboot.c.

#define lt_lt   020

Definition at line 40 of file ctangleboot.c.

#define macro   0

Definition at line 141 of file ctangleboot.c.

Definition at line 75 of file ctangleboot.c.

Definition at line 74 of file ctangleboot.c.

#define max_bytes   90000 \

Definition at line 25 of file ctangleboot.c.

#define max_file_name_length   1024

Definition at line 78 of file ctangleboot.c.

#define max_files   256

Definition at line 118 of file ctangleboot.c.

#define max_names   4000 \

Definition at line 28 of file ctangleboot.c.

#define max_texts   2500

Definition at line 30 of file ctangleboot.c.

#define max_toks   270000

Definition at line 27 of file ctangleboot.c.

#define minus_gt   031

Definition at line 44 of file ctangleboot.c.

#define minus_gt_ast   027 \

Definition at line 53 of file ctangleboot.c.

#define minus_minus   01

Definition at line 43 of file ctangleboot.c.

#define new_line   putchar('\n')

Definition at line 89 of file ctangleboot.c.

#define new_section   0312 \

Definition at line 130 of file ctangleboot.c.

#define normal   0

Definition at line 112 of file ctangleboot.c.

#define not_eq   032

Definition at line 45 of file ctangleboot.c.

#define num_or_id   1

Definition at line 113 of file ctangleboot.c.

#define or_or   037

Definition at line 49 of file ctangleboot.c.

#define ord   0302

Definition at line 122 of file ctangleboot.c.

#define output_defs_code   0305

Definition at line 125 of file ctangleboot.c.

#define output_defs_flag   (2*024000-1) \

Definition at line 101 of file ctangleboot.c.

#define period_ast   026

Definition at line 52 of file ctangleboot.c.

#define plus_plus   013

Definition at line 42 of file ctangleboot.c.

#define post_slash   2

Definition at line 114 of file ctangleboot.c.

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

Definition at line 63 of file ctangleboot.c.

#define putxchar   putchar

Definition at line 90 of file ctangleboot.c.

#define rlink   dummy.Rlink

Definition at line 65 of file ctangleboot.c.

#define root   name_dir->rlink \

Definition at line 66 of file ctangleboot.c.

#define section_flag   max_texts \

Definition at line 97 of file ctangleboot.c.

#define section_name   0311

Definition at line 129 of file ctangleboot.c.

#define section_number   0201

Definition at line 109 of file ctangleboot.c.

#define show_banner   flags['b']

Definition at line 84 of file ctangleboot.c.

#define show_happiness   flags['h'] \

Definition at line 86 of file ctangleboot.c.

#define show_progress   flags['p']

Definition at line 85 of file ctangleboot.c.

#define spotless   0

Definition at line 70 of file ctangleboot.c.

#define stack_size   50

Definition at line 33 of file ctangleboot.c.

int int char double double int int char * string   02

Definition at line 99 of file ctangleboot.c.

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

Definition at line 91 of file ctangleboot.c.

#define translit_code   0304

Definition at line 124 of file ctangleboot.c.

#define translit_length   10 \

Definition at line 119 of file ctangleboot.c.

#define unbreakable   3

Definition at line 115 of file ctangleboot.c.

#define update_terminal   fflush(stdout)

Definition at line 88 of file ctangleboot.c.

#define verbatim   4 \

Definition at line 116 of file ctangleboot.c.

#define web_file_name   file_name[0]

Definition at line 81 of file ctangleboot.c.

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

Definition at line 55 of file ctangleboot.c.

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

Definition at line 56 of file ctangleboot.c.

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

Definition at line 58 of file ctangleboot.c.

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

Definition at line 57 of file ctangleboot.c.

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

Definition at line 59 of file ctangleboot.c.

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

Definition at line 60 of file ctangleboot.c.


Typedef Documentation

typedef char unsigned eight_bits

Definition at line 151 of file ctangleboot.c.

Definition at line 185 of file ctangleboot.c.

typedef struct name_info name_info

Definition at line 184 of file ctangleboot.c.

typedef unsigned short sixteen_bits

Definition at line 246 of file ctangleboot.c.

Definition at line 297 of file ctangleboot.c.

typedef text* text_pointer

Definition at line 285 of file ctangleboot.c.


Function Documentation

Definition at line 518 of file ctangleboot.c.

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

Definition at line 533 of file ctangleboot.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:

Definition at line 546 of file ctangleboot.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:

void pop_level P1C ( int  ,
flag   
)

Definition at line 564 of file ctangleboot.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;
}
static void out_char P1C ( eight_bits  ,
cur_char   
) [static]

Definition at line 764 of file ctangleboot.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;
/*52:*/
#line 719 "./cwebdir/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;

/*:52*/
#line 662 "./cwebdir/ctangle.w"
;
/*53:*/
#line 732 "./cwebdir/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;

/*:53*/
#line 663 "./cwebdir/ctangle.w"
;
/*49:*/
#line 681 "./cwebdir/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;

/*:49*/
#line 664 "./cwebdir/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:

int skip_comment P1C ( boolean  ,
is_long_comment   
)

Definition at line 885 of file ctangleboot.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:

void scan_repl P1C ( eight_bits  ,
t   
)

Definition at line 1233 of file ctangleboot.c.

{
sixteen_bits a;
if(t==section_name){/*76:*/
#line 1225 "./cwebdir/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);}

/*:76*/
#line 1205 "./cwebdir/ctangle.w"
;}
while(1)switch(a= get_next()){
/*77:*/
#line 1235 "./cwebdir/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{
/*78:*/
#line 1268 "./cwebdir/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");



}

/*:78*/
#line 1241 "./cwebdir/ctangle.w"
;
a= cur_section_name-name_dir;
app_repl((a/0400)+0250);
app_repl(a%0400);
/*76:*/
#line 1225 "./cwebdir/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);}

/*:76*/
#line 1245 "./cwebdir/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);
/*76:*/
#line 1225 "./cwebdir/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);}

/*:76*/
#line 1254 "./cwebdir/ctangle.w"
;
}
break;
case constant:case string:
/*79:*/
#line 1279 "./cwebdir/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;

/*:79*/
#line 1258 "./cwebdir/ctangle.w"
;
case ord:
/*80:*/
#line 1295 "./cwebdir/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;

/*:80*/
#line 1260 "./cwebdir/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;

/*:77*/
#line 1210 "./cwebdir/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:

void err_print P1H ( char *  )
int wrap_up P1H ( void  ) [read]

Definition at line 260 of file afm2tfm.c.

                  {
   register char *p ;
   register int c ;

   param = buffer ;
   for (p=buffer; (c=getc(afmin)) != EOF;) {
      if (p - buffer >= INBUFSIZE)
         error("! input line too long; perhaps input file is malformed?") ;
      *p++ = c ;
      if (c == '\r') {
         c = getc(afmin) ;
         if (c != EOF) {
            if (c == '\n') {
               *p++ = c ;
            } else {
               ungetc(c, afmin) ;
            }
         }
         break ;
      } else if (c == '\n') {
         break ;
      }
   }
   *p = 0 ;
   (void)strcpy(obuffer, buffer) ;
   if (p == buffer && c == EOF)
      return(0) ;
   else
      return(1) ;
}
static void out_char P1H ( eight_bits  ) [static]
int main P2C ( int  ,
ac  ,
char **  ,
av   
)

Definition at line 430 of file ctangleboot.c.

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

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


/*:17*//*19:*/
#line 177 "./cwebdir/ctangle.w"

name_dir->equiv= (char*)text_info;

/*:19*//*23:*/
#line 230 "./cwebdir/ctangle.w"
last_unnamed= text_info;text_info->text_link= 0;

/*:23*//*38:*/
#line 512 "./cwebdir/ctangle.w"

cur_out_file= end_output_files= output_files+max_files;

/*:38*//*51:*/
#line 713 "./cwebdir/ctangle.w"

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

/*:51*//*56:*/
#line 792 "./cwebdir/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;
}

/*:56*//*70:*/
#line 1116 "./cwebdir/ctangle.w"
section_text[0]= ' ';

/*:70*/
#line 98 "./cwebdir/ctangle.w"
;
common_init();
#line 76 "./cwebdir/ctang-w2c.ch"
if(show_banner){
printf("%s%s\n",banner,versionstring);
}
#line 101 "./cwebdir/ctangle.w"
phase_one();
phase_two();
return wrap_up();
}

Here is the call graph for this function:

void init_p P2C ( name_pointer  ,
p  ,
char  ,
t   
)

Definition at line 525 of file ctangleboot.c.

{}
void fatal P2H ( char *  ,
char *   
)
name_pointer section_lookup P3H ( char *  ,
char *  ,
char   
)
int names_match P4C ( name_pointer  ,
p  ,
char *  ,
first  ,
int  ,
,
char  ,
t   
)

Definition at line 506 of file ctangleboot.c.

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

Here is the call graph for this function:


Variable Documentation

Definition at line 252 of file cwebboot.c.

Definition at line 341 of file ctangleboot.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 358 of file ctangleboot.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 363 of file ctangleboot.c.

Definition at line 341 of file ctangleboot.c.

Definition at line 368 of file ctangleboot.c.

Definition at line 342 of file ctangleboot.c.

Definition at line 320 of file ctangleboot.c.

Definition at line 374 of file ctangleboot.c.

Definition at line 329 of file ctangleboot.c.

Definition at line 341 of file ctangleboot.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 160 of file ctangleboot.c.

char* id_loc

Definition at line 161 of file ctangleboot.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 315 of file ctangleboot.c.

char* limit

Definition at line 150 of file cwebboot.c.

int 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 375 of file ctangleboot.c.

Definition at line 369 of file ctangleboot.c.

Definition at line 334 of file ctangleboot.c.

Definition at line 348 of file ctangleboot.c.

Definition at line 343 of file ctangleboot.c.

Definition at line 340 of file ctangleboot.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 335 of file ctangleboot.c.

Definition at line 250 of file cwebboot.c.

char scn_file_name[]

Definition at line 241 of file cwebboot.c.

Definition at line 380 of file ctangleboot.c.

Definition at line 158 of file ctangleboot.c.

Definition at line 159 of file ctangleboot.c.

Definition at line 322 of file ctangleboot.c.

Definition at line 324 of file ctangleboot.c.

Definition at line 323 of file ctangleboot.c.

Definition at line 248 of file cwebboot.c.

char tex_file_name[]

Definition at line 239 of file cwebboot.c.

Definition at line 305 of file ctangleboot.c.

Definition at line 306 of file ctangleboot.c.

Definition at line 307 of file ctangleboot.c.

Definition at line 308 of file ctangleboot.c.

Definition at line 309 of file ctangleboot.c.

Definition at line 310 of file ctangleboot.c.

Definition at line 353 of file ctangleboot.c.

Definition at line 6 of file version.c.

Definition at line 168 of file cwebboot.c.