1 /* Copy UTF-8 string.
2    Copyright (C) 2002, 2006, 2009-2018 Free Software Foundation, Inc.
3    Written by Bruno Haible <bruno@clisp.org>, 2002.
4 
5    This program is free software: you can redistribute it and/or
6    modify it under the terms of either:
7 
8      * the GNU Lesser General Public License as published by the Free
9        Software Foundation; either version 3 of the License, or (at your
10        option) any later version.
11 
12    or
13 
14      * the GNU General Public License as published by the Free
15        Software Foundation; either version 2 of the License, or (at your
16        option) any later version.
17 
18    or both in parallel, as here.
19    This program is distributed in the hope that it will be useful,
20    but WITHOUT ANY WARRANTY; without even the implied warranty of
21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22    Lesser General Public License for more details.
23 
24    You should have received a copy of the GNU Lesser General Public License
25    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
26 
27 #include <config.h>
28 
29 /* Specification.  */
30 #include "unistr.h"
31 
32 #if HAVE_STRDUP
33 
34 # include <string.h>
35 
36 uint8_t *
u8_strdup(const uint8_t * s)37 u8_strdup (const uint8_t *s)
38 {
39   return (uint8_t *) strdup ((const char *) s);
40 }
41 
42 #else
43 
44 # define FUNC u8_strdup
45 # define UNIT uint8_t
46 # define U_STRLEN u8_strlen
47 # include "u-strdup.h"
48 
49 #endif
50