File: recopendirtype_build.py

package info (click to toggle)
python-cffi 2.0.0~b1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,796 kB
  • sloc: python: 28,456; ansic: 15,272; asm: 116; makefile: 97; sh: 14
file content (19 lines) | stat: -rw-r--r-- 393 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from cffi import FFI
import bsdopendirtype_build

ffi = FFI()

# ========== This is a demo of ffi.include() ==========
ffi.include(bsdopendirtype_build.ffi)

ffi.cdef("""
    int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
""")

ffi.set_source("_recopendirtype", """
    #include <sys/types.h>
    #include <dirent.h>
""")

if __name__ == '__main__':
    ffi.compile()