xref: /aosp_15_r20/external/grpc-grpc/third_party/upb/upb/reflection/internal/strdup2.h (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 #ifndef UPB_REFLECTION_INTERNAL_STRDUP2_H_
9 #define UPB_REFLECTION_INTERNAL_STRDUP2_H_
10 
11 #include <stddef.h>
12 
13 #include "upb/mem/arena.h"
14 
15 // Must be last.
16 #include "upb/port/def.inc"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 // Variant that works with a length-delimited rather than NULL-delimited string,
23 // as supported by strtable.
24 char* upb_strdup2(const char* s, size_t len, upb_Arena* a);
25 
26 #ifdef __cplusplus
27 } /* extern "C" */
28 #endif
29 
30 #include "upb/port/undef.inc"
31 
32 #endif /* UPB_REFLECTION_INTERNAL_STRDUP2_H_ */
33