Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:25:24

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_REFLECTION_DESC_STATE_INTERNAL_H_
0009 #define UPB_REFLECTION_DESC_STATE_INTERNAL_H_
0010 
0011 #include "upb/mem/arena.h"
0012 #include "upb/mini_descriptor/internal/encode.h"
0013 
0014 // Must be last.
0015 #include "upb/port/def.inc"
0016 
0017 // Manages the storage for mini descriptor strings as they are being encoded.
0018 // TODO: Move some of this state directly into the encoder, maybe.
0019 typedef struct {
0020   upb_MtDataEncoder e;
0021   size_t bufsize;
0022   char* buf;
0023   char* ptr;
0024 } upb_DescState;
0025 
0026 #ifdef __cplusplus
0027 extern "C" {
0028 #endif
0029 
0030 UPB_INLINE void _upb_DescState_Init(upb_DescState* d) {
0031   d->bufsize = kUpb_MtDataEncoder_MinSize * 2;
0032   d->buf = NULL;
0033   d->ptr = NULL;
0034 }
0035 
0036 bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a);
0037 
0038 #ifdef __cplusplus
0039 } /* extern "C" */
0040 #endif
0041 
0042 #include "upb/port/undef.inc"
0043 
0044 #endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */