pysus 0.4.0__py3.7-linux-x86_64.egg

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. EGG-INFO/PKG-INFO +30 -0
  2. EGG-INFO/SOURCES.txt +75 -0
  3. EGG-INFO/dependency_links.txt +1 -0
  4. EGG-INFO/native_libs.txt +3 -0
  5. EGG-INFO/not-zip-safe +1 -0
  6. EGG-INFO/requires.txt +7 -0
  7. EGG-INFO/top_level.txt +2 -0
  8. __pycache__/_readdbc.cpython-37.pyc +0 -0
  9. _readdbc.abi3.so +0 -0
  10. _readdbc.py +7 -0
  11. pysus/__init__.py +2 -0
  12. pysus/__pycache__/__init__.cpython-37.pyc +0 -0
  13. pysus/online_data/CIHA.py +62 -0
  14. pysus/online_data/CNES.py +24 -0
  15. pysus/online_data/SIA.py +92 -0
  16. pysus/online_data/SIH.py +61 -0
  17. pysus/online_data/SIM.py +155 -0
  18. pysus/online_data/SINAN.py +77 -0
  19. pysus/online_data/__init__.py +22 -0
  20. pysus/online_data/__pycache__/CIHA.cpython-37.pyc +0 -0
  21. pysus/online_data/__pycache__/CNES.cpython-37.pyc +0 -0
  22. pysus/online_data/__pycache__/SIA.cpython-37.pyc +0 -0
  23. pysus/online_data/__pycache__/SIH.cpython-37.pyc +0 -0
  24. pysus/online_data/__pycache__/SIM.cpython-37.pyc +0 -0
  25. pysus/online_data/__pycache__/SINAN.cpython-37.pyc +0 -0
  26. pysus/online_data/__pycache__/__init__.cpython-37.pyc +0 -0
  27. pysus/online_data/__pycache__/sinasc.cpython-37.pyc +0 -0
  28. pysus/online_data/sinasc.py +44 -0
  29. pysus/preprocessing/__init__.py +8 -0
  30. pysus/preprocessing/__pycache__/__init__.cpython-37.pyc +0 -0
  31. pysus/preprocessing/__pycache__/decoders.cpython-37.pyc +0 -0
  32. pysus/preprocessing/__pycache__/sinan.cpython-37.pyc +0 -0
  33. pysus/preprocessing/decoders.py +96 -0
  34. pysus/preprocessing/sinan.py +103 -0
  35. pysus/tests/__init__.py +8 -0
  36. pysus/tests/__pycache__/__init__.cpython-37.pyc +0 -0
  37. pysus/tests/__pycache__/test_decoders.cpython-37.pyc +0 -0
  38. pysus/tests/__pycache__/test_sinan.cpython-37.pyc +0 -0
  39. pysus/tests/__pycache__/test_utilities.cpython-37.pyc +0 -0
  40. pysus/tests/test_data/__init__.py +6 -0
  41. pysus/tests/test_data/__pycache__/__init__.cpython-37.pyc +0 -0
  42. pysus/tests/test_data/__pycache__/test_ciha.cpython-37.pyc +0 -0
  43. pysus/tests/test_data/__pycache__/test_sia.cpython-37.pyc +0 -0
  44. pysus/tests/test_data/__pycache__/test_sih.cpython-37.pyc +0 -0
  45. pysus/tests/test_data/__pycache__/test_sim.cpython-37.pyc +0 -0
  46. pysus/tests/test_data/__pycache__/test_sinasc.cpython-37.pyc +0 -0
  47. pysus/tests/test_data/test_ciha.py +23 -0
  48. pysus/tests/test_data/test_sia.py +25 -0
  49. pysus/tests/test_data/test_sih.py +18 -0
  50. pysus/tests/test_data/test_sim.py +41 -0
  51. pysus/tests/test_data/test_sinasc.py +20 -0
  52. pysus/tests/test_decoders.py +38 -0
  53. pysus/tests/test_sinan.py +44 -0
  54. pysus/tests/test_utilities.py +18 -0
  55. pysus/utilities/__init__.py +6 -0
  56. pysus/utilities/__pycache__/__init__.cpython-37.pyc +0 -0
  57. pysus/utilities/__pycache__/_build_readdbc.cpython-37.pyc +0 -0
  58. pysus/utilities/__pycache__/readdbc.cpython-37.pyc +0 -0
  59. pysus/utilities/_build_readdbc.py +32 -0
  60. pysus/utilities/_readdbc.c +966 -0
  61. pysus/utilities/_readdbc.cpython-36m-x86_64-linux-gnu.so +0 -0
  62. pysus/utilities/_readdbc.cpython-37m-x86_64-linux-gnu.so +0 -0
  63. pysus/utilities/_readdbc.o +0 -0
  64. pysus/utilities/blast.c +982 -0
  65. pysus/utilities/blast.h +75 -0
  66. pysus/utilities/blast.o +0 -0
  67. pysus/utilities/readdbc.py +52 -0
@@ -0,0 +1,966 @@
1
+ #define _CFFI_
2
+
3
+ /* We try to define Py_LIMITED_API before including Python.h.
4
+
5
+ Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and
6
+ Py_REF_DEBUG are not defined. This is a best-effort approximation:
7
+ we can learn about Py_DEBUG from pyconfig.h, but it is unclear if
8
+ the same works for the other two macros. Py_DEBUG implies them,
9
+ but not the other way around.
10
+
11
+ Issue #350 is still open: on Windows, the code here causes it to link
12
+ with PYTHON36.DLL (for example) instead of PYTHON3.DLL. A fix was
13
+ attempted in 164e526a5515 and 14ce6985e1c3, but reverted: virtualenv
14
+ does not make PYTHON3.DLL available, and so the "correctly" compiled
15
+ version would not run inside a virtualenv. We will re-apply the fix
16
+ after virtualenv has been fixed for some time. For explanation, see
17
+ issue #355. For a workaround if you want PYTHON3.DLL and don't worry
18
+ about virtualenv, see issue #350. See also 'py_limited_api' in
19
+ setuptools_ext.py.
20
+ */
21
+ #if !defined(_CFFI_USE_EMBEDDING) && !defined(Py_LIMITED_API)
22
+ # include <pyconfig.h>
23
+ # if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG)
24
+ # define Py_LIMITED_API
25
+ # endif
26
+ #endif
27
+
28
+ #include <Python.h>
29
+ #ifdef __cplusplus
30
+ extern "C" {
31
+ #endif
32
+ #include <stddef.h>
33
+
34
+ /* This part is from file 'cffi/parse_c_type.h'. It is copied at the
35
+ beginning of C sources generated by CFFI's ffi.set_source(). */
36
+
37
+ typedef void *_cffi_opcode_t;
38
+
39
+ #define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8))
40
+ #define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode)
41
+ #define _CFFI_GETARG(cffi_opcode) (((intptr_t)cffi_opcode) >> 8)
42
+
43
+ #define _CFFI_OP_PRIMITIVE 1
44
+ #define _CFFI_OP_POINTER 3
45
+ #define _CFFI_OP_ARRAY 5
46
+ #define _CFFI_OP_OPEN_ARRAY 7
47
+ #define _CFFI_OP_STRUCT_UNION 9
48
+ #define _CFFI_OP_ENUM 11
49
+ #define _CFFI_OP_FUNCTION 13
50
+ #define _CFFI_OP_FUNCTION_END 15
51
+ #define _CFFI_OP_NOOP 17
52
+ #define _CFFI_OP_BITFIELD 19
53
+ #define _CFFI_OP_TYPENAME 21
54
+ #define _CFFI_OP_CPYTHON_BLTN_V 23 // varargs
55
+ #define _CFFI_OP_CPYTHON_BLTN_N 25 // noargs
56
+ #define _CFFI_OP_CPYTHON_BLTN_O 27 // O (i.e. a single arg)
57
+ #define _CFFI_OP_CONSTANT 29
58
+ #define _CFFI_OP_CONSTANT_INT 31
59
+ #define _CFFI_OP_GLOBAL_VAR 33
60
+ #define _CFFI_OP_DLOPEN_FUNC 35
61
+ #define _CFFI_OP_DLOPEN_CONST 37
62
+ #define _CFFI_OP_GLOBAL_VAR_F 39
63
+ #define _CFFI_OP_EXTERN_PYTHON 41
64
+
65
+ #define _CFFI_PRIM_VOID 0
66
+ #define _CFFI_PRIM_BOOL 1
67
+ #define _CFFI_PRIM_CHAR 2
68
+ #define _CFFI_PRIM_SCHAR 3
69
+ #define _CFFI_PRIM_UCHAR 4
70
+ #define _CFFI_PRIM_SHORT 5
71
+ #define _CFFI_PRIM_USHORT 6
72
+ #define _CFFI_PRIM_INT 7
73
+ #define _CFFI_PRIM_UINT 8
74
+ #define _CFFI_PRIM_LONG 9
75
+ #define _CFFI_PRIM_ULONG 10
76
+ #define _CFFI_PRIM_LONGLONG 11
77
+ #define _CFFI_PRIM_ULONGLONG 12
78
+ #define _CFFI_PRIM_FLOAT 13
79
+ #define _CFFI_PRIM_DOUBLE 14
80
+ #define _CFFI_PRIM_LONGDOUBLE 15
81
+
82
+ #define _CFFI_PRIM_WCHAR 16
83
+ #define _CFFI_PRIM_INT8 17
84
+ #define _CFFI_PRIM_UINT8 18
85
+ #define _CFFI_PRIM_INT16 19
86
+ #define _CFFI_PRIM_UINT16 20
87
+ #define _CFFI_PRIM_INT32 21
88
+ #define _CFFI_PRIM_UINT32 22
89
+ #define _CFFI_PRIM_INT64 23
90
+ #define _CFFI_PRIM_UINT64 24
91
+ #define _CFFI_PRIM_INTPTR 25
92
+ #define _CFFI_PRIM_UINTPTR 26
93
+ #define _CFFI_PRIM_PTRDIFF 27
94
+ #define _CFFI_PRIM_SIZE 28
95
+ #define _CFFI_PRIM_SSIZE 29
96
+ #define _CFFI_PRIM_INT_LEAST8 30
97
+ #define _CFFI_PRIM_UINT_LEAST8 31
98
+ #define _CFFI_PRIM_INT_LEAST16 32
99
+ #define _CFFI_PRIM_UINT_LEAST16 33
100
+ #define _CFFI_PRIM_INT_LEAST32 34
101
+ #define _CFFI_PRIM_UINT_LEAST32 35
102
+ #define _CFFI_PRIM_INT_LEAST64 36
103
+ #define _CFFI_PRIM_UINT_LEAST64 37
104
+ #define _CFFI_PRIM_INT_FAST8 38
105
+ #define _CFFI_PRIM_UINT_FAST8 39
106
+ #define _CFFI_PRIM_INT_FAST16 40
107
+ #define _CFFI_PRIM_UINT_FAST16 41
108
+ #define _CFFI_PRIM_INT_FAST32 42
109
+ #define _CFFI_PRIM_UINT_FAST32 43
110
+ #define _CFFI_PRIM_INT_FAST64 44
111
+ #define _CFFI_PRIM_UINT_FAST64 45
112
+ #define _CFFI_PRIM_INTMAX 46
113
+ #define _CFFI_PRIM_UINTMAX 47
114
+ #define _CFFI_PRIM_FLOATCOMPLEX 48
115
+ #define _CFFI_PRIM_DOUBLECOMPLEX 49
116
+ #define _CFFI_PRIM_CHAR16 50
117
+ #define _CFFI_PRIM_CHAR32 51
118
+
119
+ #define _CFFI__NUM_PRIM 52
120
+ #define _CFFI__UNKNOWN_PRIM (-1)
121
+ #define _CFFI__UNKNOWN_FLOAT_PRIM (-2)
122
+ #define _CFFI__UNKNOWN_LONG_DOUBLE (-3)
123
+
124
+ #define _CFFI__IO_FILE_STRUCT (-1)
125
+
126
+
127
+ struct _cffi_global_s {
128
+ const char *name;
129
+ void *address;
130
+ _cffi_opcode_t type_op;
131
+ void *size_or_direct_fn; // OP_GLOBAL_VAR: size, or 0 if unknown
132
+ // OP_CPYTHON_BLTN_*: addr of direct function
133
+ };
134
+
135
+ struct _cffi_getconst_s {
136
+ unsigned long long value;
137
+ const struct _cffi_type_context_s *ctx;
138
+ int gindex;
139
+ };
140
+
141
+ struct _cffi_struct_union_s {
142
+ const char *name;
143
+ int type_index; // -> _cffi_types, on a OP_STRUCT_UNION
144
+ int flags; // _CFFI_F_* flags below
145
+ size_t size;
146
+ int alignment;
147
+ int first_field_index; // -> _cffi_fields array
148
+ int num_fields;
149
+ };
150
+ #define _CFFI_F_UNION 0x01 // is a union, not a struct
151
+ #define _CFFI_F_CHECK_FIELDS 0x02 // complain if fields are not in the
152
+ // "standard layout" or if some are missing
153
+ #define _CFFI_F_PACKED 0x04 // for CHECK_FIELDS, assume a packed struct
154
+ #define _CFFI_F_EXTERNAL 0x08 // in some other ffi.include()
155
+ #define _CFFI_F_OPAQUE 0x10 // opaque
156
+
157
+ struct _cffi_field_s {
158
+ const char *name;
159
+ size_t field_offset;
160
+ size_t field_size;
161
+ _cffi_opcode_t field_type_op;
162
+ };
163
+
164
+ struct _cffi_enum_s {
165
+ const char *name;
166
+ int type_index; // -> _cffi_types, on a OP_ENUM
167
+ int type_prim; // _CFFI_PRIM_xxx
168
+ const char *enumerators; // comma-delimited string
169
+ };
170
+
171
+ struct _cffi_typename_s {
172
+ const char *name;
173
+ int type_index; /* if opaque, points to a possibly artificial
174
+ OP_STRUCT which is itself opaque */
175
+ };
176
+
177
+ struct _cffi_type_context_s {
178
+ _cffi_opcode_t *types;
179
+ const struct _cffi_global_s *globals;
180
+ const struct _cffi_field_s *fields;
181
+ const struct _cffi_struct_union_s *struct_unions;
182
+ const struct _cffi_enum_s *enums;
183
+ const struct _cffi_typename_s *typenames;
184
+ int num_globals;
185
+ int num_struct_unions;
186
+ int num_enums;
187
+ int num_typenames;
188
+ const char *const *includes;
189
+ int num_types;
190
+ int flags; /* future extension */
191
+ };
192
+
193
+ struct _cffi_parse_info_s {
194
+ const struct _cffi_type_context_s *ctx;
195
+ _cffi_opcode_t *output;
196
+ unsigned int output_size;
197
+ size_t error_location;
198
+ const char *error_message;
199
+ };
200
+
201
+ struct _cffi_externpy_s {
202
+ const char *name;
203
+ size_t size_of_result;
204
+ void *reserved1, *reserved2;
205
+ };
206
+
207
+ #ifdef _CFFI_INTERNAL
208
+ static int parse_c_type(struct _cffi_parse_info_s *info, const char *input);
209
+ static int search_in_globals(const struct _cffi_type_context_s *ctx,
210
+ const char *search, size_t search_len);
211
+ static int search_in_struct_unions(const struct _cffi_type_context_s *ctx,
212
+ const char *search, size_t search_len);
213
+ #endif
214
+
215
+ /* this block of #ifs should be kept exactly identical between
216
+ c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py
217
+ and cffi/_cffi_include.h */
218
+ #if defined(_MSC_VER)
219
+ # include <malloc.h> /* for alloca() */
220
+ # if _MSC_VER < 1600 /* MSVC < 2010 */
221
+ typedef __int8 int8_t;
222
+ typedef __int16 int16_t;
223
+ typedef __int32 int32_t;
224
+ typedef __int64 int64_t;
225
+ typedef unsigned __int8 uint8_t;
226
+ typedef unsigned __int16 uint16_t;
227
+ typedef unsigned __int32 uint32_t;
228
+ typedef unsigned __int64 uint64_t;
229
+ typedef __int8 int_least8_t;
230
+ typedef __int16 int_least16_t;
231
+ typedef __int32 int_least32_t;
232
+ typedef __int64 int_least64_t;
233
+ typedef unsigned __int8 uint_least8_t;
234
+ typedef unsigned __int16 uint_least16_t;
235
+ typedef unsigned __int32 uint_least32_t;
236
+ typedef unsigned __int64 uint_least64_t;
237
+ typedef __int8 int_fast8_t;
238
+ typedef __int16 int_fast16_t;
239
+ typedef __int32 int_fast32_t;
240
+ typedef __int64 int_fast64_t;
241
+ typedef unsigned __int8 uint_fast8_t;
242
+ typedef unsigned __int16 uint_fast16_t;
243
+ typedef unsigned __int32 uint_fast32_t;
244
+ typedef unsigned __int64 uint_fast64_t;
245
+ typedef __int64 intmax_t;
246
+ typedef unsigned __int64 uintmax_t;
247
+ # else
248
+ # include <stdint.h>
249
+ # endif
250
+ # if _MSC_VER < 1800 /* MSVC < 2013 */
251
+ # ifndef __cplusplus
252
+ typedef unsigned char _Bool;
253
+ # endif
254
+ # endif
255
+ #else
256
+ # include <stdint.h>
257
+ # if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
258
+ # include <alloca.h>
259
+ # endif
260
+ #endif
261
+
262
+ #ifdef __GNUC__
263
+ # define _CFFI_UNUSED_FN __attribute__((unused))
264
+ #else
265
+ # define _CFFI_UNUSED_FN /* nothing */
266
+ #endif
267
+
268
+ #ifdef __cplusplus
269
+ # ifndef _Bool
270
+ typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */
271
+ # endif
272
+ #endif
273
+
274
+ /********** CPython-specific section **********/
275
+ #ifndef PYPY_VERSION
276
+
277
+
278
+ #if PY_MAJOR_VERSION >= 3
279
+ # define PyInt_FromLong PyLong_FromLong
280
+ #endif
281
+
282
+ #define _cffi_from_c_double PyFloat_FromDouble
283
+ #define _cffi_from_c_float PyFloat_FromDouble
284
+ #define _cffi_from_c_long PyInt_FromLong
285
+ #define _cffi_from_c_ulong PyLong_FromUnsignedLong
286
+ #define _cffi_from_c_longlong PyLong_FromLongLong
287
+ #define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong
288
+ #define _cffi_from_c__Bool PyBool_FromLong
289
+
290
+ #define _cffi_to_c_double PyFloat_AsDouble
291
+ #define _cffi_to_c_float PyFloat_AsDouble
292
+
293
+ #define _cffi_from_c_int(x, type) \
294
+ (((type)-1) > 0 ? /* unsigned */ \
295
+ (sizeof(type) < sizeof(long) ? \
296
+ PyInt_FromLong((long)x) : \
297
+ sizeof(type) == sizeof(long) ? \
298
+ PyLong_FromUnsignedLong((unsigned long)x) : \
299
+ PyLong_FromUnsignedLongLong((unsigned long long)x)) : \
300
+ (sizeof(type) <= sizeof(long) ? \
301
+ PyInt_FromLong((long)x) : \
302
+ PyLong_FromLongLong((long long)x)))
303
+
304
+ #define _cffi_to_c_int(o, type) \
305
+ ((type)( \
306
+ sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \
307
+ : (type)_cffi_to_c_i8(o)) : \
308
+ sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \
309
+ : (type)_cffi_to_c_i16(o)) : \
310
+ sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \
311
+ : (type)_cffi_to_c_i32(o)) : \
312
+ sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \
313
+ : (type)_cffi_to_c_i64(o)) : \
314
+ (Py_FatalError("unsupported size for type " #type), (type)0)))
315
+
316
+ #define _cffi_to_c_i8 \
317
+ ((int(*)(PyObject *))_cffi_exports[1])
318
+ #define _cffi_to_c_u8 \
319
+ ((int(*)(PyObject *))_cffi_exports[2])
320
+ #define _cffi_to_c_i16 \
321
+ ((int(*)(PyObject *))_cffi_exports[3])
322
+ #define _cffi_to_c_u16 \
323
+ ((int(*)(PyObject *))_cffi_exports[4])
324
+ #define _cffi_to_c_i32 \
325
+ ((int(*)(PyObject *))_cffi_exports[5])
326
+ #define _cffi_to_c_u32 \
327
+ ((unsigned int(*)(PyObject *))_cffi_exports[6])
328
+ #define _cffi_to_c_i64 \
329
+ ((long long(*)(PyObject *))_cffi_exports[7])
330
+ #define _cffi_to_c_u64 \
331
+ ((unsigned long long(*)(PyObject *))_cffi_exports[8])
332
+ #define _cffi_to_c_char \
333
+ ((int(*)(PyObject *))_cffi_exports[9])
334
+ #define _cffi_from_c_pointer \
335
+ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[10])
336
+ #define _cffi_to_c_pointer \
337
+ ((char *(*)(PyObject *, struct _cffi_ctypedescr *))_cffi_exports[11])
338
+ #define _cffi_get_struct_layout \
339
+ not used any more
340
+ #define _cffi_restore_errno \
341
+ ((void(*)(void))_cffi_exports[13])
342
+ #define _cffi_save_errno \
343
+ ((void(*)(void))_cffi_exports[14])
344
+ #define _cffi_from_c_char \
345
+ ((PyObject *(*)(char))_cffi_exports[15])
346
+ #define _cffi_from_c_deref \
347
+ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[16])
348
+ #define _cffi_to_c \
349
+ ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[17])
350
+ #define _cffi_from_c_struct \
351
+ ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[18])
352
+ #define _cffi_to_c_wchar_t \
353
+ ((_cffi_wchar_t(*)(PyObject *))_cffi_exports[19])
354
+ #define _cffi_from_c_wchar_t \
355
+ ((PyObject *(*)(_cffi_wchar_t))_cffi_exports[20])
356
+ #define _cffi_to_c_long_double \
357
+ ((long double(*)(PyObject *))_cffi_exports[21])
358
+ #define _cffi_to_c__Bool \
359
+ ((_Bool(*)(PyObject *))_cffi_exports[22])
360
+ #define _cffi_prepare_pointer_call_argument \
361
+ ((Py_ssize_t(*)(struct _cffi_ctypedescr *, \
362
+ PyObject *, char **))_cffi_exports[23])
363
+ #define _cffi_convert_array_from_object \
364
+ ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[24])
365
+ #define _CFFI_CPIDX 25
366
+ #define _cffi_call_python \
367
+ ((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX])
368
+ #define _cffi_to_c_wchar3216_t \
369
+ ((int(*)(PyObject *))_cffi_exports[26])
370
+ #define _cffi_from_c_wchar3216_t \
371
+ ((PyObject *(*)(int))_cffi_exports[27])
372
+ #define _CFFI_NUM_EXPORTS 28
373
+
374
+ struct _cffi_ctypedescr;
375
+
376
+ static void *_cffi_exports[_CFFI_NUM_EXPORTS];
377
+
378
+ #define _cffi_type(index) ( \
379
+ assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \
380
+ (struct _cffi_ctypedescr *)_cffi_types[index])
381
+
382
+ static PyObject *_cffi_init(const char *module_name, Py_ssize_t version,
383
+ const struct _cffi_type_context_s *ctx)
384
+ {
385
+ PyObject *module, *o_arg, *new_module;
386
+ void *raw[] = {
387
+ (void *)module_name,
388
+ (void *)version,
389
+ (void *)_cffi_exports,
390
+ (void *)ctx,
391
+ };
392
+
393
+ module = PyImport_ImportModule("_cffi_backend");
394
+ if (module == NULL)
395
+ goto failure;
396
+
397
+ o_arg = PyLong_FromVoidPtr((void *)raw);
398
+ if (o_arg == NULL)
399
+ goto failure;
400
+
401
+ new_module = PyObject_CallMethod(
402
+ module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg);
403
+
404
+ Py_DECREF(o_arg);
405
+ Py_DECREF(module);
406
+ return new_module;
407
+
408
+ failure:
409
+ Py_XDECREF(module);
410
+ return NULL;
411
+ }
412
+
413
+
414
+ #ifdef HAVE_WCHAR_H
415
+ typedef wchar_t _cffi_wchar_t;
416
+ #else
417
+ typedef uint16_t _cffi_wchar_t; /* same random pick as _cffi_backend.c */
418
+ #endif
419
+
420
+ _CFFI_UNUSED_FN static uint16_t _cffi_to_c_char16_t(PyObject *o)
421
+ {
422
+ if (sizeof(_cffi_wchar_t) == 2)
423
+ return (uint16_t)_cffi_to_c_wchar_t(o);
424
+ else
425
+ return (uint16_t)_cffi_to_c_wchar3216_t(o);
426
+ }
427
+
428
+ _CFFI_UNUSED_FN static PyObject *_cffi_from_c_char16_t(uint16_t x)
429
+ {
430
+ if (sizeof(_cffi_wchar_t) == 2)
431
+ return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
432
+ else
433
+ return _cffi_from_c_wchar3216_t((int)x);
434
+ }
435
+
436
+ _CFFI_UNUSED_FN static int _cffi_to_c_char32_t(PyObject *o)
437
+ {
438
+ if (sizeof(_cffi_wchar_t) == 4)
439
+ return (int)_cffi_to_c_wchar_t(o);
440
+ else
441
+ return (int)_cffi_to_c_wchar3216_t(o);
442
+ }
443
+
444
+ _CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(int x)
445
+ {
446
+ if (sizeof(_cffi_wchar_t) == 4)
447
+ return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
448
+ else
449
+ return _cffi_from_c_wchar3216_t(x);
450
+ }
451
+
452
+
453
+ /********** end CPython-specific section **********/
454
+ #else
455
+ _CFFI_UNUSED_FN
456
+ static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *);
457
+ # define _cffi_call_python _cffi_call_python_org
458
+ #endif
459
+
460
+
461
+ #define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0]))
462
+
463
+ #define _cffi_prim_int(size, sign) \
464
+ ((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \
465
+ (size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \
466
+ (size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \
467
+ (size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \
468
+ _CFFI__UNKNOWN_PRIM)
469
+
470
+ #define _cffi_prim_float(size) \
471
+ ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \
472
+ (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \
473
+ (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \
474
+ _CFFI__UNKNOWN_FLOAT_PRIM)
475
+
476
+ #define _cffi_check_int(got, got_nonpos, expected) \
477
+ ((got_nonpos) == (expected <= 0) && \
478
+ (got) == (unsigned long long)expected)
479
+
480
+ #ifdef MS_WIN32
481
+ # define _cffi_stdcall __stdcall
482
+ #else
483
+ # define _cffi_stdcall /* nothing */
484
+ #endif
485
+
486
+ #ifdef __cplusplus
487
+ }
488
+ #endif
489
+
490
+ /************************************************************/
491
+
492
+ /* dbc2dbf.c
493
+
494
+ Copyright (C) 2016 Daniela Petruzalek
495
+ Version 1.0, 22 May 2016
496
+
497
+ This program is free software: you can redistribute it and/or modify
498
+ it under the terms of the GNU Affero General Public License as published
499
+ by the Free Software Foundation, either version 3 of the License, or
500
+ (at your option) any later version.
501
+
502
+ This program is distributed in the hope that it will be useful,
503
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
504
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
505
+ GNU Affero General Public License for more details.
506
+
507
+ You should have received a copy of the GNU Affero General Public License
508
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
509
+
510
+ */
511
+
512
+ /*
513
+ Author Notes
514
+ ============
515
+
516
+ This program decompresses .dbc files to .dbf. This code is based on the work
517
+ of Mark Adler <madler@alumni.caltech.edu> (zlib/blast) and Pablo Fonseca
518
+ (https://github.com/eaglebh/blast-dbf).
519
+ */
520
+
521
+ #include <stdio.h>
522
+ #include <stdlib.h>
523
+ #include <unistd.h>
524
+ #include <errno.h>
525
+ #include <string.h>
526
+ #include <stdint.h>
527
+ // #include <R.h>
528
+
529
+ #include "blast.h"
530
+
531
+ #define CHUNK 4096
532
+
533
+ /* Input file helper function */
534
+ static unsigned inf(void *how, unsigned char **buf)
535
+ {
536
+ static unsigned char hold[CHUNK];
537
+
538
+ *buf = hold;
539
+ return fread(hold, 1, CHUNK, (FILE *)how);
540
+ }
541
+
542
+ /* Output file helper function */
543
+ static int outf(void *how, unsigned char *buf, unsigned len)
544
+ {
545
+ return fwrite(buf, 1, len, (FILE *)how) != len;
546
+ }
547
+
548
+ /*
549
+ dbc2dbf(char** input_file, char** output_file)
550
+ This function decompresses a given .dbc input file into the corresponding .dbf.
551
+
552
+ Please provide fully qualified names, including file extension.
553
+ */
554
+ void dbc2dbf(char** input_file, char** output_file) {
555
+ FILE *input = 0, *output = 0;
556
+ int ret = 0;
557
+ unsigned char rawHeader[2];
558
+ uint16_t header = 0;
559
+
560
+ /* Open input file */
561
+ input = fopen(input_file[0], "rb");
562
+ if(input == NULL) {
563
+ printf("Error reading input file %s: %s", input_file[0], strerror(errno));
564
+ perror("");
565
+ return;
566
+ }
567
+
568
+ /* Open output file */
569
+ output = fopen(output_file[0], "wb");
570
+ if(output == NULL) {
571
+ printf("Error reading output file %s: %s", output_file[0], strerror(errno));
572
+ perror("");
573
+ return;
574
+ }
575
+
576
+ /* Process file header - skip 8 bytes */
577
+ if( fseek(input, 8, SEEK_SET) ) {
578
+ printf("Error processing input file %s: %s", input_file[0], strerror(errno));
579
+ perror("");
580
+ return;
581
+ }
582
+
583
+ /* Reads two bytes from the header = header size */
584
+ ret = fread(rawHeader, 2, 1, input);
585
+ if( ferror(input) ) {
586
+ printf("Error reading input file %s: %s", input_file[0], strerror(errno));
587
+ perror("");
588
+ return;
589
+ }
590
+
591
+ /* Platform independent code (header is stored in little endian format) */
592
+ header = rawHeader[0] + (rawHeader[1] << 8);
593
+
594
+ /* Reset file pointer */
595
+ rewind(input);
596
+
597
+ /* Copy file header from input to output */
598
+ unsigned char buf[header];
599
+
600
+ ret = fread(buf, 1, header, input);
601
+ if( ferror(input) ) {
602
+ printf("Error reading input file %s: %s", input_file[0], strerror(errno));
603
+ perror("");
604
+ return;
605
+ }
606
+
607
+ ret = fwrite(buf, 1, header, output);
608
+ if( ferror(output) ) {
609
+ printf("Error writing output file %s: %s", output_file[0], strerror(errno));
610
+ perror("");
611
+ return;
612
+ }
613
+
614
+ /* Jump to the data (Skip CRC32) */
615
+ if( fseek(input, header + 4, SEEK_SET) ) {
616
+ printf("Error processing input file %s: %s", input_file[0], strerror(errno));
617
+ perror("");
618
+ return;
619
+ }
620
+
621
+ /* decompress */
622
+ ret = blast(inf, input, outf, output);
623
+ if( ret ) {
624
+ printf("blast printf code: %d", ret);
625
+ perror("");
626
+ }
627
+
628
+ /* see if there are any leftover bytes */
629
+ int n = 0;
630
+ while (fgetc(input) != EOF) n++;
631
+ if (n) {
632
+ printf("blast warning: %d unused bytes of input\n", n);
633
+ perror("");
634
+ }
635
+
636
+ fclose(input);
637
+ fclose(output);
638
+ }
639
+
640
+
641
+ /************************************************************/
642
+
643
+ static void *_cffi_types[] = {
644
+ /* 0 */ _CFFI_OP(_CFFI_OP_FUNCTION, 21), // int()(unsigned int(*)(void *, unsigned char * *), void *, int(*)(void *, unsigned char *, unsigned int), void *)
645
+ /* 1 */ _CFFI_OP(_CFFI_OP_POINTER, 11), // unsigned int(*)(void *, unsigned char * *)
646
+ /* 2 */ _CFFI_OP(_CFFI_OP_POINTER, 23), // void *
647
+ /* 3 */ _CFFI_OP(_CFFI_OP_POINTER, 6), // int(*)(void *, unsigned char *, unsigned int)
648
+ /* 4 */ _CFFI_OP(_CFFI_OP_NOOP, 2),
649
+ /* 5 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0),
650
+ /* 6 */ _CFFI_OP(_CFFI_OP_FUNCTION, 21), // int()(void *, unsigned char *, unsigned int)
651
+ /* 7 */ _CFFI_OP(_CFFI_OP_NOOP, 2),
652
+ /* 8 */ _CFFI_OP(_CFFI_OP_POINTER, 22), // unsigned char *
653
+ /* 9 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 8), // unsigned int
654
+ /* 10 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0),
655
+ /* 11 */ _CFFI_OP(_CFFI_OP_FUNCTION, 9), // unsigned int()(void *, unsigned char * *)
656
+ /* 12 */ _CFFI_OP(_CFFI_OP_NOOP, 2),
657
+ /* 13 */ _CFFI_OP(_CFFI_OP_POINTER, 8), // unsigned char * *
658
+ /* 14 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0),
659
+ /* 15 */ _CFFI_OP(_CFFI_OP_FUNCTION, 23), // void()(char * *, char * *)
660
+ /* 16 */ _CFFI_OP(_CFFI_OP_POINTER, 19), // char * *
661
+ /* 17 */ _CFFI_OP(_CFFI_OP_NOOP, 16),
662
+ /* 18 */ _CFFI_OP(_CFFI_OP_FUNCTION_END, 0),
663
+ /* 19 */ _CFFI_OP(_CFFI_OP_POINTER, 20), // char *
664
+ /* 20 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 2), // char
665
+ /* 21 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 7), // int
666
+ /* 22 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 4), // unsigned char
667
+ /* 23 */ _CFFI_OP(_CFFI_OP_PRIMITIVE, 0), // void
668
+ };
669
+
670
+ static int _cffi_d_blast(unsigned int(* x0)(void *, unsigned char * *), void * x1, int(* x2)(void *, unsigned char *, unsigned int), void * x3)
671
+ {
672
+ return blast(x0, x1, x2, x3);
673
+ }
674
+ #ifndef PYPY_VERSION
675
+ static PyObject *
676
+ _cffi_f_blast(PyObject *self, PyObject *args)
677
+ {
678
+ unsigned int(* x0)(void *, unsigned char * *);
679
+ void * x1;
680
+ int(* x2)(void *, unsigned char *, unsigned int);
681
+ void * x3;
682
+ Py_ssize_t datasize;
683
+ int result;
684
+ PyObject *arg0;
685
+ PyObject *arg1;
686
+ PyObject *arg2;
687
+ PyObject *arg3;
688
+
689
+ if (!PyArg_UnpackTuple(args, "blast", 4, 4, &arg0, &arg1, &arg2, &arg3))
690
+ return NULL;
691
+
692
+ x0 = (unsigned int(*)(void *, unsigned char * *))_cffi_to_c_pointer(arg0, _cffi_type(1));
693
+ if (x0 == (unsigned int(*)(void *, unsigned char * *))NULL && PyErr_Occurred())
694
+ return NULL;
695
+
696
+ datasize = _cffi_prepare_pointer_call_argument(
697
+ _cffi_type(2), arg1, (char **)&x1);
698
+ if (datasize != 0) {
699
+ if (datasize < 0)
700
+ return NULL;
701
+ x1 = (void *)alloca((size_t)datasize);
702
+ memset((void *)x1, 0, (size_t)datasize);
703
+ if (_cffi_convert_array_from_object((char *)x1, _cffi_type(2), arg1) < 0)
704
+ return NULL;
705
+ }
706
+
707
+ x2 = (int(*)(void *, unsigned char *, unsigned int))_cffi_to_c_pointer(arg2, _cffi_type(3));
708
+ if (x2 == (int(*)(void *, unsigned char *, unsigned int))NULL && PyErr_Occurred())
709
+ return NULL;
710
+
711
+ datasize = _cffi_prepare_pointer_call_argument(
712
+ _cffi_type(2), arg3, (char **)&x3);
713
+ if (datasize != 0) {
714
+ if (datasize < 0)
715
+ return NULL;
716
+ x3 = (void *)alloca((size_t)datasize);
717
+ memset((void *)x3, 0, (size_t)datasize);
718
+ if (_cffi_convert_array_from_object((char *)x3, _cffi_type(2), arg3) < 0)
719
+ return NULL;
720
+ }
721
+
722
+ Py_BEGIN_ALLOW_THREADS
723
+ _cffi_restore_errno();
724
+ { result = blast(x0, x1, x2, x3); }
725
+ _cffi_save_errno();
726
+ Py_END_ALLOW_THREADS
727
+
728
+ (void)self; /* unused */
729
+ return _cffi_from_c_int(result, int);
730
+ }
731
+ #else
732
+ # define _cffi_f_blast _cffi_d_blast
733
+ #endif
734
+
735
+ static void _cffi_d_dbc2dbf(char * * x0, char * * x1)
736
+ {
737
+ dbc2dbf(x0, x1);
738
+ }
739
+ #ifndef PYPY_VERSION
740
+ static PyObject *
741
+ _cffi_f_dbc2dbf(PyObject *self, PyObject *args)
742
+ {
743
+ char * * x0;
744
+ char * * x1;
745
+ Py_ssize_t datasize;
746
+ PyObject *arg0;
747
+ PyObject *arg1;
748
+
749
+ if (!PyArg_UnpackTuple(args, "dbc2dbf", 2, 2, &arg0, &arg1))
750
+ return NULL;
751
+
752
+ datasize = _cffi_prepare_pointer_call_argument(
753
+ _cffi_type(16), arg0, (char **)&x0);
754
+ if (datasize != 0) {
755
+ if (datasize < 0)
756
+ return NULL;
757
+ x0 = (char * *)alloca((size_t)datasize);
758
+ memset((void *)x0, 0, (size_t)datasize);
759
+ if (_cffi_convert_array_from_object((char *)x0, _cffi_type(16), arg0) < 0)
760
+ return NULL;
761
+ }
762
+
763
+ datasize = _cffi_prepare_pointer_call_argument(
764
+ _cffi_type(16), arg1, (char **)&x1);
765
+ if (datasize != 0) {
766
+ if (datasize < 0)
767
+ return NULL;
768
+ x1 = (char * *)alloca((size_t)datasize);
769
+ memset((void *)x1, 0, (size_t)datasize);
770
+ if (_cffi_convert_array_from_object((char *)x1, _cffi_type(16), arg1) < 0)
771
+ return NULL;
772
+ }
773
+
774
+ Py_BEGIN_ALLOW_THREADS
775
+ _cffi_restore_errno();
776
+ { dbc2dbf(x0, x1); }
777
+ _cffi_save_errno();
778
+ Py_END_ALLOW_THREADS
779
+
780
+ (void)self; /* unused */
781
+ Py_INCREF(Py_None);
782
+ return Py_None;
783
+ }
784
+ #else
785
+ # define _cffi_f_dbc2dbf _cffi_d_dbc2dbf
786
+ #endif
787
+
788
+ static unsigned int _cffi_d_inf(void * x0, unsigned char * * x1)
789
+ {
790
+ return inf(x0, x1);
791
+ }
792
+ #ifndef PYPY_VERSION
793
+ static PyObject *
794
+ _cffi_f_inf(PyObject *self, PyObject *args)
795
+ {
796
+ void * x0;
797
+ unsigned char * * x1;
798
+ Py_ssize_t datasize;
799
+ unsigned int result;
800
+ PyObject *arg0;
801
+ PyObject *arg1;
802
+
803
+ if (!PyArg_UnpackTuple(args, "inf", 2, 2, &arg0, &arg1))
804
+ return NULL;
805
+
806
+ datasize = _cffi_prepare_pointer_call_argument(
807
+ _cffi_type(2), arg0, (char **)&x0);
808
+ if (datasize != 0) {
809
+ if (datasize < 0)
810
+ return NULL;
811
+ x0 = (void *)alloca((size_t)datasize);
812
+ memset((void *)x0, 0, (size_t)datasize);
813
+ if (_cffi_convert_array_from_object((char *)x0, _cffi_type(2), arg0) < 0)
814
+ return NULL;
815
+ }
816
+
817
+ datasize = _cffi_prepare_pointer_call_argument(
818
+ _cffi_type(13), arg1, (char **)&x1);
819
+ if (datasize != 0) {
820
+ if (datasize < 0)
821
+ return NULL;
822
+ x1 = (unsigned char * *)alloca((size_t)datasize);
823
+ memset((void *)x1, 0, (size_t)datasize);
824
+ if (_cffi_convert_array_from_object((char *)x1, _cffi_type(13), arg1) < 0)
825
+ return NULL;
826
+ }
827
+
828
+ Py_BEGIN_ALLOW_THREADS
829
+ _cffi_restore_errno();
830
+ { result = inf(x0, x1); }
831
+ _cffi_save_errno();
832
+ Py_END_ALLOW_THREADS
833
+
834
+ (void)self; /* unused */
835
+ return _cffi_from_c_int(result, unsigned int);
836
+ }
837
+ #else
838
+ # define _cffi_f_inf _cffi_d_inf
839
+ #endif
840
+
841
+ static int _cffi_d_outf(void * x0, unsigned char * x1, unsigned int x2)
842
+ {
843
+ return outf(x0, x1, x2);
844
+ }
845
+ #ifndef PYPY_VERSION
846
+ static PyObject *
847
+ _cffi_f_outf(PyObject *self, PyObject *args)
848
+ {
849
+ void * x0;
850
+ unsigned char * x1;
851
+ unsigned int x2;
852
+ Py_ssize_t datasize;
853
+ int result;
854
+ PyObject *arg0;
855
+ PyObject *arg1;
856
+ PyObject *arg2;
857
+
858
+ if (!PyArg_UnpackTuple(args, "outf", 3, 3, &arg0, &arg1, &arg2))
859
+ return NULL;
860
+
861
+ datasize = _cffi_prepare_pointer_call_argument(
862
+ _cffi_type(2), arg0, (char **)&x0);
863
+ if (datasize != 0) {
864
+ if (datasize < 0)
865
+ return NULL;
866
+ x0 = (void *)alloca((size_t)datasize);
867
+ memset((void *)x0, 0, (size_t)datasize);
868
+ if (_cffi_convert_array_from_object((char *)x0, _cffi_type(2), arg0) < 0)
869
+ return NULL;
870
+ }
871
+
872
+ datasize = _cffi_prepare_pointer_call_argument(
873
+ _cffi_type(8), arg1, (char **)&x1);
874
+ if (datasize != 0) {
875
+ if (datasize < 0)
876
+ return NULL;
877
+ x1 = (unsigned char *)alloca((size_t)datasize);
878
+ memset((void *)x1, 0, (size_t)datasize);
879
+ if (_cffi_convert_array_from_object((char *)x1, _cffi_type(8), arg1) < 0)
880
+ return NULL;
881
+ }
882
+
883
+ x2 = _cffi_to_c_int(arg2, unsigned int);
884
+ if (x2 == (unsigned int)-1 && PyErr_Occurred())
885
+ return NULL;
886
+
887
+ Py_BEGIN_ALLOW_THREADS
888
+ _cffi_restore_errno();
889
+ { result = outf(x0, x1, x2); }
890
+ _cffi_save_errno();
891
+ Py_END_ALLOW_THREADS
892
+
893
+ (void)self; /* unused */
894
+ return _cffi_from_c_int(result, int);
895
+ }
896
+ #else
897
+ # define _cffi_f_outf _cffi_d_outf
898
+ #endif
899
+
900
+ static const struct _cffi_global_s _cffi_globals[] = {
901
+ { "blast", (void *)_cffi_f_blast, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 0), (void *)_cffi_d_blast },
902
+ { "dbc2dbf", (void *)_cffi_f_dbc2dbf, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 15), (void *)_cffi_d_dbc2dbf },
903
+ { "inf", (void *)_cffi_f_inf, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 11), (void *)_cffi_d_inf },
904
+ { "outf", (void *)_cffi_f_outf, _CFFI_OP(_CFFI_OP_CPYTHON_BLTN_V, 6), (void *)_cffi_d_outf },
905
+ };
906
+
907
+ static const struct _cffi_typename_s _cffi_typenames[] = {
908
+ { "blast_in", 1 },
909
+ { "blast_out", 3 },
910
+ };
911
+
912
+ static const struct _cffi_type_context_s _cffi_type_context = {
913
+ _cffi_types,
914
+ _cffi_globals,
915
+ NULL, /* no fields */
916
+ NULL, /* no struct_unions */
917
+ NULL, /* no enums */
918
+ _cffi_typenames,
919
+ 4, /* num_globals */
920
+ 0, /* num_struct_unions */
921
+ 0, /* num_enums */
922
+ 2, /* num_typenames */
923
+ NULL, /* no includes */
924
+ 24, /* num_types */
925
+ 0, /* flags */
926
+ };
927
+
928
+ #ifdef __GNUC__
929
+ # pragma GCC visibility push(default) /* for -fvisibility= */
930
+ #endif
931
+
932
+ #ifdef PYPY_VERSION
933
+ PyMODINIT_FUNC
934
+ _cffi_pypyinit__readdbc(const void *p[])
935
+ {
936
+ p[0] = (const void *)0x2601;
937
+ p[1] = &_cffi_type_context;
938
+ #if PY_MAJOR_VERSION >= 3
939
+ return NULL;
940
+ #endif
941
+ }
942
+ # ifdef _MSC_VER
943
+ PyMODINIT_FUNC
944
+ # if PY_MAJOR_VERSION >= 3
945
+ PyInit__readdbc(void) { return NULL; }
946
+ # else
947
+ init_readdbc(void) { }
948
+ # endif
949
+ # endif
950
+ #elif PY_MAJOR_VERSION >= 3
951
+ PyMODINIT_FUNC
952
+ PyInit__readdbc(void)
953
+ {
954
+ return _cffi_init("_readdbc", 0x2601, &_cffi_type_context);
955
+ }
956
+ #else
957
+ PyMODINIT_FUNC
958
+ init_readdbc(void)
959
+ {
960
+ _cffi_init("_readdbc", 0x2601, &_cffi_type_context);
961
+ }
962
+ #endif
963
+
964
+ #ifdef __GNUC__
965
+ # pragma GCC visibility pop
966
+ #endif