libyasm/preproc.h File Reference

YASM preprocessor module interface. More...

Go to the source code of this file.

Data Structures

struct  yasm_preproc_module
 YASM preprocesor module interface. More...

Functions

yasm_preprocyasm_preproc_create (yasm_preproc_module *module, const char *in_filename, yasm_symtab *symtab, yasm_linemap *lm, yasm_errwarns *errwarns)
 Initialize preprocessor.
void yasm_preproc_destroy (yasm_preproc *preproc)
 Cleans up any allocated preproc memory.
char * yasm_preproc_get_line (yasm_preproc *preproc)
 Gets a single line of preprocessed source code.
size_t yasm_preproc_get_included_file (yasm_preproc *preproc, char *buf, size_t max_size)
 Get the next filename included by the source code.
void yasm_preproc_add_include_file (yasm_preproc *preproc, const char *filename)
 Pre-include a file.
void yasm_preproc_predefine_macro (yasm_preproc *preproc, const char *macronameval)
 Pre-define a macro.
void yasm_preproc_undefine_macro (yasm_preproc *preproc, const char *macroname)
 Un-define a macro.
void yasm_preproc_define_builtin (yasm_preproc *preproc, const char *macronameval)
 Define a builtin macro, preprocessed before the "standard" macros.
void yasm_preproc_add_standard (yasm_preproc *preproc, const char **macros)
 Define additional standard macros, preprocessed after the builtins but prior to any user-defined macros.


Detailed Description

YASM preprocessor module interface.

Definition in file preproc.h.


Function Documentation

void yasm_preproc_add_include_file ( yasm_preproc preproc,
const char *  filename 
)

Pre-include a file.

Parameters:
preproc preprocessor
filename filename

void yasm_preproc_add_standard ( yasm_preproc preproc,
const char **  macros 
)

Define additional standard macros, preprocessed after the builtins but prior to any user-defined macros.

Parameters:
preproc preprocessor
macros NULL-terminated array of macro strings

yasm_preproc* yasm_preproc_create ( yasm_preproc_module module,
const char *  in_filename,
yasm_symtab symtab,
yasm_linemap lm,
yasm_errwarns errwarns 
)

Initialize preprocessor.

The preprocessor needs access to the object format module to find out any output format specific macros.

Parameters:
module preprocessor module
in_filename initial starting filename, or "-" to read from stdin
symtab symbol table (may be NULL if none)
lm line mapping repository
errwarns error/warning set
Returns:
New preprocessor.
Note:
Errors/warnings are stored into errwarns.

void yasm_preproc_define_builtin ( yasm_preproc preproc,
const char *  macronameval 
)

Define a builtin macro, preprocessed before the "standard" macros.

Parameters:
preproc preprocessor
macronameval "name=value" string

void yasm_preproc_destroy ( yasm_preproc preproc  ) 

Cleans up any allocated preproc memory.

Parameters:
preproc preprocessor

size_t yasm_preproc_get_included_file ( yasm_preproc preproc,
char *  buf,
size_t  max_size 
)

Get the next filename included by the source code.

Parameters:
preproc preprocessor
buf destination buffer for filename
max_size maximum number of bytes that can be returned in buf
Returns:
Actual number of bytes returned in buf.

char* yasm_preproc_get_line ( yasm_preproc preproc  ) 

Gets a single line of preprocessed source code.

Parameters:
preproc preprocessor
Returns:
Allocated line of code, without the trailing
.

void yasm_preproc_predefine_macro ( yasm_preproc preproc,
const char *  macronameval 
)

Pre-define a macro.

Parameters:
preproc preprocessor
macronameval "name=value" string

void yasm_preproc_undefine_macro ( yasm_preproc preproc,
const char *  macroname 
)

Un-define a macro.

Parameters:
preproc preprocessor
macroname macro name


Generated on Thu Jul 24 01:23:32 2008 for libyasm by  doxygen 1.5.2