/Modules/cgensupport.h

http://unladen-swallow.googlecode.com/ · C++ Header · 64 lines · 54 code · 8 blank · 2 comment · 0 complexity · 77200b51c20bb273916249b74bee02a0 MD5 · raw file

  1. #ifndef Py_CGENSUPPORT_H
  2. #define Py_CGENSUPPORT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /* Definitions used by cgen output */
  7. /* XXX This file is obsolete. It is *only* used by glmodule.c. */
  8. typedef char *string;
  9. #define mknewlongobject(x) PyInt_FromLong(x)
  10. #define mknewshortobject(x) PyInt_FromLong((long)x)
  11. #define mknewfloatobject(x) PyFloat_FromDouble(x)
  12. #define mknewcharobject(ch) Py_BuildValue("c", ch)
  13. #define getichararg PyArg_GetChar
  14. #define getidoublearray PyArg_GetDoubleArray
  15. #define getifloatarg PyArg_GetFloat
  16. #define getifloatarray PyArg_GetFloatArray
  17. #define getilongarg PyArg_GetLong
  18. #define getilongarray PyArg_GetLongArray
  19. #define getilongarraysize PyArg_GetLongArraySize
  20. #define getiobjectarg PyArg_GetObject
  21. #define getishortarg PyArg_GetShort
  22. #define getishortarray PyArg_GetShortArray
  23. #define getishortarraysize PyArg_GetShortArraySize
  24. #define getistringarg PyArg_GetString
  25. extern int PyArg_GetObject(PyObject *args, int nargs,
  26. int i, PyObject **p_a);
  27. extern int PyArg_GetLong(PyObject *args, int nargs,
  28. int i, long *p_a);
  29. extern int PyArg_GetShort(PyObject *args, int nargs,
  30. int i, short *p_a);
  31. extern int PyArg_GetFloat(PyObject *args, int nargs,
  32. int i, float *p_a);
  33. extern int PyArg_GetString(PyObject *args, int nargs,
  34. int i, string *p_a);
  35. extern int PyArg_GetChar(PyObject *args, int nargs,
  36. int i, char *p_a);
  37. extern int PyArg_GetLongArray(PyObject *args, int nargs,
  38. int i, int n, long *p_a);
  39. extern int PyArg_GetShortArray(PyObject *args, int nargs,
  40. int i, int n, short *p_a);
  41. extern int PyArg_GetDoubleArray(PyObject *args, int nargs,
  42. int i, int n, double *p_a);
  43. extern int PyArg_GetFloatArray(PyObject *args, int nargs,
  44. int i, int n, float *p_a);
  45. extern int PyArg_GetLongArraySize(PyObject *args, int nargs,
  46. int i, long *p_a);
  47. extern int PyArg_GetShortArraySize(PyObject *args, int nargs,
  48. int i, short *p_a);
  49. extern int PyArg_GetDoubleArraySize(PyObject *args, int nargs,
  50. int i, double *p_a);
  51. extern int PyArg_GetFloatArraySize(PyObject *args, int nargs,
  52. int i, float *p_a);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif /* !Py_CGENSUPPORT_H */