1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  *     google/protobuf/any.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_
10 #define GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_
11 
12 #include "upb/collections/array_internal.h"
13 #include "upb/collections/map_gencode_util.h"
14 #include "upb/message/accessors.h"
15 #include "upb/message/internal.h"
16 #include "upb/mini_table/enum_internal.h"
17 #include "upb/wire/decode.h"
18 #include "upb/wire/decode_fast.h"
19 #include "upb/wire/encode.h"
20 
21 // Must be last.
22 #include "upb/port/def.inc"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 typedef struct google_protobuf_Any google_protobuf_Any;
29 extern const upb_MiniTable google_protobuf_Any_msg_init;
30 
31 
32 
33 /* google.protobuf.Any */
34 
google_protobuf_Any_new(upb_Arena * arena)35 UPB_INLINE google_protobuf_Any* google_protobuf_Any_new(upb_Arena* arena) {
36   return (google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena);
37 }
google_protobuf_Any_parse(const char * buf,size_t size,upb_Arena * arena)38 UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse(const char* buf, size_t size, upb_Arena* arena) {
39   google_protobuf_Any* ret = google_protobuf_Any_new(arena);
40   if (!ret) return NULL;
41   if (upb_Decode(buf, size, ret, &google_protobuf_Any_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
42     return NULL;
43   }
44   return ret;
45 }
google_protobuf_Any_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)46 UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse_ex(const char* buf, size_t size,
47                            const upb_ExtensionRegistry* extreg,
48                            int options, upb_Arena* arena) {
49   google_protobuf_Any* ret = google_protobuf_Any_new(arena);
50   if (!ret) return NULL;
51   if (upb_Decode(buf, size, ret, &google_protobuf_Any_msg_init, extreg, options, arena) !=
52       kUpb_DecodeStatus_Ok) {
53     return NULL;
54   }
55   return ret;
56 }
google_protobuf_Any_serialize(const google_protobuf_Any * msg,upb_Arena * arena,size_t * len)57 UPB_INLINE char* google_protobuf_Any_serialize(const google_protobuf_Any* msg, upb_Arena* arena, size_t* len) {
58   char* ptr;
59   (void)upb_Encode(msg, &google_protobuf_Any_msg_init, 0, arena, &ptr, len);
60   return ptr;
61 }
google_protobuf_Any_serialize_ex(const google_protobuf_Any * msg,int options,upb_Arena * arena,size_t * len)62 UPB_INLINE char* google_protobuf_Any_serialize_ex(const google_protobuf_Any* msg, int options,
63                                  upb_Arena* arena, size_t* len) {
64   char* ptr;
65   (void)upb_Encode(msg, &google_protobuf_Any_msg_init, options, arena, &ptr, len);
66   return ptr;
67 }
google_protobuf_Any_clear_type_url(google_protobuf_Any * msg)68 UPB_INLINE void google_protobuf_Any_clear_type_url(google_protobuf_Any* msg) {
69   const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
70   _upb_Message_ClearNonExtensionField(msg, &field);
71 }
google_protobuf_Any_type_url(const google_protobuf_Any * msg)72 UPB_INLINE upb_StringView google_protobuf_Any_type_url(const google_protobuf_Any* msg) {
73   upb_StringView default_val = upb_StringView_FromString("");
74   upb_StringView ret;
75   const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
76   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
77   return ret;
78 }
google_protobuf_Any_clear_value(google_protobuf_Any * msg)79 UPB_INLINE void google_protobuf_Any_clear_value(google_protobuf_Any* msg) {
80   const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
81   _upb_Message_ClearNonExtensionField(msg, &field);
82 }
google_protobuf_Any_value(const google_protobuf_Any * msg)83 UPB_INLINE upb_StringView google_protobuf_Any_value(const google_protobuf_Any* msg) {
84   upb_StringView default_val = upb_StringView_FromString("");
85   upb_StringView ret;
86   const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
87   _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
88   return ret;
89 }
90 
google_protobuf_Any_set_type_url(google_protobuf_Any * msg,upb_StringView value)91 UPB_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_StringView value) {
92   const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
93   _upb_Message_SetNonExtensionField(msg, &field, &value);
94 }
google_protobuf_Any_set_value(google_protobuf_Any * msg,upb_StringView value)95 UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_StringView value) {
96   const upb_MiniTableField field = {2, UPB_SIZE(8, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
97   _upb_Message_SetNonExtensionField(msg, &field, &value);
98 }
99 
100 extern const upb_MiniTableFile google_protobuf_any_proto_upb_file_layout;
101 
102 #ifdef __cplusplus
103 }  /* extern "C" */
104 #endif
105 
106 #include "upb/port/undef.inc"
107 
108 #endif  /* GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ */
109