1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 #ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
8 #define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
9
10 #include "upb/base/status.h"
11 #include "upb/mem/arena.h"
12 #include "upb/mini_table/enum.h"
13
14 // Must be last.
15 #include "upb/port/def.inc"
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 // Builds a upb_MiniTableEnum from an enum MiniDescriptor. The MiniDescriptor
22 // must be for an enum, not a message.
23 UPB_API upb_MiniTableEnum* upb_MiniDescriptor_BuildEnum(const char* data,
24 size_t len,
25 upb_Arena* arena,
26 upb_Status* status);
27
28 // TODO: Deprecated name; update callers.
upb_MiniTableEnum_Build(const char * data,size_t len,upb_Arena * arena,upb_Status * status)29 UPB_API_INLINE upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data,
30 size_t len,
31 upb_Arena* arena,
32 upb_Status* status) {
33 return upb_MiniDescriptor_BuildEnum(data, len, arena, status);
34 }
35
36 #ifdef __cplusplus
37 } /* extern "C" */
38 #endif
39
40 #include "upb/port/undef.inc"
41
42 #endif // UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_
43