testing/cffi0/snippets/distutils_package_2/snip_basic_verify2/__init__.py
raw| 1 | |
| 2 | from cffi import FFI |
| 3 | import sys |
| 4 | |
| 5 | ffi = FFI() |
| 6 | ffi.cdef(""" // some declarations from the man page |
| 7 | struct passwd { |
| 8 | char *pw_name; |
| 9 | ...; |
| 10 | }; |
| 11 | struct passwd *getpwuid(int uid); |
| 12 | """) |
| 13 | C = ffi.verify(""" // passed to the real C compiler |
| 14 | #include <sys/types.h> |
| 15 | #include <pwd.h> |
| 16 | """, libraries=[], # or a list of libraries to link with |
| 17 | ext_package='snip_basic_verify2', |
| 18 | force_generic_engine=hasattr(sys, '_force_generic_engine_')) |