any.upb.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* This file was generated by upbc (the upb compiler) from the input
  2. * file:
  3. *
  4. * google/protobuf/any.proto
  5. *
  6. * Do not edit -- your changes will be discarded when the file is
  7. * regenerated. */
  8. #ifndef GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_
  9. #define GOOGLE_PROTOBUF_ANY_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_Any;
  19. typedef struct google_protobuf_Any google_protobuf_Any;
  20. extern const upb_msglayout google_protobuf_Any_msginit;
  21. /* google.protobuf.Any */
  22. UPB_INLINE google_protobuf_Any *google_protobuf_Any_new(upb_arena *arena) {
  23. return (google_protobuf_Any *)upb_msg_new(&google_protobuf_Any_msginit, arena);
  24. }
  25. UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse(const char *buf, size_t size,
  26. upb_arena *arena) {
  27. google_protobuf_Any *ret = google_protobuf_Any_new(arena);
  28. return (ret && upb_decode(buf, size, ret, &google_protobuf_Any_msginit, arena)) ? ret : NULL;
  29. }
  30. UPB_INLINE char *google_protobuf_Any_serialize(const google_protobuf_Any *msg, upb_arena *arena, size_t *len) {
  31. return upb_encode(msg, &google_protobuf_Any_msginit, arena, len);
  32. }
  33. UPB_INLINE upb_strview google_protobuf_Any_type_url(const google_protobuf_Any *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
  34. UPB_INLINE upb_strview google_protobuf_Any_value(const google_protobuf_Any *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 16)); }
  35. UPB_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_strview value) {
  36. UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
  37. }
  38. UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_strview value) {
  39. UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(8, 16)) = value;
  40. }
  41. #ifdef __cplusplus
  42. } /* extern "C" */
  43. #endif
  44. #include "upb/port_undef.inc"
  45. #endif /* GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_ */