Back to home page

EIC code displayed by LXR

 
 

    


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

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_TEXT_ENCODE_H_
0009 #define UPB_TEXT_ENCODE_H_
0010 
0011 #include "upb/reflection/def.h"
0012 #include "upb/text/options.h"  // IWYU pragma: export
0013 
0014 // Must be last.
0015 #include "upb/port/def.inc"
0016 
0017 #ifdef __cplusplus
0018 extern "C" {
0019 #endif
0020 
0021 /* Encodes the given |msg| to text format.  The message's reflection is given in
0022  * |m|.  The symtab in |symtab| is used to find extensions (if NULL, extensions
0023  * will not be printed).
0024  *
0025  * Output is placed in the given buffer, and always NULL-terminated.  The output
0026  * size (excluding NULL) is returned.  This means that a return value >= |size|
0027  * implies that the output was truncated.  (These are the same semantics as
0028  * snprintf()). */
0029 size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m,
0030                       const upb_DefPool* ext_pool, int options, char* buf,
0031                       size_t size);
0032 
0033 #ifdef __cplusplus
0034 } /* extern "C" */
0035 #endif
0036 
0037 #include "upb/port/undef.inc"
0038 
0039 #endif /* UPB_TEXT_ENCODE_H_ */