35 lines
581 B
C++
35 lines
581 B
C++
|
|
||
|
#include <Python.h>
|
||
|
#include "array_wrapper.h"
|
||
|
|
||
|
using namespace CNORXZ;
|
||
|
|
||
|
static PyModuleDef cnorxz_core_module = {
|
||
|
PyModuleDef_HEAD_INIT,
|
||
|
"cnorxz",
|
||
|
"cnorxz core module",
|
||
|
-1,
|
||
|
NULL, NULL, NULL, NULL, NULL
|
||
|
};
|
||
|
|
||
|
PyMODINIT_FUNC PyInit_cnorxz()
|
||
|
{
|
||
|
PyObject* m;
|
||
|
|
||
|
PyTypeObject* carray_type = PyCArrayBType_init();
|
||
|
if(carray_type == NULL){
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
m = PyModule_Create(&cnorxz_core_module);
|
||
|
if(m == NULL){
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
Py_INCREF(carray_type);
|
||
|
|
||
|
PyModule_AddObject(m, "CArray", (PyObject*) carray_type);
|
||
|
|
||
|
return m;
|
||
|
}
|