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

emit.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "pcihdr.h"
#include "toke.h"
#include "vocabfuncts.h"
#include "stack.h"
#include "scanner.h"
#include "emit.h"
#include "clflags.h"
#include "errhandler.h"
#include "stream.h"
#include "nextfcode.h"

Include dependency graph for emit.c:

Go to the source code of this file.

Defines

#define EMIT_STRUCT(x)   {int j; for (j=0; j < sizeof(x) ; j++ ) emit_byte(0); }

Functions

void increase_output_buffer (void)
void init_emit (void)
static void emit_byte (u8 data)
void emit_fcode (u16 tok)
static void emit_num32 (u32 num)
void user_emit_byte (u8 data)
void emit_offset (s16 offs)
void emit_literal (u32 num)
void emit_string (u8 *string, signed int cnt)
void emit_fcodehdr (const char *starter_name)
void finish_fcodehdr (void)
static void emit_pci_rom_hdr (void)
static void emit_pci_data_block (void)
void emit_pcihdr (void)
void finish_pcihdr (void)
void finish_headers (void)

Variables

static int fcode_start_ob_off = -1
static int fcode_hdr_ob_off = -1
static int fcode_body_ob_off = -1
static int pci_hdr_ob_off = -1
static int pci_data_blk_ob_off = -1
static bool fcode_written = FALSE
u8 * ostart
int olen


Define Documentation

#define EMIT_STRUCT  )     {int j; for (j=0; j < sizeof(x) ; j++ ) emit_byte(0); }
 

Definition at line 66 of file emit.c.

Referenced by emit_fcodehdr(), emit_pci_data_block(), and emit_pci_rom_hdr().


Function Documentation

static void emit_byte u8  data  )  [static]
 

Definition at line 144 of file emit.c.

References increase_output_buffer(), olen, opc, and ostart.

Referenced by emit_fcode(), emit_num32(), emit_offset(), emit_string(), finish_pcihdr(), and user_emit_byte().

Here is the call graph for this function:

void emit_fcode u16  tok  ) 
 

Definition at line 156 of file emit.c.

References emit_byte(), and fcode_written.

Referenced by create_word(), emit_fc_token(), handle_internal(), and tokz_emit_fcode().

Here is the call graph for this function:

void emit_fcodehdr const char *  starter_name  ) 
 

Definition at line 219 of file emit.c.

References EMIT_STRUCT, emit_token(), fcode_body_ob_off, fcode_hdr_ob_off, fcode_start_ob_off, fcode_written, fcode_header_t::format, noerrors, opc, ostart, TKERROR, and tokenization_error().

Referenced by fcode_starter().

Here is the call graph for this function:

void emit_literal u32  num  ) 
 

Definition at line 197 of file emit.c.

References emit_num32(), and emit_token().

Referenced by abort_quote(), base_change(), deliver_number(), and handle_internal().

Here is the call graph for this function:

static void emit_num32 u32  num  )  [static]
 

Definition at line 165 of file emit.c.

References emit_byte().

Referenced by emit_literal().

Here is the call graph for this function:

void emit_offset s16  offs  ) 
 

Definition at line 189 of file emit.c.

References emit_byte(), and offs16.

Referenced by emit_fc_offset(), mark_forward_branch(), and resolve_loop().

Here is the call graph for this function:

static void emit_pci_data_block void   )  [static]
 

Definition at line 420 of file emit.c.

References dpop(), EMIT_STRUCT, INFO, opc, ostart, pci_data_blk_ob_off, pci_is_last_image, and tokenization_error().

Referenced by emit_pcihdr().

Here is the call graph for this function:

static void emit_pci_rom_hdr void   )  [static]
 

Definition at line 352 of file emit.c.

References EMIT_STRUCT, opc, ostart, and pci_hdr_ob_off.

Referenced by emit_pcihdr().

void emit_pcihdr void   ) 
 

Definition at line 480 of file emit.c.

References emit_pci_data_block(), emit_pci_rom_hdr(), fcode_start_ob_off, fcode_written, noerrors, TKERROR, and tokenization_error().

Referenced by handle_internal().

Here is the call graph for this function:

void emit_string u8 *  string,
signed int  cnt
 

Definition at line 203 of file emit.c.

References emit_byte(), STRING_LEN_MAX, TKERROR, and tokenization_error().

Referenced by abort_quote(), create_word(), encode_file(), and handle_internal().

Here is the call graph for this function:

void finish_fcodehdr void   ) 
 

Definition at line 268 of file emit.c.

References fcode_header_t::checksum, emit_token(), fcode_body_ob_off, fcode_ender(), fcode_hdr_ob_off, fcode_start_ob_off, fcode_written, haveend, fcode_header_t::length, list_fcode_ranges(), opc, ostart, TKERROR, tokenization_error(), verbose, and WARNING.

Referenced by fcode_ender(), and finish_headers().

Here is the call graph for this function:

void finish_headers void   ) 
 

Definition at line 566 of file emit.c.

References fcode_hdr_ob_off, finish_fcodehdr(), finish_pcihdr(), and pci_hdr_ob_off.

Referenced by main().

Here is the call graph for this function:

void finish_pcihdr void   ) 
 

Definition at line 509 of file emit.c.

References big_end_pci_image_rev, emit_byte(), opc, ostart, pci_data_blk_ob_off, pci_hdr_ob_off, pci_image_rev, pci_is_last_image, pci_vpd, statbuf, TKERROR, and tokenization_error().

Referenced by finish_headers(), and handle_internal().

Here is the call graph for this function:

void increase_output_buffer void   ) 
 

Definition at line 1485 of file stream.c.

References FATAL, INFO, olen, ostart, and tokenization_error().

Referenced by emit_byte().

Here is the call graph for this function:

void init_emit void   ) 
 

Definition at line 122 of file emit.c.

References fcode_body_ob_off, fcode_hdr_ob_off, fcode_start_ob_off, fcode_written, haveend, pci_data_blk_ob_off, and pci_hdr_ob_off.

Referenced by init_output().

void user_emit_byte u8  data  ) 
 

Definition at line 183 of file emit.c.

References emit_byte(), and fcode_written.

Referenced by tokz_esc_emit_byte().

Here is the call graph for this function:


Variable Documentation

int fcode_body_ob_off = -1 [static]
 

Definition at line 84 of file emit.c.

Referenced by emit_fcodehdr(), finish_fcodehdr(), and init_emit().

int fcode_hdr_ob_off = -1 [static]
 

Definition at line 83 of file emit.c.

Referenced by emit_fcodehdr(), finish_fcodehdr(), finish_headers(), and init_emit().

int fcode_start_ob_off = -1 [static]
 

Definition at line 82 of file emit.c.

Referenced by emit_fcodehdr(), emit_pcihdr(), finish_fcodehdr(), and init_emit().

bool fcode_written = FALSE [static]
 

Definition at line 96 of file emit.c.

Referenced by emit_fcode(), emit_fcodehdr(), emit_pcihdr(), finish_fcodehdr(), init_emit(), and user_emit_byte().

int olen
 

Definition at line 92 of file stream.c.

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

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().

int pci_data_blk_ob_off = -1 [static]
 

Definition at line 86 of file emit.c.

Referenced by emit_pci_data_block(), finish_pcihdr(), and init_emit().

int pci_hdr_ob_off = -1 [static]
 

Definition at line 85 of file emit.c.

Referenced by emit_pci_rom_hdr(), finish_headers(), finish_pcihdr(), and init_emit().


Generated on Fri Aug 18 14:04:09 2006 for Toke1.0 by  doxygen 1.4.4