| 1 |
#ifndef LIBRT_RANDOM_API_H |
| 2 |
#define LIBRT_RANDOM_API_H |
| 3 |
|
| 4 |
#include <stdbool.h> |
| 5 |
#include <stdint.h> |
| 6 |
#include <Python.h> |
| 7 |
#include "librt_random.h" |
| 8 |
|
| 9 |
int |
| 10 |
import_librt_random(void); |
| 11 |
|
| 12 |
extern void *LibRTRandom_API[LIBRT_RANDOM_API_LEN]; |
| 13 |
|
| 14 |
#define LibRTRandom_ABIVersion (*(int (*)(void)) LibRTRandom_API[0]) |
| 15 |
#define LibRTRandom_APIVersion (*(int (*)(void)) LibRTRandom_API[1]) |
| 16 |
#define LibRTRandom_Random_internal (*(PyObject* (*)(void)) LibRTRandom_API[2]) |
| 17 |
#define LibRTRandom_Random_from_seed_internal (*(PyObject* (*)(int64_t)) LibRTRandom_API[3]) |
| 18 |
#define LibRTRandom_Random_type_internal (*(PyTypeObject* (*)(void)) LibRTRandom_API[4]) |
| 19 |
#define LibRTRandom_Random_random_internal (*(double (*)(PyObject*)) LibRTRandom_API[5]) |
| 20 |
#define LibRTRandom_Random_randint_internal (*(int64_t (*)(PyObject*, int64_t, int64_t)) LibRTRandom_API[6]) |
| 21 |
#define LibRTRandom_Random_randrange1_internal (*(int64_t (*)(PyObject*, int64_t)) LibRTRandom_API[7]) |
| 22 |
#define LibRTRandom_Random_randrange2_internal (*(int64_t (*)(PyObject*, int64_t, int64_t)) LibRTRandom_API[8]) |
| 23 |
#define LibRTRandom_module_random_internal (*(double (*)(void)) LibRTRandom_API[9]) |
| 24 |
#define LibRTRandom_module_randint_internal (*(int64_t (*)(int64_t, int64_t)) LibRTRandom_API[10]) |
| 25 |
#define LibRTRandom_module_randrange1_internal (*(int64_t (*)(int64_t)) LibRTRandom_API[11]) |
| 26 |
#define LibRTRandom_module_randrange2_internal (*(int64_t (*)(int64_t, int64_t)) LibRTRandom_API[12]) |
| 27 |
|
| 28 |
static inline bool CPyRandom_Check(PyObject *obj) { |
| 29 |
return Py_TYPE(obj) == LibRTRandom_Random_type_internal(); |
| 30 |
} |
| 31 |
|
| 32 |
#endif // LIBRT_RANDOM_API_H |