Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:19

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2023 Google LLC.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef UPB_UTIL_DEF_TO_PROTO_H_
0009 #define UPB_UTIL_DEF_TO_PROTO_H_
0010 
0011 #include "upb/reflection/def.h"
0012 
0013 #ifdef __cplusplus
0014 extern "C" {
0015 #endif
0016 
0017 // Functions for converting defs back to the equivalent descriptor proto.
0018 // Ultimately the goal is that a round-trip proto->def->proto is lossless.  Each
0019 // function returns a new proto created in arena `a`, or NULL if memory
0020 // allocation failed.
0021 google_protobuf_DescriptorProto* upb_MessageDef_ToProto(const upb_MessageDef* m,
0022                                                         upb_Arena* a);
0023 google_protobuf_EnumDescriptorProto* upb_EnumDef_ToProto(const upb_EnumDef* e,
0024                                                          upb_Arena* a);
0025 google_protobuf_EnumValueDescriptorProto* upb_EnumValueDef_ToProto(
0026     const upb_EnumValueDef* e, upb_Arena* a);
0027 google_protobuf_FieldDescriptorProto* upb_FieldDef_ToProto(
0028     const upb_FieldDef* f, upb_Arena* a);
0029 google_protobuf_OneofDescriptorProto* upb_OneofDef_ToProto(
0030     const upb_OneofDef* o, upb_Arena* a);
0031 google_protobuf_FileDescriptorProto* upb_FileDef_ToProto(const upb_FileDef* f,
0032                                                          upb_Arena* a);
0033 google_protobuf_MethodDescriptorProto* upb_MethodDef_ToProto(
0034     const upb_MethodDef* m, upb_Arena* a);
0035 google_protobuf_ServiceDescriptorProto* upb_ServiceDef_ToProto(
0036     const upb_ServiceDef* s, upb_Arena* a);
0037 
0038 #ifdef __cplusplus
0039 } /* extern "C" */
0040 #endif
0041 
0042 #endif /* UPB_UTIL_DEF_TO_PROTO_H_ */