# define MAXDIM 40 # define SZ_BUF 79 typedef struct { void *data; /* pointer to data buffer */ void *imag; /* imaginary part, or NULL */ long ndim; /* dimension (rank) of array */ long nelem; /* total number of elements */ long shape[MAXDIM]; /* length of each axis */ long strides[MAXDIM]; long byteoffset; long bytestride; long itemsize; char type[SZ_BUF+1]; /* flags */ int C_array; /* aligned, contiguous, and not byteswapped */ int writeable; int aligned; int contiguous; int byteswap; } NDInfo; typedef enum { tBool, tInt8, tUInt8, tInt16, tUInt16, tInt32, tFloat32, tFloat64, tComplex64, tComplex128 } NumericType; #define nNumericType (tComplex128+1) #define NA_Begin() Py_Initialize(); import_libnumarray(); NA_Init(); #define NA_End() NA_Done(); Py_Finalize(); #define NA_OFFSETDATA(info) ((void *) (((char*)(info).data)+(info).byteoffset))