1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC. All rights reserved.
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
8 #ifndef THIRD_PARTY_UPB_UPB_GENERATOR_MINITABLE_NAMES_H_
9 #define THIRD_PARTY_UPB_UPB_GENERATOR_MINITABLE_NAMES_H_
13 #include "absl/strings/string_view.h"
16 #include "upb/port/def.inc"
21 // Maps: foo/bar/baz.proto -> foo/bar/baz.upb_minitable.h
22 UPBC_API
std::string
MiniTableHeaderFilename(absl::string_view proto_filename
);
24 // These are the publicly visible symbols defined in foo.upb_minitable.h.
25 // extern const upb_MiniTable <Message>; // One for each message.
26 // extern const upb_MiniTableEnum <Enum>; // One for each enum.
27 // extern const upb_MiniTableExtension <Extension>; // One for each ext.
28 // extern const upb_MiniTableFile <File>; // One for each file.
30 // extern const upb_MiniTable* <MessagePtr>;
32 UPBC_API
std::string
MiniTableMessageVarName(absl::string_view full_name
);
33 UPBC_API
std::string
MiniTableEnumVarName(absl::string_view full_name
);
34 UPBC_API
std::string
MiniTableExtensionVarName(absl::string_view full_name
);
35 UPBC_API
std::string
MiniTableFileVarName(absl::string_view proto_filename
);
37 // This is used for weak linking and tree shaking. Other translation units may
38 // define weak versions of this symbol that point to a dummy message, to
39 // gracefully degrade the behavior of the generated code when the message is not
40 // linked into the current binary.
41 UPBC_API
std::string
MiniTableMessagePtrVarName(absl::string_view full_name
);
43 } // namespace generator
46 #endif // THIRD_PARTY_UPB_UPB_GENERATOR_MINITABLE_NAMES_H_