wrappers.upb.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /* This file was generated by upbc (the upb compiler) from the input
  2. * file:
  3. *
  4. * google/protobuf/wrappers.proto
  5. *
  6. * Do not edit -- your changes will be discarded when the file is
  7. * regenerated. */
  8. #ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
  9. #define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
  10. #include "upb/generated_util.h"
  11. #include "upb/msg.h"
  12. #include "upb/decode.h"
  13. #include "upb/encode.h"
  14. #include "upb/port_def.inc"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. struct google_protobuf_DoubleValue;
  19. struct google_protobuf_FloatValue;
  20. struct google_protobuf_Int64Value;
  21. struct google_protobuf_UInt64Value;
  22. struct google_protobuf_Int32Value;
  23. struct google_protobuf_UInt32Value;
  24. struct google_protobuf_BoolValue;
  25. struct google_protobuf_StringValue;
  26. struct google_protobuf_BytesValue;
  27. typedef struct google_protobuf_DoubleValue google_protobuf_DoubleValue;
  28. typedef struct google_protobuf_FloatValue google_protobuf_FloatValue;
  29. typedef struct google_protobuf_Int64Value google_protobuf_Int64Value;
  30. typedef struct google_protobuf_UInt64Value google_protobuf_UInt64Value;
  31. typedef struct google_protobuf_Int32Value google_protobuf_Int32Value;
  32. typedef struct google_protobuf_UInt32Value google_protobuf_UInt32Value;
  33. typedef struct google_protobuf_BoolValue google_protobuf_BoolValue;
  34. typedef struct google_protobuf_StringValue google_protobuf_StringValue;
  35. typedef struct google_protobuf_BytesValue google_protobuf_BytesValue;
  36. extern const upb_msglayout google_protobuf_DoubleValue_msginit;
  37. extern const upb_msglayout google_protobuf_FloatValue_msginit;
  38. extern const upb_msglayout google_protobuf_Int64Value_msginit;
  39. extern const upb_msglayout google_protobuf_UInt64Value_msginit;
  40. extern const upb_msglayout google_protobuf_Int32Value_msginit;
  41. extern const upb_msglayout google_protobuf_UInt32Value_msginit;
  42. extern const upb_msglayout google_protobuf_BoolValue_msginit;
  43. extern const upb_msglayout google_protobuf_StringValue_msginit;
  44. extern const upb_msglayout google_protobuf_BytesValue_msginit;
  45. /* google.protobuf.DoubleValue */
  46. UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_new(upb_arena *arena) {
  47. return (google_protobuf_DoubleValue *)upb_msg_new(&google_protobuf_DoubleValue_msginit, arena);
  48. }
  49. UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parse(const char *buf, size_t size,
  50. upb_arena *arena) {
  51. google_protobuf_DoubleValue *ret = google_protobuf_DoubleValue_new(arena);
  52. return (ret && upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, arena)) ? ret : NULL;
  53. }
  54. UPB_INLINE char *google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue *msg, upb_arena *arena, size_t *len) {
  55. return upb_encode(msg, &google_protobuf_DoubleValue_msginit, arena, len);
  56. }
  57. UPB_INLINE double google_protobuf_DoubleValue_value(const google_protobuf_DoubleValue *msg) { return UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)); }
  58. UPB_INLINE void google_protobuf_DoubleValue_set_value(google_protobuf_DoubleValue *msg, double value) {
  59. UPB_FIELD_AT(msg, double, UPB_SIZE(0, 0)) = value;
  60. }
  61. /* google.protobuf.FloatValue */
  62. UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_new(upb_arena *arena) {
  63. return (google_protobuf_FloatValue *)upb_msg_new(&google_protobuf_FloatValue_msginit, arena);
  64. }
  65. UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parse(const char *buf, size_t size,
  66. upb_arena *arena) {
  67. google_protobuf_FloatValue *ret = google_protobuf_FloatValue_new(arena);
  68. return (ret && upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, arena)) ? ret : NULL;
  69. }
  70. UPB_INLINE char *google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue *msg, upb_arena *arena, size_t *len) {
  71. return upb_encode(msg, &google_protobuf_FloatValue_msginit, arena, len);
  72. }
  73. UPB_INLINE float google_protobuf_FloatValue_value(const google_protobuf_FloatValue *msg) { return UPB_FIELD_AT(msg, float, UPB_SIZE(0, 0)); }
  74. UPB_INLINE void google_protobuf_FloatValue_set_value(google_protobuf_FloatValue *msg, float value) {
  75. UPB_FIELD_AT(msg, float, UPB_SIZE(0, 0)) = value;
  76. }
  77. /* google.protobuf.Int64Value */
  78. UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_new(upb_arena *arena) {
  79. return (google_protobuf_Int64Value *)upb_msg_new(&google_protobuf_Int64Value_msginit, arena);
  80. }
  81. UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parse(const char *buf, size_t size,
  82. upb_arena *arena) {
  83. google_protobuf_Int64Value *ret = google_protobuf_Int64Value_new(arena);
  84. return (ret && upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, arena)) ? ret : NULL;
  85. }
  86. UPB_INLINE char *google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value *msg, upb_arena *arena, size_t *len) {
  87. return upb_encode(msg, &google_protobuf_Int64Value_msginit, arena, len);
  88. }
  89. UPB_INLINE int64_t google_protobuf_Int64Value_value(const google_protobuf_Int64Value *msg) { return UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)); }
  90. UPB_INLINE void google_protobuf_Int64Value_set_value(google_protobuf_Int64Value *msg, int64_t value) {
  91. UPB_FIELD_AT(msg, int64_t, UPB_SIZE(0, 0)) = value;
  92. }
  93. /* google.protobuf.UInt64Value */
  94. UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_new(upb_arena *arena) {
  95. return (google_protobuf_UInt64Value *)upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
  96. }
  97. UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parse(const char *buf, size_t size,
  98. upb_arena *arena) {
  99. google_protobuf_UInt64Value *ret = google_protobuf_UInt64Value_new(arena);
  100. return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, arena)) ? ret : NULL;
  101. }
  102. UPB_INLINE char *google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value *msg, upb_arena *arena, size_t *len) {
  103. return upb_encode(msg, &google_protobuf_UInt64Value_msginit, arena, len);
  104. }
  105. UPB_INLINE uint64_t google_protobuf_UInt64Value_value(const google_protobuf_UInt64Value *msg) { return UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(0, 0)); }
  106. UPB_INLINE void google_protobuf_UInt64Value_set_value(google_protobuf_UInt64Value *msg, uint64_t value) {
  107. UPB_FIELD_AT(msg, uint64_t, UPB_SIZE(0, 0)) = value;
  108. }
  109. /* google.protobuf.Int32Value */
  110. UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_new(upb_arena *arena) {
  111. return (google_protobuf_Int32Value *)upb_msg_new(&google_protobuf_Int32Value_msginit, arena);
  112. }
  113. UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parse(const char *buf, size_t size,
  114. upb_arena *arena) {
  115. google_protobuf_Int32Value *ret = google_protobuf_Int32Value_new(arena);
  116. return (ret && upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, arena)) ? ret : NULL;
  117. }
  118. UPB_INLINE char *google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value *msg, upb_arena *arena, size_t *len) {
  119. return upb_encode(msg, &google_protobuf_Int32Value_msginit, arena, len);
  120. }
  121. UPB_INLINE int32_t google_protobuf_Int32Value_value(const google_protobuf_Int32Value *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); }
  122. UPB_INLINE void google_protobuf_Int32Value_set_value(google_protobuf_Int32Value *msg, int32_t value) {
  123. UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value;
  124. }
  125. /* google.protobuf.UInt32Value */
  126. UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_new(upb_arena *arena) {
  127. return (google_protobuf_UInt32Value *)upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
  128. }
  129. UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parse(const char *buf, size_t size,
  130. upb_arena *arena) {
  131. google_protobuf_UInt32Value *ret = google_protobuf_UInt32Value_new(arena);
  132. return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, arena)) ? ret : NULL;
  133. }
  134. UPB_INLINE char *google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value *msg, upb_arena *arena, size_t *len) {
  135. return upb_encode(msg, &google_protobuf_UInt32Value_msginit, arena, len);
  136. }
  137. UPB_INLINE uint32_t google_protobuf_UInt32Value_value(const google_protobuf_UInt32Value *msg) { return UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(0, 0)); }
  138. UPB_INLINE void google_protobuf_UInt32Value_set_value(google_protobuf_UInt32Value *msg, uint32_t value) {
  139. UPB_FIELD_AT(msg, uint32_t, UPB_SIZE(0, 0)) = value;
  140. }
  141. /* google.protobuf.BoolValue */
  142. UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_new(upb_arena *arena) {
  143. return (google_protobuf_BoolValue *)upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
  144. }
  145. UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parse(const char *buf, size_t size,
  146. upb_arena *arena) {
  147. google_protobuf_BoolValue *ret = google_protobuf_BoolValue_new(arena);
  148. return (ret && upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, arena)) ? ret : NULL;
  149. }
  150. UPB_INLINE char *google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue *msg, upb_arena *arena, size_t *len) {
  151. return upb_encode(msg, &google_protobuf_BoolValue_msginit, arena, len);
  152. }
  153. UPB_INLINE bool google_protobuf_BoolValue_value(const google_protobuf_BoolValue *msg) { return UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)); }
  154. UPB_INLINE void google_protobuf_BoolValue_set_value(google_protobuf_BoolValue *msg, bool value) {
  155. UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value;
  156. }
  157. /* google.protobuf.StringValue */
  158. UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_new(upb_arena *arena) {
  159. return (google_protobuf_StringValue *)upb_msg_new(&google_protobuf_StringValue_msginit, arena);
  160. }
  161. UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parse(const char *buf, size_t size,
  162. upb_arena *arena) {
  163. google_protobuf_StringValue *ret = google_protobuf_StringValue_new(arena);
  164. return (ret && upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, arena)) ? ret : NULL;
  165. }
  166. UPB_INLINE char *google_protobuf_StringValue_serialize(const google_protobuf_StringValue *msg, upb_arena *arena, size_t *len) {
  167. return upb_encode(msg, &google_protobuf_StringValue_msginit, arena, len);
  168. }
  169. UPB_INLINE upb_strview google_protobuf_StringValue_value(const google_protobuf_StringValue *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
  170. UPB_INLINE void google_protobuf_StringValue_set_value(google_protobuf_StringValue *msg, upb_strview value) {
  171. UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
  172. }
  173. /* google.protobuf.BytesValue */
  174. UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_new(upb_arena *arena) {
  175. return (google_protobuf_BytesValue *)upb_msg_new(&google_protobuf_BytesValue_msginit, arena);
  176. }
  177. UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parse(const char *buf, size_t size,
  178. upb_arena *arena) {
  179. google_protobuf_BytesValue *ret = google_protobuf_BytesValue_new(arena);
  180. return (ret && upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, arena)) ? ret : NULL;
  181. }
  182. UPB_INLINE char *google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue *msg, upb_arena *arena, size_t *len) {
  183. return upb_encode(msg, &google_protobuf_BytesValue_msginit, arena, len);
  184. }
  185. UPB_INLINE upb_strview google_protobuf_BytesValue_value(const google_protobuf_BytesValue *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
  186. UPB_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue *msg, upb_strview value) {
  187. UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
  188. }
  189. #ifdef __cplusplus
  190. } /* extern "C" */
  191. #endif
  192. #include "upb/port_undef.inc"
  193. #endif /* GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_ */