1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2017-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING.  If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_uniconv_wrappers_h)
27 #define octave_uniconv_wrappers_h 1
28 
29 #if defined (__cplusplus)
30 #  include <cstddef>
31 #  include <cstdint>
32 #else
33 #  include <stddef.h>
34 #  include <stdint.h>
35 #endif
36 
37 #if defined __cplusplus
38 extern "C" {
39 #endif
40 
41 // Since we omit arguments we don't care about in Octave, these aren't
42 // named with the _wrapper suffix.
43 
44 extern uint8_t *
45 octave_u8_conv_from_encoding (const char *fromcode, const char *src,
46                               size_t srclen, size_t *lengthp);
47 
48 extern char *
49 octave_u8_conv_to_encoding (const char *tocode, const uint8_t *src,
50                             size_t srclen, size_t *lengthp);
51 
52 extern char *
53 octave_u32_conv_to_encoding_strict (const char *tocode, const uint32_t *src,
54                                     size_t srclen, size_t *lengthp);
55 
56 extern char *
57 u8_from_wchar (const wchar_t *wc);
58 
59 extern wchar_t *
60 u8_to_wchar (const char *u8_char);
61 
62 #if defined __cplusplus
63 }
64 #endif
65 
66 #endif
67