| 1 |
#ifndef CPPYY_CAPI |
| 2 |
#define CPPYY_CAPI |
| 3 |
|
| 4 |
#include <stddef.h> |
| 5 |
#include <stdint.h> |
| 6 |
#include "src/precommondefs.h" |
| 7 |
|
| 8 |
#ifdef __cplusplus |
| 9 |
extern "C" { |
| 10 |
#endif |
| 11 |
|
| 12 |
typedef size_t cppyy_scope_t; |
| 13 |
typedef cppyy_scope_t cppyy_type_t; |
| 14 |
typedef void* cppyy_enum_t; |
| 15 |
typedef void* cppyy_object_t; |
| 16 |
typedef intptr_t cppyy_method_t; |
| 17 |
|
| 18 |
typedef size_t cppyy_index_t; |
| 19 |
typedef void* cppyy_funcaddr_t; |
| 20 |
|
| 21 |
typedef unsigned long cppyy_exctype_t; |
| 22 |
|
| 23 |
|
| 24 |
RPY_EXTERN |
| 25 |
int cppyy_compile(const char* code); |
| 26 |
RPY_EXTERN |
| 27 |
char* cppyy_to_string(cppyy_type_t klass, cppyy_object_t obj); |
| 28 |
|
| 29 |
|
| 30 |
RPY_EXTERN |
| 31 |
char* cppyy_resolve_name(const char* cppitem_name); |
| 32 |
RPY_EXTERN |
| 33 |
char* cppyy_resolve_enum(const char* enum_type); |
| 34 |
RPY_EXTERN |
| 35 |
cppyy_scope_t cppyy_get_scope(const char* scope_name); |
| 36 |
RPY_EXTERN |
| 37 |
cppyy_type_t cppyy_actual_class(cppyy_type_t klass, cppyy_object_t obj); |
| 38 |
RPY_EXTERN |
| 39 |
size_t cppyy_size_of_klass(cppyy_type_t klass); |
| 40 |
RPY_EXTERN |
| 41 |
size_t cppyy_size_of_type(const char* type_name); |
| 42 |
|
| 43 |
RPY_EXTERN |
| 44 |
int cppyy_is_builtin(const char* type_name); |
| 45 |
RPY_EXTERN |
| 46 |
int cppyy_is_complete(const char* type_name); |
| 47 |
|
| 48 |
|
| 49 |
RPY_EXTERN |
| 50 |
cppyy_object_t cppyy_allocate(cppyy_type_t type); |
| 51 |
RPY_EXTERN |
| 52 |
void cppyy_deallocate(cppyy_type_t type, cppyy_object_t self); |
| 53 |
RPY_EXTERN |
| 54 |
cppyy_object_t cppyy_construct(cppyy_type_t type); |
| 55 |
RPY_EXTERN |
| 56 |
void cppyy_destruct(cppyy_type_t type, cppyy_object_t self); |
| 57 |
|
| 58 |
|
| 59 |
RPY_EXTERN |
| 60 |
void cppyy_call_v(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 61 |
RPY_EXTERN |
| 62 |
unsigned char cppyy_call_b(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 63 |
RPY_EXTERN |
| 64 |
char cppyy_call_c(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 65 |
RPY_EXTERN |
| 66 |
short cppyy_call_h(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 67 |
RPY_EXTERN |
| 68 |
int cppyy_call_i(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 69 |
RPY_EXTERN |
| 70 |
long cppyy_call_l(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 71 |
RPY_EXTERN |
| 72 |
long long cppyy_call_ll(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 73 |
RPY_EXTERN |
| 74 |
float cppyy_call_f(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 75 |
RPY_EXTERN |
| 76 |
double cppyy_call_d(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 77 |
RPY_EXTERN |
| 78 |
long double cppyy_call_ld(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 79 |
RPY_EXTERN |
| 80 |
double cppyy_call_nld(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 81 |
|
| 82 |
RPY_EXTERN |
| 83 |
void* cppyy_call_r(cppyy_method_t method, cppyy_object_t self, int nargs, void* args); |
| 84 |
RPY_EXTERN |
| 85 |
char* cppyy_call_s(cppyy_method_t method, cppyy_object_t self, int nargs, void* args, size_t* length); |
| 86 |
RPY_EXTERN |
| 87 |
cppyy_object_t cppyy_constructor(cppyy_method_t method, cppyy_type_t klass, int nargs, void* args); |
| 88 |
RPY_EXTERN |
| 89 |
void cppyy_destructor(cppyy_type_t type, cppyy_object_t self); |
| 90 |
RPY_EXTERN |
| 91 |
cppyy_object_t cppyy_call_o(cppyy_method_t method, cppyy_object_t self, int nargs, void* args, cppyy_type_t result_type); |
| 92 |
|
| 93 |
RPY_EXTERN |
| 94 |
cppyy_funcaddr_t cppyy_function_address(cppyy_method_t method); |
| 95 |
|
| 96 |
|
| 97 |
RPY_EXTERN |
| 98 |
void* cppyy_allocate_function_args(int nargs); |
| 99 |
RPY_EXTERN |
| 100 |
void cppyy_deallocate_function_args(void* args); |
| 101 |
RPY_EXTERN |
| 102 |
size_t cppyy_function_arg_sizeof(); |
| 103 |
RPY_EXTERN |
| 104 |
size_t cppyy_function_arg_typeoffset(); |
| 105 |
|
| 106 |
|
| 107 |
RPY_EXTERN |
| 108 |
int cppyy_is_namespace(cppyy_scope_t scope); |
| 109 |
RPY_EXTERN |
| 110 |
int cppyy_is_template(const char* template_name); |
| 111 |
RPY_EXTERN |
| 112 |
int cppyy_is_abstract(cppyy_type_t type); |
| 113 |
RPY_EXTERN |
| 114 |
int cppyy_is_enum(const char* type_name); |
| 115 |
RPY_EXTERN |
| 116 |
int cppyy_is_aggregate(cppyy_type_t type); |
| 117 |
RPY_EXTERN |
| 118 |
int cppyy_is_default_constructable(cppyy_type_t type); |
| 119 |
|
| 120 |
RPY_EXTERN |
| 121 |
const char** cppyy_get_all_cpp_names(cppyy_scope_t scope, size_t* count); |
| 122 |
|
| 123 |
|
| 124 |
RPY_EXTERN |
| 125 |
cppyy_index_t* cppyy_get_using_namespaces(cppyy_scope_t scope); |
| 126 |
|
| 127 |
|
| 128 |
RPY_EXTERN |
| 129 |
char* cppyy_final_name(cppyy_type_t type); |
| 130 |
RPY_EXTERN |
| 131 |
char* cppyy_scoped_final_name(cppyy_type_t type); |
| 132 |
RPY_EXTERN |
| 133 |
int cppyy_has_virtual_destructor(cppyy_type_t type); |
| 134 |
RPY_EXTERN |
| 135 |
int cppyy_has_complex_hierarchy(cppyy_type_t type); |
| 136 |
RPY_EXTERN |
| 137 |
int cppyy_num_bases(cppyy_type_t type); |
| 138 |
RPY_EXTERN |
| 139 |
char* cppyy_base_name(cppyy_type_t type, int base_index); |
| 140 |
RPY_EXTERN |
| 141 |
int cppyy_is_subtype(cppyy_type_t derived, cppyy_type_t base); |
| 142 |
RPY_EXTERN |
| 143 |
int cppyy_is_smartptr(cppyy_type_t type); |
| 144 |
RPY_EXTERN |
| 145 |
int cppyy_smartptr_info(const char* name, cppyy_type_t* raw, cppyy_method_t* deref); |
| 146 |
RPY_EXTERN |
| 147 |
void cppyy_add_smartptr_type(const char* type_name); |
| 148 |
|
| 149 |
RPY_EXTERN |
| 150 |
void cppyy_add_type_reducer(const char* reducable, const char* reduced); |
| 151 |
|
| 152 |
|
| 153 |
RPY_EXTERN |
| 154 |
ptrdiff_t cppyy_base_offset(cppyy_type_t derived, cppyy_type_t base, cppyy_object_t address, int direction); |
| 155 |
|
| 156 |
|
| 157 |
RPY_EXTERN |
| 158 |
int cppyy_num_methods(cppyy_scope_t scope); |
| 159 |
RPY_EXTERN |
| 160 |
int cppyy_num_methods_ns(cppyy_scope_t scope); |
| 161 |
RPY_EXTERN |
| 162 |
cppyy_index_t* cppyy_method_indices_from_name(cppyy_scope_t scope, const char* name); |
| 163 |
|
| 164 |
RPY_EXTERN |
| 165 |
cppyy_method_t cppyy_get_method(cppyy_scope_t scope, cppyy_index_t idx); |
| 166 |
|
| 167 |
RPY_EXTERN |
| 168 |
char* cppyy_method_name(cppyy_method_t); |
| 169 |
RPY_EXTERN |
| 170 |
char* cppyy_method_full_name(cppyy_method_t); |
| 171 |
RPY_EXTERN |
| 172 |
char* cppyy_method_mangled_name(cppyy_method_t); |
| 173 |
RPY_EXTERN |
| 174 |
char* cppyy_method_result_type(cppyy_method_t); |
| 175 |
RPY_EXTERN |
| 176 |
int cppyy_method_num_args(cppyy_method_t); |
| 177 |
RPY_EXTERN |
| 178 |
int cppyy_method_req_args(cppyy_method_t); |
| 179 |
RPY_EXTERN |
| 180 |
char* cppyy_method_arg_name(cppyy_method_t, int arg_index); |
| 181 |
RPY_EXTERN |
| 182 |
char* cppyy_method_arg_type(cppyy_method_t, int arg_index); |
| 183 |
RPY_EXTERN |
| 184 |
char* cppyy_method_arg_default(cppyy_method_t, int arg_index); |
| 185 |
RPY_EXTERN |
| 186 |
char* cppyy_method_signature(cppyy_method_t, int show_formalargs); |
| 187 |
RPY_EXTERN |
| 188 |
char* cppyy_method_signature_max(cppyy_method_t, int show_formalargs, int maxargs); |
| 189 |
RPY_EXTERN |
| 190 |
char* cppyy_method_prototype(cppyy_scope_t scope, cppyy_method_t, int show_formalargs); |
| 191 |
RPY_EXTERN |
| 192 |
int cppyy_is_const_method(cppyy_method_t); |
| 193 |
|
| 194 |
RPY_EXTERN |
| 195 |
int cppyy_get_num_templated_methods(cppyy_scope_t scope); |
| 196 |
RPY_EXPORTED |
| 197 |
int cppyy_get_num_templated_methods_ns(cppyy_scope_t scope); |
| 198 |
RPY_EXTERN |
| 199 |
char* cppyy_get_templated_method_name(cppyy_scope_t scope, cppyy_index_t imeth); |
| 200 |
RPY_EXTERN |
| 201 |
int cppyy_is_templated_constructor(cppyy_scope_t scope, cppyy_index_t imeth); |
| 202 |
RPY_EXTERN |
| 203 |
int cppyy_exists_method_template(cppyy_scope_t scope, const char* name); |
| 204 |
RPY_EXTERN |
| 205 |
int cppyy_method_is_template(cppyy_scope_t scope, cppyy_index_t idx); |
| 206 |
RPY_EXTERN |
| 207 |
cppyy_method_t cppyy_get_method_template(cppyy_scope_t scope, const char* name, const char* proto); |
| 208 |
|
| 209 |
RPY_EXTERN |
| 210 |
cppyy_index_t cppyy_get_global_operator( |
| 211 |
cppyy_scope_t scope, cppyy_scope_t lc, cppyy_scope_t rc, const char* op); |
| 212 |
|
| 213 |
|
| 214 |
RPY_EXTERN |
| 215 |
int cppyy_is_publicmethod(cppyy_method_t); |
| 216 |
RPY_EXTERN |
| 217 |
int cppyy_is_protectedmethod(cppyy_method_t); |
| 218 |
RPY_EXTERN |
| 219 |
int cppyy_is_constructor(cppyy_method_t); |
| 220 |
RPY_EXTERN |
| 221 |
int cppyy_is_destructor(cppyy_method_t); |
| 222 |
RPY_EXTERN |
| 223 |
int cppyy_is_staticmethod(cppyy_method_t); |
| 224 |
|
| 225 |
|
| 226 |
RPY_EXTERN |
| 227 |
int cppyy_num_datamembers(cppyy_scope_t scope); |
| 228 |
RPY_EXPORTED |
| 229 |
int cppyy_num_datamembers_ns(cppyy_scope_t scope); |
| 230 |
RPY_EXTERN |
| 231 |
char* cppyy_datamember_name(cppyy_scope_t scope, int datamember_index); |
| 232 |
RPY_EXTERN |
| 233 |
char* cppyy_datamember_type(cppyy_scope_t scope, int datamember_index); |
| 234 |
RPY_EXTERN |
| 235 |
intptr_t cppyy_datamember_offset(cppyy_scope_t scope, int datamember_index); |
| 236 |
RPY_EXTERN |
| 237 |
int cppyy_datamember_index(cppyy_scope_t scope, const char* name); |
| 238 |
|
| 239 |
|
| 240 |
RPY_EXTERN |
| 241 |
int cppyy_is_publicdata(cppyy_type_t type, cppyy_index_t datamember_index); |
| 242 |
RPY_EXTERN |
| 243 |
int cppyy_is_protecteddata(cppyy_type_t type, cppyy_index_t datamember_index); |
| 244 |
RPY_EXTERN |
| 245 |
int cppyy_is_staticdata(cppyy_type_t type, cppyy_index_t datamember_index); |
| 246 |
RPY_EXTERN |
| 247 |
int cppyy_is_const_data(cppyy_scope_t scope, cppyy_index_t idata); |
| 248 |
RPY_EXTERN |
| 249 |
int cppyy_is_enum_data(cppyy_scope_t scope, cppyy_index_t idata); |
| 250 |
RPY_EXTERN |
| 251 |
int cppyy_get_dimension_size(cppyy_scope_t scope, cppyy_index_t idata, int dimension); |
| 252 |
|
| 253 |
|
| 254 |
RPY_EXTERN |
| 255 |
cppyy_enum_t cppyy_get_enum(cppyy_scope_t scope, const char* enum_name); |
| 256 |
RPY_EXTERN |
| 257 |
cppyy_index_t cppyy_get_num_enum_data(cppyy_enum_t); |
| 258 |
RPY_EXTERN |
| 259 |
const char* cppyy_get_enum_data_name(cppyy_enum_t, cppyy_index_t idata); |
| 260 |
RPY_EXTERN |
| 261 |
long long cppyy_get_enum_data_value(cppyy_enum_t, cppyy_index_t idata); |
| 262 |
|
| 263 |
|
| 264 |
RPY_EXTERN |
| 265 |
long long cppyy_strtoll(const char* str); |
| 266 |
RPY_EXTERN |
| 267 |
unsigned long long cppyy_strtoull(const char* str); |
| 268 |
RPY_EXTERN |
| 269 |
void cppyy_free(void* ptr); |
| 270 |
|
| 271 |
RPY_EXTERN |
| 272 |
cppyy_object_t cppyy_charp2stdstring(const char* str, size_t sz); |
| 273 |
RPY_EXTERN |
| 274 |
const char* cppyy_stdstring2charp(cppyy_object_t ptr, size_t* lsz); |
| 275 |
RPY_EXTERN |
| 276 |
cppyy_object_t cppyy_stdstring2stdstring(cppyy_object_t ptr); |
| 277 |
|
| 278 |
RPY_EXTERN |
| 279 |
double cppyy_longdouble2double(void*); |
| 280 |
RPY_EXTERN |
| 281 |
void cppyy_double2longdouble(double, void*); |
| 282 |
|
| 283 |
RPY_EXTERN |
| 284 |
int cppyy_vectorbool_getitem(cppyy_object_t ptr, int idx); |
| 285 |
RPY_EXTERN |
| 286 |
void cppyy_vectorbool_setitem(cppyy_object_t ptr, int idx, int value); |
| 287 |
|
| 288 |
#ifdef __cplusplus |
| 289 |
} |
| 290 |
#endif |
| 291 |
|
| 292 |
#endif |