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/msg_internal.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 google_protobuf_Any;
24 typedef struct google_protobuf_Any google_protobuf_Any;
25 extern const upb_msglayout google_protobuf_Any_msginit;
26 
27 
28 /* google.protobuf.Any */
29 
google_protobuf_Any_new(upb_arena * arena)30 UPB_INLINE google_protobuf_Any *google_protobuf_Any_new(upb_arena *arena) {
31   return (google_protobuf_Any *)_upb_msg_new(&google_protobuf_Any_msginit, arena);
32 }
google_protobuf_Any_parse(const char * buf,size_t size,upb_arena * arena)33 UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse(const char *buf, size_t size,
34                         upb_arena *arena) {
35   google_protobuf_Any *ret = google_protobuf_Any_new(arena);
36   if (!ret) return NULL;
37   if (!upb_decode(buf, size, ret, &google_protobuf_Any_msginit, arena)) return NULL;
38   return ret;
39 }
google_protobuf_Any_parse_ex(const char * buf,size_t size,const upb_extreg * extreg,int options,upb_arena * arena)40 UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse_ex(const char *buf, size_t size,
41                            const upb_extreg *extreg, int options,
42                            upb_arena *arena) {
43   google_protobuf_Any *ret = google_protobuf_Any_new(arena);
44   if (!ret) return NULL;
45   if (!_upb_decode(buf, size, ret, &google_protobuf_Any_msginit, extreg, options, arena)) {
46     return NULL;
47   }
48   return ret;
49 }
google_protobuf_Any_serialize(const google_protobuf_Any * msg,upb_arena * arena,size_t * len)50 UPB_INLINE char *google_protobuf_Any_serialize(const google_protobuf_Any *msg, upb_arena *arena, size_t *len) {
51   return upb_encode(msg, &google_protobuf_Any_msginit, arena, len);
52 }
53 
google_protobuf_Any_type_url(const google_protobuf_Any * msg)54 UPB_INLINE upb_strview google_protobuf_Any_type_url(const google_protobuf_Any *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
google_protobuf_Any_value(const google_protobuf_Any * msg)55 UPB_INLINE upb_strview google_protobuf_Any_value(const google_protobuf_Any *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
56 
google_protobuf_Any_set_type_url(google_protobuf_Any * msg,upb_strview value)57 UPB_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_strview value) {
58   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
59 }
google_protobuf_Any_set_value(google_protobuf_Any * msg,upb_strview value)60 UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_strview value) {
61   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
62 }
63 
64 #ifdef __cplusplus
65 }  /* extern "C" */
66 #endif
67 
68 #include "upb/port_undef.inc"
69 
70 #endif  /* GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ */
71