| 1 |
#ifndef LIBRT_INTERNAL_API_H |
| 2 |
#define LIBRT_INTERNAL_API_H |
| 3 |
|
| 4 |
#include "librt_internal.h" |
| 5 |
|
| 6 |
extern void *NativeInternal_API[LIBRT_INTERNAL_API_LEN]; |
| 7 |
|
| 8 |
#define ReadBuffer_internal (*(PyObject* (*)(PyObject *source)) NativeInternal_API[0]) |
| 9 |
#define WriteBuffer_internal (*(PyObject* (*)(void)) NativeInternal_API[1]) |
| 10 |
#define WriteBuffer_getvalue_internal (*(PyObject* (*)(PyObject *source)) NativeInternal_API[2]) |
| 11 |
#define write_bool_internal (*(char (*)(PyObject *source, char value)) NativeInternal_API[3]) |
| 12 |
#define read_bool_internal (*(char (*)(PyObject *source)) NativeInternal_API[4]) |
| 13 |
#define write_str_internal (*(char (*)(PyObject *source, PyObject *value)) NativeInternal_API[5]) |
| 14 |
#define read_str_internal (*(PyObject* (*)(PyObject *source)) NativeInternal_API[6]) |
| 15 |
#define write_float_internal (*(char (*)(PyObject *source, double value)) NativeInternal_API[7]) |
| 16 |
#define read_float_internal (*(double (*)(PyObject *source)) NativeInternal_API[8]) |
| 17 |
#define write_int_internal (*(char (*)(PyObject *source, CPyTagged value)) NativeInternal_API[9]) |
| 18 |
#define read_int_internal (*(CPyTagged (*)(PyObject *source)) NativeInternal_API[10]) |
| 19 |
#define write_tag_internal (*(char (*)(PyObject *source, uint8_t value)) NativeInternal_API[11]) |
| 20 |
#define read_tag_internal (*(uint8_t (*)(PyObject *source)) NativeInternal_API[12]) |
| 21 |
#define NativeInternal_ABI_Version (*(int (*)(void)) NativeInternal_API[13]) |
| 22 |
#define write_bytes_internal (*(char (*)(PyObject *source, PyObject *value)) NativeInternal_API[14]) |
| 23 |
#define read_bytes_internal (*(PyObject* (*)(PyObject *source)) NativeInternal_API[15]) |
| 24 |
#define cache_version_internal (*(uint8_t (*)(void)) NativeInternal_API[16]) |
| 25 |
#define ReadBuffer_type_internal (*(PyTypeObject* (*)(void)) NativeInternal_API[17]) |
| 26 |
#define WriteBuffer_type_internal (*(PyTypeObject* (*)(void)) NativeInternal_API[18]) |
| 27 |
#define NativeInternal_API_Version (*(int (*)(void)) NativeInternal_API[19]) |
| 28 |
#define extract_symbol_internal (*(PyObject* (*)(PyObject *source)) NativeInternal_API[20]) |
| 29 |
|
| 30 |
int |
| 31 |
import_librt_internal(void); |
| 32 |
|
| 33 |
static inline bool CPyReadBuffer_Check(PyObject *obj) { |
| 34 |
return Py_TYPE(obj) == ReadBuffer_type_internal(); |
| 35 |
} |
| 36 |
|
| 37 |
static inline bool CPyWriteBuffer_Check(PyObject *obj) { |
| 38 |
return Py_TYPE(obj) == WriteBuffer_type_internal(); |
| 39 |
} |
| 40 |
|
| 41 |
#endif // LIBRT_INTERNAL_API_H |