Lines Matching defs:file

1 /* Amalgamated source file */
17 * // Code for this file.
23 * This file is private and must not be included by users!
2485 /* This file was generated by upbc (the upb compiler) from the input
2486 * file:
2490 * Do not edit -- your changes will be discarded when the file is
2990 const upb_filedef *file;
3022 const upb_filedef *file;
3045 const upb_filedef *file;
3345 return e->file;
3472 return f->file;
3585 f->file->syntax == UPB_SYNTAX_PROTO2;
3607 return m->file;
3615 return m->file->syntax;
4065 upb_filedef *file; /* File we are building. */
4442 f = (upb_fielddef*)&ctx->file->exts[ctx->file->ext_count++];
4449 f->file = ctx->file;
4462 if (f->label_ == UPB_LABEL_REQUIRED && f->file->syntax == UPB_SYNTAX_PROTO3) {
4526 e = (upb_enumdef*)&ctx->file->enums[ctx->file->enum_count++];
4533 e->file = ctx->file;
4552 if (i == 0 && e->file->syntax == UPB_SYNTAX_PROTO3 && num != 0) {
4593 m = (upb_msgdef*)&ctx->file->msgs[ctx->file->msg_count++];
4600 m->file = ctx->file;
4735 if (f->file->syntax == UPB_SYNTAX_PROTO3) {
4764 symtab_addctx *ctx, upb_filedef *file,
4777 file->msgs = upb_malloc(alloc, sizeof(*file->msgs) * counts.msg_count);
4778 file->enums = upb_malloc(alloc, sizeof(*file->enums) * counts.enum_count);
4779 file->exts = upb_malloc(alloc, sizeof(*file->exts) * counts.ext_count);
4781 CHK_OOM(counts.msg_count == 0 || file->msgs);
4782 CHK_OOM(counts.enum_count == 0 || file->enums);
4783 CHK_OOM(counts.ext_count == 0 || file->exts);
4786 file->msg_count = 0;
4787 file->enum_count = 0;
4788 file->ext_count = 0;
4795 file->name =
4797 file->phpprefix = NULL;
4798 file->phpnamespace = NULL;
4804 file->package = strviewdup(ctx, package);
4806 file->package = NULL;
4814 file->syntax = UPB_SYNTAX_PROTO2;
4816 file->syntax = UPB_SYNTAX_PROTO3;
4823 file->syntax = UPB_SYNTAX_PROTO2;
4830 file->phpprefix = strviewdup(
4835 file->phpnamespace = strviewdup(
4842 file->deps = upb_malloc(alloc, sizeof(*file->deps) * n) ;
4843 CHK_OOM(n == 0 || file->deps);
4851 "Depends on file '" UPB_STRVIEW_FORMAT
4856 file->deps[i] = upb_value_getconstptr(v);
4862 CHK(create_msgdef(ctx, file->package, msgs[i]));
4868 CHK(create_enumdef(ctx, file->package, enums[i]));
4873 file->exts = upb_malloc(alloc, sizeof(*file->exts) * n);
4874 CHK_OOM(n == 0 || file->exts);
4876 CHK(create_fielddef(ctx, file->package, NULL, exts[i]));
4880 for (i = 0; i < file->ext_count; i++) {
4881 CHK(resolve_fielddef(ctx, file->package, (upb_fielddef*)&file->exts[i]));
4884 for (i = 0; i < file->msg_count; i++) {
4885 const upb_msgdef *m = &file->msgs[i];
4893 for (i = 0; i < file->msg_count; i++) {
4894 const upb_msgdef *m = &file->msgs[i];
4904 const upb_filedef *file = ctx->file;
4908 CHK_OOM(upb_strtable_insert3(&s->files, file->name, strlen(file->name),
4909 upb_value_constptr(file), alloc));
5027 upb_filedef *file = upb_malloc(alloc, sizeof(*file));
5031 ctx.file = file;
5039 ok = file &&
5041 build_filedef(&ctx, file, file_proto) &&
5045 return ok ? file : NULL;
5054 /* Include here since we want most of this file to be stdio-free. */
5061 google_protobuf_FileDescriptorProto *file;
5077 file = google_protobuf_FileDescriptorProto_parse(
5080 if (!file) {
5083 "Failed to parse compiled-in descriptor for file '%s'. This should "
5089 if (!_upb_symtab_addfile(s, file, init->layouts, &status)) goto err;
6489 /* TODO: prioritize based on packed setting in .proto file. */
6964 /* Error messages shared within this file. */