mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-25 14:15:29 +00:00
Massive automated renaming of all Py_/PyObject/etc. prefixes to Ty_/TyObject/etc. This includes: - All public API types (TyObject, TyTypeObject, etc.) - All public API functions (Ty_Initialize, Ty_BuildValue, etc.) - All internal API (_Ty_ prefixes) - Reference counting macros (Ty_INCREF, Ty_DECREF, etc.) - Type flags (Ty_TPFLAGS_*) - Debug flags (Ty_DEBUG, Ty_TRACE_REFS, etc.) - All object type APIs (TyList_, TyDict_, TyUnicode_, etc.) This changes over 60,000 occurrences across 1000+ files. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
63 lines
1.6 KiB
C
63 lines
1.6 KiB
C
#ifndef Ty_CPYTHON_DESCROBJECT_H
|
|
# error "this header file must not be included directly"
|
|
#endif
|
|
|
|
typedef TyObject *(*wrapperfunc)(TyObject *self, TyObject *args,
|
|
void *wrapped);
|
|
|
|
typedef TyObject *(*wrapperfunc_kwds)(TyObject *self, TyObject *args,
|
|
void *wrapped, TyObject *kwds);
|
|
|
|
struct wrapperbase {
|
|
const char *name;
|
|
int offset;
|
|
void *function;
|
|
wrapperfunc wrapper;
|
|
const char *doc;
|
|
int flags;
|
|
TyObject *name_strobj;
|
|
};
|
|
|
|
/* Flags for above struct */
|
|
#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */
|
|
|
|
/* Various kinds of descriptor objects */
|
|
|
|
typedef struct {
|
|
PyObject_HEAD
|
|
TyTypeObject *d_type;
|
|
TyObject *d_name;
|
|
TyObject *d_qualname;
|
|
} PyDescrObject;
|
|
|
|
#define PyDescr_COMMON PyDescrObject d_common
|
|
|
|
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
|
|
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
|
|
|
|
typedef struct {
|
|
PyDescr_COMMON;
|
|
TyMethodDef *d_method;
|
|
vectorcallfunc vectorcall;
|
|
} PyMethodDescrObject;
|
|
|
|
typedef struct {
|
|
PyDescr_COMMON;
|
|
TyMemberDef *d_member;
|
|
} PyMemberDescrObject;
|
|
|
|
typedef struct {
|
|
PyDescr_COMMON;
|
|
TyGetSetDef *d_getset;
|
|
} PyGetSetDescrObject;
|
|
|
|
typedef struct {
|
|
PyDescr_COMMON;
|
|
struct wrapperbase *d_base;
|
|
void *d_wrapped; /* This can be any function pointer */
|
|
} PyWrapperDescrObject;
|
|
|
|
PyAPI_FUNC(TyObject *) PyDescr_NewWrapper(TyTypeObject *,
|
|
struct wrapperbase *, void *);
|
|
PyAPI_FUNC(int) PyDescr_IsData(TyObject *);
|