Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-27 09:56:13

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_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
0009 #define UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_
0010 
0011 #include <stddef.h>
0012 
0013 // Must be last.
0014 #include "upb/message/message.h"
0015 #include "upb/port/def.inc"
0016 
0017 #ifdef __cplusplus
0018 extern "C" {
0019 #endif
0020 
0021 // Returns true if unknown fields from the two messages are equal when sorted
0022 // and varints are made canonical.
0023 //
0024 // This function is discouraged, as the comparison is inherently lossy without
0025 // schema data:
0026 //
0027 //  1. We don't know whether delimited fields are sub-messages. Unknown
0028 //     sub-messages will therefore not have their fields sorted and varints
0029 //     canonicalized.
0030 //  2. We don't know about oneof/non-repeated fields, which should semantically
0031 //     discard every value except the last.
0032 
0033 typedef enum {
0034   kUpb_UnknownCompareResult_Equal = 0,
0035   kUpb_UnknownCompareResult_NotEqual = 1,
0036   kUpb_UnknownCompareResult_OutOfMemory = 2,
0037   kUpb_UnknownCompareResult_MaxDepthExceeded = 3,
0038 } upb_UnknownCompareResult;
0039 
0040 upb_UnknownCompareResult UPB_PRIVATE(_upb_Message_UnknownFieldsAreEqual)(
0041     const upb_Message* msg1, const upb_Message* msg2, int max_depth);
0042 
0043 #ifdef __cplusplus
0044 } /* extern "C" */
0045 #endif
0046 
0047 #include "upb/port/undef.inc"
0048 
0049 #endif /* UPB_MESSAGE_INTERNAL_COMPARE_UNKNOWN_H_ */