Main Page | Data Structures | File List | Data Fields | Globals

stream.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include "emit.h"
#include "stream.h"
#include "errhandler.h"
#include "toke.h"

Include dependency graph for stream.c:

Go to the source code of this file.

Data Structures

struct  incl_list

Defines

#define DISPLAY_WIDTH   80

Typedefs

typedef incl_list incl_list_t

Functions

void init_emit (void)
void add_to_include_list (char *dir_compt)
void display_include_list (void)
static void init_incl_list_scan (char *base_name)
static bool scan_incl_list (char *base_name)
static void finish_incl_list_scan (bool op_succeeded)
static FILE * open_incl_list_file (char *base_name, char *mode)
static bool stat_incl_list_file (char *base_name, struct stat *file_info)
void init_inbuf (char *inbuf, unsigned int buflen)
static void could_not_open (int severity, char *fle_nam, char *for_what)
static void file_is_missing (char *fle_nam)
static void add_to_load_lists (const char *in_name)
static void expanded_name (void)
static void expansion_error (void)
static char * expand_pathname (const char *input_pathname)
FILE * open_expanded_file (const char *path_name, char *mode, char *for_what)
bool init_stream (const char *name)
static char * extend_filename (const char *base_name, const char *new_ext)
void init_output (const char *in_name, const char *out_name)
void increase_output_buffer (void)
void close_stream (_PTR dummy)
bool close_output (void)

Variables

u8 * start = NULL
u8 * pc
u8 * end
char * iname = NULL
unsigned int lineno = 0
unsigned int abs_token_no = 0
static unsigned int ilen
u8 * ostart
char * oname = NULL
unsigned int opc
unsigned int olen
static char * load_list_name
static FILE * load_list_file
static char * depncy_list_name
static FILE * depncy_file
static char * missing_list_name
static FILE * missing_list_file
static bool no_files_missing = TRUE
static incl_list_tinclude_list_start = NULL
static incl_list_tinclude_list_next = NULL
static unsigned int max_dir_path_len = 0
static char * include_list_full_path = NULL
static char expansion_buffer [2 *GET_BUF_MAX]
static bool was_expanded
static int expansion_msg_severity = INFO


Define Documentation

#define DISPLAY_WIDTH   80
 

Definition at line 205 of file stream.c.

Referenced by display_include_list().


Typedef Documentation

typedef struct incl_list incl_list_t
 


Function Documentation

void add_to_include_list char *  dir_compt  ) 
 

Definition at line 185 of file stream.c.

References incl_list::dir_path, max_dir_path_len, incl_list::next, and safe_malloc().

Referenced by get_args().

Here is the call graph for this function:

static void add_to_load_lists const char *  in_name  )  [static]
 

Definition at line 672 of file stream.c.

References depncy_file, include_list_full_path, and load_list_file.

Referenced by init_output(), and init_stream().

bool close_output void   ) 
 

Definition at line 1544 of file stream.c.

References depncy_file, depncy_list_name, error_summary(), FATAL, load_list_file, load_list_name, missing_list_file, missing_list_name, no_files_missing, olen, oname, opc, ostart, OUTPUT_SIZE, and tokenization_error().

Referenced by main().

Here is the call graph for this function:

void close_stream _PTR  dummy  ) 
 

Definition at line 1526 of file stream.c.

References iname, lineno, and start.

Referenced by handle_internal(), and main().

static void could_not_open int  severity,
char *  fle_nam,
char *  for_what
[static]
 

Definition at line 603 of file stream.c.

References tokenization_error().

Referenced by init_output(), and init_stream().

Here is the call graph for this function:

void display_include_list void   ) 
 

Definition at line 236 of file stream.c.

References incl_list::dir_path, DISPLAY_WIDTH, and incl_list::next.

Referenced by get_args().

static char* expand_pathname const char *  input_pathname  )  [static]
 

Definition at line 886 of file stream.c.

References expanded_name(), expansion_buffer, GET_BUF_MAX, TKERROR, tokenization_error(), and was_expanded.

Referenced by init_stream(), and open_expanded_file().

Here is the call graph for this function:

static void expanded_name void   )  [static]
 

Definition at line 723 of file stream.c.

References expansion_buffer, expansion_msg_severity, tokenization_error(), and was_expanded.

Referenced by expand_pathname(), and expansion_error().

Here is the call graph for this function:

static void expansion_error void   )  [static]
 

Definition at line 772 of file stream.c.

References expanded_name(), expansion_msg_severity, FORCE_MSG, and verbose.

Referenced by init_stream(), and open_expanded_file().

Here is the call graph for this function:

static char* extend_filename const char *  base_name,
const char *  new_ext
[static]
 

Definition at line 1242 of file stream.c.

References safe_malloc().

Referenced by init_output().

Here is the call graph for this function:

static void file_is_missing char *  fle_nam  )  [static]
 

Definition at line 634 of file stream.c.

References missing_list_file, and no_files_missing.

Referenced by init_stream().

static void finish_incl_list_scan bool  op_succeeded  )  [static]
 

Definition at line 446 of file stream.c.

References include_list_full_path, INFO, and tokenization_error().

Referenced by init_output(), init_stream(), and open_expanded_file().

Here is the call graph for this function:

void increase_output_buffer void   ) 
 

void init_emit void   ) 
 

void init_inbuf char *  inbuf,
unsigned int  buflen
 

Definition at line 575 of file stream.c.

References end, pc, and start.

Referenced by eval_mac_string(), eval_string(), and init_stream().

static void init_incl_list_scan char *  base_name  )  [static]
 

Definition at line 313 of file stream.c.

References include_list_full_path, max_dir_path_len, and safe_malloc().

Referenced by open_incl_list_file(), and stat_incl_list_file().

Here is the call graph for this function:

void init_output const char *  in_name,
const char *  out_name
 

Definition at line 1359 of file stream.c.

References abs_token_no, add_to_load_lists(), could_not_open(), dependency_list, depncy_file, depncy_list_name, extend_filename(), FFLUSH_STDOUT, finish_incl_list_scan(), fload_list, iname, init_emit(), load_list_file, load_list_name, missing_list_file, missing_list_name, no_files_missing, olen, oname, opc, ostart, OUTPUT_SIZE, safe_malloc(), TKERROR, and WARNING.

Referenced by main().

Here is the call graph for this function:

bool init_stream const char *  name  ) 
 

Definition at line 1064 of file stream.c.

References add_to_load_lists(), could_not_open(), expand_pathname(), expansion_error(), FFLUSH_STDOUT, file_is_missing(), finish_incl_list_scan(), ilen, iname, include_list_full_path, init_inbuf(), lineno, oname, safe_malloc(), stat_incl_list_file(), TKERROR, and tokenization_error().

Referenced by handle_internal(), and main().

Here is the call graph for this function:

FILE* open_expanded_file const char *  path_name,
char *  mode,
char *  for_what
 

Definition at line 964 of file stream.c.

References expand_pathname(), expansion_error(), finish_incl_list_scan(), open_incl_list_file(), TKERROR, and tokenization_error().

Referenced by encode_file().

Here is the call graph for this function:

static FILE* open_incl_list_file char *  base_name,
char *  mode
[static]
 

Definition at line 489 of file stream.c.

References include_list_full_path, init_incl_list_scan(), and scan_incl_list().

Referenced by open_expanded_file().

Here is the call graph for this function:

static bool scan_incl_list char *  base_name  )  [static]
 

Definition at line 386 of file stream.c.

References incl_list::dir_path, include_list_full_path, and incl_list::next.

Referenced by open_incl_list_file(), and stat_incl_list_file().

static bool stat_incl_list_file char *  base_name,
struct stat *  file_info
[static]
 

Definition at line 537 of file stream.c.

References include_list_full_path, init_incl_list_scan(), and scan_incl_list().

Referenced by init_stream().

Here is the call graph for this function:


Variable Documentation

unsigned int abs_token_no = 0
 

Definition at line 79 of file stream.c.

Referenced by get_rest_of_line(), get_word(), get_word_in_line(), handle_internal(), init_output(), push_cstag(), and validate_to_target().

FILE* depncy_file [static]
 

Definition at line 112 of file stream.c.

Referenced by add_to_load_lists(), close_output(), and init_output().

char* depncy_list_name [static]
 

Definition at line 111 of file stream.c.

Referenced by close_output(), and init_output().

u8* end
 

Definition at line 76 of file stream.c.

Referenced by c_string_escape(), declare_locals(), get_sequence(), get_string(), get_word(), init_inbuf(), pop_source(), push_source(), skip_until(), and skip_ws().

char expansion_buffer[2 *GET_BUF_MAX] [static]
 

Definition at line 697 of file stream.c.

Referenced by expand_pathname(), and expanded_name().

int expansion_msg_severity = INFO [static]
 

Definition at line 699 of file stream.c.

Referenced by expanded_name(), and expansion_error().

unsigned int ilen [static]
 

Definition at line 84 of file stream.c.

Referenced by init_stream().

char* iname = NULL
 

Definition at line 77 of file stream.c.

Referenced by c_string_escape(), close_stream(), collect_input_filename(), conditionally_tokenize(), create_word(), fcode_ender(), fcode_starter(), get_number(), get_sequence(), get_string(), get_word(), handle_internal(), init_output(), init_stream(), new_device_vocab(), parse_number(), pop_source(), print_where_started(), process_remark(), push_cstag(), push_source(), reset_fcode_ranges(), set_next_fcode(), tokenization_error(), and warn_if_multiline().

char* include_list_full_path = NULL [static]
 

Definition at line 144 of file stream.c.

Referenced by add_to_load_lists(), finish_incl_list_scan(), init_incl_list_scan(), init_stream(), open_incl_list_file(), scan_incl_list(), and stat_incl_list_file().

incl_list_t* include_list_next = NULL [static]
 

Definition at line 142 of file stream.c.

incl_list_t* include_list_start = NULL [static]
 

Definition at line 141 of file stream.c.

unsigned int lineno = 0
 

Definition at line 78 of file stream.c.

Referenced by assign_local(), c_string_escape(), close_stream(), conditionally_tokenize(), create_constant(), create_word(), declare_locals(), fcode_starter(), get_number(), get_rest_of_line(), get_sequence(), get_string(), get_word(), get_word_in_line(), handle_internal(), handle_user_message(), init_stream(), new_device_vocab(), parse_number(), pop_source(), print_where_started(), process_remark(), push_cstag(), push_source(), reset_fcode_ranges(), set_next_fcode(), skip_string(), skip_until(), skip_ws(), string_remark(), tokenization_error(), validate_to_target(), warn_if_multiline(), and warn_unterm().

FILE* load_list_file [static]
 

Definition at line 110 of file stream.c.

Referenced by add_to_load_lists(), close_output(), and init_output().

char* load_list_name [static]
 

Definition at line 109 of file stream.c.

Referenced by close_output(), and init_output().

unsigned int max_dir_path_len = 0 [static]
 

Definition at line 143 of file stream.c.

Referenced by add_to_include_list(), and init_incl_list_scan().

FILE* missing_list_file [static]
 

Definition at line 114 of file stream.c.

Referenced by close_output(), file_is_missing(), and init_output().

char* missing_list_name [static]
 

Definition at line 113 of file stream.c.

Referenced by close_output(), and init_output().

bool no_files_missing = TRUE [static]
 

Definition at line 115 of file stream.c.

Referenced by close_output(), file_is_missing(), and init_output().

unsigned int olen
 

Definition at line 92 of file stream.c.

Referenced by close_output(), emit_byte(), increase_output_buffer(), and init_output().

char* oname = NULL
 

Definition at line 88 of file stream.c.

Referenced by close_output(), handle_internal(), init_output(), and init_stream().

unsigned int opc
 

Definition at line 89 of file stream.c.

Referenced by close_output(), emit_byte(), emit_fcodehdr(), emit_pci_data_block(), emit_pci_rom_hdr(), error_check_locals(), error_summary(), finish_fcodehdr(), finish_pcihdr(), handle_internal(), init_output(), mark_backward_target(), resolve_backward(), and resolve_forward().

u8* ostart
 

Definition at line 87 of file stream.c.

Referenced by close_output(), emit_byte(), emit_fcodehdr(), emit_pci_data_block(), emit_pci_rom_hdr(), finish_fcodehdr(), finish_pcihdr(), increase_output_buffer(), and init_output().

u8* pc
 

Definition at line 75 of file stream.c.

Referenced by assign_local(), base_val(), c_string_escape(), declare_locals(), get_rest_of_line(), get_sequence(), get_string(), get_token(), get_until(), get_word(), get_word_in_line(), handle_internal(), handle_user_message(), init_inbuf(), pop_source(), process_remark(), push_source(), skip_string(), skip_until(), skip_ws(), and validate_to_target().

u8* start = NULL
 

Definition at line 74 of file stream.c.

Referenced by close_stream(), init_inbuf(), pop_source(), and push_source().

bool was_expanded [static]
 

Definition at line 698 of file stream.c.

Referenced by expand_pathname(), and expanded_name().


Generated on Fri Aug 18 14:05:08 2006 for Toke1.0 by  doxygen 1.4.4