Back to home page

EIC code displayed by LXR

 
 

    


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

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_LEX_ROUND_TRIP_H_
0009 #define UPB_LEX_ROUND_TRIP_H_
0010 
0011 // Must be last.
0012 #include "upb/port/def.inc"
0013 
0014 // Encodes a float or double that is round-trippable, but as short as possible.
0015 // These routines are not fully optimal (not guaranteed to be shortest), but are
0016 // short-ish and match the implementation that has been used in protobuf since
0017 // the beginning.
0018 
0019 // The given buffer size must be at least kUpb_RoundTripBufferSize.
0020 enum { kUpb_RoundTripBufferSize = 32 };
0021 
0022 #ifdef __cplusplus
0023 extern "C" {
0024 #endif
0025 
0026 void _upb_EncodeRoundTripDouble(double val, char* buf, size_t size);
0027 void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size);
0028 
0029 #ifdef __cplusplus
0030 } /* extern "C" */
0031 #endif
0032 
0033 #include "upb/port/undef.inc"
0034 
0035 #endif /* UPB_LEX_ROUND_TRIP_H_ */