diff --git a/python/BUILD b/python/BUILD index f85894d75d..453850ffa6 100644 --- a/python/BUILD +++ b/python/BUILD @@ -207,7 +207,6 @@ py_extension( "//:descriptor_upb_proto_reflection", "//:port", "//:reflection", - "//:reflection_internal", "//:table_internal", "//:textformat", "//:upb", diff --git a/python/extension_dict.c b/python/extension_dict.c index c3180567e0..daf80e4a90 100644 --- a/python/extension_dict.c +++ b/python/extension_dict.c @@ -29,7 +29,7 @@ #include "python/message.h" #include "python/protobuf.h" -#include "upb/reflection/def_pool_internal.h" +#include "upb/reflection/def.h" // ----------------------------------------------------------------------------- // ExtensionDict @@ -76,7 +76,7 @@ static PyObject* PyUpb_ExtensionDict_FindExtensionByNumber(PyObject* _self, const upb_MiniTable_Extension* ext = (upb_MiniTable_Extension*)_upb_extreg_get(reg, l, number); if (ext) { - const upb_FieldDef* f = _upb_DefPool_FindExtensionByMiniTable(symtab, ext); + const upb_FieldDef* f = upb_DefPool_FindExtensionByMiniTable(symtab, ext); return PyUpb_FieldDescriptor_Get(f); } else { Py_RETURN_NONE; diff --git a/upb/reflection/def_pool.c b/upb/reflection/def_pool.c index 46169e6598..44679f3f8d 100644 --- a/upb/reflection/def_pool.c +++ b/upb/reflection/def_pool.c @@ -400,7 +400,7 @@ size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s) { upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s) { return s->arena; } -const upb_FieldDef* _upb_DefPool_FindExtensionByMiniTable( +const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable( const upb_DefPool* s, const upb_MiniTable_Extension* ext) { upb_value v; bool ok = upb_inttable_lookup(&s->exts, (uintptr_t)ext, &v); @@ -413,7 +413,7 @@ const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, int32_t fieldnum) { const upb_MiniTable* l = upb_MessageDef_MiniTable(m); const upb_MiniTable_Extension* ext = _upb_extreg_get(s->extreg, l, fieldnum); - return ext ? _upb_DefPool_FindExtensionByMiniTable(s, ext) : NULL; + return ext ? upb_DefPool_FindExtensionByMiniTable(s, ext) : NULL; } const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( diff --git a/upb/reflection/def_pool.h b/upb/reflection/def_pool.h index 7c5a2f80f5..256c06b2ce 100644 --- a/upb/reflection/def_pool.h +++ b/upb/reflection/def_pool.h @@ -64,12 +64,19 @@ const upb_FileDef* upb_DefPool_FindFileByNameWithSize(const upb_DefPool* s, const char* name, size_t len); -const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize( - const upb_DefPool* s, const char* name, size_t size); +const upb_FieldDef* upb_DefPool_FindExtensionByMiniTable( + const upb_DefPool* s, const upb_MiniTable_Extension* ext); const upb_FieldDef* upb_DefPool_FindExtensionByName(const upb_DefPool* s, const char* sym); +const upb_FieldDef* upb_DefPool_FindExtensionByNameWithSize( + const upb_DefPool* s, const char* name, size_t size); + +const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, + const upb_MessageDef* m, + int32_t fieldnum); + const upb_ServiceDef* upb_DefPool_FindServiceByName(const upb_DefPool* s, const char* name); @@ -83,10 +90,6 @@ const upb_FileDef* upb_DefPool_AddFile( upb_DefPool* s, const google_protobuf_FileDescriptorProto* file_proto, upb_Status* status); -const upb_FieldDef* upb_DefPool_FindExtensionByNumber(const upb_DefPool* s, - const upb_MessageDef* m, - int32_t fieldnum); - const upb_ExtensionRegistry* upb_DefPool_ExtensionRegistry( const upb_DefPool* s); diff --git a/upb/reflection/def_pool_internal.h b/upb/reflection/def_pool_internal.h index 9df86a17a8..5da30a97a3 100644 --- a/upb/reflection/def_pool_internal.h +++ b/upb/reflection/def_pool_internal.h @@ -40,8 +40,6 @@ extern "C" { upb_Arena* _upb_DefPool_Arena(const upb_DefPool* s); size_t _upb_DefPool_BytesLoaded(const upb_DefPool* s); upb_ExtensionRegistry* _upb_DefPool_ExtReg(const upb_DefPool* s); -const upb_FieldDef* _upb_DefPool_FindExtensionByMiniTable( - const upb_DefPool* s, const upb_MiniTable_Extension* ext); bool _upb_DefPool_InsertExt(upb_DefPool* s, const upb_MiniTable_Extension* ext, upb_FieldDef* f); diff --git a/upb/reflection/message.c b/upb/reflection/message.c index 7362471152..48377bb315 100644 --- a/upb/reflection/message.c +++ b/upb/reflection/message.c @@ -32,7 +32,7 @@ #include "upb/internal/table.h" #include "upb/map.h" #include "upb/msg.h" -#include "upb/reflection/def_pool_internal.h" +#include "upb/reflection/def_pool.h" #include "upb/reflection/def_type.h" #include "upb/reflection/field_def_internal.h" #include "upb/reflection/message_def.h" @@ -267,7 +267,7 @@ bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, if (i - n < count) { ext += count - 1 - (i - n); memcpy(out_val, &ext->data, sizeof(*out_val)); - *out_f = _upb_DefPool_FindExtensionByMiniTable(ext_pool, ext->ext); + *out_f = upb_DefPool_FindExtensionByMiniTable(ext_pool, ext->ext); *iter = i; return true; }