| 1 |
/* This file was generated by upbc (the upb compiler) from the input |
| 2 |
* file: |
| 3 |
* |
| 4 |
* xds/annotations/v3/versioning.proto |
| 5 |
* |
| 6 |
* Do not edit -- your changes will be discarded when the file is |
| 7 |
* regenerated. */ |
| 8 |
|
| 9 |
#ifndef XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_ |
| 10 |
#define XDS_ANNOTATIONS_V3_VERSIONING_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 xds_annotations_v3_VersioningAnnotation; |
| 24 |
typedef struct xds_annotations_v3_VersioningAnnotation xds_annotations_v3_VersioningAnnotation; |
| 25 |
extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msginit; |
| 26 |
extern const upb_MiniTable_Extension xds_annotations_v3_versioning_ext; |
| 27 |
struct google_protobuf_MessageOptions; |
| 28 |
extern const upb_MiniTable google_protobuf_MessageOptions_msginit; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
/* xds.annotations.v3.VersioningAnnotation */ |
| 33 |
|
| 34 |
UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_new(upb_Arena* arena) { |
| 35 |
return (xds_annotations_v3_VersioningAnnotation*)_upb_Message_New(&xds_annotations_v3_VersioningAnnotation_msginit, arena); |
| 36 |
} |
| 37 |
UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { |
| 38 |
xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena); |
| 39 |
if (!ret) return NULL; |
| 40 |
if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { |
| 41 |
return NULL; |
| 42 |
} |
| 43 |
return ret; |
| 44 |
} |
| 45 |
UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_parse_ex(const char* buf, size_t size, |
| 46 |
const upb_ExtensionRegistry* extreg, |
| 47 |
int options, upb_Arena* arena) { |
| 48 |
xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena); |
| 49 |
if (!ret) return NULL; |
| 50 |
if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msginit, extreg, options, arena) != |
| 51 |
kUpb_DecodeStatus_Ok) { |
| 52 |
return NULL; |
| 53 |
} |
| 54 |
return ret; |
| 55 |
} |
| 56 |
UPB_INLINE char* xds_annotations_v3_VersioningAnnotation_serialize(const xds_annotations_v3_VersioningAnnotation* msg, upb_Arena* arena, size_t* len) { |
| 57 |
char* ptr; |
| 58 |
(void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, 0, arena, &ptr, len); |
| 59 |
return ptr; |
| 60 |
} |
| 61 |
UPB_INLINE char* xds_annotations_v3_VersioningAnnotation_serialize_ex(const xds_annotations_v3_VersioningAnnotation* msg, int options, |
| 62 |
upb_Arena* arena, size_t* len) { |
| 63 |
char* ptr; |
| 64 |
(void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, options, arena, &ptr, len); |
| 65 |
return ptr; |
| 66 |
} |
| 67 |
UPB_INLINE void xds_annotations_v3_VersioningAnnotation_clear_previous_message_type(const xds_annotations_v3_VersioningAnnotation* msg) { |
| 68 |
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); |
| 69 |
} |
| 70 |
UPB_INLINE upb_StringView xds_annotations_v3_VersioningAnnotation_previous_message_type(const xds_annotations_v3_VersioningAnnotation* msg) { |
| 71 |
return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); |
| 72 |
} |
| 73 |
|
| 74 |
UPB_INLINE void xds_annotations_v3_VersioningAnnotation_set_previous_message_type(xds_annotations_v3_VersioningAnnotation *msg, upb_StringView value) { |
| 75 |
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; |
| 76 |
} |
| 77 |
|
| 78 |
UPB_INLINE bool xds_annotations_v3_has_versioning(const struct google_protobuf_MessageOptions* msg) { |
| 79 |
return _upb_Message_Getext(msg, &xds_annotations_v3_versioning_ext) != NULL; |
| 80 |
} |
| 81 |
UPB_INLINE void xds_annotations_v3_clear_versioning(struct google_protobuf_MessageOptions* msg) { |
| 82 |
_upb_Message_Clearext(msg, &xds_annotations_v3_versioning_ext); |
| 83 |
} |
| 84 |
UPB_INLINE const xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_versioning(const struct google_protobuf_MessageOptions* msg) { |
| 85 |
const upb_Message_Extension* ext = _upb_Message_Getext(msg, &xds_annotations_v3_versioning_ext); |
| 86 |
UPB_ASSERT(ext); |
| 87 |
return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_VersioningAnnotation*); |
| 88 |
} |
| 89 |
UPB_INLINE void xds_annotations_v3_set_versioning(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_VersioningAnnotation* ext, upb_Arena* arena) { |
| 90 |
const upb_Message_Extension* msg_ext = |
| 91 |
_upb_Message_GetOrCreateExtension(msg, &xds_annotations_v3_versioning_ext, arena); |
| 92 |
UPB_ASSERT(msg_ext); |
| 93 |
*UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_VersioningAnnotation*) = ext; |
| 94 |
} |
| 95 |
extern const upb_MiniTable_File xds_annotations_v3_versioning_proto_upb_file_layout; |
| 96 |
|
| 97 |
#ifdef __cplusplus |
| 98 |
} /* extern "C" */ |
| 99 |
#endif |
| 100 |
|
| 101 |
#include "upb/port_undef.inc" |
| 102 |
|
| 103 |
#endif /* XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_ */ |