Go to the documentation of this file.
41 if (s->c_descriptor_symtab) {
47 if (!
arg || !PyBool_Check(
arg)) {
48 PyErr_SetString(PyExc_TypeError,
49 "Argument to SetAllowOversizeProtos must be boolean");
53 state->allow_oversize_protos = PyObject_IsTrue(
arg);
60 "Enable/disable oversize proto parsing."},
63 static struct PyModuleDef
module_def = {PyModuleDef_HEAD_INIT,
96 if (!
state->wkt_bases) {
100 if (wkt_module == NULL) {
104 state->wkt_bases = PyObject_GetAttrString(wkt_module,
"WKTBASES");
107 PyModule_AddObject(
m,
"__internal_wktbases",
state->wkt_bases);
108 Py_DECREF(wkt_module);
111 return state->wkt_bases;
135 assert((
n & 7) == 0);
141 upb_value_ptr(py_obj),
map->arena);
159 PyObject*
ret = upb_value_getptr(val);
172 *
key = (
void*)(u_key << 3);
173 *
obj = upb_value_getptr(val);
187 return state->obj_cache;
223 return &
arena->ob_base;
251 return state->arena_type;
259 PyObject*
type = PyType_FromSpec(
spec);
269 const char*
name = strrchr(
spec->name,
'.');
275 PyObject*
type = PyType_FromSpec(
spec);
277 if (PyModule_AddObject(
m,
name,
type) < 0) {
281 return (PyTypeObject*)
type;
286 PyObject*
type = PyType_FromSpecWithBases(
spec, bases);
288 if (PyModule_AddObject(
m,
name,
type) < 0) {
292 return (PyTypeObject*)
type;
296 if (PyUnicode_Check(
obj)) {
297 return PyUnicode_AsUTF8AndSize(
obj, NULL);
298 }
else if (PyBytes_Check(
obj)) {
299 return PyBytes_AsString(
obj);
308 PyErr_Format(PyExc_TypeError,
"Expected string: %S",
obj);
313 PyObject*
name = PyObject_GetAttrString(cls,
"__name__");
314 PyErr_Format(PyExc_RuntimeError,
315 "Objects of type %U may not be created directly.",
name);
330 state->allow_oversize_protos =
false;
331 state->wkt_bases = NULL;
333 state->c_descriptor_symtab = NULL;
345 PyModule_AddIntConstant(
m,
"_IS_UPB", 1);
const char * PyUpb_GetStrData(PyObject *obj)
OPENSSL_EXPORT const ASN1_OBJECT * obj
void upb_inttable_removeiter(upb_inttable *t, intptr_t *iter)
void PyUpb_WeakMap_Delete(PyUpb_WeakMap *map, const void *key)
UPB_INLINE bool upb_inttable_insert(upb_inttable *t, uintptr_t key, upb_value val)
bool PyUpb_InitExtensionDict(PyObject *m)
static struct PyModuleDef module_def
bool PyUpb_Map_Init(PyObject *m)
bool PyUpb_InitDescriptorPool(PyObject *m)
PyUpb_ModuleState * PyUpb_ModuleState_GetFromModule(PyObject *module)
PyObject * PyUpb_SetAllowOversizeProtos(PyObject *m, PyObject *arg)
static PyType_Spec PyUpb_Arena_Spec
PyObject * PyUpb_GetWktBases(PyUpb_ModuleState *state)
UPB_INLINE upb_Arena * upb_Arena_New(void)
grpc_core::ScopedArenaPtr arena
PyTypeObject * PyUpb_AddClassWithBases(PyObject *m, PyType_Spec *spec, PyObject *bases)
static bool PyUpb_InitArena(PyObject *m)
bool upb_inttable_next2(const upb_inttable *t, uintptr_t *key, upb_value *val, intptr_t *iter)
bool PyUpb_Repeated_Init(PyObject *m)
void PyUpb_WeakMap_TryDelete(PyUpb_WeakMap *map, const void *key)
static PyType_Slot PyUpb_Arena_Slots[]
bool PyUpb_InitDescriptorContainers(PyObject *m)
static void PyUpb_Dealloc(void *self)
static PyMethodDef PyUpb_ModuleMethods[]
#define PYUPB_PROTOBUF_INTERNAL_PACKAGE
UPB_INLINE void * upb_Arena_Malloc(upb_Arena *a, size_t size)
UPB_INLINE bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype)
static void PyUpb_Arena_Dealloc(PyObject *self)
PyTypeObject * PyUpb_AddClass(PyObject *m, PyType_Spec *spec)
const char * PyUpb_VerifyStrData(PyObject *obj)
_W64 unsigned int uintptr_t
PyObject * PyUpb_Forbidden_New(PyObject *cls, PyObject *args, PyObject *kwds)
PyUpb_WeakMap * PyUpb_ObjCache_Instance(void)
void PyUpb_WeakMap_DeleteIter(PyUpb_WeakMap *map, intptr_t *iter)
PyObject * PyUpb_WeakMap_Get(PyUpb_WeakMap *map, const void *key)
void PyUpb_WeakMap_Add(PyUpb_WeakMap *map, const void *key, PyObject *py_obj)
PyObject * PyUpb_ObjCache_Get(const void *key)
PyUpb_ModuleState * PyUpb_ModuleState_Get(void)
upb_Arena * PyUpb_Arena_Get(PyObject *arena)
PyTypeObject * AddObject(PyObject *m, const char *name, PyType_Spec *spec)
bool PyUpb_InitDescriptor(PyObject *m)
PyObject * PyUpb_Arena_New(void)
#define PYUPB_MODULE_NAME
void upb_DefPool_Free(upb_DefPool *s)
bool upb_inttable_lookup(const upb_inttable *t, uintptr_t key, upb_value *v)
PyMODINIT_FUNC PyInit__message(void)
PyUpb_WeakMap * PyUpb_WeakMap_New(void)
bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val)
void PyUpb_ObjCache_Add(const void *key, PyObject *py_obj)
UniquePtr< SSL_SESSION > ret
bool PyUpb_InitMessage(PyObject *m)
static void PyUpb_ModuleDealloc(void *module)
void PyUpb_WeakMap_Free(PyUpb_WeakMap *map)
static const char * PyUpb_GetClassName(PyType_Spec *spec)
void PyUpb_ObjCache_Delete(const void *key)
uintptr_t PyUpb_WeakMap_GetKey(const void *key)
void upb_Arena_Free(upb_Arena *a)
PyUpb_ModuleState * PyUpb_ModuleState_MaybeGet(void)
static struct rpc_state state
bool PyUpb_WeakMap_Next(PyUpb_WeakMap *map, const void **key, PyObject **obj, intptr_t *iter)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:56