osprey/kg++fe/gnu/tradcpp.c File Reference

#include "config.h"
#include "system.h"
#include "version.h"
#include "cppdefault.h"
#include "tradcpp.h"
#include "mkdeps.h"
#include "intl.h"

Include dependency graph for tradcpp.c:

Go to the source code of this file.

Data Types

type  file_buf
type  file_name_list
type  definition
type  definition::reflist
type  answer
union  hashval
type  hashnode
type  directive
type  argdata
type  arglist
type  if_stack
type  pending_dir

Defines

#define INPUT_STACK_MAX   200
#define CHECK_DEPTH(code)
#define OUTBUF_SIZE   10
#define check_expand(OBUF, NEEDED)
#define HASHSIZE   1403
#define HASHSTEP(old, c)   ((old << 2) + c)
#define MAKE_POS(v)   (v & 0x7fffffff)
#define abort()   fancy_abort(__LINE__, 0);
#define U   (const unsigned char *)
#define SKIP_WHITE_SPACE(p)   do { while (is_nvspace(*p)) p++; } while (0)
#define SKIP_ALL_WHITE_SPACE(p)   do { while (is_space(*p)) p++; } while (0)
#define POPMACRO
#define RECACHE
#define FNAME_HASHSIZE   37
#define DSC(x)   U x, sizeof x - 1
#define install_spec(name, type)   install(DSC(name), type, -1);
#define install_value(name, val)   hp = install(DSC(name), T_CONST, -1); hp->value.cpval = val;

Typedefs

typedef unsigned char U_CHAR
typedef struct file_buf FILE_BUF
typedef struct definition DEFINITION
typedef struct hashnode HASHNODE
typedef struct if_stack IF_STACK_FRAME
typedef struct pending_dir pending_dir

Enumerations

enum  node_type {
  NT_VOID = 0, NT_MACRO, NT_ASSERTION, INITIAL = 0,
  FREE, PRECOLORED, SIMPLIFY, SIMPLIFY_SPILL,
  SIMPLIFY_FAT, FREEZE, SPILL, SELECT,
  SPILLED, COALESCED, COLORED, LAST_NODE_TYPE,
  T_DEFINE = 1, T_INCLUDE, T_INCLUDE_NEXT, T_IFDEF,
  T_IFNDEF, T_IF, T_ELSE, T_ELIF,
  T_UNDEF, T_LINE, T_ENDIF, T_ERROR,
  T_WARNING, T_ASSERT, T_UNASSERT, T_SPECLINE,
  T_DATE, T_FILE, T_BASE_FILE, T_INCLUDE_LEVEL,
  T_VERSION, T_TIME, T_CONST, T_MACRO,
  T_SPEC_DEFINED, T_UNUSED, NT_VOID = 0, NT_MACRO,
  NT_ASSERTION, INITIAL = 0, FREE, PRECOLORED,
  SIMPLIFY, SIMPLIFY_SPILL, SIMPLIFY_FAT, FREEZE,
  SPILL, SELECT, SPILLED, COALESCED,
  COLORED, LAST_NODE_TYPE, T_DEFINE = 1, T_INCLUDE,
  T_INCLUDE_NEXT, T_IFDEF, T_IFNDEF, T_IF,
  T_ELSE, T_ELIF, T_UNDEF, T_LINE,
  T_ENDIF, T_ERROR, T_WARNING, T_ASSERT,
  T_UNASSERT, T_SPECLINE, T_DATE, T_FILE,
  T_BASE_FILE, T_INCLUDE_LEVEL, T_VERSION, T_TIME,
  T_CONST, T_MACRO, T_SPEC_DEFINED, T_UNUSED,
  NT_VOID = 0, NT_MACRO, NT_ASSERTION, NT_VOID = 0,
  NT_MACRO, NT_ASSERTION
}
enum  file_change_code {
  same_file, enter_file, leave_file, same_file,
  enter_file, leave_file
}
enum  msgtype {
  MT_WARNING = 0, MT_ERROR, MT_FATAL, MT_WARNING = 0,
  MT_ERROR, MT_FATAL
}
enum  pending_dir_t {
  PD_NONE = 0, PD_DEFINE, PD_UNDEF, PD_ASSERTION,
  PD_FILE, PD_NONE = 0, PD_DEFINE, PD_UNDEF,
  PD_ASSERTION, PD_FILE
}

Functions/Subroutines

static HASHNODE *parse_assertion PARAMS ((const unsigned char *, const unsigned char *, struct answer **, int))
static struct answer **find_answer PARAMS ((HASHNODE *, const struct answer *))
static unsigned char
*canonicalize_text 
PARAMS ((const unsigned char *, const unsigned char *, const unsigned char **))
static void do_define PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *))
static void do_xifdef PARAMS ((U_CHAR *, U_CHAR *, enum node_type))
static struct hashnode *install PARAMS ((const U_CHAR *, int, enum node_type, int))
static int hashf PARAMS ((const U_CHAR *, int, int))
static int compare_defs PARAMS ((DEFINITION *, DEFINITION *))
static int comp_def_part PARAMS ((int, const U_CHAR *, int, const U_CHAR *, int, int))
static void delete_macro PARAMS ((HASHNODE *))
static void v_message PARAMS ((enum msgtype mtype, int line, const char *msgid, va_list ap))
static FILE_BUF
expand_to_temp_buffer 
PARAMS ((const U_CHAR *, const U_CHAR *, int))
static DEFINITION
*collect_expansion 
PARAMS ((U_CHAR *, U_CHAR *, int, struct arglist *))
int main (int argc, char **argv)
static void init_dependency_output ()
static void output_deps ()
static void newline_fix (U_CHAR *bp)
static void name_newline_fix (U_CHAR *bp)
static void rescan (FILE_BUF *op, int output_marks)
static FILE_BUF expand_to_temp_buffer (U_CHAR *buf, U_CHAR *limit, int output_marks) const
static int handle_directive (FILE_BUF *ip, FILE_BUF *op)
static void special_symbol (HASHNODE *hp, FILE_BUF *op)
static void do_include (U_CHAR *buf, U_CHAR *limit, FILE_BUF *op)
static void do_include_next (U_CHAR *buf, U_CHAR *limit, FILE_BUF *op)
static void process_include (struct file_name_list *stackp, const U_CHAR *fbeg, int flen, int system_header_p, FILE_BUF *op)
static void fixup_newlines (FILE_BUF *fp)
static void finclude (int f, const char *fname, struct file_name_list *nhd, FILE_BUF *op)
static void do_define (U_CHAR *buf, U_CHAR *limit, op)
static int compare_defs (DEFINITION *d1, DEFINITION *d2)
static int comp_def_part (int first, const U_CHAR *beg1, int len1, const U_CHAR *beg2, int len2, int last)
static DEFINITIONcollect_expansion (U_CHAR *buf, U_CHAR *end, int nargs, struct arglist *arglist)
static void do_line (U_CHAR *buf, U_CHAR *limit, FILE_BUF *op)
static void do_undef (U_CHAR *buf, limit, op)
static int parse_answer (unsigned char *buf, unsigned char *limit, struct answer **answerp, int type) const
static HASHNODEparse_assertion (unsigned char *buf, unsigned char *limit, struct answer **answerp, int type) const
int test_assertion (unsigned char **pbuf)
static void do_error (U_CHAR *buf, U_CHAR *limit, op)
static void do_warning (U_CHAR *buf, U_CHAR *limit, op)
static void do_assert (U_CHAR *buf, U_CHAR *limit, op)
static void do_unassert (U_CHAR *buf, U_CHAR *limit, op)
static struct answer ** find_answer (HASHNODE *node, const struct answer *candidate)
static unsigned char * canonicalize_text (unsigned char *buf, unsigned char *limit, unsigned char **climit) const
static void do_if (U_CHAR *buf, U_CHAR *limit, op)
static void do_elif (U_CHAR *buf, U_CHAR *limit, FILE_BUF *op)
static int eval_if_expression (U_CHAR *buf, int length) const
static void do_xifdef (U_CHAR *buf, U_CHAR *limit, enum node_type type)
static void do_ifdef (U_CHAR *buf, U_CHAR *limit, op)
static void do_ifndef (U_CHAR *buf, U_CHAR *limit, op)
static void conditional_skip (FILE_BUF *ip, int skip, enum node_type type)
static void skip_if_group (FILE_BUF *ip, int any)
static void do_else (buf, limit, FILE_BUF *op)
static void do_endif (buf, limit, FILE_BUF *op)
static U_CHARskip_to_end_of_comment (FILE_BUF *ip, int *line_counter)
static U_CHARskip_quoted_string (U_CHAR *bp, const U_CHAR *limit, int start_line, int *count_newlines, int *backslash_newlines_p, int *eofp) const
static void output_line_command (FILE_BUF *ip, FILE_BUF *op, int conditional, enum file_change_code file_change)
static void macroexpand (HASHNODE *hp, FILE_BUF *op)
static const char * macarg (struct argdata *argptr)
static U_CHARmacarg1 (U_CHAR *start, const U_CHAR *limit, int *depthptr, int *newlines, int *comments)
static int discard_comments (U_CHAR *start, int length, int newlines)
static void v_message (enum msgtype mtype, int line, const char *msgid, va_list ap)
void error VPARAMS ((const char *msgid,...))
void error_with_line VPARAMS ((int line, const char *msgid,...))
void error_from_errno (char *name) const
void fancy_abort (int line, const char *func)
void perror_with_name (char *name) const
void pfatal_with_name (char *name) const
static int line_for_error (int line)
static void grow_outbuf (FILE_BUF *obuf, int needed)
static HASHNODEinstall (U_CHAR *name, int len, enum node_type type, int hash) const
HASHNODElookup (U_CHAR *name, int len, int hash) const
static void delete_macro (HASHNODE *hp)
static int hashf (U_CHAR *name, int len, int hashsize) const
static void dump_all_macros ()
static void dump_defn_1 (U_CHAR *base, int start, int length) const
static void dump_arg_n (DEFINITION *defn, int argnum)
static void initialize_builtins ()
static void run_directive (char *str, size_t len, enum node_type type) const
static void make_definition (char *str) const
static void make_undef (char *str) const
static void make_assertion (char *str) const
static int file_size_and_mode (int fd, int *mode_pointer, long *size_pointer)

Variables

static const char * progname
size_t max_include_len
int put_out_comments = 0
struct depsdeps
int print_deps = 0
int print_deps_phony_targets = 0
int deps_append = 0
const char * deps_file = 0
int deps_missing_files = 0
int no_line_commands
int dump_macros
int inhibit_warnings = 0
int inhibit_output = 0
int flag_signed_char = 0
int warn_comments
int no_output
static const char * user_label_prefix
struct file_buf instack [INPUT_STACK_MAX]
int indepth = -1
int system_include_depth = 0
FILE_BUF outbuf
struct file_name_listinclude = 0
struct file_name_listfirst_bracket_include = 0
struct file_name_listlast_include = 0
struct file_name_listdont_repeat_files = 0
struct file_name_listall_include_files = 0
HASHNODEhashtab [HASHSIZE]
int errors = 0
IF_STACK_FRAMEif_stack = NULL
int ignore_srcdir
static const char *const monthnames []


Define Documentation

#define abort ( void   )     fancy_abort(__LINE__, 0);

#define CHECK_DEPTH ( code   ) 

Value:

if (indepth >= (INPUT_STACK_MAX - 1))         \
    {                 \
      error_with_line (line_for_error (instack[indepth].lineno),  \
           "macro or #include recursion too deep");   \
      code;               \
    }

Definition at line 141 of file tradcpp.c.

Referenced by expand_to_temp_buffer(), finclude(), and macroexpand().

#define check_expand ( OBUF,
NEEDED   ) 

Value:

do { \
  if ((OBUF)->length - ((OBUF)->bufp - (OBUF)->buf) <= (NEEDED)) \
    grow_outbuf ((OBUF), (NEEDED)); \
 } while (0)

Definition at line 162 of file tradcpp.c.

Referenced by do_line(), handle_directive(), output_line_command(), rescan(), and special_symbol().

#define DSC (  )     U x, sizeof x - 1

Definition at line 5125 of file tradcpp.c.

#define FNAME_HASHSIZE   37

Definition at line 3149 of file tradcpp.c.

Referenced by do_line().

#define HASHSIZE   1403

Definition at line 312 of file tradcpp.c.

Referenced by do_define(), dump_all_macros(), install(), lookup(), parse_assertion(), and rescan().

#define HASHSTEP ( old,
c   )     ((old << 2) + c)

Definition at line 314 of file tradcpp.c.

#define INPUT_STACK_MAX   200

Definition at line 115 of file tradcpp.c.

Referenced by ffecom_open_include_().

#define install_spec ( name,
type   )     install(DSC(name), type, -1);

Definition at line 5126 of file tradcpp.c.

Referenced by initialize_builtins().

#define install_value ( name,
val   )     hp = install(DSC(name), T_CONST, -1); hp->value.cpval = val;

Definition at line 5128 of file tradcpp.c.

Referenced by initialize_builtins().

#define MAKE_POS (  )     (v & 0x7fffffff)

Definition at line 315 of file tradcpp.c.

Referenced by hashf(), and rescan().

#define OUTBUF_SIZE   10

Definition at line 156 of file tradcpp.c.

Referenced by main().

#define POPMACRO

Value:

do { ip->macro->type = T_MACRO;   \
     if (ip->free_ptr) free (ip->free_ptr); \
     --indepth; } while (0)

Referenced by rescan().

#define RECACHE

Value:

do { ip = &instack[indepth];    \
     ibp = ip->bufp;      \
     limit = ip->buf + ip->length;  \
     op->bufp = obp;      \
     check_expand (op, limit - ibp);  \
     beg_of_line = 0;     \
     obufp_before_macroname += op->bufp - obp;  \
     obp = op->bufp; } while (0)

Referenced by rescan().

#define SKIP_ALL_WHITE_SPACE ( p   )     do { while (is_space(*p)) p++; } while (0)

Definition at line 477 of file tradcpp.c.

#define SKIP_WHITE_SPACE ( p   )     do { while (is_nvspace(*p)) p++; } while (0)

#define U   (const unsigned char *)


Typedef Documentation

Definition at line 205 of file tradcpp.c.

Definition at line 136 of file tradcpp.c.

Definition at line 292 of file tradcpp.c.

Definition at line 496 of file tradcpp.c.

Definition at line 506 of file tradcpp.c.

typedef unsigned char U_CHAR

Definition at line 30 of file tradcpp.c.


Enumeration Type Documentation

Enumerator:
same_file 
enter_file 
leave_file 
same_file 
enter_file 
leave_file 

Definition at line 328 of file tradcpp.c.

enum msgtype

Enumerator:
MT_WARNING 
MT_ERROR 
MT_FATAL 
MT_WARNING 
MT_ERROR 
MT_FATAL 

Definition at line 393 of file tradcpp.c.

enum node_type

Enumerator:
NT_VOID 
NT_MACRO 
NT_ASSERTION 
INITIAL 
FREE 
PRECOLORED 
SIMPLIFY 
SIMPLIFY_SPILL 
SIMPLIFY_FAT 
FREEZE 
SPILL 
SELECT 
SPILLED 
COALESCED 
COLORED 
LAST_NODE_TYPE 
T_DEFINE 
T_INCLUDE 
T_INCLUDE_NEXT 
T_IFDEF 
T_IFNDEF 
T_IF 
T_ELSE 
T_ELIF 
T_UNDEF 
T_LINE 
T_ENDIF 
T_ERROR 
T_WARNING 
T_ASSERT 
T_UNASSERT 
T_SPECLINE 
T_DATE 
T_FILE 
T_BASE_FILE 
T_INCLUDE_LEVEL 
T_VERSION 
T_TIME 
T_CONST 
T_MACRO 
T_SPEC_DEFINED 
T_UNUSED 
NT_VOID 
NT_MACRO 
NT_ASSERTION 
INITIAL 
FREE 
PRECOLORED 
SIMPLIFY 
SIMPLIFY_SPILL 
SIMPLIFY_FAT 
FREEZE 
SPILL 
SELECT 
SPILLED 
COALESCED 
COLORED 
LAST_NODE_TYPE 
T_DEFINE 
T_INCLUDE 
T_INCLUDE_NEXT 
T_IFDEF 
T_IFNDEF 
T_IF 
T_ELSE 
T_ELIF 
T_UNDEF 
T_LINE 
T_ENDIF 
T_ERROR 
T_WARNING 
T_ASSERT 
T_UNASSERT 
T_SPECLINE 
T_DATE 
T_FILE 
T_BASE_FILE 
T_INCLUDE_LEVEL 
T_VERSION 
T_TIME 
T_CONST 
T_MACRO 
T_SPEC_DEFINED 
T_UNUSED 
NT_VOID 
NT_MACRO 
NT_ASSERTION 
NT_VOID 
NT_MACRO 
NT_ASSERTION 

Definition at line 251 of file tradcpp.c.

Enumerator:
PD_NONE 
PD_DEFINE 
PD_UNDEF 
PD_ASSERTION 
PD_FILE 
PD_NONE 
PD_DEFINE 
PD_UNDEF 
PD_ASSERTION 
PD_FILE 

Definition at line 504 of file tradcpp.c.


Function Documentation

static unsigned char* canonicalize_text ( unsigned char *  buf,
unsigned char *  limit,
unsigned char **  climit 
) const [static]

Definition at line 3540 of file tradcpp.c.

References dest, is_space, len, result, and xmalloc().

static DEFINITION* collect_expansion ( U_CHAR buf,
U_CHAR end,
int  nargs,
struct arglist arglist 
) [static]

static int comp_def_part ( int  first,
const U_CHAR beg1,
int  len1,
const U_CHAR beg2,
int  len2,
int  last 
) [static]

Definition at line 2922 of file tradcpp.c.

References is_space.

Referenced by compare_defs().

static int compare_defs ( DEFINITION d1,
DEFINITION d2 
) [static]

Definition at line 2879 of file tradcpp.c.

References a1, a2, comp_def_part(), first, p1, p2, strcmp(), and strncmp().

Referenced by do_define().

static void conditional_skip ( FILE_BUF ip,
int  skip,
enum node_type  type 
) [static]

static void delete_macro ( HASHNODE hp  )  [static]

Definition at line 4983 of file tradcpp.c.

References free(), and NULL.

Referenced by do_unassert(), do_undef(), and eval_if_expression().

static int discard_comments ( U_CHAR start,
int  length,
int  newlines 
) [static]

static void do_assert ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

static void do_define ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

static void do_elif ( U_CHAR buf,
U_CHAR limit,
FILE_BUF op 
) [static]

static void do_else ( buf  ,
limit  ,
FILE_BUF op 
) [static]

static void do_endif ( buf  ,
limit  ,
FILE_BUF op 
) [static]

Definition at line 3930 of file tradcpp.c.

References error(), free(), indepth, instack, output_line_command(), and same_file.

static void do_error ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

Definition at line 3429 of file tradcpp.c.

References error().

static void do_if ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

Definition at line 3576 of file tradcpp.c.

References conditional_skip(), eval_if_expression(), indepth, instack, and T_IF.

static void do_ifdef ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

Definition at line 3681 of file tradcpp.c.

References do_xifdef(), and T_IFDEF.

static void do_ifndef ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

Definition at line 3689 of file tradcpp.c.

References do_xifdef(), and T_IFNDEF.

static void do_include ( U_CHAR buf,
U_CHAR limit,
FILE_BUF op 
) [static]

static void do_include_next ( U_CHAR buf,
U_CHAR limit,
FILE_BUF op 
) [static]

static void do_line ( U_CHAR buf,
U_CHAR limit,
FILE_BUF op 
) [static]

static void do_unassert ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

static void do_undef ( U_CHAR buf,
limit  ,
op   
) [static]

static void do_warning ( U_CHAR buf,
U_CHAR limit,
op   
) [static]

Definition at line 3439 of file tradcpp.c.

References warning.

static void do_xifdef ( U_CHAR buf,
U_CHAR limit,
enum node_type  type 
) [static]

Definition at line 3657 of file tradcpp.c.

References conditional_skip(), end, indepth, instack, is_idchar, is_nvspace, lookup(), NULL, skip, SKIP_WHITE_SPACE, T_IF, T_IFDEF, and T_IFNDEF.

Referenced by do_ifdef(), and do_ifndef().

static void dump_all_macros (  )  [static]

static void dump_arg_n ( DEFINITION defn,
int  argnum 
) [static]

Definition at line 5108 of file tradcpp.c.

References p, putchar(), and strchr.

Referenced by dump_all_macros().

static void dump_defn_1 ( U_CHAR base,
int  start,
int  length 
) const [static]

Definition at line 5084 of file tradcpp.c.

References fwrite, p, p1, putchar(), and skip_quoted_string().

Referenced by dump_all_macros().

void error_from_errno ( char *  name  )  const

Definition at line 4763 of file tradcpp.c.

References errno, error(), and strerror().

Referenced by output_deps(), and process_include().

static int eval_if_expression ( U_CHAR buf,
int  length 
) const [static]

Definition at line 3632 of file tradcpp.c.

References file_buf::buf, delete_macro(), expand_to_temp_buffer(), free(), install(), T_SPEC_DEFINED, and U.

Referenced by do_elif(), and do_if().

static FILE_BUF expand_to_temp_buffer ( U_CHAR buf,
U_CHAR limit,
int  output_marks 
) const [static]

void fancy_abort ( int  line,
const char *  func 
)

Definition at line 4793 of file tradcpp.c.

References fatal().

static int file_size_and_mode ( int  fd,
int *  mode_pointer,
long size_pointer 
) [static]

Definition at line 5265 of file tradcpp.c.

References fstat, stat::st_mode, and stat::st_size.

Referenced by finclude(), and main().

static void finclude ( int  f,
const char *  fname,
struct file_name_list nhd,
FILE_BUF op 
) [static]

static struct answer** find_answer ( HASHNODE node,
const struct answer candidate 
) [static, read]

Definition at line 3518 of file tradcpp.c.

References answer::answer, answer::len, memcmp, answer::next, and result.

static void fixup_newlines ( FILE_BUF fp  )  [static]

Definition at line 2598 of file tradcpp.c.

References end, memchr(), NULL, p, and q.

Referenced by finclude(), and main().

static void grow_outbuf ( FILE_BUF obuf,
int  needed 
) [static]

Definition at line 4853 of file tradcpp.c.

References p, and xrealloc().

static int handle_directive ( FILE_BUF ip,
FILE_BUF op 
) [static]

static int hashf ( U_CHAR name,
int  len,
int  hashsize 
) const [static]

Definition at line 5005 of file tradcpp.c.

References HASHSTEP, MAKE_POS, and r.

Referenced by do_define(), do_line(), install(), lookup(), and parse_assertion().

static void init_dependency_output (  )  [static]

static void initialize_builtins (  )  [static]

static HASHNODE* install ( U_CHAR name,
int  len,
enum node_type  type,
int  hash 
) const [static]

static int line_for_error ( int  line  )  [static]

Definition at line 4826 of file tradcpp.c.

References i, indepth, instack, and file_buf::lineno.

Referenced by macroexpand(), rescan(), and skip_quoted_string().

HASHNODE* lookup ( U_CHAR name,
int  len,
int  hash 
) const

static const char* macarg ( struct argdata argptr  )  [static]

static U_CHAR* macarg1 ( U_CHAR start,
const U_CHAR limit,
int *  depthptr,
int *  newlines,
int *  comments 
) [static]

Definition at line 4521 of file tradcpp.c.

References newline_fix().

Referenced by macarg().

static void macroexpand ( HASHNODE hp,
FILE_BUF op 
) [static]

int main ( int argc  ,
char **  argv 
)

static void make_assertion ( char *  str  )  const [static]

Definition at line 5231 of file tradcpp.c.

References alloca, buf, count, memcpy, p, run_directive(), strchr, strlen(), T_ASSERT, and T_UNASSERT.

Referenced by main().

static void make_definition ( char *  str  )  const [static]

Definition at line 5194 of file tradcpp.c.

References alloca, buf, count, memcpy, p, run_directive(), strchr, strlen(), and T_DEFINE.

Referenced by main().

static void make_undef ( char *  str  )  const [static]

Definition at line 5223 of file tradcpp.c.

References run_directive(), strlen(), and T_UNDEF.

Referenced by main().

static void name_newline_fix ( U_CHAR bp  )  [static]

Definition at line 1128 of file tradcpp.c.

References count, is_idchar, and p.

Referenced by handle_directive(), and skip_if_group().

static void newline_fix ( U_CHAR bp  )  [static]

Definition at line 1093 of file tradcpp.c.

References count, and p.

Referenced by discard_comments(), handle_directive(), macarg1(), rescan(), skip_if_group(), and skip_to_end_of_comment().

static void output_deps (  )  [static]

static void output_line_command ( FILE_BUF ip,
FILE_BUF op,
int  conditional,
enum file_change_code  file_change 
) [static]

static DEFINITION* collect_expansion PARAMS ( (U_CHAR *, U_CHAR *, int, struct arglist *)   )  [static]

static FILE_BUF expand_to_temp_buffer PARAMS ( (const U_CHAR *, const U_CHAR *, int)   )  [static]

static void v_message PARAMS ( (enum msgtype mtype, int line,const char *msgid, va_list ap)   )  [static]

Definition at line 394 of file tradcpp.c.

static void delete_macro PARAMS ( (HASHNODE *)   )  [static]

static int comp_def_part PARAMS ( (int, const U_CHAR *, int, const U_CHAR *, int, int)   )  [static]

static int compare_defs PARAMS ( (DEFINITION *, DEFINITION *)   )  [static]

static int hashf PARAMS ( (const U_CHAR *, int, int)   )  [static]

static struct hashnode* install PARAMS ( (const U_CHAR *, int, enum node_type, int)   )  [static, read]

static void do_xifdef PARAMS ( (U_CHAR *, U_CHAR *, enum node_type  )  [static]

static void do_define PARAMS ( (U_CHAR *, U_CHAR *, FILE_BUF *)   )  [static]

static unsigned char* canonicalize_text PARAMS ( (const unsigned char *, const unsigned char *, const unsigned char **)   )  [static]

static struct answer** find_answer PARAMS ( (HASHNODE *, const struct answer *)   )  [static, read]

static HASHNODE* parse_assertion PARAMS ( (const unsigned char *, const unsigned char *, struct answer **, int)   )  [static]

static int parse_answer ( unsigned char *  buf,
unsigned char *  limit,
struct answer **  answerp,
int  type 
) const [static]

Definition at line 3281 of file tradcpp.c.

References error(), start, T_ASSERT, T_IF, T_UNASSERT, and xmalloc().

static HASHNODE* parse_assertion ( unsigned char *  buf,
unsigned char *  limit,
struct answer **  answerp,
int  type 
) const [static]

void perror_with_name ( char *  name  )  const

void pfatal_with_name ( char *  name  )  const

Definition at line 4811 of file tradcpp.c.

References exit(), FATAL_EXIT_CODE, and perror_with_name().

Referenced by execute(), lang_specific_driver(), load_specs(), and main().

static void process_include ( struct file_name_list stackp,
const U_CHAR fbeg,
int  flen,
int  system_header_p,
FILE_BUF op 
) [static]

static void rescan ( FILE_BUF op,
int  output_marks 
) [static]

static void run_directive ( char *  str,
size_t  len,
enum node_type  type 
) const [static]

static void skip_if_group ( FILE_BUF ip,
int  any 
) [static]

static U_CHAR* skip_quoted_string ( U_CHAR bp,
const U_CHAR limit,
int  start_line,
int *  count_newlines,
int *  backslash_newlines_p,
int *  eofp 
) const [static]

Definition at line 4016 of file tradcpp.c.

References c, and line_for_error().

Referenced by dump_defn_1(), handle_directive(), and skip_if_group().

static U_CHAR* skip_to_end_of_comment ( FILE_BUF ip,
int *  line_counter 
) [static]

static void special_symbol ( HASHNODE hp,
FILE_BUF op 
) [static]

int test_assertion ( unsigned char **  pbuf  ) 

static void v_message ( enum msgtype  mtype,
int  line,
const char *  msgid,
va_list  ap 
) [static]

void error_with_line VPARAMS ( (int line, const char *msgid,...)   ) 

Definition at line 4751 of file tradcpp.c.

References MT_ERROR, v_message, VA_CLOSE, VA_FIXEDARG, and VA_OPEN.

void error VPARAMS ( (const char *msgid,...)   ) 

Definition at line 4741 of file tradcpp.c.

References MT_ERROR, v_message, VA_CLOSE, VA_FIXEDARG, and VA_OPEN.


Variable Documentation

Definition at line 182 of file tradcpp.c.

Definition at line 46 of file tradcpp.c.

int deps_append = 0

Definition at line 60 of file tradcpp.c.

const char* deps_file = 0

Definition at line 65 of file tradcpp.c.

Definition at line 70 of file tradcpp.c.

Referenced by init_dependency_output(), main(), and process_include().

Definition at line 179 of file tradcpp.c.

Definition at line 80 of file tradcpp.c.

Referenced by cb_define(), and main().

int errors = 0

Definition at line 479 of file tradcpp.c.

Definition at line 175 of file tradcpp.c.

Definition at line 93 of file tradcpp.c.

HASHNODE* hashtab[HASHSIZE]

Definition at line 313 of file tradcpp.c.

Definition at line 497 of file tradcpp.c.

Definition at line 501 of file tradcpp.c.

Referenced by do_include(), main(), and search_from().

Definition at line 173 of file tradcpp.c.

int indepth = -1

int inhibit_output = 0

Definition at line 87 of file tradcpp.c.

Referenced by init_dependency_output(), and main().

Definition at line 84 of file tradcpp.c.

struct file_buf instack[INPUT_STACK_MAX]

Definition at line 176 of file tradcpp.c.

Definition at line 39 of file tradcpp.c.

const char* const monthnames[] [static]

Initial value:

 {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}

Definition at line 2155 of file tradcpp.c.

Definition at line 74 of file tradcpp.c.

Referenced by main(), output_line_command(), and print_line().

int no_output

Definition at line 104 of file tradcpp.c.

Referenced by main(), output_line_command(), and rescan().

int print_deps = 0

Definition at line 52 of file tradcpp.c.

Referenced by init_dependency_output(), main(), and process_include().

Definition at line 56 of file tradcpp.c.

Referenced by main(), and output_deps().

const char* progname [static]

Definition at line 34 of file tradcpp.c.

Definition at line 43 of file tradcpp.c.

Referenced by main(), rescan(), and skip_to_end_of_comment().

Definition at line 150 of file tradcpp.c.

Referenced by output_line_command(), and process_include().

const char* user_label_prefix [static]

Definition at line 108 of file tradcpp.c.


Generated on Wed Apr 8 15:46:37 2009 for Open64 by  doxygen 1.5.6