• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/msg.h"
13 #include "upb/decode.h"
14 #include "upb/encode.h"
15 
16 #include "upb/port_def.inc"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 struct google_protobuf_Duration;
23 typedef struct google_protobuf_Duration google_protobuf_Duration;
24 extern const upb_msglayout google_protobuf_Duration_msginit;
25 
26 
27 /* google.protobuf.Duration */
28 
google_protobuf_Duration_new(upb_arena * arena)29 UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_new(upb_arena *arena) {
30   return (google_protobuf_Duration *)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
31 }
google_protobuf_Duration_parse(const char * buf,size_t size,upb_arena * arena)32 UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parse(const char *buf, size_t size,
33                         upb_arena *arena) {
34   google_protobuf_Duration *ret = google_protobuf_Duration_new(arena);
35   return (ret && upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, arena)) ? ret : NULL;
36 }
google_protobuf_Duration_serialize(const google_protobuf_Duration * msg,upb_arena * arena,size_t * len)37 UPB_INLINE char *google_protobuf_Duration_serialize(const google_protobuf_Duration *msg, upb_arena *arena, size_t *len) {
38   return upb_encode(msg, &google_protobuf_Duration_msginit, arena, len);
39 }
40 
google_protobuf_Duration_seconds(const google_protobuf_Duration * msg)41 UPB_INLINE int64_t google_protobuf_Duration_seconds(const google_protobuf_Duration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
google_protobuf_Duration_nanos(const google_protobuf_Duration * msg)42 UPB_INLINE int32_t google_protobuf_Duration_nanos(const google_protobuf_Duration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
43 
google_protobuf_Duration_set_seconds(google_protobuf_Duration * msg,int64_t value)44 UPB_INLINE void google_protobuf_Duration_set_seconds(google_protobuf_Duration *msg, int64_t value) {
45   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
46 }
google_protobuf_Duration_set_nanos(google_protobuf_Duration * msg,int32_t value)47 UPB_INLINE void google_protobuf_Duration_set_nanos(google_protobuf_Duration *msg, int32_t value) {
48   *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
49 }
50 
51 #ifdef __cplusplus
52 }  /* extern "C" */
53 #endif
54 
55 #include "upb/port_undef.inc"
56 
57 #endif  /* GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_ */
58