Debian Codegraph @

biosig4c++/python/biosigmodule.h

raw symbols SCIP
1 #ifndef Py_BIOSIGMODULE_H
2 #define Py_BIOSIGMODULE_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 /* Header file for BIOSIGMODULE */
8
9 /* C API functions */
10 #define PyBiosig_Header_NUM 0
11 #define PyBiosig_Header_RETURN int
12 #define PyBiosig_Header_PROTO (const char *filename, char **jsonstr)
13
14 #define PyBiosig_Data_NUM 1
15 #define PyBiosig_Data_RETURN int
16 #define PyBiosig_Data_PROTO (const char *filename, PyArrayObject **data)
17
18 /* Total number of C API pointers */
19 #define PyBiosig_API_pointers 2
20
21
22 #ifdef BIOSIG_MODULE
23 /* This section is used when compiling BIOSIGMODULE.c */
24
25 static PyBiosig_Header_RETURN PyBiosig_Header PyBiosig_Header_PROTO;
26 static PyBiosig_Data_RETURN PyBiosig_Data PyBiosig_Data_PROTO;
27
28 #else
29 /* This section is used in modules that use BIOSIGMODULE's API */
30
31 static void **PyBiosig_API;
32
33 #define PyBiosig_Header (*(PyBiosig_Header_RETURN (*)PyBiosig_Header_PROTO) PyBiosig_API[PyBiosig_Header_NUM])
34 #define PyBiosig_Data (*(PyBiosig_Data_RETURN (*)PyBiosig_Data_PROTO) PyBiosig_API[PyBiosig_Data_NUM])
35
36 /* Return -1 on error, 0 on success.
37 * PyCapsule_Import will set an exception if there's an error.
38 */
39 static int
40 import_biosig(void) {
41 PyBiosig_API = (void **)PyCapsule_Import("biosig._C_API", 0);
42 return (PyBiosig_API != NULL) ? 0 : -1;
43 }
44
45 #endif
46
47 #ifdef __cplusplus
48 }
49 #endif
50
51 #endif /* !defined(Py_BIOSIGMODULE_H) */