1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * envoy/type/matcher/v3/regex.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
10 #define ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
11
12 #include "upb/msg.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 envoy_type_matcher_v3_RegexMatcher;
24 struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2;
25 struct envoy_type_matcher_v3_RegexMatchAndSubstitute;
26 typedef struct envoy_type_matcher_v3_RegexMatcher envoy_type_matcher_v3_RegexMatcher;
27 typedef struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2 envoy_type_matcher_v3_RegexMatcher_GoogleRE2;
28 typedef struct envoy_type_matcher_v3_RegexMatchAndSubstitute envoy_type_matcher_v3_RegexMatchAndSubstitute;
29 extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
30 extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit;
31 extern const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
32 struct google_protobuf_UInt32Value;
33 extern const upb_msglayout google_protobuf_UInt32Value_msginit;
34
35
36 /* envoy.type.matcher.v3.RegexMatcher */
37
envoy_type_matcher_v3_RegexMatcher_new(upb_arena * arena)38 UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_new(upb_arena *arena) {
39 return (envoy_type_matcher_v3_RegexMatcher *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
40 }
envoy_type_matcher_v3_RegexMatcher_parse(const char * buf,size_t size,upb_arena * arena)41 UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_parse(const char *buf, size_t size,
42 upb_arena *arena) {
43 envoy_type_matcher_v3_RegexMatcher *ret = envoy_type_matcher_v3_RegexMatcher_new(arena);
44 return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, arena)) ? ret : NULL;
45 }
envoy_type_matcher_v3_RegexMatcher_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)46 UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_parse_ex(const char *buf, size_t size,
47 upb_arena *arena, int options) {
48 envoy_type_matcher_v3_RegexMatcher *ret = envoy_type_matcher_v3_RegexMatcher_new(arena);
49 return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, arena, options))
50 ? ret : NULL;
51 }
envoy_type_matcher_v3_RegexMatcher_serialize(const envoy_type_matcher_v3_RegexMatcher * msg,upb_arena * arena,size_t * len)52 UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_serialize(const envoy_type_matcher_v3_RegexMatcher *msg, upb_arena *arena, size_t *len) {
53 return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, arena, len);
54 }
55
56 typedef enum {
57 envoy_type_matcher_v3_RegexMatcher_engine_type_google_re2 = 1,
58 envoy_type_matcher_v3_RegexMatcher_engine_type_NOT_SET = 0
59 } envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases;
envoy_type_matcher_v3_RegexMatcher_engine_type_case(const envoy_type_matcher_v3_RegexMatcher * msg)60 UPB_INLINE envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases envoy_type_matcher_v3_RegexMatcher_engine_type_case(const envoy_type_matcher_v3_RegexMatcher* msg) { return (envoy_type_matcher_v3_RegexMatcher_engine_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
61
envoy_type_matcher_v3_RegexMatcher_has_google_re2(const envoy_type_matcher_v3_RegexMatcher * msg)62 UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_has_google_re2(const envoy_type_matcher_v3_RegexMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
envoy_type_matcher_v3_RegexMatcher_google_re2(const envoy_type_matcher_v3_RegexMatcher * msg)63 UPB_INLINE const envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_google_re2(const envoy_type_matcher_v3_RegexMatcher *msg) { return UPB_READ_ONEOF(msg, const envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 1, NULL); }
envoy_type_matcher_v3_RegexMatcher_regex(const envoy_type_matcher_v3_RegexMatcher * msg)64 UPB_INLINE upb_strview envoy_type_matcher_v3_RegexMatcher_regex(const envoy_type_matcher_v3_RegexMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
65
envoy_type_matcher_v3_RegexMatcher_set_google_re2(envoy_type_matcher_v3_RegexMatcher * msg,envoy_type_matcher_v3_RegexMatcher_GoogleRE2 * value)66 UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_google_re2(envoy_type_matcher_v3_RegexMatcher *msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2* value) {
67 UPB_WRITE_ONEOF(msg, envoy_type_matcher_v3_RegexMatcher_GoogleRE2*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 1);
68 }
envoy_type_matcher_v3_RegexMatcher_mutable_google_re2(envoy_type_matcher_v3_RegexMatcher * msg,upb_arena * arena)69 UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_RegexMatcher_mutable_google_re2(envoy_type_matcher_v3_RegexMatcher *msg, upb_arena *arena) {
70 struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2* sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)envoy_type_matcher_v3_RegexMatcher_google_re2(msg);
71 if (sub == NULL) {
72 sub = (struct envoy_type_matcher_v3_RegexMatcher_GoogleRE2*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
73 if (!sub) return NULL;
74 envoy_type_matcher_v3_RegexMatcher_set_google_re2(msg, sub);
75 }
76 return sub;
77 }
envoy_type_matcher_v3_RegexMatcher_set_regex(envoy_type_matcher_v3_RegexMatcher * msg,upb_strview value)78 UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_set_regex(envoy_type_matcher_v3_RegexMatcher *msg, upb_strview value) {
79 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
80 }
81
82 /* envoy.type.matcher.v3.RegexMatcher.GoogleRE2 */
83
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(upb_arena * arena)84 UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(upb_arena *arena) {
85 return (envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena);
86 }
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char * buf,size_t size,upb_arena * arena)87 UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char *buf, size_t size,
88 upb_arena *arena) {
89 envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
90 return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena)) ? ret : NULL;
91 }
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)92 UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse_ex(const char *buf, size_t size,
93 upb_arena *arena, int options) {
94 envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
95 return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena, options))
96 ? ret : NULL;
97 }
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 * msg,upb_arena * arena,size_t * len)98 UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, upb_arena *arena, size_t *len) {
99 return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena, len);
100 }
101
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_has_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 * msg)102 UPB_INLINE bool envoy_type_matcher_v3_RegexMatcher_GoogleRE2_has_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg) { return _upb_hasbit(msg, 1); }
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 * msg)103 UPB_INLINE const struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
104
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 * msg,struct google_protobuf_UInt32Value * value)105 UPB_INLINE void envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, struct google_protobuf_UInt32Value* value) {
106 _upb_sethas(msg, 1);
107 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
108 }
envoy_type_matcher_v3_RegexMatcher_GoogleRE2_mutable_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 * msg,upb_arena * arena)109 UPB_INLINE struct google_protobuf_UInt32Value* envoy_type_matcher_v3_RegexMatcher_GoogleRE2_mutable_max_program_size(envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, upb_arena *arena) {
110 struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_type_matcher_v3_RegexMatcher_GoogleRE2_max_program_size(msg);
111 if (sub == NULL) {
112 sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
113 if (!sub) return NULL;
114 envoy_type_matcher_v3_RegexMatcher_GoogleRE2_set_max_program_size(msg, sub);
115 }
116 return sub;
117 }
118
119 /* envoy.type.matcher.v3.RegexMatchAndSubstitute */
120
envoy_type_matcher_v3_RegexMatchAndSubstitute_new(upb_arena * arena)121 UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_new(upb_arena *arena) {
122 return (envoy_type_matcher_v3_RegexMatchAndSubstitute *)_upb_msg_new(&envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena);
123 }
envoy_type_matcher_v3_RegexMatchAndSubstitute_parse(const char * buf,size_t size,upb_arena * arena)124 UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_parse(const char *buf, size_t size,
125 upb_arena *arena) {
126 envoy_type_matcher_v3_RegexMatchAndSubstitute *ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena);
127 return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena)) ? ret : NULL;
128 }
envoy_type_matcher_v3_RegexMatchAndSubstitute_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)129 UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_parse_ex(const char *buf, size_t size,
130 upb_arena *arena, int options) {
131 envoy_type_matcher_v3_RegexMatchAndSubstitute *ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena);
132 return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena, options))
133 ? ret : NULL;
134 }
envoy_type_matcher_v3_RegexMatchAndSubstitute_serialize(const envoy_type_matcher_v3_RegexMatchAndSubstitute * msg,upb_arena * arena,size_t * len)135 UPB_INLINE char *envoy_type_matcher_v3_RegexMatchAndSubstitute_serialize(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_arena *arena, size_t *len) {
136 return upb_encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena, len);
137 }
138
envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute * msg)139 UPB_INLINE bool envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return _upb_hasbit(msg, 1); }
envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute * msg)140 UPB_INLINE const envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_type_matcher_v3_RegexMatcher*); }
envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute * msg)141 UPB_INLINE upb_strview envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
142
envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute * msg,envoy_type_matcher_v3_RegexMatcher * value)143 UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, envoy_type_matcher_v3_RegexMatcher* value) {
144 _upb_sethas(msg, 1);
145 *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_type_matcher_v3_RegexMatcher*) = value;
146 }
envoy_type_matcher_v3_RegexMatchAndSubstitute_mutable_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute * msg,upb_arena * arena)147 UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatchAndSubstitute_mutable_pattern(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_arena *arena) {
148 struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(msg);
149 if (sub == NULL) {
150 sub = (struct envoy_type_matcher_v3_RegexMatcher*)_upb_msg_new(&envoy_type_matcher_v3_RegexMatcher_msginit, arena);
151 if (!sub) return NULL;
152 envoy_type_matcher_v3_RegexMatchAndSubstitute_set_pattern(msg, sub);
153 }
154 return sub;
155 }
envoy_type_matcher_v3_RegexMatchAndSubstitute_set_substitution(envoy_type_matcher_v3_RegexMatchAndSubstitute * msg,upb_strview value)156 UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_substitution(envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_strview value) {
157 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
158 }
159
160 #ifdef __cplusplus
161 } /* extern "C" */
162 #endif
163
164 #include "upb/port_undef.inc"
165
166 #endif /* ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_ */
167