mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-28 08:10:25 +08:00
added better error support
This commit is contained in:
parent
e4c7dd5e60
commit
05a919e29f
22
libtcc.h
22
libtcc.h
@ -14,6 +14,10 @@ void tcc_delete(TCCState *s);
|
|||||||
/* add debug information in the generated code */
|
/* add debug information in the generated code */
|
||||||
void tcc_enable_debug(TCCState *s);
|
void tcc_enable_debug(TCCState *s);
|
||||||
|
|
||||||
|
/* set error/warning display callback */
|
||||||
|
void tcc_set_error_func(TCCState *s, void *error_opaque,
|
||||||
|
void (*error_func)(void *opaque, const char *msg));
|
||||||
|
|
||||||
/*****************************/
|
/*****************************/
|
||||||
/* preprocessor */
|
/* preprocessor */
|
||||||
|
|
||||||
@ -33,16 +37,13 @@ void tcc_undefine_symbol(TCCState *s, const char *sym);
|
|||||||
/* compiling */
|
/* compiling */
|
||||||
|
|
||||||
/* add a file (either a C file, dll, an object, a library or an ld
|
/* add a file (either a C file, dll, an object, a library or an ld
|
||||||
script */
|
script). Return -1 if error. */
|
||||||
void tcc_add_file(TCCState *s, const char *filename);
|
int tcc_add_file(TCCState *s, const char *filename);
|
||||||
|
|
||||||
/* compile a string containing a C source. Return non zero if
|
/* compile a string containing a C source. Return non zero if
|
||||||
error. */
|
error. */
|
||||||
int tcc_compile_string(TCCState *s, const char *buf);
|
int tcc_compile_string(TCCState *s, const char *buf);
|
||||||
|
|
||||||
/* get last error */
|
|
||||||
int tcc_get_error(TCCState *s, char *buf, int buf_size);
|
|
||||||
|
|
||||||
/*****************************/
|
/*****************************/
|
||||||
/* linking commands */
|
/* linking commands */
|
||||||
|
|
||||||
@ -63,14 +64,17 @@ int tcc_add_library(TCCState *s, const char *libraryname);
|
|||||||
/* add a symbol to the compiled program */
|
/* add a symbol to the compiled program */
|
||||||
int tcc_add_symbol(TCCState *s, const char *name, unsigned long val);
|
int tcc_add_symbol(TCCState *s, const char *name, unsigned long val);
|
||||||
|
|
||||||
/* output an executable, library or object file */
|
/* output an executable, library or object file. DO NOT call
|
||||||
|
tcc_relocate() before. */
|
||||||
int tcc_output_file(TCCState *s, const char *filename);
|
int tcc_output_file(TCCState *s, const char *filename);
|
||||||
|
|
||||||
/* link and run main() function and return its value */
|
/* link and run main() function and return its value. DO NOT call
|
||||||
|
tcc_relocate() before. */
|
||||||
int tcc_run(TCCState *s, int argc, char **argv);
|
int tcc_run(TCCState *s, int argc, char **argv);
|
||||||
|
|
||||||
/* do all relocations (needed before using tcc_get_symbol()) */
|
/* do all relocations (needed before using tcc_get_symbol()). Return
|
||||||
void tcc_relocate(TCCState *s);
|
non zero if link error. */
|
||||||
|
int tcc_relocate(TCCState *s);
|
||||||
|
|
||||||
/* return symbol value or error */
|
/* return symbol value or error */
|
||||||
void *tcc_get_symbol(TCCState *s, const char *name);
|
void *tcc_get_symbol(TCCState *s, const char *name);
|
||||||
|
Loading…
Reference in New Issue
Block a user