blob: 2277a4738d656cb2bfc6a1d0643115fd31cdef90 [file] [log] [blame]
Guido van Rossuma3309961993-07-28 09:05:47 +00001#ifndef Py_CGENSUPPORT_H
2#define Py_CGENSUPPORT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
Guido van Rossumf70e43a1991-02-19 12:39:46 +00007/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00008Copyright (c) 2000, BeOpen.com.
9Copyright (c) 1995-2000, Corporation for National Research Initiatives.
10Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
11All rights reserved.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000012
Guido van Rossumfd71b9e2000-06-30 23:50:40 +000013See the file "Misc/COPYRIGHT" for information on usage and
14redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000015******************************************************************/
16
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000017/* Definitions used by cgen output */
18
Guido van Rossum1818b771997-04-29 15:35:28 +000019/* XXX This file is obsolete. It is *only* used by glmodule.c. */
20
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000021typedef char *string;
22
Guido van Rossumcaa63801995-01-12 11:45:45 +000023#define mknewlongobject(x) PyInt_FromLong(x)
24#define mknewshortobject(x) PyInt_FromLong((long)x)
25#define mknewfloatobject(x) PyFloat_FromDouble(x)
26#define mknewcharobject(ch) Py_BuildValue("c", ch)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000027
Guido van Rossum1818b771997-04-29 15:35:28 +000028#define getichararg PyArg_GetChar
29#define getidoublearray PyArg_GetDoubleArray
30#define getifloatarg PyArg_GetFloat
31#define getifloatarray PyArg_GetFloatArray
32#define getilongarg PyArg_GetLong
33#define getilongarray PyArg_GetLongArray
34#define getilongarraysize PyArg_GetLongArraySize
35#define getiobjectarg PyArg_GetObject
36#define getishortarg PyArg_GetShort
37#define getishortarray PyArg_GetShortArray
38#define getishortarraysize PyArg_GetShortArraySize
39#define getistringarg PyArg_GetString
40
Tim Petersdbd9ba62000-07-09 03:09:57 +000041extern int PyArg_GetObject(PyObject *args, int nargs,
42 int i, PyObject **p_a);
43extern int PyArg_GetLong(PyObject *args, int nargs,
44 int i, long *p_a);
45extern int PyArg_GetShort(PyObject *args, int nargs,
46 int i, short *p_a);
47extern int PyArg_GetFloat(PyObject *args, int nargs,
48 int i, float *p_a);
49extern int PyArg_GetString(PyObject *args, int nargs,
50 int i, string *p_a);
51extern int PyArg_GetChar(PyObject *args, int nargs,
52 int i, char *p_a);
53extern int PyArg_GetLongArray(PyObject *args, int nargs,
54 int i, int n, long *p_a);
55extern int PyArg_GetShortArray(PyObject *args, int nargs,
56 int i, int n, short *p_a);
57extern int PyArg_GetDoubleArray(PyObject *args, int nargs,
58 int i, int n, double *p_a);
59extern int PyArg_GetFloatArray(PyObject *args, int nargs,
60 int i, int n, float *p_a);
61extern int PyArg_GetLongArraySize(PyObject *args, int nargs,
62 int i, long *p_a);
63extern int PyArg_GetShortArraySize(PyObject *args, int nargs,
64 int i, short *p_a);
65extern int PyArg_GetDoubleArraySize(PyObject *args, int nargs,
66 int i, double *p_a);
67extern int PyArg_GetFloatArraySize(PyObject *args, int nargs,
68 int i, float *p_a);
Guido van Rossuma3309961993-07-28 09:05:47 +000069
70#ifdef __cplusplus
71}
72#endif
73#endif /* !Py_CGENSUPPORT_H */