Unified · Split
| @@ -14,6 +14,10 @@ void tcc_delete(TCCState *s); · 13 unmodified lines | |||
| 14 | /* add debug information in the generated code */ | 14 | /* add debug information in the generated code */ |
| 15 | void tcc_enable_debug(TCCState *s); | 15 | void tcc_enable_debug(TCCState *s); |
| 16 | 16 | ||
| 17 | /* set error/warning display callback */ | ||
| 18 | void tcc_set_error_func(TCCState *s, void *error_opaque, | ||
| 19 | void (*error_func)(void *opaque, const char *msg)); | ||
| 20 | |||
| 17 | /*****************************/ | 21 | /*****************************/ |
| 18 | /* preprocessor */ | 22 | /* preprocessor */ |
| 19 | 23 | ||
| @@ -33,16 +37,13 @@ void tcc_undefine_symbol(TCCState *s, const char *sym); · 13 unmodified lines | |||
| 33 | /* compiling */ | 37 | /* compiling */ |
| 34 | 38 | ||
| 35 | /* add a file (either a C file, dll, an object, a library or an ld | 39 | /* add a file (either a C file, dll, an object, a library or an ld |
| 36 | script */ | 40 | script). Return -1 if error. */ |
| 37 | void tcc_add_file(TCCState *s, const char *filename); | 41 | int tcc_add_file(TCCState *s, const char *filename); |
| 38 | 42 | ||
| 39 | /* compile a string containing a C source. Return non zero if | 43 | /* compile a string containing a C source. Return non zero if |
| 40 | error. */ | 44 | error. */ |
| 41 | int tcc_compile_string(TCCState *s, const char *buf); | 45 | int tcc_compile_string(TCCState *s, const char *buf); |
| 42 | 46 | ||
| 43 | /* get last error */ | ||
| 44 | int tcc_get_error(TCCState *s, char *buf, int buf_size); | ||
| 45 | |||
| 46 | /*****************************/ | 47 | /*****************************/ |
| 47 | /* linking commands */ | 48 | /* linking commands */ |
| 48 | 49 | ||
| @@ -63,14 +64,17 @@ int tcc_add_library(TCCState *s, const char *libraryname); · 14 unmodified lines | |||
| 63 | /* add a symbol to the compiled program */ | 64 | /* add a symbol to the compiled program */ |
| 64 | int tcc_add_symbol(TCCState *s, const char *name, unsigned long val); | 65 | int tcc_add_symbol(TCCState *s, const char *name, unsigned long val); |
| 65 | 66 | ||
| 66 | /* output an executable, library or object file */ | 67 | /* output an executable, library or object file. DO NOT call |
| 68 | tcc_relocate() before. */ | ||
| 67 | int tcc_output_file(TCCState *s, const char *filename); | 69 | int tcc_output_file(TCCState *s, const char *filename); |
| 68 | 70 | ||
| 69 | /* link and run main() function and return its value */ | 71 | /* link and run main() function and return its value. DO NOT call |
| 72 | tcc_relocate() before. */ | ||
| 70 | int tcc_run(TCCState *s, int argc, char **argv); | 73 | int tcc_run(TCCState *s, int argc, char **argv); |
| 71 | 74 | ||
| 72 | /* do all relocations (needed before using tcc_get_symbol()) */ | 75 | /* do all relocations (needed before using tcc_get_symbol()). Return |
| 73 | void tcc_relocate(TCCState *s); | 76 | non zero if link error. */ |
| 77 | int tcc_relocate(TCCState *s); | ||
| 74 | 78 | ||
| 75 | /* return symbol value or error */ | 79 | /* return symbol value or error */ |
| 76 | void *tcc_get_symbol(TCCState *s, const char *name); | 80 | void *tcc_get_symbol(TCCState *s, const char *name); |