atlas
0.6
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include "common.h"
#include <stdarg.h>
Macros | |
#define | max_bytes 50000L \ |
#define | max_modules 1000 |
#define | max_idents 5000 |
#define | max_sections 4000 \ |
#define | hash_size 353 |
#define | buf_size 200 |
#define | longest_name 1000 \ |
#define | long_buf_size (buf_size+longest_name) |
#define | local static |
#define | array_size(a) ((int)(sizeof(a)/sizeof(a[0]))) |
#define | false (boolean) 0 |
#define | true (boolean) 1 |
#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 | find_char() (loc<=limit || get_line()) |
#define | id_index(p) ((sixteen_bits)((p)-id_table)) |
#define | id_at(i) (&id_table[i]) |
#define | mod_index(p) ((sixteen_bits)((p)-mod_table)) |
#define | mod_at(i) (&mod_table[i]) |
#define | name_begin(p) ((p)->byte_start) |
#define | length(p) ((int)(strlen(name_begin(p)))) |
#define | name_end(p) (name_begin(p)+length(p)) |
#define | complete_name(p) ((p)->byte_start[-1]=='\0') |
#define | print_mod(p) printf(": <%s%s>",name_begin(p), complete_name(p) ? "" : "..." ) |
#define | spotless 0 |
#define | harmless_message 1 |
#define | error_message 2 |
#define | fatal_message 3 |
#define | mark_harmless() if (history==spotless) history=harmless_message; else |
#define | mark_error() (history=error_message) |
#define | overflow(t) fatal("\n! Sorry, %s capacity exceeded",t) \ |
#define | confusion(s) fatal("\n! This can't happen: %s",s) |
#define | show_banner flags['b'] |
#define | show_happiness flags['h'] |
#define | show_progress flags['p'] |
#define | show_stats flags['s'] |
#define | C_plus_plus flags['+'] |
#define | compatibility_mode flags['c'] |
#define | update_terminal() fflush(stdout) |
#define | new_line() putchar('\n') |
#define | term_write(string, leng) printf("%.*s",(int)(leng),string) |
#define | buffer_end (&buffer[buf_size-2]) |
#define | max_include_depth 32 \ |
#define | max_include_paths 16 \ |
#define | max_path_length 200 |
#define | lines_match() |
#define | byte_mem_end (&byte_mem[max_bytes]) |
#define | id_table_end (&id_table[max_idents]) |
#define | mod_table_end (&mod_table[max_modules]) |
#define | copy_char(c) if (id_loc<mod_text_end) *id_loc++=c; else (void)(c) |
#define | CPPEXT "cpp" |
Enumerations | |
enum | mod_comparison { less, equal, greater, prefix, extension } |
#define and_and 04 |
#define array_size | ( | a | ) | ((int)(sizeof(a)/sizeof(a[0]))) |
#define buf_size 200 |
#define C_plus_plus flags['+'] |
#define compatibility_mode flags['c'] |
#define confusion | ( | s | ) | fatal("\n! This can't happen: %s",s) |
#define copy_char | ( | c | ) | if (id_loc<mod_text_end) *id_loc++=c; else (void)(c) |
#define CPPEXT "cpp" |
#define ctangle 0 |
#define cweave 1 |
#define eq_eq 036 |
#define error_message 2 |
#define false (boolean) 0 |
#define fatal_message 3 |
#define gt_eq 035 |
#define gt_gt 021 |
#define harmless_message 1 |
#define hash_size 353 |
#define id_at | ( | i | ) | (&id_table[i]) |
#define id_index | ( | p | ) | ((sixteen_bits)((p)-id_table)) |
#define id_table_end (&id_table[max_idents]) |
#define length | ( | p | ) | ((int)(strlen(name_begin(p)))) |
#define lines_match | ( | ) |
#define local static |
#define long_buf_size (buf_size+longest_name) |
#define longest_name 1000 \ |
#define lt_eq 034 |
#define lt_lt 020 |
#define mark_error | ( | ) | (history=error_message) |
#define mark_harmless | ( | ) | if (history==spotless) history=harmless_message; else |
#define max_bytes 50000L \ |
#define max_idents 5000 |
#define max_include_depth 32 \ |
#define max_include_paths 16 \ |
#define max_modules 1000 |
#define max_path_length 200 |
#define max_sections 4000 \ |
#define minus_gt 031 |
#define minus_minus 01 |
#define mod_at | ( | i | ) | (&mod_table[i]) |
#define mod_index | ( | p | ) | ((sixteen_bits)((p)-mod_table)) |
#define mod_table_end (&mod_table[max_modules]) |
#define name_end | ( | p | ) | (name_begin(p)+length(p)) |
#define new_line | ( | ) | putchar('\n') |
#define not_eq 032 |
#define or_or 037 |
#define overflow | ( | t | ) | fatal("\n! Sorry, %s capacity exceeded",t) \ |
#define plus_plus 013 |
#define print_mod | ( | p | ) | printf(": <%s%s>",name_begin(p), complete_name(p) ? "" : "..." ) |
#define show_banner flags['b'] |
#define show_happiness flags['h'] |
#define show_stats flags['s'] |
#define spotless 0 |
#define true (boolean) 1 |
#define update_terminal | ( | ) | fflush(stdout) |
enum mod_comparison |
local void check_change | ( | void | ) |
void check_complete | ( | void | ) |
void common_init | ( | int | argc, |
char ** | argv, | ||
char * | version | ||
) |
void err_print | ( | char * | s | ) |
void fatal | ( | char * | s, |
... | |||
) |
boolean get_control_text | ( | void | ) |
boolean get_line | ( | void | ) |
mod_pointer get_module_name | ( | void | ) |
void get_string | ( | void | ) |
id_pointer id_lookup | ( | char * | first, |
char * | last, | ||
int | ilk | ||
) |
void init_id_name | ( | id_pointer | dummy, |
int | ilk | ||
) |
void init_module_name | ( | mod_pointer | node | ) |
boolean locate_file_name | ( | ) |
local mod_pointer make_mod_node | ( | char * | name | ) |
local enum mod_comparison mod_name_cmp | ( | char * | p, |
int | l1, | ||
char * | q, | ||
int | l2 | ||
) |
local mod_pointer mod_name_lookup | ( | char * | name, |
int | l | ||
) |
boolean names_match | ( | id_pointer | x, |
char * | q, | ||
int | l, | ||
int | dummy | ||
) |
void open_output_file | ( | void | ) |
local mod_pointer prefix_lookup | ( | char * | name, |
int | l | ||
) |
local void prime_the_change_buffer | ( | void | ) |
void print | ( | char * | s, |
... | |||
) |
void print_progress | ( | char * | s | ) |
void print_section_progress | ( | void | ) |
void reset_input | ( | void | ) |
local void scan_args | ( | int | argc, |
char ** | argv | ||
) |
char* store_string | ( | char * | s, |
int | l | ||
) |
void wrap_up | ( | void | ) |
local char alt_web_file_name[max_file_name_length] |
local { ... } at_h_path[max_include_paths] |
local { ... } at_i_path[max_include_paths] |
char buffer[long_buf_size] |
char byte_mem[max_bytes] |
char* byte_ptr =&byte_mem[0] |
FILE* C_file |
char C_file_name[max_file_name_length] |
struct f change |
local char change_file_name[max_file_name_length] |
local char* change_limit |
eight_bits changed_section[(max_sections+7)/8] |
boolean changing |
struct f file[max_include_depth] |
boolean flags[UCHAR_MAX+1] |
id_pointer hash[hash_size] |
int history =spotless |
char* id_first |
char* id_loc |
id_pointer id_ptr =&id_table[0] |
id_info id_table[max_idents] |
char idx_file_name[max_file_name_length] |
int include_depth |
boolean input_has_ended |
int length |
char* limit =buffer |
char* loc =buffer |
mod_pointer mod_ptr =&mod_table[0] |
mod_info mod_table[max_modules] |
char mod_text[longest_name+1] |
char* name |
int phase |
int program |
mod_pointer root =NULL |
local char* saved_change_limit |
local int saved_include_depth =0 |
char scn_file_name[max_file_name_length] |
sixteen_bits section_count |
FILE* tex_file |
local char tex_file_name[max_file_name_length] |
local char web_file_name[max_file_name_length] |