Uncategorized

[libclang python binding] How to dump the information from a C structure initializer – Using Clang



Hi All:
I would like to dump all the information from a C structure initializer, for example:

struct A fops = {
    .open = ffopen,
    .close = ffclose,
};

I want to dump all such structure initializers in a C file, which API should I use? Currently I’m using the libclang python bindings, it prints out the CursorKind.VAR_DECL: fops but does not show the content inside the {}. The get_children() just returns “struct” “A” and “fops”. Any help will be appreciated!



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *