diff options
| author | grischka <grischka> | 2013-02-12 19:13:28 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2013-02-12 19:13:28 +0100 |
| commit | 05108a3b0a8eff70739b253b8995999b1861f9f2 (patch) | |
| tree | 690c17ebe3cd0479e278bc3b65e00eba7ec674fd /tccpp.c | |
| parent | 829655949b7964c66e1f7da9d44c19655dba88aa (diff) | |
| download | tinycc-05108a3b0a8eff70739b253b8995999b1861f9f2.tar.gz tinycc-05108a3b0a8eff70739b253b8995999b1861f9f2.tar.bz2 | |
libtcc: new LIBTCCAPI tcc_set_options(TCCState*, const char*str)
This replaces -> use instead:
-----------------------------------
- tcc_set_linker -> tcc_set_options(s, "-Wl,...");
- tcc_set_warning -> tcc_set_options(s, "-W...");
- tcc_enable_debug -> tcc_set_options(s, "-g");
parse_args is moved to libtcc.c (now tcc_parse_args).
Also some cleanups:
- reorder TCCState members
- add some comments here and there
- do not use argv's directly, make string copies
- use const char* in tcc_set_linker
- tccpe: use fd instead of fp
tested with -D MEM_DEBUG: 0 bytes left
Diffstat (limited to 'tccpp.c')
| -rw-r--r-- | tccpp.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -118,7 +118,7 @@ static void cstr_realloc(CString *cstr, int new_size) } /* add a byte */ -PUB_FUNC void cstr_ccat(CString *cstr, int ch) +ST_FUNC void cstr_ccat(CString *cstr, int ch) { int size; size = cstr->size + 1; @@ -128,7 +128,7 @@ PUB_FUNC void cstr_ccat(CString *cstr, int ch) cstr->size = size; } -PUB_FUNC void cstr_cat(CString *cstr, const char *str) +ST_FUNC void cstr_cat(CString *cstr, const char *str) { int c; for(;;) { @@ -141,7 +141,7 @@ PUB_FUNC void cstr_cat(CString *cstr, const char *str) } /* add a wide char */ -PUB_FUNC void cstr_wccat(CString *cstr, int ch) +ST_FUNC void cstr_wccat(CString *cstr, int ch) { int size; size = cstr->size + sizeof(nwchar_t); @@ -151,20 +151,20 @@ PUB_FUNC void cstr_wccat(CString *cstr, int ch) cstr->size = size; } -PUB_FUNC void cstr_new(CString *cstr) +ST_FUNC void cstr_new(CString *cstr) { memset(cstr, 0, sizeof(CString)); } /* free string and reset it to NULL */ -PUB_FUNC void cstr_free(CString *cstr) +ST_FUNC void cstr_free(CString *cstr) { tcc_free(cstr->data_allocated); cstr_new(cstr); } /* reset string to empty */ -PUB_FUNC void cstr_reset(CString *cstr) +ST_FUNC void cstr_reset(CString *cstr) { cstr->size = 0; } @@ -3112,17 +3112,17 @@ print_line: : "" ; iptr = iptr_new; - fprintf(s1->outfile, "# %d \"%s\"%s\n", file->line_num, file->filename, s); + fprintf(s1->ppfp, "# %d \"%s\"%s\n", file->line_num, file->filename, s); } else { while (d) - fputs("\n", s1->outfile), --d; + fputs("\n", s1->ppfp), --d; } line_ref = (file_ref = file)->line_num; token_seen = tok != TOK_LINEFEED; if (!token_seen) continue; } - fputs(get_tok_str(tok, &tokc), s1->outfile); + fputs(get_tok_str(tok, &tokc), s1->ppfp); } free_defines(define_start); return 0; |
