Debian Codegraph @

libuna/libuna_utf16_stream.h

raw symbols SCIP
1 /*
2 * UTF-16 stream functions
3 *
4 * Copyright (C) 2008-2024, Joachim Metz <[email protected]>
5 *
6 * Refer to AUTHORS for acknowledgements.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #if !defined( _LIBUNA_UTF16_STREAM_H )
23 #define _LIBUNA_UTF16_STREAM_H
24
25 #include <common.h>
26 #include <types.h>
27
28 #include "libuna_extern.h"
29 #include "libuna_libcerror.h"
30 #include "libuna_types.h"
31
32 #if defined( __cplusplus )
33 extern "C" {
34 #endif
35
36 LIBUNA_EXTERN \
37 int libuna_utf16_stream_copy_byte_order_mark(
38 uint8_t *utf16_stream,
39 size_t utf16_stream_size,
40 size_t *utf16_stream_index,
41 int byte_order,
42 libcerror_error_t **error );
43
44 LIBUNA_EXTERN \
45 int libuna_utf16_stream_size_from_utf8(
46 const libuna_utf8_character_t *utf8_string,
47 size_t utf8_string_size,
48 size_t *utf16_stream_size,
49 libcerror_error_t **error );
50
51 LIBUNA_EXTERN \
52 int libuna_utf16_stream_copy_from_utf8(
53 uint8_t *utf16_stream,
54 size_t utf16_stream_size,
55 int byte_order,
56 const libuna_utf8_character_t *utf8_string,
57 size_t utf8_string_size,
58 libcerror_error_t **error );
59
60 /* The functionality for libuna_utf16_stream_copy_to_utf8 is implemented by
61 * libuna_utf8_string_copy_from_utf16_stream
62 */
63
64 LIBUNA_EXTERN \
65 int libuna_utf16_stream_size_from_utf16(
66 const libuna_utf16_character_t *utf16_string,
67 size_t utf16_string_size,
68 size_t *utf16_stream_size,
69 libcerror_error_t **error );
70
71 LIBUNA_EXTERN \
72 int libuna_utf16_stream_copy_from_utf16(
73 uint8_t *utf16_stream,
74 size_t utf16_stream_size,
75 int byte_order,
76 const libuna_utf16_character_t *utf16_string,
77 size_t utf16_string_size,
78 libcerror_error_t **error );
79
80 /* The functionality for libuna_utf16_stream_copy_to_utf16 is implemented by
81 * libuna_utf16_string_copy_from_utf16_stream
82 */
83
84 LIBUNA_EXTERN \
85 int libuna_utf16_stream_size_from_utf32(
86 const libuna_utf32_character_t *utf32_string,
87 size_t utf32_string_size,
88 size_t *utf16_stream_size,
89 libcerror_error_t **error );
90
91 LIBUNA_EXTERN \
92 int libuna_utf16_stream_copy_from_utf32(
93 uint8_t *utf16_stream,
94 size_t utf16_stream_size,
95 int byte_order,
96 const libuna_utf32_character_t *utf32_string,
97 size_t utf32_string_size,
98 libcerror_error_t **error );
99
100 /* The functionality for libuna_utf16_stream_copy_to_utf32 is implemented by
101 * libuna_utf32_string_copy_from_utf16_stream
102 */
103
104 #if defined( __cplusplus )
105 }
106 #endif
107
108 #endif /* !defined( _LIBUNA_UTF16_STREAM_H ) */
109