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
This commit is contained in:
grischka
2013-02-12 19:13:28 +01:00
parent 829655949b
commit 05108a3b0a
12 changed files with 909 additions and 987 deletions

View File

@ -79,7 +79,7 @@ int main(int argc, char **argv)
ElfW(Sym) *sym;
int i, fsize, iarg;
char *buf, *shstr, *symtab = NULL, *strtab = NULL;
int symtabsize = 0, strtabsize = 0;
int symtabsize = 0;//, strtabsize = 0;
char *anames = NULL;
int *afpos = NULL;
int istrlen, strpos = 0, fpos = 0, funccnt = 0, funcmax, hofs;
@ -171,7 +171,7 @@ int main(int argc, char **argv)
if (!strcmp(shstr + shdr->sh_name, ".strtab"))
{
strtab = (char *)(buf + shdr->sh_offset);
strtabsize = shdr->sh_size;
//strtabsize = shdr->sh_size;
}
}
}