I've just taken a closer look at libtcc.h.  Now, I realize that this is
radical,
but for the sake of discussion... if we're willing to break compatibility
it seems
to me that just one new API:

/* add option as on a comment line (multiple supported) */
LIBTCCAPI int tcc_argv_add(TCCState *s, const char *str);

could replace all of:

LIBTCCAPI int tcc_set_options(TCCState *s, const char *str);
LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path);
LIBTCCAPI int tcc_add_include_path(TCCState *s, const char *pathname);
LIBTCCAPI int tcc_add_sysinclude_path(TCCState *s, const char *pathname);
LIBTCCAPI void tcc_define_symbol(TCCState *s, const char *sym, const char
*value);
LIBTCCAPI void tcc_undefine_symbol(TCCState *s, const char *sym);
LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename);

Also, now that tcc_relocate() has no options, tcc_get_symbol() could
just remember if it's been called and call tcc_relocate(s) on its
first invocation.

So this would also disappear:

/* do all relocations (needed before using tcc_get_symbol()) */
LIBTCCAPI int tcc_relocate(TCCState *s1);

Food for thought, perhaps.

- Eric
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to