GRPC Core  9.0.0
duration.upb.h
Go to the documentation of this file.
1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  * google/protobuf/duration.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_
10 #define GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_
11 
12 #include "upb/generated_util.h"
13 #include "upb/msg.h"
14 #include "upb/decode.h"
15 #include "upb/encode.h"
16 
17 #include "upb/port_def.inc"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
25 extern const upb_msglayout google_protobuf_Duration_msginit;
26 
27 
28 /* google.protobuf.Duration */
29 
31  return (google_protobuf_Duration *)upb_msg_new(&google_protobuf_Duration_msginit, arena);
32 }
33 UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parse(const char *buf, size_t size,
34  upb_arena *arena) {
36  return (ret && upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, arena)) ? ret : NULL;
37 }
38 UPB_INLINE char *google_protobuf_Duration_serialize(const google_protobuf_Duration *msg, upb_arena *arena, size_t *len) {
39  return upb_encode(msg, &google_protobuf_Duration_msginit, arena, len);
40 }
41 
42 UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration *msg) { return UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)); }
43 UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)); }
44 
45 UPB_INLINE void google_protobuf_Duration_set_seconds(google_protobuf_Duration *msg, int64_t value) {
46  UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)) = value;
47 }
48 UPB_INLINE void google_protobuf_Duration_set_nanos(google_protobuf_Duration *msg, int32_t value) {
49  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(8, 8)) = value;
50 }
51 
52 #ifdef __cplusplus
53 } /* extern "C" */
54 #endif
55 
56 #include "upb/port_undef.inc"
57 
58 #endif /* GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ */
UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration *msg)
Definition: duration.upb.h:42
UPB_INLINE google_protobuf_Duration * google_protobuf_Duration_parse(const char *buf, size_t size, upb_arena *arena)
Definition: duration.upb.h:33
UPB_INLINE google_protobuf_Duration * google_protobuf_Duration_new(upb_arena *arena)
Definition: duration.upb.h:30
UPB_INLINE void google_protobuf_Duration_set_nanos(google_protobuf_Duration *msg, int32_t value)
Definition: duration.upb.h:48
struct google_protobuf_Duration google_protobuf_Duration
Definition: duration.upb.h:24
UPB_INLINE void google_protobuf_Duration_set_seconds(google_protobuf_Duration *msg, int64_t value)
Definition: duration.upb.h:45
const upb_msglayout google_protobuf_Duration_msginit
Definition: duration.upb.c:20
UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration *msg)
Definition: duration.upb.h:43
UPB_INLINE char * google_protobuf_Duration_serialize(const google_protobuf_Duration *msg, upb_arena *arena, size_t *len)
Definition: duration.upb.h:38