File indexing completed on 2025-01-18 10:13:17
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef UPB_MINI_TABLE_DECODE_H_
0009 #define UPB_MINI_TABLE_DECODE_H_
0010
0011 #include "upb/base/status.h"
0012 #include "upb/mem/arena.h"
0013 #include "upb/mini_table/extension.h"
0014 #include "upb/mini_table/sub.h"
0015
0016
0017
0018
0019 #include "upb/mini_descriptor/build_enum.h"
0020 #include "upb/mini_descriptor/link.h"
0021
0022
0023
0024 #include "upb/port/def.inc"
0025
0026 typedef enum {
0027 kUpb_MiniTablePlatform_32Bit,
0028 kUpb_MiniTablePlatform_64Bit,
0029 kUpb_MiniTablePlatform_Native =
0030 UPB_SIZE(kUpb_MiniTablePlatform_32Bit, kUpb_MiniTablePlatform_64Bit),
0031 } upb_MiniTablePlatform;
0032
0033 #ifdef __cplusplus
0034 extern "C" {
0035 #endif
0036
0037
0038
0039
0040
0041 upb_MiniTable* _upb_MiniTable_Build(const char* data, size_t len,
0042 upb_MiniTablePlatform platform,
0043 upb_Arena* arena, upb_Status* status);
0044
0045 UPB_API_INLINE upb_MiniTable* upb_MiniTable_Build(const char* data, size_t len,
0046 upb_Arena* arena,
0047 upb_Status* status) {
0048 return _upb_MiniTable_Build(data, len, kUpb_MiniTablePlatform_Native, arena,
0049 status);
0050 }
0051
0052
0053
0054
0055 const char* _upb_MiniTableExtension_Init(const char* data, size_t len,
0056 upb_MiniTableExtension* ext,
0057 const upb_MiniTable* extendee,
0058 upb_MiniTableSub sub,
0059 upb_MiniTablePlatform platform,
0060 upb_Status* status);
0061
0062 UPB_API_INLINE const char* upb_MiniTableExtension_Init(
0063 const char* data, size_t len, upb_MiniTableExtension* ext,
0064 const upb_MiniTable* extendee, upb_MiniTableSub sub, upb_Status* status) {
0065 return _upb_MiniTableExtension_Init(data, len, ext, extendee, sub,
0066 kUpb_MiniTablePlatform_Native, status);
0067 }
0068
0069 UPB_API upb_MiniTableExtension* _upb_MiniTableExtension_Build(
0070 const char* data, size_t len, const upb_MiniTable* extendee,
0071 upb_MiniTableSub sub, upb_MiniTablePlatform platform, upb_Arena* arena,
0072 upb_Status* status);
0073
0074 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_Build(
0075 const char* data, size_t len, const upb_MiniTable* extendee,
0076 upb_Arena* arena, upb_Status* status) {
0077 upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(NULL);
0078 return _upb_MiniTableExtension_Build(
0079 data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
0080 }
0081
0082 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildMessage(
0083 const char* data, size_t len, const upb_MiniTable* extendee,
0084 upb_MiniTable* submsg, upb_Arena* arena, upb_Status* status) {
0085 upb_MiniTableSub sub = upb_MiniTableSub_FromMessage(submsg);
0086 return _upb_MiniTableExtension_Build(
0087 data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
0088 }
0089
0090 UPB_API_INLINE upb_MiniTableExtension* upb_MiniTableExtension_BuildEnum(
0091 const char* data, size_t len, const upb_MiniTable* extendee,
0092 upb_MiniTableEnum* subenum, upb_Arena* arena, upb_Status* status) {
0093 upb_MiniTableSub sub = upb_MiniTableSub_FromEnum(subenum);
0094 return _upb_MiniTableExtension_Build(
0095 data, len, extendee, sub, kUpb_MiniTablePlatform_Native, arena, status);
0096 }
0097
0098
0099
0100
0101
0102
0103
0104 upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len,
0105 upb_MiniTablePlatform platform,
0106 upb_Arena* arena, void** buf,
0107 size_t* buf_size, upb_Status* status);
0108
0109 #ifdef __cplusplus
0110 }
0111 #endif
0112
0113 #include "upb/port/undef.inc"
0114
0115 #endif