Go to the documentation of this file.
88 destructor subtype_dealloc = PyType_GetSlot(type_subclass, Py_tp_dealloc);
90 destructor maybe_subtype_dealloc;
91 memcpy(&maybe_subtype_dealloc, (
char*)type_subclass +
i,
93 if (maybe_subtype_dealloc == subtype_dealloc) {
94 destructor type_dealloc;
95 memcpy(&type_dealloc, (
char*)&PyType_Type +
i,
sizeof(destructor));
104 PyObject* bases = NULL;
105 PyTypeObject*
type = NULL;
106 PyObject*
size = NULL;
107 PyObject* sys = NULL;
108 PyObject* hex_version = NULL;
115 static PyType_Slot dummy_slots[] = {{0, NULL}};
117 static PyType_Spec dummy_spec = {
125 bases = Py_BuildValue(
"(O)", &PyType_Type);
126 if (!bases)
goto err;
127 type = (PyTypeObject*)PyType_FromSpecWithBases(&dummy_spec, bases);
130 bits->type_new = PyType_GetSlot(
type, Py_tp_new);
132 bits->type_getattro = PyType_GetSlot(
type, Py_tp_getattro);
133 bits->type_setattro = PyType_GetSlot(
type, Py_tp_setattro);
135 size = PyObject_GetAttrString((PyObject*)&PyType_Type,
"__basicsize__");
137 bits->type_basicsize = PyLong_AsLong(
size);
138 if (
bits->type_basicsize == -1)
goto err;
140 assert(
bits->type_new);
141 assert(
bits->type_dealloc);
142 assert(
bits->type_getattro);
143 assert(
bits->type_setattro);
145 #ifndef Py_LIMITED_API
146 assert(
bits->type_new == PyType_Type.tp_new);
147 assert(
bits->type_dealloc == PyType_Type.tp_dealloc);
148 assert(
bits->type_getattro == PyType_Type.tp_getattro);
149 assert(
bits->type_setattro == PyType_Type.tp_setattro);
150 assert(
bits->type_basicsize ==
sizeof(PyHeapTypeObject));
153 sys = PyImport_ImportModule(
"sys");
154 hex_version = PyObject_GetAttrString(sys,
"hexversion");
155 bits->python_version_hex = PyLong_AsLong(hex_version);
163 Py_XDECREF(hex_version);
226 return self->ptr.msg;
237 PyErr_Format(PyExc_TypeError,
"Expected a message object, but got %R.",
252 PyObject* unused_kwargs) {
258 msg->unset_subobj_map = NULL;
259 msg->ext_dict = NULL;
262 PyObject*
ret = &
msg->ob_base;
279 PyObject* exc_type) {
282 const char*
name = NULL;
283 if (PyUnicode_Check(py_name)) {
284 name = PyUnicode_AsUTF8AndSize(py_name, &
size);
285 }
else if (PyBytes_Check(py_name)) {
286 PyBytes_AsStringAndSize(py_name, (
char**)&
name, &
size);
289 PyErr_Format(exc_type,
290 "Expected a field name, but got non-string argument %S.",
298 PyErr_Format(exc_type,
"Protocol message %s has no \"%s\" field.",
306 PyErr_Format(exc_type,
"Expected a field name, but got oneof name %s.",
314 PyErr_Format(exc_type,
"Expected a oneof name, but got field name %s.",
324 if (!src || !
dst)
return false;
328 PyObject*
ok = PyObject_CallMethod(
dst,
"Clear", NULL);
329 if (!
ok)
return false;
331 ok = PyObject_CallMethod(
dst,
"MergeFrom",
"O", src);
332 if (!
ok)
return false;
343 PyObject*
tmp = NULL;
348 PyErr_Format(PyExc_TypeError,
"Argument for field %s is not iterable",
353 while ((e = PyIter_Next(
it)) != NULL) {
354 PyObject* src = PyObject_GetItem(
value, e);
355 PyObject*
dst = PyObject_GetItem(
map, e);
363 tmp = PyObject_CallMethod(
map,
"update",
"O",
value);
389 PyObject*
tmp = NULL;
405 if (!submsg)
return -1;
406 assert(!PyErr_Occurred());
412 }
else if (PyDict_Check(
value)) {
413 assert(!PyErr_Occurred());
417 PyErr_Format(PyExc_TypeError,
"Message must be initialized with a dict: %s",
430 assert(!PyErr_Occurred());
438 assert(!PyErr_Occurred());
440 if (
args != NULL && PyTuple_Size(
args) != 0) {
441 PyErr_SetString(PyExc_TypeError,
"No positional arguments allowed");
445 if (kwargs == NULL)
return 0;
456 assert(!PyErr_Occurred());
458 assert(!PyErr_Occurred());
463 if (
value == Py_None)
continue;
465 assert(!PyErr_Occurred());
476 if (PyErr_Occurred())
return -1;
479 if (PyErr_Occurred())
return -1;
485 if (
args != NULL && PyTuple_Size(
args) != 0) {
486 PyErr_SetString(PyExc_TypeError,
"No positional arguments allowed");
502 msg->unset_subobj_map = NULL;
503 msg->ext_dict = NULL;
509 return &
msg->ob_base;
514 if (m1 == m2)
return true;
515 if (!PyObject_TypeCheck(_m2, m1->ob_base.ob_type)) {
521 assert(m1_msgdef == m2_msgdef);
610 Py_DECREF(&
self->ptr.parent->ob_base);
636 if (!subobj_map)
return;
648 Py_INCREF(&
self->ob_base);
668 Py_DECREF(&
self->ob_base);
676 return PyUnicode_FromStringAndSize(NULL, 0);
685 return PyUnicode_FromStringAndSize(
buf,
size);
689 assert(
size == size2);
690 PyObject*
ret = PyUnicode_FromStringAndSize(
buf2, size2);
699 if (opid != Py_EQ && opid != Py_NE) {
700 Py_INCREF(Py_NotImplemented);
701 return Py_NotImplemented;
704 if (opid == Py_NE)
ret = !
ret;
705 return PyBool_FromLong(
ret);
727 Py_DECREF(
self->ptr.parent);
732 if (
self->unset_subobj_map) {
736 Py_DECREF(
self->arena);
740 PyTypeObject* tp =
Py_TYPE(
self);
741 freefunc tp_free = PyType_GetSlot(tp, Py_tp_free);
759 PyUpb_CMessage* py_msg = (
void*)PyType_GenericAlloc((PyTypeObject*)cls, 0);
766 ret = &py_msg->ob_base;
796 PyObject* _self = (
void*)
self;
797 if (!
self->unset_subobj_map) {
802 if (subobj)
return subobj;
813 assert(!PyErr_Occurred());
872 PyObject*
value, PyObject* exc) {
878 "Assignment not allowed to message, map, or repeated "
879 "field \"%s\" in protocol message object.",
911 PyObject* _self, PyObject*
attr) {
921 assert(!PyErr_Occurred());
922 PyObject*
ret = PyObject_GenericGetAttr(_self,
attr);
930 if (PyErr_ExceptionMatches(PyExc_AttributeError) &&
950 PyExc_AttributeError)) {
955 PyExc_AttributeError);
968 PyErr_Format(PyExc_ValueError,
"Field %s does not have presence.",
986 if (!list)
return NULL;
987 bool ok = PyList_Size(list) == 0;
988 PyObject*
ret = NULL;
989 PyObject* extend_result = NULL;
991 extend_result = PyObject_CallMethod(
errors,
"extend",
"O", list);
992 if (!extend_result)
goto done;
994 ret = PyBool_FromLong(
ok);
998 Py_XDECREF(extend_result);
1004 if (!PyArg_ParseTuple(
args,
"|O", &
errors)) {
1024 assert(PyTuple_Check(val));
1025 PyObject*
field = PyTuple_GetItem(val, 0);
1033 PyObject*
args = PyTuple_New(0);
1034 PyObject* kwargs = PyDict_New();
1035 PyObject*
method = PyObject_GetAttrString(list,
"sort");
1036 PyObject* call_result = NULL;
1038 if (PyDict_SetItemString(kwargs,
"key",
state->listfields_item_key) < 0) {
1041 call_result = PyObject_Call(
method,
args, kwargs);
1042 if (!call_result)
goto err;
1049 Py_XDECREF(call_result);
1054 PyObject* list = PyList_New(0);
1056 if (!
msg)
return list;
1062 PyObject* field_desc = NULL;
1063 PyObject* py_val = NULL;
1064 PyObject* tuple = NULL;
1067 bool in_order =
true;
1070 if (field_number < last_field) in_order =
false;
1071 last_field = field_number;
1074 if (!field_desc || !py_val)
goto err;
1075 PyObject* tuple = Py_BuildValue(
"(NN)", field_desc, py_val);
1078 if (!tuple)
goto err;
1079 if (PyList_Append(list, tuple))
goto err;
1090 Py_XDECREF(field_desc);
1098 if (
self->ob_type !=
arg->ob_type) {
1099 PyErr_Format(PyExc_TypeError,
1100 "Parameter to MergeFrom() must be instance of same class: "
1101 "expected %S got %S.",
1106 PyObject* subargs = PyTuple_New(0);
1109 if (!serialized)
return NULL;
1111 Py_DECREF(serialized);
1125 PyErr_SetString(PyExc_NotImplementedError,
"unknown field accessor");
1133 PyObject*
bytes = NULL;
1135 if (PyMemoryView_Check(
arg)) {
1141 }
else if (PyBytes_AsStringAndSize(
arg, &
buf, &
size) < 0) {
1159 PyErr_Format(
state->decode_error_class,
"Error parsing message");
1163 return PyLong_FromSsize_t(
size);
1178 PyObject* subargs = PyTuple_New(0);
1181 if (!serialized)
return NULL;
1182 size_t size = PyBytes_Size(serialized);
1183 Py_DECREF(serialized);
1184 return PyLong_FromSize_t(
size);
1226 PyObject* sub =
self->unset_subobj_map
1256 if (!
f)
return NULL;
1297 PyObject*
ret = PyList_New(0);
1311 assert(
size > need);
1313 PyObject*
str = PyUnicode_FromString(
buf);
1323 PyObject* serialized) {
1324 PyObject*
ret = NULL;
1327 ret = PyObject_CallObject(cls, NULL);
1328 if (
ret == NULL)
goto err;
1347 PyErr_Format(PyExc_KeyError,
"Object %R is not a field descriptor\n",
key);
1351 PyErr_Format(PyExc_KeyError,
"Field %s is not an extension\n",
1357 PyErr_Format(PyExc_KeyError,
"Extension doesn't match (%s vs %s)",
1365 PyObject* ext_desc) {
1368 if (!
f)
return NULL;
1370 PyErr_SetString(PyExc_KeyError,
1371 "Field is repeated. A singular method is required.");
1374 if (!
msg) Py_RETURN_FALSE;
1381 PyObject* comma = PyUnicode_FromString(
",");
1382 PyObject* missing_fields = NULL;
1383 if (!comma)
goto done;
1384 missing_fields = PyUnicode_Join(comma,
errors);
1385 if (!missing_fields)
goto done;
1386 PyErr_Format(exc,
"Message %s is missing required fields: %U",
1390 Py_XDECREF(missing_fields);
1396 bool check_required) {
1399 static const char* kwlist[] = {
"deterministic", NULL};
1400 int deterministic = 0;
1401 if (!PyArg_ParseTupleAndKeywords(
args, kwargs,
"|p", (
char**)(kwlist),
1412 if (!
errors)
return NULL;
1413 if (PyList_Size(
errors) == 0) {
1415 return PyBytes_FromStringAndSize(NULL, 0);
1418 state->encode_error_class);
1430 PyObject*
ret = NULL;
1435 if (PyList_Size(
errors) != 0) {
1437 state->encode_error_class);
1439 PyErr_Format(
state->encode_error_class,
"Failed to serialize proto");
1444 ret = PyBytes_FromStringAndSize(pb,
size);
1469 if (!
msg) Py_RETURN_NONE;
1471 if (!
f) Py_RETURN_NONE;
1477 assert(
self->ext_dict);
1478 self->ext_dict = NULL;
1484 if (
self->ext_dict) {
1485 Py_INCREF(
self->ext_dict);
1486 return self->ext_dict;
1491 PyErr_SetNone(PyExc_AttributeError);
1496 return self->ext_dict;
1510 "Returns the size of the message in bytes."},
1512 "Clears the message."},
1514 "Clears a message field."},
1516 "Clears a message field."},
1521 METH_NOARGS,
"Discards the unknown fields."},
1523 METH_NOARGS,
"Finds unset required fields."},
1525 "Creates new method instance from given serialized data."},
1527 "Checks if a message field is set."},
1529 "Checks if a message field is set."},
1531 "Checks if all required fields of a protocol message are set."},
1533 "Lists all set fields of a message."},
1535 "Merges a protocol message into the current message."},
1537 "Merges a serialized message into the current message."},
1539 "Parses a serialized message into the current message."},
1544 {
"SerializePartialToString",
1546 METH_VARARGS | METH_KEYWORDS,
1547 "Serializes the message to a string, even if it isn't initialized."},
1549 METH_VARARGS | METH_KEYWORDS,
1550 "Serializes the message to a string, only for initialized messages."},
1552 "Sets the has bit of the given field in its parent message."},
1554 "Parse unknown field set"},
1556 "Returns the name of the field set inside a oneof, "
1557 "or None if no field is set."},
1559 METH_O | METH_STATIC,
1560 "Compares ListFields() list entries by field number"},
1565 {Py_tp_doc,
"A ProtocolMessage"},
1568 {Py_tp_hash, PyObject_HashNotImplemented},
1582 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1610 assert(!
state || cls->ob_type ==
state->message_meta_type);
1621 const char*
name, PyObject* dict) {
1625 return PyErr_Format(PyExc_TypeError,
"Expected a message Descriptor");
1632 PyObject* slots = PyTuple_New(0);
1633 if (!slots)
return NULL;
1634 int status = PyDict_SetItemString(dict,
"__slots__", slots);
1636 if (
status < 0)
return NULL;
1642 PyObject* wkt_base =
1645 if (wkt_base == NULL) {
1647 state->message_class, dict);
1650 state->message_class, wkt_base, dict);
1655 if (!
ret)
return NULL;
1670 static const char* kwlist[] = {
"name",
"bases",
"dict", 0};
1671 PyObject *bases, *dict;
1675 if (!PyArg_ParseTupleAndKeywords(
args, kwargs,
"sO!O!:type", (
char**)kwlist,
1676 &
name, &PyTuple_Type, &bases, &PyDict_Type,
1682 Py_ssize_t
size = PyTuple_Size(bases);
1684 (
size == 1 && PyTuple_GetItem(bases, 0) ==
state->message_class))) {
1685 PyErr_Format(PyExc_TypeError,
1686 "A Message class can only inherit from Message, not %S",
1692 PyObject* py_descriptor = PyDict_GetItemString(dict,
"DESCRIPTOR");
1693 if (py_descriptor == NULL) {
1694 PyErr_SetString(PyExc_TypeError,
"Message class has no DESCRIPTOR");
1708 PyTypeObject* tp =
Py_TYPE(
self);
1716 PyObject* upper = PyObject_CallMethod(
name,
"upper",
"");
1725 if (!name_buf)
return NULL;
1733 PyObject*
ret = NULL;
1743 PyObject*
klass =
state->enum_type_wrapper_class;
1745 ret = PyObject_CallFunctionObjArgs(
klass,
ret, NULL);
1754 const char*
suffix =
"_FIELD_NUMBER";
1755 size_t n = strlen(name_buf);
1756 size_t suffix_n = strlen(
suffix);
1757 if (
n > suffix_n && memcmp(
suffix, name_buf +
n - suffix_n, suffix_n) == 0) {
1762 for (
int i = 0;
i <
n;
i++) {
1766 for (
int i = 0;
i <
n;
i++) {
1770 ret = PyObject_GenericGetAttr(
self,
name);
1788 PyObject_SetAttr(
self,
name,
ret);
1793 PyErr_SetObject(PyExc_AttributeError,
name);
1809 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
1814 PyObject* bases = Py_BuildValue(
"(O)", &PyType_Type);
1815 if (!bases)
return NULL;
1829 state->message_meta_type = (PyTypeObject*)message_meta_type;
1831 if (!
state->cmessage_type || !
state->message_meta_type)
return false;
1832 if (PyModule_AddObject(
m,
"MessageMeta", message_meta_type))
return false;
1833 state->listfields_item_key = PyObject_GetAttrString(
1834 (PyObject*)
state->cmessage_type,
"_ListFieldsItemKey");
1838 if (mod == NULL)
return false;
1840 state->encode_error_class = PyObject_GetAttrString(mod,
"EncodeError");
1841 state->decode_error_class = PyObject_GetAttrString(mod,
"DecodeError");
1842 state->message_class = PyObject_GetAttrString(mod,
"Message");
1845 PyObject* enum_type_wrapper = PyImport_ImportModule(
1847 if (enum_type_wrapper == NULL)
return false;
1849 state->enum_type_wrapper_class =
1850 PyObject_GetAttrString(enum_type_wrapper,
"EnumTypeWrapper");
1851 Py_DECREF(enum_type_wrapper);
1853 if (!
state->encode_error_class || !
state->decode_error_class ||
1854 !
state->message_class || !
state->listfields_item_key ||
1855 !
state->enum_type_wrapper_class) {
static PyObject * PyUpb_CMessage_IsInitialized(PyObject *_self, PyObject *args)
static PyObject * PyUpb_CMessage_NewStub(PyObject *parent, const upb_FieldDef *f, PyObject *arena)
uint32_t upb_FieldDef_Number(const upb_FieldDef *f)
const char * PyUpb_GetStrData(PyObject *obj)
OPENSSL_EXPORT const ASN1_OBJECT * obj
static const upb_FieldDef * PyUpb_CMessage_InitAsMsg(PyUpb_CMessage *m, upb_Arena *arena)
void PyUpb_WeakMap_Delete(PyUpb_WeakMap *map, const void *key)
destructor upb_Pre310_PyType_GetDeallocSlot(PyTypeObject *type_subclass)
#define UPB_DECODE_MAXDEPTH(depth)
const upb_EnumDef * upb_DefPool_FindEnumByName(const upb_DefPool *s, const char *sym)
PyObject * PyUpb_CMessage_MergeFrom(PyObject *self, PyObject *arg)
void PyUpb_CMessage_DoClearField(PyObject *_self, const upb_FieldDef *f)
static PyObject * PyUpb_MessageMeta_GetDynamicAttr(PyObject *self, PyObject *name)
void upb_Message_Clear(upb_Message *msg, const upb_MessageDef *m)
PyObject * PyUpb_CMessage_GetScalarValue(PyUpb_CMessage *self, const upb_FieldDef *field)
@ kUpb_Encode_Deterministic
PyType_Spec PyUpb_CMessage_Spec
const upb_MiniTable * upb_MessageDef_MiniTable(const upb_MessageDef *m)
static const upb_MessageDef * _PyUpb_CMessage_GetMsgdef(PyUpb_CMessage *msg)
@ kUpb_Encode_CheckRequired
bool PyUpb_CMessage_IsStub(PyUpb_CMessage *msg)
static PyType_Slot PyUpb_CMessage_Slots[]
PyUpb_WeakMap * unset_subobj_map
void PyUpb_MapContainer_Reify(PyObject *_self, upb_Map *map)
bool PyUpb_CMessage_Verify(PyObject *self)
PyObject * PyUpb_EnumDescriptor_Get(const upb_EnumDef *enumdef)
PyObject * PyUpb_MessageMeta_DoCreateClass(PyObject *py_descriptor, const char *name, PyObject *dict)
upb_DecodeStatus upb_Decode(const char *buf, size_t size, void *msg, const upb_MiniTable *l, const upb_ExtensionRegistry *extreg, int options, upb_Arena *arena)
bool upb_MessageDef_FindByNameWithSize(const upb_MessageDef *m, const char *name, size_t len, const upb_FieldDef **out_f, const upb_OneofDef **out_o)
const upb_ExtensionRegistry * upb_DefPool_ExtensionRegistry(const upb_DefPool *s)
void PyUpb_MessageMeta_AddFieldNumber(PyObject *self, const upb_FieldDef *f)
static bool PyUpb_CMessage_InitScalarAttribute(upb_Message *msg, const upb_FieldDef *f, PyObject *value, upb_Arena *arena)
static PyObject * PyUpb_CMessage_ClearField(PyObject *_self, PyObject *arg)
const upb_EnumValueDef * upb_DefPool_FindEnumByNameval(const upb_DefPool *s, const char *sym)
void upb_Message_ClearField(upb_Message *msg, const upb_FieldDef *f)
PyObject * PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef *f, PyObject *arena)
PyUpb_ModuleState * PyUpb_ModuleState_GetFromModule(PyObject *module)
const upb_MessageDef * PyUpb_CMessage_GetMsgdef(PyObject *self)
const upb_MessageDef * PyUpb_Descriptor_GetDef(PyObject *_self)
static PyObject * PyUpb_CMessage_RichCompare(PyObject *_self, PyObject *other, int opid)
void PyUpb_MapContainer_Invalidate(PyObject *obj)
zend_class_entry * descriptor_type
void PyUpb_CMessage_SetConcreteSubobj(PyObject *_self, const upb_FieldDef *f, upb_MessageValue subobj)
static PyObject * PyUpb_CMessage_New(PyObject *cls, PyObject *unused_args, PyObject *unused_kwargs)
PyObject * PyUpb_RepeatedContainer_Extend(PyObject *_self, PyObject *value)
static PyObject * PyUpb_CMessage_ByteSize(PyObject *self, PyObject *args)
static bool PyUpb_CMessage_LookupName(PyUpb_CMessage *self, PyObject *py_name, const upb_FieldDef **f, const upb_OneofDef **o, PyObject *exc_type)
int upb_MessageDef_NestedExtensionCount(const upb_MessageDef *m)
PyObject * PyUpb_GetWktBases(PyUpb_ModuleState *state)
void PyUpb_CMessage_ReportInitializationErrors(const upb_MessageDef *msgdef, PyObject *errors, PyObject *exc)
UPB_INLINE upb_Arena * upb_Arena_New(void)
upb_Map * PyUpb_MapContainer_EnsureReified(PyObject *_self)
grpc_core::ScopedArenaPtr arena
const upb_Array * array_val
static PyType_Slot PyUpb_MessageMeta_Slots[]
static int PyUpb_CMessage_SetAttr(PyObject *_self, PyObject *attr, PyObject *value)
static PyUpb_MessageMeta * PyUpb_GetMessageMeta(PyObject *cls)
upb_Message * upb_Message_New(const upb_MessageDef *m, upb_Arena *a)
PyUpb_CPythonBits cpython_bits
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static PyObject * PyUpb_CMessage_FindInitializationErrors(PyObject *_self, PyObject *arg)
const char * upb_MessageDef_Name(const upb_MessageDef *m)
static PyObject * PyUpb_CMessage_IsInitializedAppendErrors(PyObject *_self, PyObject *errors)
#define kUpb_Message_Begin
union PyUpb_CMessage::@695 ptr
bool upb_FieldDef_IsMap(const upb_FieldDef *f)
PyObject * PyUpb_CMessage_SerializeToString(PyObject *_self, PyObject *args, PyObject *kwargs)
void PyUpb_RepeatedContainer_Reify(PyObject *_self, upb_Array *arr)
bool upb_FieldDef_HasPresence(const upb_FieldDef *f)
static PyObject * PyUpb_CMessage_HasExtension(PyObject *_self, PyObject *ext_desc)
static PyObject * PyUpb_CMessage_FromString(PyObject *cls, PyObject *serialized)
#define PYUPB_PROTOBUF_INTERNAL_PACKAGE
static PyObject * PyUpb_CMessage_DiscardUnknownFields(PyUpb_CMessage *self, PyObject *arg)
const upb_DefPool * upb_FileDef_Pool(const upb_FileDef *f)
bool upb_Message_DiscardUnknown(upb_Message *msg, const upb_MessageDef *m, int maxdepth)
#define UPB_ENCODE_MAXDEPTH(depth)
OPENSSL_EXPORT ASN1_BIT_STRING * bits
upb_MessageValue upb_FieldDef_Default(const upb_FieldDef *f)
getattrofunc type_getattro
static PyObject * PyUpb_CMessage_GetExtensionDict(PyObject *_self, void *closure)
bool upb_FieldDef_IsExtension(const upb_FieldDef *f)
struct PyUpb_CMessage PyUpb_CMessage
#define PYUPB_WEAKMAP_BEGIN
static PyObject * PyUpb_MessageMeta_New(PyTypeObject *type, PyObject *args, PyObject *kwargs)
static void PyUpb_CMessage_Reify(PyUpb_CMessage *self, const upb_FieldDef *f, upb_Message *msg)
PyTypeObject * PyUpb_AddClass(PyObject *m, PyType_Spec *spec)
bool upb_Message_Next(const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, const upb_FieldDef **out_f, upb_MessageValue *out_val, size_t *iter)
static bool PyUpb_CMessage_InitMessageAttribute(PyObject *_self, PyObject *name, PyObject *value)
PyObject * PyUpb_FieldDescriptor_Get(const upb_FieldDef *field)
bool upb_util_HasUnsetRequired(const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, upb_FieldPathEntry **fields)
PyObject * PyUpb_ExtensionDict_New(PyObject *msg)
static PyGetSetDef PyUpb_CMessage_Getters[]
const upb_Message * msg_val
static int PyUpb_CMessage_Init(PyObject *_self, PyObject *args, PyObject *kwargs)
_W64 unsigned int uintptr_t
void PyUpb_CMessage_CacheDelete(PyObject *_self, const upb_FieldDef *f)
void PyUpb_WeakMap_DeleteIter(PyUpb_WeakMap *map, intptr_t *iter)
#define PYUPB_PROTOBUF_PUBLIC_PACKAGE
const upb_MessageDef * upb_FieldDef_MessageSubDef(const upb_FieldDef *f)
PyObject * PyUpb_WeakMap_Get(PyUpb_WeakMap *map, const void *key)
const upb_FieldDef * PyUpb_FieldDescriptor_GetDef(PyObject *_self)
static bool PyUpb_CMessage_InitMessageMapEntry(PyObject *dst, PyObject *src)
static bool PyUpb_CMessage_SortFieldList(PyObject *list)
void PyUpb_WeakMap_Add(PyUpb_WeakMap *map, const void *key, PyObject *py_obj)
PyObject * PyUpb_CMessage_GetStub(PyUpb_CMessage *self, const upb_FieldDef *field)
int upb_MessageDef_ExtensionRangeCount(const upb_MessageDef *m)
static bool PyUpb_CMessage_InitRepeatedAttribute(PyObject *_self, PyObject *name, PyObject *value)
PyObject * PyUpb_RepeatedContainer_NewStub(PyObject *parent, const upb_FieldDef *f, PyObject *arena)
bool upb_Message_Has(const upb_Message *msg, const upb_FieldDef *f)
PyObject * PyUpb_CMessage_SerializeInternal(PyObject *_self, PyObject *args, PyObject *kwargs, bool check_required)
PyObject * PyUpb_RepeatedContainer_GetOrCreateWrapper(upb_Array *arr, const upb_FieldDef *f, PyObject *arena)
PyObject * PyUpb_MapContainer_NewStub(PyObject *parent, const upb_FieldDef *f, PyObject *arena)
PyObject * PyUpb_ObjCache_Get(const void *key)
int PyUpb_CMessage_InitMapAttributes(PyObject *map, PyObject *value, const upb_FieldDef *f)
PyUpb_ModuleState * PyUpb_ModuleState_Get(void)
static bool PyUpb_CMessage_IsEqual(PyUpb_CMessage *m1, PyObject *_m2)
size_t upb_TextEncode(const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, int options, char *buf, size_t size)
static PyObject * PyUpb_CMessage_HasField(PyObject *_self, PyObject *arg)
static PyObject * PyUpb_CMessage_ToString(PyUpb_CMessage *self)
char * upb_Encode(const void *msg, const upb_MiniTable *l, int options, upb_Arena *arena, size_t *size)
upb_Arena * PyUpb_Arena_Get(PyObject *arena)
OPENSSL_EXPORT X509_ATTRIBUTE * attr
const upb_MessageDef * upb_FieldDef_ContainingType(const upb_FieldDef *f)
static void PyUpb_CMessage_SetField(PyUpb_CMessage *parent, const upb_FieldDef *f, PyUpb_CMessage *child, upb_Arena *arena)
const upb_FieldDef * PyUpb_CMessage_GetExtensionDef(PyObject *_self, PyObject *key)
static PyType_Spec PyUpb_MessageMeta_Spec
const FieldDescriptor * field
PyObject * PyUpb_Arena_New(void)
#define PYUPB_MODULE_NAME
unsigned char suffix[65536]
PyUpb_WeakMap * PyUpb_WeakMap_New(void)
const upb_FieldDef * PyUpb_CMessage_GetFieldDef(PyUpb_CMessage *msg)
upb_MutableMessageValue upb_Message_Mutable(upb_Message *msg, const upb_FieldDef *f, upb_Arena *a)
const upb_FieldDef * upb_MessageDef_NestedExtension(const upb_MessageDef *m, int i)
PyObject * PyUpb_CMessage_MergeFromString(PyObject *_self, PyObject *arg)
upb_MessageValue upb_Message_Get(const upb_Message *msg, const upb_FieldDef *f)
static PyObject * PyUpb_CMessage_UnknownFields(PyObject *_self, PyObject *arg)
bool upb_FieldDef_IsRepeated(const upb_FieldDef *f)
size_t upb_FieldPath_ToText(upb_FieldPathEntry **path, char *buf, size_t size)
const upb_FieldDef * upb_Message_WhichOneof(const upb_Message *msg, const upb_OneofDef *o)
void PyUpb_ObjCache_Add(const void *key, PyObject *py_obj)
static PyObject * PyUpb_CMessage_SetInParent(PyObject *_self, PyObject *arg)
UniquePtr< SSL_SESSION > ret
bool PyUpb_InitMessage(PyObject *m)
static void PyUpb_CMessage_Dealloc(PyObject *_self)
void PyUpb_CMessage_ClearExtensionDict(PyObject *_self)
void PyUpb_CMessage_EnsureReified(PyUpb_CMessage *self)
const upb_msgdef * msgdef
static PyObject * PyUpb_MessageMeta_CreateType(void)
const upb_enumdef * enumdef
upb_Array * PyUpb_RepeatedContainer_EnsureReified(PyObject *_self)
static bool PyUpb_CPythonBits_Init(PyUpb_CPythonBits *bits)
const upb_FieldDef * upb_DefPool_FindExtensionByName(const upb_DefPool *s, const char *sym)
const char * upb_MessageDef_FullName(const upb_MessageDef *m)
PyObject * PyUpb_MapContainer_GetOrCreateWrapper(upb_Map *map, const upb_FieldDef *f, PyObject *arena)
PyObject * PyUpb_CMessage_Get(upb_Message *u_msg, const upb_MessageDef *m, PyObject *arena)
static bool PyUpb_CMessage_InitMapAttribute(PyObject *_self, PyObject *name, const upb_FieldDef *f, PyObject *value)
const upb_FileDef * upb_MessageDef_File(const upb_MessageDef *m)
static PyObject * PyUpb_MessageMeta_GetAttr(PyObject *self, PyObject *name)
static PyObject * PyUpb_CMessage_Clear(PyUpb_CMessage *self, PyObject *args)
PyObject * PyUpb_CMessage_SerializePartialToString(PyObject *_self, PyObject *args, PyObject *kwargs)
static void PyUpb_CMessage_SyncSubobjs(PyUpb_CMessage *self)
setattrofunc type_setattro
bool upb_FieldDef_IsSubMessage(const upb_FieldDef *f)
static const upb_MessageDef * PyUpb_MessageMeta_GetMsgdef(PyObject *cls)
PyObject * PyUpb_CMessage_GetFieldValue(PyObject *_self, const upb_FieldDef *field)
PyObject * PyUpb_Descriptor_GetClass(const upb_MessageDef *m)
static PyObject * PyUpb_CMessage_ListFields(PyObject *_self, PyObject *arg)
static upb_Message * PyUpb_CMessage_GetMsg(PyUpb_CMessage *self)
const char * upb_FieldDef_Name(const upb_FieldDef *f)
struct PyUpb_CMessage * parent
static PyObject * PyUpb_CMessage_ListFieldsItemKey(PyObject *self, PyObject *val)
bool PyUpb_CMessage_TryCheck(PyObject *self)
static PyObject * PyUpb_CMessage_ParseFromString(PyObject *self, PyObject *arg)
int upb_MessageDef_FieldCount(const upb_MessageDef *m)
void PyUpb_WeakMap_Free(PyUpb_WeakMap *map)
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
const upb_FieldDef * upb_MessageDef_Field(const upb_MessageDef *m, int i)
bool upb_Message_Set(upb_Message *msg, const upb_FieldDef *f, upb_MessageValue val, upb_Arena *a)
int PyUpb_CMessage_InitAttributes(PyObject *_self, PyObject *args, PyObject *kwargs)
int PyUpb_CMessage_SetFieldValue(PyObject *_self, const upb_FieldDef *field, PyObject *value, PyObject *exc)
void PyUpb_ObjCache_Delete(const void *key)
static void PyUpb_MessageMeta_Dealloc(PyObject *self)
upb_Message * PyUpb_CMessage_GetIfReified(PyObject *_self)
static PyMethodDef PyUpb_CMessage_Methods[]
int32_t upb_EnumValueDef_Number(const upb_EnumValueDef *ev)
const upb_MessageDef * upb_DefPool_FindMessageByName(const upb_DefPool *s, const char *sym)
static grpc_slice repeated(char c, size_t length)
void upb_Arena_Free(upb_Arena *a)
PyUpb_ModuleState * PyUpb_ModuleState_MaybeGet(void)
static PyObject * PyUpb_CMessage_GetAttr(PyObject *_self, PyObject *attr)
const char * upb_FieldDef_FullName(const upb_FieldDef *f)
int PyUpb_CMessage_GetVersion(PyObject *_self)
static PyObject * PyUpb_CMessage_WhichOneof(PyObject *_self, PyObject *name)
PyObject * PyUpb_CMessage_GetPresentWrapper(PyUpb_CMessage *self, const upb_FieldDef *field)
static PyObject * PyUpb_CMessage_ClearExtension(PyObject *_self, PyObject *arg)
bool PyUpb_PyToUpb(PyObject *obj, const upb_FieldDef *f, upb_MessageValue *val, upb_Arena *arena)
bool PyUpb_WeakMap_Next(PyUpb_WeakMap *map, const void **key, PyObject **obj, intptr_t *iter)
bool PyUpb_Message_IsEqual(const upb_Message *msg1, const upb_Message *msg2, const upb_MessageDef *m)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:36