• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  *     udpa/type/v1/typed_struct.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
10 #define UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
11 
12 #include "upb/msg.h"
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
16 
17 #include "upb/port_def.inc"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 struct udpa_type_v1_TypedStruct;
24 typedef struct udpa_type_v1_TypedStruct udpa_type_v1_TypedStruct;
25 extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
26 struct google_protobuf_Struct;
27 extern const upb_msglayout google_protobuf_Struct_msginit;
28 
29 
30 /* udpa.type.v1.TypedStruct */
31 
udpa_type_v1_TypedStruct_new(upb_arena * arena)32 UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_new(upb_arena *arena) {
33   return (udpa_type_v1_TypedStruct *)_upb_msg_new(&udpa_type_v1_TypedStruct_msginit, arena);
34 }
udpa_type_v1_TypedStruct_parse(const char * buf,size_t size,upb_arena * arena)35 UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse(const char *buf, size_t size,
36                         upb_arena *arena) {
37   udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
38   return (ret && upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena)) ? ret : NULL;
39 }
udpa_type_v1_TypedStruct_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)40 UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse_ex(const char *buf, size_t size,
41                            upb_arena *arena, int options) {
42   udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
43   return (ret && _upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena, options))
44       ? ret : NULL;
45 }
udpa_type_v1_TypedStruct_serialize(const udpa_type_v1_TypedStruct * msg,upb_arena * arena,size_t * len)46 UPB_INLINE char *udpa_type_v1_TypedStruct_serialize(const udpa_type_v1_TypedStruct *msg, upb_arena *arena, size_t *len) {
47   return upb_encode(msg, &udpa_type_v1_TypedStruct_msginit, arena, len);
48 }
49 
udpa_type_v1_TypedStruct_type_url(const udpa_type_v1_TypedStruct * msg)50 UPB_INLINE upb_strview udpa_type_v1_TypedStruct_type_url(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
udpa_type_v1_TypedStruct_has_value(const udpa_type_v1_TypedStruct * msg)51 UPB_INLINE bool udpa_type_v1_TypedStruct_has_value(const udpa_type_v1_TypedStruct *msg) { return _upb_hasbit(msg, 1); }
udpa_type_v1_TypedStruct_value(const udpa_type_v1_TypedStruct * msg)52 UPB_INLINE const struct google_protobuf_Struct* udpa_type_v1_TypedStruct_value(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); }
53 
udpa_type_v1_TypedStruct_set_type_url(udpa_type_v1_TypedStruct * msg,upb_strview value)54 UPB_INLINE void udpa_type_v1_TypedStruct_set_type_url(udpa_type_v1_TypedStruct *msg, upb_strview value) {
55   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
56 }
udpa_type_v1_TypedStruct_set_value(udpa_type_v1_TypedStruct * msg,struct google_protobuf_Struct * value)57 UPB_INLINE void udpa_type_v1_TypedStruct_set_value(udpa_type_v1_TypedStruct *msg, struct google_protobuf_Struct* value) {
58   _upb_sethas(msg, 1);
59   *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
60 }
udpa_type_v1_TypedStruct_mutable_value(udpa_type_v1_TypedStruct * msg,upb_arena * arena)61 UPB_INLINE struct google_protobuf_Struct* udpa_type_v1_TypedStruct_mutable_value(udpa_type_v1_TypedStruct *msg, upb_arena *arena) {
62   struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)udpa_type_v1_TypedStruct_value(msg);
63   if (sub == NULL) {
64     sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
65     if (!sub) return NULL;
66     udpa_type_v1_TypedStruct_set_value(msg, sub);
67   }
68   return sub;
69 }
70 
71 #ifdef __cplusplus
72 }  /* extern "C" */
73 #endif
74 
75 #include "upb/port_undef.inc"
76 
77 #endif  /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_ */
78