Back to home page

EIC code displayed by LXR

 
 

    


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

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 // Public APIs for message operations that do not depend on the schema.
0009 //
0010 // MiniTable-based accessors live in accessors.h.
0011 
0012 #ifndef UPB_MESSAGE_MESSAGE_H_
0013 #define UPB_MESSAGE_MESSAGE_H_
0014 
0015 #include <stddef.h>
0016 
0017 #include "upb/mem/arena.h"
0018 #include "upb/message/internal/message.h"
0019 #include "upb/message/internal/types.h"
0020 #include "upb/mini_table/message.h"
0021 
0022 // Must be last.
0023 #include "upb/port/def.inc"
0024 
0025 typedef struct upb_Message upb_Message;
0026 
0027 #ifdef __cplusplus
0028 extern "C" {
0029 #endif
0030 
0031 // Creates a new message with the given mini_table on the given arena.
0032 UPB_API upb_Message* upb_Message_New(const upb_MiniTable* m, upb_Arena* arena);
0033 
0034 // Returns a reference to the message's unknown data.
0035 const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len);
0036 
0037 // Removes partial unknown data from message.
0038 void upb_Message_DeleteUnknown(upb_Message* msg, const char* data, size_t len);
0039 
0040 // Returns the number of extensions present in this message.
0041 size_t upb_Message_ExtensionCount(const upb_Message* msg);
0042 
0043 // Mark a message and all of its descendents as frozen/immutable.
0044 UPB_API void upb_Message_Freeze(upb_Message* msg, const upb_MiniTable* m);
0045 
0046 // Returns whether a message has been frozen.
0047 UPB_API_INLINE bool upb_Message_IsFrozen(const upb_Message* msg);
0048 
0049 #ifdef UPB_TRACING_ENABLED
0050 UPB_API void upb_Message_LogNewMessage(const upb_MiniTable* m,
0051                                        const upb_Arena* arena);
0052 
0053 UPB_API void upb_Message_SetNewMessageTraceHandler(
0054     void (*handler)(const upb_MiniTable* m, const upb_Arena* arena));
0055 #endif  // UPB_TRACING_ENABLED
0056 
0057 #ifdef __cplusplus
0058 } /* extern "C" */
0059 #endif
0060 
0061 #include "upb/port/undef.inc"
0062 
0063 #endif /* UPB_MESSAGE_MESSAGE_H_ */