Python.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file Python.h
  10. * @author drose
  11. * @date 2000-05-12
  12. */
  13. // This file, and all the other files in this directory, aren't
  14. // intended to be compiled--they're just parsed by CPPParser (and
  15. // interrogate) in lieu of the actual system headers, to generate the
  16. // interrogate database.
  17. #ifndef PYTHON_H
  18. #define PYTHON_H
  19. struct _object;
  20. typedef _object PyObject;
  21. struct _typeobject;
  22. typedef _typeobject PyTypeObject;
  23. typedef struct {} PyStringObject;
  24. typedef struct {} PyUnicodeObject;
  25. typedef struct _ts PyThreadState;
  26. typedef int Py_ssize_t;
  27. typedef struct bufferinfo Py_buffer;
  28. // We need to define these accurately since interrogate may want to
  29. // write these out to default value assignments.
  30. PyObject _Py_NoneStruct;
  31. PyObject _Py_TrueStruct;
  32. #define Py_None (&_Py_NoneStruct)
  33. #define Py_True ((PyObject *) &_Py_TrueStruct)
  34. #if PY_MAJOR_VERSION >= 3
  35. PyObject _Py_ZeroStruct;
  36. #define Py_False ((PyObject *) &_Py_ZeroStruct)
  37. #else
  38. PyObject _Py_FalseStruct;
  39. #define Py_False ((PyObject *) &_Py_FalseStruct)
  40. #endif
  41. typedef void *visitproc;
  42. #endif // PYTHON_H