Debian Codegraph @

libcsplit/libcsplit_wide_split_string.h

raw symbols SCIP
1 /*
2 * Split wide string 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( _LIBCSPLIT_INTERNAL_WIDE_SPLIT_STRING_H )
23 #define _LIBCSPLIT_INTERNAL_WIDE_SPLIT_STRING_H
24
25 #include <common.h>
26 #include <types.h>
27
28 #include "libcsplit_extern.h"
29 #include "libcsplit_libcerror.h"
30 #include "libcsplit_types.h"
31
32 #if defined( __cplusplus )
33 extern "C" {
34 #endif
35
36 #if defined( HAVE_WIDE_CHARACTER_TYPE )
37
38 typedef struct libcsplit_internal_wide_split_string libcsplit_internal_wide_split_string_t;
39
40 struct libcsplit_internal_wide_split_string
41 {
42 /* The number of string segments
43 */
44 int number_of_segments;
45
46 /* The string
47 */
48 wchar_t *string;
49
50 /* The string size
51 */
52 size_t string_size;
53
54 /* The segments
55 */
56 wchar_t **segments;
57
58 /* The segment sizes
59 */
60 size_t *segment_sizes;
61 };
62
63 int libcsplit_wide_split_string_initialize(
64 libcsplit_wide_split_string_t **split_string,
65 const wchar_t *string,
66 size_t string_size,
67 int number_of_segments,
68 libcerror_error_t **error );
69
70 LIBCSPLIT_EXTERN \
71 int libcsplit_wide_split_string_free(
72 libcsplit_wide_split_string_t **split_string,
73 libcerror_error_t **error );
74
75 LIBCSPLIT_EXTERN \
76 int libcsplit_wide_split_string_get_string(
77 libcsplit_wide_split_string_t *split_string,
78 wchar_t **string,
79 size_t *string_size,
80 libcerror_error_t **error );
81
82 LIBCSPLIT_EXTERN \
83 int libcsplit_wide_split_string_get_number_of_segments(
84 libcsplit_wide_split_string_t *split_string,
85 int *number_of_segments,
86 libcerror_error_t **error );
87
88 LIBCSPLIT_EXTERN \
89 int libcsplit_wide_split_string_get_segment_by_index(
90 libcsplit_wide_split_string_t *split_string,
91 int segment_index,
92 wchar_t **string_segment,
93 size_t *string_segment_size,
94 libcerror_error_t **error );
95
96 LIBCSPLIT_EXTERN \
97 int libcsplit_wide_split_string_set_segment_by_index(
98 libcsplit_wide_split_string_t *split_string,
99 int segment_index,
100 wchar_t *string_segment,
101 size_t string_segment_size,
102 libcerror_error_t **error );
103
104 #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */
105
106 #if defined( __cplusplus )
107 }
108 #endif
109
110 #endif /* !defined( _LIBCSPLIT_INTERNAL_WIDE_SPLIT_STRING_H ) */
111