-
Notifications
You must be signed in to change notification settings - Fork 5
/
pyrsistence.c
49 lines (41 loc) · 856 Bytes
/
pyrsistence.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* pyrsistence - A Python extension for External Memory Data Structures (EMDs)
* huku <[email protected]>
*
* pyrsistence.c - Python extension entry point.
*/
#include "marshaller.h"
#include "em_dict.h"
#include "em_list.h"
#if PY_MAJOR_VERSION >= 3
static PyModuleDef pyrsistence_module =
{
PyModuleDef_HEAD_INIT,
"pyrsistence",
NULL,
-1,
NULL,
NULL,
NULL,
NULL,
NULL
};
#endif
#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_pyrsistence(void)
#else
PyMODINIT_FUNC initpyrsistence(void)
#endif
{
PyObject *module;
#if PY_MAJOR_VERSION >= 3
module = PyModule_Create(&pyrsistence_module);
#else
module = Py_InitModule("pyrsistence", NULL);
#endif
register_em_dict_object(module);
register_em_list_object(module);
marshaller_init();
#if PY_MAJOR_VERSION >= 3
return module;
#endif
}