upb_extreg, upb_msg
diff --git a/python/message.c b/python/message.c index e2ac314..37d0aec 100644 --- a/python/message.c +++ b/python/message.c
@@ -192,7 +192,7 @@ uintptr_t def; // Tagged, low bit 1 == upb_FieldDef*, else upb_MessageDef* union { // when def is msgdef, the data for this msg. - upb_msg* msg; + upb_Message* msg; // when def is fielddef, owning pointer to parent struct PyUpb_CMessage* parent; } ptr; @@ -221,7 +221,7 @@ return _PyUpb_CMessage_GetMsgdef((PyUpb_CMessage*)self); } -static upb_msg* PyUpb_CMessage_GetMsg(PyUpb_CMessage* self) { +static upb_Message* PyUpb_CMessage_GetMsg(PyUpb_CMessage* self) { assert(!PyUpb_CMessage_IsStub(self)); return self->ptr.msg; } @@ -243,7 +243,7 @@ // If the message is reified, returns it. Otherwise, returns NULL. // If NULL is returned, the object is empty and has no underlying data. -upb_msg* PyUpb_CMessage_GetIfReified(PyObject* _self) { +upb_Message* PyUpb_CMessage_GetIfReified(PyObject* _self) { PyUpb_CMessage* self = (void*)_self; return PyUpb_CMessage_IsStub(self) ? NULL : self->ptr.msg; } @@ -422,7 +422,7 @@ return ok; } -static bool PyUpb_CMessage_InitScalarAttribute(upb_msg* msg, +static bool PyUpb_CMessage_InitScalarAttribute(upb_Message* msg, const upb_FieldDef* f, PyObject* value, upb_Arena* arena) { @@ -449,7 +449,7 @@ PyObject* name; PyObject* value; PyUpb_CMessage_EnsureReified(self); - upb_msg* msg = PyUpb_CMessage_GetMsg(self); + upb_Message* msg = PyUpb_CMessage_GetMsg(self); upb_Arena* arena = PyUpb_Arena_Get(self->arena); while (PyDict_Next(kwargs, &pos, &name, &value)) { @@ -520,8 +520,8 @@ const upb_MessageDef* m2_msgdef = _PyUpb_CMessage_GetMsgdef(m2); assert(m1_msgdef == m2_msgdef); #endif - const upb_msg* m1_msg = PyUpb_CMessage_GetIfReified((PyObject*)m1); - const upb_msg* m2_msg = PyUpb_CMessage_GetIfReified(_m2); + const upb_Message* m1_msg = PyUpb_CMessage_GetIfReified((PyObject*)m1); + const upb_Message* m2_msg = PyUpb_CMessage_GetIfReified(_m2); return PyUpb_Message_IsEqual(m1_msg, m2_msg, m1_msgdef); } @@ -566,8 +566,8 @@ if (!PyUpb_CMessage_IsStub(self)) return; upb_Arena* arena = PyUpb_Arena_Get(self->arena); - // This is a non-present message. We need to create a real upb_msg for this - // object and every parent until we reach a present message. + // This is a non-present message. We need to create a real upb_Message for + // this object and every parent until we reach a present message. PyUpb_CMessage* child = self; PyUpb_CMessage* parent = self->ptr.parent; const upb_FieldDef* child_f = PyUpb_CMessage_InitAsMsg(child, arena); @@ -600,7 +600,7 @@ * the set state (having a non-owning pointer to self->ptr.msg). */ static void PyUpb_CMessage_Reify(PyUpb_CMessage* self, const upb_FieldDef* f, - upb_msg* msg) { + upb_Message* msg) { assert(f == PyUpb_CMessage_GetFieldDef(self)); if (!msg) { const upb_MessageDef* msgdef = PyUpb_CMessage_GetMsgdef((PyObject*)self); @@ -616,7 +616,7 @@ /* * PyUpb_CMessage_SyncSubobjs() * - * This operation must be invoked whenever the underlying upb_msg has been + * This operation must be invoked whenever the underlying upb_Message has been * mutated directly in C. This will attach any newly-present field data * to previously returned stub wrapper objects. * @@ -635,7 +635,7 @@ PyUpb_WeakMap* subobj_map = self->unset_subobj_map; if (!subobj_map) return; - upb_msg* msg = PyUpb_CMessage_GetMsg(self); + upb_Message* msg = PyUpb_CMessage_GetMsg(self); intptr_t iter = PYUPB_WEAKMAP_BEGIN; const void* key; PyObject* obj; @@ -661,7 +661,7 @@ } else { PyUpb_CMessage* sub = (void*)obj; assert(self == sub->ptr.parent); - PyUpb_CMessage_Reify(sub, f, (upb_msg*)msgval.msg_val); + PyUpb_CMessage_Reify(sub, f, (upb_Message*)msgval.msg_val); } } @@ -675,7 +675,7 @@ if (PyUpb_CMessage_IsStub(self)) { return PyUnicode_FromStringAndSize(NULL, 0); } - upb_msg* msg = PyUpb_CMessage_GetMsg(self); + upb_Message* msg = PyUpb_CMessage_GetMsg(self); const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self); const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(msgdef)); char buf[1024]; @@ -749,7 +749,7 @@ } } -PyObject* PyUpb_CMessage_Get(upb_msg* u_msg, const upb_MessageDef* m, +PyObject* PyUpb_CMessage_Get(upb_Message* u_msg, const upb_MessageDef* m, PyObject* arena) { PyObject* ret = PyUpb_ObjCache_Get(u_msg); if (ret) return ret; @@ -1011,7 +1011,7 @@ } else { // We just need to return a boolean "true" or "false" for whether all // required fields are set. - upb_msg* msg = PyUpb_CMessage_GetIfReified(_self); + upb_Message* msg = PyUpb_CMessage_GetIfReified(_self); const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(_self); const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m)); bool initialized = !upb_util_HasUnsetRequired(msg, m, symtab, NULL); @@ -1052,7 +1052,7 @@ static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) { PyObject* list = PyList_New(0); - upb_msg* msg = PyUpb_CMessage_GetIfReified(_self); + upb_Message* msg = PyUpb_CMessage_GetIfReified(_self); if (!msg) return list; size_t iter1 = kUpb_Message_Begin; @@ -1145,7 +1145,7 @@ PyUpb_CMessage_EnsureReified(self); const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self); const upb_FileDef* file = upb_MessageDef_File(msgdef); - const upb_extreg* extreg = + const upb_ExtensionRegistry* extreg = upb_DefPool_ExtensionRegistry(upb_FileDef_Pool(file)); const upb_MiniTable* layout = upb_MessageDef_MiniTable(msgdef); upb_Arena* arena = PyUpb_Arena_Get(self->arena); @@ -1190,7 +1190,7 @@ PyUpb_WeakMap* subobj_map = self->unset_subobj_map; if (subobj_map) { - upb_msg* msg = PyUpb_CMessage_GetMsg(self); + upb_Message* msg = PyUpb_CMessage_GetMsg(self); intptr_t iter = PYUPB_WEAKMAP_BEGIN; const void* key; PyObject* obj; @@ -1290,7 +1290,7 @@ static PyObject* PyUpb_CMessage_FindInitializationErrors(PyObject* _self, PyObject* arg) { PyUpb_CMessage* self = (void*)_self; - upb_msg* msg = PyUpb_CMessage_GetIfReified(_self); + upb_Message* msg = PyUpb_CMessage_GetIfReified(_self); const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self); const upb_DefPool* ext_pool = upb_FileDef_Pool(upb_MessageDef_File(msgdef)); upb_FieldPathEntry* fields; @@ -1363,7 +1363,7 @@ static PyObject* PyUpb_CMessage_HasExtension(PyObject* _self, PyObject* ext_desc) { - upb_msg* msg = PyUpb_CMessage_GetIfReified(_self); + upb_Message* msg = PyUpb_CMessage_GetIfReified(_self); const upb_FieldDef* f = PyUpb_CMessage_GetExtensionDef(_self, ext_desc); if (!f) return NULL; if (upb_FieldDef_IsRepeated(f)) { @@ -1465,7 +1465,7 @@ if (!PyUpb_CMessage_LookupName(self, name, NULL, &o, PyExc_ValueError)) { return NULL; } - upb_msg* msg = PyUpb_CMessage_GetIfReified(_self); + upb_Message* msg = PyUpb_CMessage_GetIfReified(_self); if (!msg) Py_RETURN_NONE; const upb_FieldDef* f = upb_Message_WhichOneof(msg, o); if (!f) Py_RETURN_NONE;