atlas  0.6
common.h
Go to the documentation of this file.
1 
2 
3 typedef char boolean;
4 typedef unsigned char eight_bits;
5 typedef unsigned short sixteen_bits;
6 
7 typedef struct id_info
8 { char *byte_start; /* beginning of the name in |byte_mem| */
9 
11 
12  struct id_info *hash_link; /* links identifiers with same hash code */
13  int ilk;
14 
16 
17 typedef struct mod_info
18 { char *byte_start; /* beginning of the name in |byte_mem| */
19 
21 
22  struct mod_info *llink,*rlink;
23  /* left and right links in binary search tree */
24  int key_length;
25 
27 
28 
29 extern int program, phase;
30 
31 void common_init (int argc,char** argv,char* version);
32 
33 extern char buffer[], *loc, *limit;
34 
35 #define max_file_name_length 256
36 extern struct f
37 { FILE *file; char name[max_file_name_length]; sixteen_bits line; }
38 file[], change;
39 extern int include_depth;
42 
43 boolean locate_file_name();
44 boolean push_input_file(boolean,boolean); /* start a new level of input */
45 boolean get_line (void); /* get the next line of merged input */
46 
47 #define cur_file file[include_depth].file /* current file */
48 #define cur_file_name file[include_depth].name /* current file name */
49 #define cur_line file[include_depth].line
50  /* number of current line in current file */
51 #define web_file file[0].file
52 #define change_file change.file
53 #define change_line change.line
54 
55 void reset_input (void);
56 
59 #define mark_section_as_changed(n) (changed_section[(n)>>3]|=1<<((n)&7))
60 #define section_changed(n) ((changed_section[(n)>>3]&(1<<((n)&7)))!=0)
61 
62 extern void check_complete (void);
63 
64 extern char byte_mem[], *byte_ptr;
65 extern id_info id_table[], *id_ptr;
66 extern mod_info mod_table[], *mod_ptr;
67 
68 extern id_pointer hash[];
69 #define hash_end (&hash[hash_size]) /* end of |hash| */
70 id_pointer id_lookup(char*,char*,int);
71 
72 extern mod_pointer root;
73 
74 extern char mod_text[], *id_first, *id_loc;
75 #define mod_text_end (&mod_text[longest_name+1]) /* end of |mod_text| */
76 mod_pointer get_module_name (void);
77 boolean get_control_text(void);
78 void get_string(void);
79 
80 extern history; /* indicates how bad this run was */
81 extern void err_print (char*), wrap_up (void), print_stats (void),
82  fatal (char*,...);
83 
84 extern boolean flags[];
85 extern char C_file_name[],idx_file_name[],scn_file_name[];
86 
87 extern FILE *C_file, *tex_file;
88 void open_output_file(void);
89 
90 void print(char*,...), print_progress(char*), print_section_progress(void);
91 
92 
void get_string(void)
Definition: common.c:686
void reset_input(void)
Definition: common.c:383
boolean web_file_open
Definition: common.c:101
FILE * C_file
Definition: common.c:144
mod_info mod_table[]
Definition: common.c:122
history
Definition: common.c:134
struct f file[]
void print_stats(void)
Definition: common.h:17
char * loc
Definition: common.c:89
boolean locate_file_name()
Definition: common.c:214
void print_section_progress(void)
Definition: common.c:870
mod_info * mod_ptr
Definition: common.c:123
void common_init(int argc, char **argv, char *version)
Definition: common.c:164
int key_length
Definition: common.h:24
unsigned short sixteen_bits
Definition: common.h:5
struct variant * equiv_or_xref
Definition: common.h:10
boolean input_has_ended
Definition: common.c:99
char * byte_start
Definition: common.h:8
unsigned char eight_bits
Definition: common.h:4
boolean get_control_text(void)
Definition: common.c:671
eight_bits changed_section[]
Definition: common.c:116
char * byte_start
Definition: common.h:18
id_pointer id_lookup(char *, char *, int)
Definition: common.c:490
char byte_mem[]
Definition: common.c:118
char scn_file_name[]
Definition: common.c:140
char * limit
Definition: common.c:91
char idx_file_name[]
Definition: common.c:139
#define max_file_name_length
Definition: common.h:35
id_info id_table[]
Definition: common.c:120
int phase
Definition: common.c:86
boolean including_header_file
Definition: common.c:106
FILE * tex_file
Definition: common.c:145
void wrap_up(void)
mod_pointer get_module_name(void)
Definition: common.c:637
struct mod_info * rlink
Definition: common.h:22
char buffer[]
Definition: common.c:88
struct id_info * hash_link
Definition: common.h:12
Definition: common.h:7
int program
Definition: common.c:86
struct variant * equiv_or_xref
Definition: common.h:20
id_pointer hash[]
Definition: common.c:125
struct mod_info * llink
Definition: common.h:22
#define variant
Definition: ctangle.c:8
void print(char *,...)
mod_pointer root
Definition: common.c:127
boolean push_input_file(boolean, boolean)
Definition: common.c:232
char C_file_name[]
Definition: common.c:137
char * byte_ptr
Definition: common.c:119
void check_complete(void)
Definition: common.c:473
struct id_info * id_pointer
id_info * id_ptr
Definition: common.c:121
int ilk
Definition: common.h:13
struct id_info id_info
boolean print_where
Definition: common.c:102
boolean changing
Definition: common.c:100
char * name
Definition: common.c:103
char * id_loc
Definition: common.c:132
sixteen_bits section_count
Definition: common.c:115
void fatal(char *,...)
Definition: common.c:755
boolean flags[]
Definition: common.c:136
void err_print(char *)
void print_progress(char *)
int include_depth
Definition: common.c:98
struct mod_info mod_info
char * id_first
Definition: common.c:131
struct mod_info * mod_pointer
Definition: common.h:36
char boolean
Definition: common.h:3
struct f change[]
void open_output_file(void)
Definition: common.c:852
boolean get_line(void)
Definition: common.c:410
char mod_text[]
Definition: common.c:130