Kevin Ingwersen via Tinycc-devel wrote:
Hello there!

Quick and short question: Can I use libtcc to extract symbol information
(types, functions, structs, enums, unions) from a C header so that I can
then use it to generate a wrapper? My goal is to automate the process of
C interop generation for the V language, which uses TCC as one of the
mainly supported compilers - so the source is already accessible even
from a standard V installation, hence my thought of possibly taking
advantage of that to generate wrappers

As is, libtcc does not have support for that.  You would need to
add some lines here or there.  To start with, see tccgen.c:decl0():

    #if 0
            {
                char buf[500];
                type_to_str(buf, sizeof(buf), &type, get_tok_str(v, NULL));
                printf("type = '%s'\n", buf);
            }
    #endif

I did use similar hacks to generate the list of function prototypes in
tcc.h initially. (long ago)

--- grischka


Thank you in advance!

Kind regards,
Kevin Ingwersen


_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to