Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:18

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2023 Google LLC.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_
0009 #define UPB_MINI_TABLE_INTERNAL_SUB_H_
0010 
0011 // Must be last.
0012 #include "upb/port/def.inc"
0013 
0014 typedef union {
0015   const struct upb_MiniTable* const* UPB_PRIVATE(submsg);
0016   const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
0017 } upb_MiniTableSubInternal;
0018 
0019 union upb_MiniTableSub {
0020   const struct upb_MiniTable* UPB_PRIVATE(submsg);
0021   const struct upb_MiniTableEnum* UPB_PRIVATE(subenum);
0022 };
0023 
0024 #ifdef __cplusplus
0025 extern "C" {
0026 #endif
0027 
0028 UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromEnum(
0029     const struct upb_MiniTableEnum* subenum) {
0030   union upb_MiniTableSub out;
0031   out.UPB_PRIVATE(subenum) = subenum;
0032   return out;
0033 }
0034 
0035 UPB_API_INLINE union upb_MiniTableSub upb_MiniTableSub_FromMessage(
0036     const struct upb_MiniTable* submsg) {
0037   union upb_MiniTableSub out;
0038   out.UPB_PRIVATE(submsg) = submsg;
0039   return out;
0040 }
0041 
0042 UPB_API_INLINE const struct upb_MiniTableEnum* upb_MiniTableSub_Enum(
0043     const union upb_MiniTableSub sub) {
0044   return sub.UPB_PRIVATE(subenum);
0045 }
0046 
0047 UPB_API_INLINE const struct upb_MiniTable* upb_MiniTableSub_Message(
0048     const union upb_MiniTableSub sub) {
0049   return sub.UPB_PRIVATE(submsg);
0050 }
0051 
0052 #ifdef __cplusplus
0053 } /* extern "C" */
0054 #endif
0055 
0056 #include "upb/port/undef.inc"
0057 
0058 #endif /* UPB_MINI_TABLE_INTERNAL_SUB_H_ */