/* W W AAA RRRR N N III N N GGG !!! ** W W A A R R NN N I NN N G G !!! ** W W W AAAAA RRRR N N N I N N N G ! ** W W W A A R R N NN I N NN G GG ** W W A A R R N N III N N GGG !!! ** ** WARNING: This file is program generated by genapi.py. ** ** DO NOT EDIT THIS FILE! Any changes made to this file will be lost! */ #ifndef _libnumeric #define _libnumeric #ifdef __cplusplus extern "C" { #endif /* Header file for libnumeric */ #if !defined(_libnumeric_MODULE) /* Extensions constructed from seperate compilation units can access the C-API defined here by defining "libnumeric_UNIQUE_SYMBOL" to a global name unique to the extension. Doing this circumvents the requirement to import libnumeric into each compilation unit, but is nevertheless mildly discouraged as "outside the Python norm" and potentially leading to problems. Looking around at "existing Python art", most extension modules are monolithic C files, and likely for good reason. */ #if defined(libnumeric_UNIQUE_SYMBOL) #define libnumeric_API libnumeric_UNIQUE_SYMBOL #endif /* C API address pointer */ #if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY) extern void **libnumeric_API; #else #if defined(libnumeric_UNIQUE_SYMBOL) void **libnumeric_API; #else static void **libnumeric_API; #endif #endif #define _import_libnumeric() \ { \ PyObject *module = PyImport_ImportModule("numarray.libnumeric"); \ if (module != NULL) { \ PyObject *module_dict = PyModule_GetDict(module); \ PyObject *c_api_object = \ PyDict_GetItemString(module_dict, "_C_API"); \ if (c_api_object && PyCObject_Check(c_api_object)) { \ libnumeric_API = (void **)PyCObject_AsVoidPtr(c_api_object); \ } else { \ PyErr_Format(PyExc_ImportError, \ "Can't get API for module 'numarray.libnumeric'"); \ } \ } \ } #define import_libnumeric() _import_libnumeric(); if (PyErr_Occurred()) { PyErr_Print(); Py_FatalError("numarray.libnumeric failed to import... exiting.\n"); } #endif #define libnumeric_FatalApiError (Py_FatalError("Call to API function without first calling import_libnumeric() in " __FILE__), NULL) /* Macros defining components of function prototypes */ #ifdef _libnumeric_MODULE /* This section is used when compiling libnumeric */ static PyObject *_Error; static PyObject * PyArray_Type (void); static int XXX_PyArray_SetNumericOps (PyObject *); static int XXX_PyArray_INCREF (PyArrayObject *ap); static int XXX_PyArray_XDECREF (PyArrayObject *ap); static PyObject * XXX_PyArrayError (void); static void XXX_PyArray_SetStringFunction (PyObject *op, int repr); static PyArray_Descr * PyArray_DescrFromType (int); static PyObject * PyArray_Cast (PyArrayObject *, int); static int PyArray_CanCastSafely (int fromtype, int totype); static int PyArray_ObjectType (PyObject *object, int min_type); static int _PyArray_multiply_list (int *lp, int n); static int PyArray_Size (PyObject *); static PyObject * PyArray_FromDims (int, int *, int); static PyObject * PyArray_FromDimsAndData (int, int *, int, char *); static PyObject * PyArray_ContiguousFromObject (PyObject *, int, int, int); static PyObject * PyArray_CopyFromObject (PyObject *, int, int, int); static PyObject * PyArray_FromObject (PyObject *, int, int, int); static PyObject * PyArray_Return (PyArrayObject *); static PyObject * PyArray_Reshape (PyArrayObject *ap, PyObject *shape); static PyObject * PyArray_Copy (PyArrayObject *ap); static PyObject * PyArray_Take (PyObject *ap, PyObject *items, int axis); static int PyArray_As1D (PyObject **op, char **ptr, int *d1, int typecode); static int PyArray_As2D (PyObject **op, char ***ptr, int *d1, int *d2, int typecode); static int PyArray_Free (PyObject *op, char *ptr); static PyObject * XXX_PyArray_FromDimsAndDataAndDescr (int, int *, PyArray_Descr *, char *); static int PyArray_Converter (PyObject *, PyObject **); static PyObject * PyArray_Put (PyObject *ap, PyObject *items, PyObject* values); static PyObject * PyArray_PutMask (PyObject *ap, PyObject *mask, PyObject* values); static int PyArray_CopyArray (PyArrayObject *dest, PyArrayObject *src); static int PyArray_ValidType (int type); static PyObject * PyArray_GetItem (PyArrayObject *a, char *where); static int PyArray_SetItem (PyArrayObject *a, char *where, PyObject *what); static char * PyArray_Zero (PyArrayObject *a); static char * PyArray_One (PyArrayObject *a); static int _PyArray_compare_lists (int *l1, int *l2, int n); static int PyArray_Check (PyObject *o); #else /* This section is used in modules that use libnumeric */ #define PyArray_Type (libnumeric_API ? (*(PyObject * (*) (void) ) libnumeric_API[ 0 ]) : (*(PyObject * (*) (void) ) libnumeric_FatalApiError)) #define XXX_PyArray_SetNumericOps (libnumeric_API ? (*(int (*) (PyObject *) ) libnumeric_API[ 1 ]) : (*(int (*) (PyObject *) ) libnumeric_FatalApiError)) #define XXX_PyArray_INCREF (libnumeric_API ? (*(int (*) (PyArrayObject *ap) ) libnumeric_API[ 2 ]) : (*(int (*) (PyArrayObject *ap) ) libnumeric_FatalApiError)) #define XXX_PyArray_XDECREF (libnumeric_API ? (*(int (*) (PyArrayObject *ap) ) libnumeric_API[ 3 ]) : (*(int (*) (PyArrayObject *ap) ) libnumeric_FatalApiError)) #define XXX_PyArrayError (libnumeric_API ? (*(PyObject * (*) (void) ) libnumeric_API[ 4 ]) : (*(PyObject * (*) (void) ) libnumeric_FatalApiError)) #define XXX_PyArray_SetStringFunction (libnumeric_API ? (*(void (*) (PyObject *op, int repr) ) libnumeric_API[ 5 ]) : (*(void (*) (PyObject *op, int repr) ) libnumeric_FatalApiError)) #define PyArray_DescrFromType (libnumeric_API ? (*(PyArray_Descr * (*) (int) ) libnumeric_API[ 6 ]) : (*(PyArray_Descr * (*) (int) ) libnumeric_FatalApiError)) #define PyArray_Cast (libnumeric_API ? (*(PyObject * (*) (PyArrayObject *, int) ) libnumeric_API[ 7 ]) : (*(PyObject * (*) (PyArrayObject *, int) ) libnumeric_FatalApiError)) #define PyArray_CanCastSafely (libnumeric_API ? (*(int (*) (int fromtype, int totype) ) libnumeric_API[ 8 ]) : (*(int (*) (int fromtype, int totype) ) libnumeric_FatalApiError)) #define PyArray_ObjectType (libnumeric_API ? (*(int (*) (PyObject *object, int min_type) ) libnumeric_API[ 9 ]) : (*(int (*) (PyObject *object, int min_type) ) libnumeric_FatalApiError)) #define _PyArray_multiply_list (libnumeric_API ? (*(int (*) (int *lp, int n) ) libnumeric_API[ 10 ]) : (*(int (*) (int *lp, int n) ) libnumeric_FatalApiError)) #define PyArray_Size (libnumeric_API ? (*(int (*) (PyObject *) ) libnumeric_API[ 11 ]) : (*(int (*) (PyObject *) ) libnumeric_FatalApiError)) #define PyArray_FromDims (libnumeric_API ? (*(PyObject * (*) (int, int *, int) ) libnumeric_API[ 12 ]) : (*(PyObject * (*) (int, int *, int) ) libnumeric_FatalApiError)) #define PyArray_FromDimsAndData (libnumeric_API ? (*(PyObject * (*) (int, int *, int, char *) ) libnumeric_API[ 13 ]) : (*(PyObject * (*) (int, int *, int, char *) ) libnumeric_FatalApiError)) #define PyArray_ContiguousFromObject (libnumeric_API ? (*(PyObject * (*) (PyObject *, int, int, int) ) libnumeric_API[ 14 ]) : (*(PyObject * (*) (PyObject *, int, int, int) ) libnumeric_FatalApiError)) #define PyArray_CopyFromObject (libnumeric_API ? (*(PyObject * (*) (PyObject *, int, int, int) ) libnumeric_API[ 15 ]) : (*(PyObject * (*) (PyObject *, int, int, int) ) libnumeric_FatalApiError)) #define PyArray_FromObject (libnumeric_API ? (*(PyObject * (*) (PyObject *, int, int, int) ) libnumeric_API[ 16 ]) : (*(PyObject * (*) (PyObject *, int, int, int) ) libnumeric_FatalApiError)) #define PyArray_Return (libnumeric_API ? (*(PyObject * (*) (PyArrayObject *) ) libnumeric_API[ 17 ]) : (*(PyObject * (*) (PyArrayObject *) ) libnumeric_FatalApiError)) #define PyArray_Reshape (libnumeric_API ? (*(PyObject * (*) (PyArrayObject *ap, PyObject *shape) ) libnumeric_API[ 18 ]) : (*(PyObject * (*) (PyArrayObject *ap, PyObject *shape) ) libnumeric_FatalApiError)) #define PyArray_Copy (libnumeric_API ? (*(PyObject * (*) (PyArrayObject *ap) ) libnumeric_API[ 19 ]) : (*(PyObject * (*) (PyArrayObject *ap) ) libnumeric_FatalApiError)) #define PyArray_Take (libnumeric_API ? (*(PyObject * (*) (PyObject *ap, PyObject *items, int axis) ) libnumeric_API[ 20 ]) : (*(PyObject * (*) (PyObject *ap, PyObject *items, int axis) ) libnumeric_FatalApiError)) #define PyArray_As1D (libnumeric_API ? (*(int (*) (PyObject **op, char **ptr, int *d1, int typecode) ) libnumeric_API[ 21 ]) : (*(int (*) (PyObject **op, char **ptr, int *d1, int typecode) ) libnumeric_FatalApiError)) #define PyArray_As2D (libnumeric_API ? (*(int (*) (PyObject **op, char ***ptr, int *d1, int *d2, int typecode) ) libnumeric_API[ 22 ]) : (*(int (*) (PyObject **op, char ***ptr, int *d1, int *d2, int typecode) ) libnumeric_FatalApiError)) #define PyArray_Free (libnumeric_API ? (*(int (*) (PyObject *op, char *ptr) ) libnumeric_API[ 23 ]) : (*(int (*) (PyObject *op, char *ptr) ) libnumeric_FatalApiError)) #define XXX_PyArray_FromDimsAndDataAndDescr (libnumeric_API ? (*(PyObject * (*) (int, int *, PyArray_Descr *, char *) ) libnumeric_API[ 24 ]) : (*(PyObject * (*) (int, int *, PyArray_Descr *, char *) ) libnumeric_FatalApiError)) #define PyArray_Converter (libnumeric_API ? (*(int (*) (PyObject *, PyObject **) ) libnumeric_API[ 25 ]) : (*(int (*) (PyObject *, PyObject **) ) libnumeric_FatalApiError)) #define PyArray_Put (libnumeric_API ? (*(PyObject * (*) (PyObject *ap, PyObject *items, PyObject* values) ) libnumeric_API[ 26 ]) : (*(PyObject * (*) (PyObject *ap, PyObject *items, PyObject* values) ) libnumeric_FatalApiError)) #define PyArray_PutMask (libnumeric_API ? (*(PyObject * (*) (PyObject *ap, PyObject *mask, PyObject* values) ) libnumeric_API[ 27 ]) : (*(PyObject * (*) (PyObject *ap, PyObject *mask, PyObject* values) ) libnumeric_FatalApiError)) #define PyArray_CopyArray (libnumeric_API ? (*(int (*) (PyArrayObject *dest, PyArrayObject *src) ) libnumeric_API[ 28 ]) : (*(int (*) (PyArrayObject *dest, PyArrayObject *src) ) libnumeric_FatalApiError)) #define PyArray_ValidType (libnumeric_API ? (*(int (*) (int type) ) libnumeric_API[ 29 ]) : (*(int (*) (int type) ) libnumeric_FatalApiError)) #define PyArray_GetItem (libnumeric_API ? (*(PyObject * (*) (PyArrayObject *a, char *where) ) libnumeric_API[ 30 ]) : (*(PyObject * (*) (PyArrayObject *a, char *where) ) libnumeric_FatalApiError)) #define PyArray_SetItem (libnumeric_API ? (*(int (*) (PyArrayObject *a, char *where, PyObject *what) ) libnumeric_API[ 31 ]) : (*(int (*) (PyArrayObject *a, char *where, PyObject *what) ) libnumeric_FatalApiError)) #define PyArray_Zero (libnumeric_API ? (*(char * (*) (PyArrayObject *a) ) libnumeric_API[ 32 ]) : (*(char * (*) (PyArrayObject *a) ) libnumeric_FatalApiError)) #define PyArray_One (libnumeric_API ? (*(char * (*) (PyArrayObject *a) ) libnumeric_API[ 33 ]) : (*(char * (*) (PyArrayObject *a) ) libnumeric_FatalApiError)) #define _PyArray_compare_lists (libnumeric_API ? (*(int (*) (int *l1, int *l2, int n) ) libnumeric_API[ 34 ]) : (*(int (*) (int *l1, int *l2, int n) ) libnumeric_FatalApiError)) #define PyArray_Check (libnumeric_API ? (*(int (*) (PyObject *o) ) libnumeric_API[ 35 ]) : (*(int (*) (PyObject *o) ) libnumeric_FatalApiError)) #endif /* Total number of C API pointers */ #define libnumeric_API_pointers 36 #ifdef __cplusplus } #endif #endif /* !defined(_libnumeric) */