| 1 |
#ifndef LIBRT_STRINGS_API_H |
| 2 |
#define LIBRT_STRINGS_API_H |
| 3 |
|
| 4 |
int |
| 5 |
import_librt_strings(void); |
| 6 |
|
| 7 |
#include <Python.h> |
| 8 |
#include <stdbool.h> |
| 9 |
#include "librt_strings.h" |
| 10 |
|
| 11 |
extern void *LibRTStrings_API[LIBRT_STRINGS_API_LEN]; |
| 12 |
|
| 13 |
#define LibRTStrings_ABIVersion (*(int (*)(void)) LibRTStrings_API[0]) |
| 14 |
#define LibRTStrings_APIVersion (*(int (*)(void)) LibRTStrings_API[1]) |
| 15 |
#define LibRTStrings_BytesWriter_internal (*(PyObject* (*)(void)) LibRTStrings_API[2]) |
| 16 |
#define LibRTStrings_BytesWriter_getvalue_internal (*(PyObject* (*)(PyObject *source)) LibRTStrings_API[3]) |
| 17 |
#define LibRTStrings_BytesWriter_append_internal (*(char (*)(PyObject *source, uint8_t value)) LibRTStrings_API[4]) |
| 18 |
#define LibRTStrings_ByteWriter_grow_buffer_internal (*(bool (*)(BytesWriterObject *obj, Py_ssize_t size)) LibRTStrings_API[5]) |
| 19 |
#define LibRTStrings_BytesWriter_type_internal (*(PyTypeObject* (*)(void)) LibRTStrings_API[6]) |
| 20 |
#define LibRTStrings_BytesWriter_truncate_internal (*(char (*)(PyObject *self, int64_t size)) LibRTStrings_API[7]) |
| 21 |
#define LibRTStrings_StringWriter_internal (*(PyObject* (*)(void)) LibRTStrings_API[8]) |
| 22 |
#define LibRTStrings_StringWriter_getvalue_internal (*(PyObject* (*)(PyObject *source)) LibRTStrings_API[9]) |
| 23 |
#define LibRTStrings_string_append_slow_path (*(char (*)(StringWriterObject *obj, int32_t value)) LibRTStrings_API[10]) |
| 24 |
#define LibRTStrings_StringWriter_type_internal (*(PyTypeObject* (*)(void)) LibRTStrings_API[11]) |
| 25 |
#define LibRTStrings_StringWriter_write_internal (*(char (*)(PyObject *source, PyObject *value)) LibRTStrings_API[12]) |
| 26 |
#define LibRTStrings_grow_string_buffer (*(bool (*)(StringWriterObject *obj, Py_ssize_t n)) LibRTStrings_API[13]) |
| 27 |
|
| 28 |
|
| 29 |
static inline bool CPyBytesWriter_Check(PyObject *obj) { |
| 30 |
return Py_TYPE(obj) == LibRTStrings_BytesWriter_type_internal(); |
| 31 |
} |
| 32 |
|
| 33 |
static inline bool CPyStringWriter_Check(PyObject *obj) { |
| 34 |
return Py_TYPE(obj) == LibRTStrings_StringWriter_type_internal(); |
| 35 |
} |
| 36 |
|
| 37 |
#endif // LIBRT_STRINGS_API_H |