summaryrefslogtreecommitdiff
path: root/testing/cffi0/snippets/setuptools_package_2/snip_setuptools_verify2/__init__.py
blob: 5f4bd138112a520a0dc9adbc1c337ab1064ca3f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

from cffi import FFI
import sys

ffi = FFI()
ffi.cdef("""     // some declarations from the man page
    struct passwd {
        char *pw_name;
        ...;
    };
    struct passwd *getpwuid(int uid);
""")
C = ffi.verify("""   // passed to the real C compiler
#include <sys/types.h>
#include <pwd.h>
""", libraries=[],    # or a list of libraries to link with
     ext_package='snip_setuptools_verify2',
     force_generic_engine=hasattr(sys, '_force_generic_engine_'))