|
|
|
@ -170,6 +170,17 @@ const upb_MiniTableExtension* _upb_FileDef_ExtensionMiniTable( |
|
|
|
|
return f->ext_layouts[i]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Note: Import cycles are not allowed so this will terminate.
|
|
|
|
|
bool upb_FileDef_Resolves(const upb_FileDef* f, const char* path) { |
|
|
|
|
if (!strcmp(f->name, path)) return true; |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < upb_FileDef_PublicDependencyCount(f); i++) { |
|
|
|
|
const upb_FileDef* dep = upb_FileDef_PublicDependency(f, i); |
|
|
|
|
if (upb_FileDef_Resolves(dep, path)) return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static char* strviewdup(upb_DefBuilder* ctx, upb_StringView view) { |
|
|
|
|
char* ret = upb_strdup2(view.data, view.size, _upb_DefBuilder_Arena(ctx)); |
|
|
|
|
if (!ret) _upb_DefBuilder_OomErr(ctx); |
|
|
|
|