~ubuntu-branches/ubuntu/wily/tcc/wily

« back to all changes in this revision

Viewing changes to libtcc.h

  • Committer: Package Import Robot
  • Author(s): Graham Inggs
  • Date: 2015-09-27 08:17:02 UTC
  • mfrom: (17.1.16 wily-proposed)
  • Revision ID: package-import@ubuntu.com-20150927081702-utgd126t8647rcp0
Tags: 0.9.27~git20140923.9d7fb33-3ubuntu1
Disable stack protection on i386 to avoid FTBFS with
undefined symbol '__stack_chk_fail_local' (LP: #1500147).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
/* free a TCC compilation context */
20
20
LIBTCCAPI void tcc_delete(TCCState *s);
21
21
 
22
 
/* add debug information in the generated code */
23
 
LIBTCCAPI void tcc_enable_debug(TCCState *s);
 
22
/* set CONFIG_TCCDIR at runtime */
 
23
LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path);
24
24
 
25
25
/* set error/warning display callback */
26
26
LIBTCCAPI void tcc_set_error_func(TCCState *s, void *error_opaque,
27
 
                        void (*error_func)(void *opaque, const char *msg));
28
 
 
29
 
/* set/reset a warning */
30
 
LIBTCCAPI int tcc_set_warning(TCCState *s, const char *warning_name, int value);
31
 
 
32
 
/* set linker option */
33
 
LIBTCCAPI const char * tcc_set_linker(TCCState *s, char *option, int multi);
 
27
    void (*error_func)(void *opaque, const char *msg));
 
28
 
 
29
/* set options as from command line (multiple supported) */
 
30
LIBTCCAPI int tcc_set_options(TCCState *s, const char *str);
34
31
 
35
32
/*****************************/
36
33
/* preprocessor */
50
47
/*****************************/
51
48
/* compiling */
52
49
 
53
 
/* add a file (either a C file, dll, an object, a library or an ld
54
 
   script). Return -1 if error. */
 
50
/* add a file (C file, dll, object, library, ld script). Return -1 if error. */
55
51
LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename);
56
52
 
57
 
/* compile a string containing a C source. Return non zero if
58
 
   error. */
 
53
/* compile a string containing a C source. Return -1 if error. */
59
54
LIBTCCAPI int tcc_compile_string(TCCState *s, const char *buf);
60
55
 
61
56
/*****************************/
62
57
/* linking commands */
63
58
 
64
59
/* set output type. MUST BE CALLED before any compilation */
65
 
#define TCC_OUTPUT_MEMORY   0 /* output will be ran in memory (no
66
 
                                 output file) (default) */
 
60
LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type);
 
61
#define TCC_OUTPUT_MEMORY   0 /* output will be run in memory (default) */
67
62
#define TCC_OUTPUT_EXE      1 /* executable file */
68
63
#define TCC_OUTPUT_DLL      2 /* dynamic library */
69
64
#define TCC_OUTPUT_OBJ      3 /* object file */
70
 
#define TCC_OUTPUT_PREPROCESS 4 /* preprocessed file (used internally) */
71
 
LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type);
72
 
 
73
 
#define TCC_OUTPUT_FORMAT_ELF    0 /* default output format: ELF */
74
 
#define TCC_OUTPUT_FORMAT_BINARY 1 /* binary image output */
75
 
#define TCC_OUTPUT_FORMAT_COFF   2 /* COFF */
 
65
#define TCC_OUTPUT_PREPROCESS 4 /* only preprocess (used internally) */
76
66
 
77
67
/* equivalent to -Lpath option */
78
68
LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname);
91
81
   tcc_relocate() before. */
92
82
LIBTCCAPI int tcc_run(TCCState *s, int argc, char **argv);
93
83
 
94
 
/* Do all relocations (needed before using tcc_get_symbol())
95
 
   Returns -1 on error. */
96
 
LIBTCCAPI int tcc_relocate(TCCState *s1);
 
84
/* do all relocations (needed before using tcc_get_symbol()) */
 
85
LIBTCCAPI int tcc_relocate(TCCState *s1, void *ptr);
 
86
/* possible values for 'ptr':
 
87
   - TCC_RELOCATE_AUTO : Allocate and manage memory internally
 
88
   - NULL              : return required memory size for the step below
 
89
   - memory address    : copy code to memory passed by the caller
 
90
   returns -1 if error. */
 
91
#define TCC_RELOCATE_AUTO (void*)1
97
92
 
98
93
/* return symbol value or NULL if not found */
99
94
LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name);
100
95
 
101
 
/* set CONFIG_TCCDIR at runtime */
102
 
LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path);
103
 
 
104
96
#ifdef __cplusplus
105
97
}
106
98
#endif