SHOW:
|
|
- or go back to the newest paste.
1 | import cffi | |
2 | ffi = cffi.FFI() | |
3 | ffi.cdef(""" | |
4 | extern struct intensity_data { | |
5 | double nw; | |
6 | double ne; | |
7 | double sw; | |
8 | double se; | |
9 | int error; | |
10 | } _intensity_data; | |
11 | ||
12 | struct intensity_data jpeg_intensities(const char *file_name); | |
13 | struct intensity_data png_intensities(const char *file_name); | |
14 | """) | |
15 | ffi.set_source('mymod', ''' | |
16 | extern struct intensity_data { | |
17 | double nw; | |
18 | double ne; | |
19 | double sw; | |
20 | double se; | |
21 | int error; | |
22 | } _intensity_data; | |
23 | struct intensity_data jpeg_intensities(const char * file_name) { | |
24 | struct intensity_data a; | |
25 | return a; | |
26 | }; | |
27 | struct intensity_data png_intensities(const char * file_name) { | |
28 | struct intensity_data a; | |
29 | return a; | |
30 | }; | |
31 | ''') | |
32 | ffi.emit_c_code('/tmp/stam.c') |