Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 1 | #ifndef Py_CGENSUPPORT_H |
| 2 | #define Py_CGENSUPPORT_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 8 | /* Definitions used by cgen output */ |
| 9 | |
Guido van Rossum | 1818b77 | 1997-04-29 15:35:28 +0000 | [diff] [blame] | 10 | /* XXX This file is obsolete. It is *only* used by glmodule.c. */ |
| 11 | |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 12 | typedef char *string; |
| 13 | |
Guido van Rossum | caa6380 | 1995-01-12 11:45:45 +0000 | [diff] [blame] | 14 | #define mknewlongobject(x) PyInt_FromLong(x) |
| 15 | #define mknewshortobject(x) PyInt_FromLong((long)x) |
| 16 | #define mknewfloatobject(x) PyFloat_FromDouble(x) |
| 17 | #define mknewcharobject(ch) Py_BuildValue("c", ch) |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 18 | |
Guido van Rossum | 1818b77 | 1997-04-29 15:35:28 +0000 | [diff] [blame] | 19 | #define getichararg PyArg_GetChar |
| 20 | #define getidoublearray PyArg_GetDoubleArray |
| 21 | #define getifloatarg PyArg_GetFloat |
| 22 | #define getifloatarray PyArg_GetFloatArray |
| 23 | #define getilongarg PyArg_GetLong |
| 24 | #define getilongarray PyArg_GetLongArray |
| 25 | #define getilongarraysize PyArg_GetLongArraySize |
| 26 | #define getiobjectarg PyArg_GetObject |
| 27 | #define getishortarg PyArg_GetShort |
| 28 | #define getishortarray PyArg_GetShortArray |
| 29 | #define getishortarraysize PyArg_GetShortArraySize |
| 30 | #define getistringarg PyArg_GetString |
| 31 | |
Tim Peters | dbd9ba6 | 2000-07-09 03:09:57 +0000 | [diff] [blame] | 32 | extern int PyArg_GetObject(PyObject *args, int nargs, |
| 33 | int i, PyObject **p_a); |
| 34 | extern int PyArg_GetLong(PyObject *args, int nargs, |
| 35 | int i, long *p_a); |
| 36 | extern int PyArg_GetShort(PyObject *args, int nargs, |
| 37 | int i, short *p_a); |
| 38 | extern int PyArg_GetFloat(PyObject *args, int nargs, |
| 39 | int i, float *p_a); |
| 40 | extern int PyArg_GetString(PyObject *args, int nargs, |
| 41 | int i, string *p_a); |
| 42 | extern int PyArg_GetChar(PyObject *args, int nargs, |
| 43 | int i, char *p_a); |
| 44 | extern int PyArg_GetLongArray(PyObject *args, int nargs, |
| 45 | int i, int n, long *p_a); |
| 46 | extern int PyArg_GetShortArray(PyObject *args, int nargs, |
| 47 | int i, int n, short *p_a); |
| 48 | extern int PyArg_GetDoubleArray(PyObject *args, int nargs, |
| 49 | int i, int n, double *p_a); |
| 50 | extern int PyArg_GetFloatArray(PyObject *args, int nargs, |
| 51 | int i, int n, float *p_a); |
| 52 | extern int PyArg_GetLongArraySize(PyObject *args, int nargs, |
| 53 | int i, long *p_a); |
| 54 | extern int PyArg_GetShortArraySize(PyObject *args, int nargs, |
| 55 | int i, short *p_a); |
| 56 | extern int PyArg_GetDoubleArraySize(PyObject *args, int nargs, |
| 57 | int i, double *p_a); |
| 58 | extern int PyArg_GetFloatArraySize(PyObject *args, int nargs, |
| 59 | int i, float *p_a); |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 60 | |
| 61 | #ifdef __cplusplus |
| 62 | } |
| 63 | #endif |
| 64 | #endif /* !Py_CGENSUPPORT_H */ |