Debian Codegraph @

src/core/ext/upb-generated/google/protobuf/timestamp.upb.h

raw
1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * google/protobuf/timestamp.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_
10 #define GOOGLE_PROTOBUF_TIMESTAMP_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_Timestamp;
24 typedef struct google_protobuf_Timestamp google_protobuf_Timestamp;
25 extern const upb_MiniTable google_protobuf_Timestamp_msginit;
26
27
28
29 /* google.protobuf.Timestamp */
30
31 UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_new(upb_Arena* arena) {
32 return (google_protobuf_Timestamp*)_upb_Message_New(&google_protobuf_Timestamp_msginit, arena);
33 }
34 UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse(const char* buf, size_t size, upb_Arena* arena) {
35 google_protobuf_Timestamp* ret = google_protobuf_Timestamp_new(arena);
36 if (!ret) return NULL;
37 if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
38 return NULL;
39 }
40 return ret;
41 }
42 UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse_ex(const char* buf, size_t size,
43 const upb_ExtensionRegistry* extreg,
44 int options, upb_Arena* arena) {
45 google_protobuf_Timestamp* ret = google_protobuf_Timestamp_new(arena);
46 if (!ret) return NULL;
47 if (upb_Decode(buf, size, ret, &google_protobuf_Timestamp_msginit, extreg, options, arena) !=
48 kUpb_DecodeStatus_Ok) {
49 return NULL;
50 }
51 return ret;
52 }
53 UPB_INLINE char* google_protobuf_Timestamp_serialize(const google_protobuf_Timestamp* msg, upb_Arena* arena, size_t* len) {
54 char* ptr;
55 (void)upb_Encode(msg, &google_protobuf_Timestamp_msginit, 0, arena, &ptr, len);
56 return ptr;
57 }
58 UPB_INLINE char* google_protobuf_Timestamp_serialize_ex(const google_protobuf_Timestamp* msg, int options,
59 upb_Arena* arena, size_t* len) {
60 char* ptr;
61 (void)upb_Encode(msg, &google_protobuf_Timestamp_msginit, options, arena, &ptr, len);
62 return ptr;
63 }
64 UPB_INLINE void google_protobuf_Timestamp_clear_seconds(const google_protobuf_Timestamp* msg) {
65 *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0;
66 }
67 UPB_INLINE int64_t google_protobuf_Timestamp_seconds(const google_protobuf_Timestamp* msg) {
68 return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t);
69 }
70 UPB_INLINE void google_protobuf_Timestamp_clear_nanos(const google_protobuf_Timestamp* msg) {
71 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0;
72 }
73 UPB_INLINE int32_t google_protobuf_Timestamp_nanos(const google_protobuf_Timestamp* msg) {
74 return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
75 }
76
77 UPB_INLINE void google_protobuf_Timestamp_set_seconds(google_protobuf_Timestamp *msg, int64_t value) {
78 *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
79 }
80 UPB_INLINE void google_protobuf_Timestamp_set_nanos(google_protobuf_Timestamp *msg, int32_t value) {
81 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
82 }
83
84 extern const upb_MiniTable_File google_protobuf_timestamp_proto_upb_file_layout;
85
86 #ifdef __cplusplus
87 } /* extern "C" */
88 #endif
89
90 #include "upb/port_undef.inc"
91
92 #endif /* GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_ */