Search code examples
pythoncpypypython-cffi

how to list every available identifier in ffi of pypy cffi?


I can list available function names and enumerator names by

lib = ffi.dlopen(...)
print dir(lib)

Howerver, dir(lib) doesn't return defined typedefs and structs.

When I tried to load an arbitrary module with an arbitrary c header file using cffi, I had to parse the header file to get the list of typedefs and structs. Is there a better way to do the same thing?


Solution

  • It's not possible so far to enumerate the types. You could file an enhancement request at https://bitbucket.org/cffi/cffi/issues.