Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

  1. #ifndef Py_ASDL_H
  2. #define Py_ASDL_H
  3. typedef PyObject * identifier;
  4. typedef PyObject * string;
  5. typedef PyObject * object;
  6. #ifndef __cplusplus
  7. typedef enum {false, true} bool;
  8. #endif
  9. /* It would be nice if the code generated by asdl_c.py was completely
  10. independent of Python, but it is a goal the requires too much work
  11. at this stage. So, for example, I'll represent identifiers as
  12. interned Python strings.
  13. */
  14. /* XXX A sequence should be typed so that its use can be typechecked. */
  15. typedef struct {
  16. int size;
  17. void *elements[1];
  18. } asdl_seq;
  19. typedef struct {
  20. int size;
  21. int elements[1];
  22. } asdl_int_seq;
  23. asdl_seq *asdl_seq_new(int size, PyArena *arena);
  24. asdl_int_seq *asdl_int_seq_new(int size, PyArena *arena);
  25. #define asdl_seq_GET(S, I) (S)->elements[(I)]
  26. #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
  27. #ifdef Py_DEBUG
  28. #define asdl_seq_SET(S, I, V) { \
  29. int _asdl_i = (I); \
  30. assert((S) && _asdl_i < (S)->size); \
  31. (S)->elements[_asdl_i] = (V); \
  32. }
  33. #else
  34. #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
  35. #endif
  36. #endif /* !Py_ASDL_H */