File: atlas_version.c

package info (click to toggle)
python-scipy 0.10.1%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 42,232 kB
  • sloc: cpp: 224,773; ansic: 103,496; python: 85,210; fortran: 79,130; makefile: 272; sh: 43
file content (61 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download | duplicates (2)
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
50
51
52
53
54
55
56
57
58
59
60
61
#include "Python.h"
#include "numpy/npy_3kcompat.h"

static PyObject* version(PyObject* self, PyObject* dummy)
{
#if defined(NO_ATLAS_INFO)
    printf("NO ATLAS INFO AVAILABLE\n");
#else
    void ATL_buildinfo(void);
    ATL_buildinfo();
#endif

    Py_INCREF(Py_None);
    return Py_None;
}

static char version_doc[] = "Print the build info from atlas.";

static PyMethodDef module_methods[] = {
    {"version", version, METH_VARARGS, version_doc},
    {NULL, NULL, 0, NULL}
};

#if PY_VERSION_HEX >= 0x03000000

static struct PyModuleDef moduledef = {
    PyModuleDef_HEAD_INIT,
    "atlas_version",
    NULL,
    -1,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};

PyObject *PyInit_atlas_version(void)
{
#define RETVAL m
    PyObject *m;
    m = PyModule_Create(&moduledef);
#else
#define RETVAL
PyMODINIT_FUNC initatlas_version(void)
{
    PyObject *m = NULL;
    m = Py_InitModule("atlas_version", module_methods);
#endif
    if (m == NULL) {
        return RETVAL;
    }
#if defined(ATLAS_INFO)
    {
        PyObject *d = PyModule_GetDict(m);
        PyDict_SetItemString(d,"ATLAS_VERSION",
                             PyUString_FromString(ATLAS_INFO));
    }
#endif
    return RETVAL;
}