• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1from cffi import FFI
2ffi = FFI()
3ffi.cdef("""     // some declarations from the man page
4    struct passwd {
5        char *pw_name;
6        ...;
7    };
8    struct passwd *getpwuid(int uid);
9""")
10
11ffi.set_source('_pwuid_cffi', """   // passed to the real C compiler
12#include <sys/types.h>
13#include <pwd.h>
14""")
15
16
17if __name__ == '__main__':
18    ffi.compile()
19