File indexing completed on 2025-01-30 10:25:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef UPB_MESSAGE_VALUE_H_
0012 #define UPB_MESSAGE_VALUE_H_
0013
0014 #include <stdint.h>
0015 #include <string.h>
0016
0017 #include "upb/base/string_view.h"
0018
0019
0020 #include "upb/port/def.inc"
0021
0022 #ifdef __cplusplus
0023 extern "C" {
0024 #endif
0025
0026 typedef union {
0027 bool bool_val;
0028 float float_val;
0029 double double_val;
0030 int32_t int32_val;
0031 int64_t int64_val;
0032 uint32_t uint32_val;
0033 uint64_t uint64_val;
0034 const struct upb_Array* array_val;
0035 const struct upb_Map* map_val;
0036 const struct upb_Message* msg_val;
0037 upb_StringView str_val;
0038
0039
0040
0041
0042
0043 uintptr_t tagged_msg_val;
0044 } upb_MessageValue;
0045
0046 UPB_API_INLINE upb_MessageValue upb_MessageValue_Zero(void) {
0047 upb_MessageValue zero;
0048 memset(&zero, 0, sizeof(zero));
0049 return zero;
0050 }
0051
0052 typedef union {
0053 struct upb_Array* array;
0054 struct upb_Map* map;
0055 struct upb_Message* msg;
0056 } upb_MutableMessageValue;
0057
0058 UPB_API_INLINE upb_MutableMessageValue upb_MutableMessageValue_Zero(void) {
0059 upb_MutableMessageValue zero;
0060 memset(&zero, 0, sizeof(zero));
0061 return zero;
0062 }
0063
0064 #ifdef __cplusplus
0065 }
0066 #endif
0067
0068 #include "upb/port/undef.inc"
0069
0070 #endif