File indexing completed on 2026-09-17 09:32:30
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 #include "upb/message/internal/types.h"
0019
0020
0021 #include "upb/port/def.inc"
0022
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026
0027 typedef union {
0028 bool bool_val;
0029 float float_val;
0030 double double_val;
0031 int32_t int32_val;
0032 int64_t int64_val;
0033 uint32_t uint32_val;
0034 uint64_t uint64_val;
0035 const struct upb_Array* array_val;
0036 const struct upb_Map* map_val;
0037 const struct upb_Message* msg_val;
0038 upb_StringView str_val;
0039
0040
0041
0042
0043
0044 uintptr_t tagged_msg_val;
0045
0046
0047
0048
0049
0050
0051
0052 struct upb_Message UPB_PRIVATE(ext_msg_val);
0053 } upb_MessageValue;
0054
0055 UPB_API_INLINE upb_MessageValue upb_MessageValue_Zero(void) {
0056 upb_MessageValue zero;
0057 memset(&zero, 0, sizeof(zero));
0058 return zero;
0059 }
0060
0061 typedef union {
0062 struct upb_Array* array;
0063 struct upb_Map* map;
0064 struct upb_Message* msg;
0065 } upb_MutableMessageValue;
0066
0067 UPB_API_INLINE upb_MutableMessageValue upb_MutableMessageValue_Zero(void) {
0068 upb_MutableMessageValue zero;
0069 memset(&zero, 0, sizeof(zero));
0070 return zero;
0071 }
0072
0073 #ifdef __cplusplus
0074 }
0075 #endif
0076
0077 #include "upb/port/undef.inc"
0078
0079 #endif