Skip to content

Commit

Permalink
Auto-generate files after cl/625324587
Browse files Browse the repository at this point in the history
  • Loading branch information
protobuf-team-bot committed Apr 16, 2024
1 parent 622f291 commit 55696ad
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions php/ext/google/protobuf/php-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -14651,6 +14651,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);
Expand Down
3 changes: 3 additions & 0 deletions php/ext/google/protobuf/php-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -11566,6 +11566,9 @@ int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);

// Returns whether |symbol| is transitively included by |f|
bool upb_FileDef_Resolves(const upb_FileDef* f, const char* symbol);

#ifdef __cplusplus
} /* extern "C" */
#endif
Expand Down
11 changes: 11 additions & 0 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -14142,6 +14142,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);
Expand Down
3 changes: 3 additions & 0 deletions ruby/ext/google/protobuf_c/ruby-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -11968,6 +11968,9 @@ int upb_FileDef_TopLevelMessageCount(const upb_FileDef* f);
const upb_FileDef* upb_FileDef_WeakDependency(const upb_FileDef* f, int i);
int upb_FileDef_WeakDependencyCount(const upb_FileDef* f);

// Returns whether |symbol| is transitively included by |f|
bool upb_FileDef_Resolves(const upb_FileDef* f, const char* symbol);

#ifdef __cplusplus
} /* extern "C" */
#endif
Expand Down

0 comments on commit 55696ad

Please sign in to comment.