1#![allow(non_camel_case_types)]
4#![allow(non_snake_case)]
5#![allow(non_upper_case_globals)]
6
7pub type wchar_t = ::std::os::raw::c_ushort;
8#[doc = " Opaque memory allocator interface.\n\n The caller is responsible for making sure an allocator owns and is compatible\n for freeing memory of a given container.\n\n `aligned_alloc` and `aligned_free` must not be null, while `allocator` can\n be used to pass any opaque data (if any) directly to the bound functions.\n\n A strict alignment requirement may be imposed by allocated types.\n"]
9#[repr(C)]
10#[derive(Debug, Copy, Clone)]
11pub struct CSTL_Alloc {
12 #[doc = " Pointer to opaque data, passed to bound memory allocation functions.\n"]
13 pub opaque: *mut ::std::os::raw::c_void,
14 #[doc = " Must return a memory block of at least `size` bytes that is at least\n as aligned as `alignment`\n"]
15 pub aligned_alloc: ::std::option::Option<
16 unsafe extern "C" fn(
17 opaque: *mut ::std::os::raw::c_void,
18 size: usize,
19 alignment: usize,
20 ) -> *mut ::std::os::raw::c_void,
21 >,
22 #[doc = " Must be able to free previously allocated memory.\n\n The caller is responsible for allocator compatibility.\n"]
23 pub aligned_free: ::std::option::Option<
24 unsafe extern "C" fn(
25 opaque: *mut ::std::os::raw::c_void,
26 memory: *mut ::std::os::raw::c_void,
27 size: usize,
28 alignment: usize,
29 ),
30 >,
31}
32#[allow(clippy::unnecessary_operation, clippy::identity_op)]
33const _: () = {
34 ["Size of CSTL_Alloc"][::std::mem::size_of::<CSTL_Alloc>() - 24usize];
35 ["Alignment of CSTL_Alloc"][::std::mem::align_of::<CSTL_Alloc>() - 8usize];
36 ["Offset of field: CSTL_Alloc::opaque"][::std::mem::offset_of!(CSTL_Alloc, opaque) - 0usize];
37 ["Offset of field: CSTL_Alloc::aligned_alloc"]
38 [::std::mem::offset_of!(CSTL_Alloc, aligned_alloc) - 8usize];
39 ["Offset of field: CSTL_Alloc::aligned_free"]
40 [::std::mem::offset_of!(CSTL_Alloc, aligned_free) - 16usize];
41};
42#[repr(C)]
43#[derive(Debug, Copy, Clone)]
44pub struct CSTL_SType {
45 _unused: [u8; 0],
46}
47#[doc = " Opaque pseudohandle to the size and alignment of a C type.\n\n Defined with `CSTL_define_type`, it is valid if not equal to `NULL`.\n\n The size of the type must be less than or equal to `INTPTR_MAX`.\n"]
48pub type CSTL_Type = *mut CSTL_SType;
49#[doc = " Destroy range.\n\n Required to destroy objects in the range `[first, last)`.\n\n After this call, all objects in the range `[first, last)` are\n treated as uninitialized memory.\n"]
50pub type CSTL_Drop = ::std::option::Option<
51 unsafe extern "C" fn(first: *mut ::std::os::raw::c_void, last: *mut ::std::os::raw::c_void),
52>;
53#[doc = " Move range.\n\n Required to write `last - first` objects to uninitialized memory at\n `dest` so that each of them is equal to the corresponding object in\n the range `[first, last)` before the operation.\n\n After this call, all objects in the range `[first, last)` are\n treated as valid objects in an unspecified state.\n"]
54pub type CSTL_Move = ::std::option::Option<
55 unsafe extern "C" fn(
56 first: *mut ::std::os::raw::c_void,
57 last: *mut ::std::os::raw::c_void,
58 dest: *mut ::std::os::raw::c_void,
59 ),
60>;
61#[doc = " Copy range.\n\n Required to write `(last - first) / size` objects to uninitialized\n memory at `dest` so that each of them is equal to the corresponding\n object in the range `[first, last)`.\n\n Note that a `CSTL_Copy` function satisfies the requirements of\n `CSTL_Move`.\n"]
62pub type CSTL_Copy = ::std::option::Option<
63 unsafe extern "C" fn(
64 first: *const ::std::os::raw::c_void,
65 last: *const ::std::os::raw::c_void,
66 dest: *mut ::std::os::raw::c_void,
67 ),
68>;
69#[doc = " Fill range.\n\n Required to write `(last - first) / size` copies of `instance`\n to uninitialized memory at `[first, last)` so that each of them\n is equal to the corresponding `instance`.\n"]
70pub type CSTL_Fill = ::std::option::Option<
71 unsafe extern "C" fn(
72 first: *mut ::std::os::raw::c_void,
73 last: *mut ::std::os::raw::c_void,
74 value: *const ::std::os::raw::c_void,
75 ),
76>;
77#[doc = " Function table for a type that can be destroyed by calling `drop`\n on a range of objects of that type.\n"]
78#[repr(C)]
79#[derive(Debug, Copy, Clone)]
80pub struct CSTL_DropType {
81 pub drop: CSTL_Drop,
82}
83#[allow(clippy::unnecessary_operation, clippy::identity_op)]
84const _: () = {
85 ["Size of CSTL_DropType"][::std::mem::size_of::<CSTL_DropType>() - 8usize];
86 ["Alignment of CSTL_DropType"][::std::mem::align_of::<CSTL_DropType>() - 8usize];
87 ["Offset of field: CSTL_DropType::drop"][::std::mem::offset_of!(CSTL_DropType, drop) - 0usize];
88};
89#[doc = " Function table for a type that can be moved by calling `move`\n on a range of objects of that type to another range, or destroyed.\n"]
90#[repr(C)]
91#[derive(Debug, Copy, Clone)]
92pub struct CSTL_MoveType {
93 pub drop_type: CSTL_DropType,
94 pub move_: CSTL_Move,
95}
96#[allow(clippy::unnecessary_operation, clippy::identity_op)]
97const _: () = {
98 ["Size of CSTL_MoveType"][::std::mem::size_of::<CSTL_MoveType>() - 16usize];
99 ["Alignment of CSTL_MoveType"][::std::mem::align_of::<CSTL_MoveType>() - 8usize];
100 ["Offset of field: CSTL_MoveType::drop_type"]
101 [::std::mem::offset_of!(CSTL_MoveType, drop_type) - 0usize];
102 ["Offset of field: CSTL_MoveType::move_"]
103 [::std::mem::offset_of!(CSTL_MoveType, move_) - 8usize];
104};
105#[doc = " Function table for a type that can be copied by calling `copy`\n on a range of objects of that type to another range, or moved, or destroyed.\n\n It is valid for `copy` to bind the same function as `move_type.move`.\n"]
106#[repr(C)]
107#[derive(Debug, Copy, Clone)]
108pub struct CSTL_CopyType {
109 pub move_type: CSTL_MoveType,
110 pub copy: CSTL_Copy,
111 pub fill: CSTL_Fill,
112}
113#[allow(clippy::unnecessary_operation, clippy::identity_op)]
114const _: () = {
115 ["Size of CSTL_CopyType"][::std::mem::size_of::<CSTL_CopyType>() - 32usize];
116 ["Alignment of CSTL_CopyType"][::std::mem::align_of::<CSTL_CopyType>() - 8usize];
117 ["Offset of field: CSTL_CopyType::move_type"]
118 [::std::mem::offset_of!(CSTL_CopyType, move_type) - 0usize];
119 ["Offset of field: CSTL_CopyType::copy"][::std::mem::offset_of!(CSTL_CopyType, copy) - 16usize];
120 ["Offset of field: CSTL_CopyType::fill"][::std::mem::offset_of!(CSTL_CopyType, fill) - 24usize];
121};
122#[doc = " Reference to a const `CSTL_DropType`.\n\n Must not be null.\n"]
123pub type CSTL_DropTypeCRef = *const CSTL_DropType;
124#[doc = " Reference to a const `CSTL_MoveType`.\n\n Must not be null.\n"]
125pub type CSTL_MoveTypeCRef = *const CSTL_MoveType;
126#[doc = " Reference to a const `CSTL_CopyType`.\n\n Must not be null.\n"]
127pub type CSTL_CopyTypeCRef = *const CSTL_CopyType;
128#[doc = " Compare two objects for equality.\n\n The function must establish an equivalence relation:\n `a == b` => `b == a`, `a == b` && `b == c` => `a == c`\n"]
129pub type CSTL_IsEq = ::std::option::Option<
130 unsafe extern "C" fn(
131 lhs: *const ::std::os::raw::c_void,
132 rhs: *const ::std::os::raw::c_void,
133 ) -> bool,
134>;
135#[doc = " Compare two objects for less than.\n\n The function must establish at least a strict weak ordering:\n `a < b` => `b < a == false`\n `a < b` && `b < c` => `a < c`\n"]
136pub type CSTL_IsLt = ::std::option::Option<
137 unsafe extern "C" fn(
138 lhs: *const ::std::os::raw::c_void,
139 rhs: *const ::std::os::raw::c_void,
140 ) -> bool,
141>;
142#[doc = " Function table for a type instances of which can be ordered\n with respect to others in a string weak ordering.\n"]
143#[repr(C)]
144#[derive(Debug, Copy, Clone)]
145pub struct CSTL_CompType {
146 pub is_eq: CSTL_IsEq,
147 pub is_lt: CSTL_IsLt,
148}
149#[allow(clippy::unnecessary_operation, clippy::identity_op)]
150const _: () = {
151 ["Size of CSTL_CompType"][::std::mem::size_of::<CSTL_CompType>() - 16usize];
152 ["Alignment of CSTL_CompType"][::std::mem::align_of::<CSTL_CompType>() - 8usize];
153 ["Offset of field: CSTL_CompType::is_eq"]
154 [::std::mem::offset_of!(CSTL_CompType, is_eq) - 0usize];
155 ["Offset of field: CSTL_CompType::is_lt"]
156 [::std::mem::offset_of!(CSTL_CompType, is_lt) - 8usize];
157};
158#[doc = " Obtain a hash for an instance of an object.\n\n The relation `a == b` => `hash(a) == hash(b)` must hold.\n"]
159pub type CSTL_Hash =
160 ::std::option::Option<unsafe extern "C" fn(instance: *const ::std::os::raw::c_void) -> usize>;
161#[doc = " Function table for a type instances of which can be hashed\n and compared for equality.\n"]
162#[repr(C)]
163#[derive(Debug, Copy, Clone)]
164pub struct CSTL_HashType {
165 pub is_eq: CSTL_IsEq,
166 pub hash: CSTL_Hash,
167}
168#[allow(clippy::unnecessary_operation, clippy::identity_op)]
169const _: () = {
170 ["Size of CSTL_HashType"][::std::mem::size_of::<CSTL_HashType>() - 16usize];
171 ["Alignment of CSTL_HashType"][::std::mem::align_of::<CSTL_HashType>() - 8usize];
172 ["Offset of field: CSTL_HashType::is_eq"]
173 [::std::mem::offset_of!(CSTL_HashType, is_eq) - 0usize];
174 ["Offset of field: CSTL_HashType::hash"][::std::mem::offset_of!(CSTL_HashType, hash) - 8usize];
175};
176unsafe extern "C" {
177 #[doc = " Obtain a pseudohandle to the size and alignment of a C type.\n\n If the below requirements are broken, the function returns\n an invalid handle equal to `NULL`:\n 1. `size` must be a non-zero multiple of `alignment`.\n 2. `alignment` must be a power of 2.\n 3. `size` must be less than or equal to `INTPTR_MAX`.\n"]
178 pub fn CSTL_define_type(size: usize, alignment: usize) -> CSTL_Type;
179}
180unsafe extern "C" {
181 #[doc = " Get the size of a C type back from a packed pseudohandle representation.\n"]
182 pub fn CSTL_sizeof_type(type_: CSTL_Type) -> usize;
183}
184unsafe extern "C" {
185 #[doc = " Get the alignment of a C type back from a packed pseudohandle representation.\n"]
186 pub fn CSTL_alignof_type(type_: CSTL_Type) -> usize;
187}
188#[doc = " STL ABI `std::vector` layout.\n\n Does not include the allocator, which nonetheless is a part of the `std::vector`\n structure! You are responsible for including it, since it can take on any form.\n\n Do not manipulate the members directly, use the associated functions!\n"]
189#[repr(C)]
190#[derive(Copy, Clone)]
191pub struct CSTL_VectorVal {
192 pub first: *mut ::std::os::raw::c_void,
193 pub last: *mut ::std::os::raw::c_void,
194 pub end: *mut ::std::os::raw::c_void,
195}
196#[allow(clippy::unnecessary_operation, clippy::identity_op)]
197const _: () = {
198 ["Size of CSTL_VectorVal"][::std::mem::size_of::<CSTL_VectorVal>() - 24usize];
199 ["Alignment of CSTL_VectorVal"][::std::mem::align_of::<CSTL_VectorVal>() - 8usize];
200 ["Offset of field: CSTL_VectorVal::first"]
201 [::std::mem::offset_of!(CSTL_VectorVal, first) - 0usize];
202 ["Offset of field: CSTL_VectorVal::last"]
203 [::std::mem::offset_of!(CSTL_VectorVal, last) - 8usize];
204 ["Offset of field: CSTL_VectorVal::end"][::std::mem::offset_of!(CSTL_VectorVal, end) - 16usize];
205};
206#[doc = " Reference to a mutable `CSTL_VectorVal`.\n\n Must not be null.\n"]
207pub type CSTL_VectorRef = *mut CSTL_VectorVal;
208#[doc = " Reference to a const `CSTL_VectorVal`.\n\n Must not be null.\n"]
209pub type CSTL_VectorCRef = *const CSTL_VectorVal;
210#[doc = " An iterator over elements of a vector.\n\n Contains a reference to a `CSTL_Type` which must outlive it.\n\n Not ABI-compatible with `std::vector::iterator`.\n"]
211#[repr(C)]
212#[derive(Debug, Copy, Clone)]
213pub struct CSTL_VectorIter {
214 pub pointer: *const ::std::os::raw::c_void,
215 pub size: usize,
216 pub owner: CSTL_VectorCRef,
217}
218#[allow(clippy::unnecessary_operation, clippy::identity_op)]
219const _: () = {
220 ["Size of CSTL_VectorIter"][::std::mem::size_of::<CSTL_VectorIter>() - 24usize];
221 ["Alignment of CSTL_VectorIter"][::std::mem::align_of::<CSTL_VectorIter>() - 8usize];
222 ["Offset of field: CSTL_VectorIter::pointer"]
223 [::std::mem::offset_of!(CSTL_VectorIter, pointer) - 0usize];
224 ["Offset of field: CSTL_VectorIter::size"]
225 [::std::mem::offset_of!(CSTL_VectorIter, size) - 8usize];
226 ["Offset of field: CSTL_VectorIter::owner"]
227 [::std::mem::offset_of!(CSTL_VectorIter, owner) - 16usize];
228};
229unsafe extern "C" {
230 #[doc = " Initializes the vector pointed to by `new_instance`, but does not allocate any memory.\n\n An initialized vector can be trivially destroyed without leaks as long\n as no functions that allocate (push, insert, reserve, etc.) have been called on it.\n\n Re-initializing a vector with a backing memory allocation will leak the old\n memory allocation.\n"]
231 pub fn CSTL_vector_construct(new_instance: *mut CSTL_VectorVal);
232}
233unsafe extern "C" {
234 #[doc = " Destroys the vector pointed to by `instance`, destroying elements\n and freeing the backing storage.\n"]
235 pub fn CSTL_vector_destroy(
236 instance: CSTL_VectorRef,
237 type_: CSTL_Type,
238 drop: CSTL_DropTypeCRef,
239 alloc: *mut CSTL_Alloc,
240 );
241}
242unsafe extern "C" {
243 #[doc = " Replaces the contents of `instance` with the contents of `other_instance`.\n\n If `propagate_alloc == true && alloc != other_alloc` then storage\n is freed with `alloc` and allocated again with `other_alloc` before elements\n are copied. Then, `instance` uses `other_alloc` as its allocator. If\n the allocation fails, returns `false`, otherwise always returns `true`.\n\n If `propagate_alloc == false` `instance` keeps using `alloc` as its allocator,\n potentially reusing its storage.\n\n You are responsible for replacing the allocator outside of `CSTL_VectorVal` if applicable.\n"]
244 pub fn CSTL_vector_copy_assign(
245 instance: CSTL_VectorRef,
246 type_: CSTL_Type,
247 copy: CSTL_CopyTypeCRef,
248 other_instance: CSTL_VectorCRef,
249 alloc: *mut CSTL_Alloc,
250 other_alloc: *mut CSTL_Alloc,
251 propagate_alloc: bool,
252 ) -> bool;
253}
254unsafe extern "C" {
255 #[doc = " Moves the contents of `other_instance` to the contents of `instance`.\n\n If `propagate_alloc == true` storage is replaced with storage of `other_instance`.\n Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false && alloc != other_alloc` then storage is reused\n and individual elements of `other_instance` are moved in. If the allocation fails,\n returns `false`, otherwise always returns `true`. Then, `instance` uses\n `alloc` as its allocator.\n\n You are responsible for replacing the allocator outside of `CSTL_VectorVal` if applicable.\n"]
256 pub fn CSTL_vector_move_assign(
257 instance: CSTL_VectorRef,
258 type_: CSTL_Type,
259 move_: CSTL_MoveTypeCRef,
260 other_instance: CSTL_VectorRef,
261 alloc: *mut CSTL_Alloc,
262 other_alloc: *mut CSTL_Alloc,
263 propagate_alloc: bool,
264 ) -> bool;
265}
266unsafe extern "C" {
267 #[doc = " Destroys vector contents, replacing them with a copy of the range `[first, last)`.\n\n If `new_size > CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
268 pub fn CSTL_vector_copy_assign_range(
269 instance: CSTL_VectorRef,
270 type_: CSTL_Type,
271 copy: CSTL_CopyTypeCRef,
272 first: *const ::std::os::raw::c_void,
273 last: *const ::std::os::raw::c_void,
274 alloc: *mut CSTL_Alloc,
275 ) -> bool;
276}
277unsafe extern "C" {
278 #[doc = " Destroys vector contents, replacing them with a copy of the range `[first, last)`.\n\n If `new_size > CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
279 pub fn CSTL_vector_move_assign_range(
280 instance: CSTL_VectorRef,
281 type_: CSTL_Type,
282 move_: CSTL_MoveTypeCRef,
283 first: *mut ::std::os::raw::c_void,
284 last: *mut ::std::os::raw::c_void,
285 alloc: *mut CSTL_Alloc,
286 ) -> bool;
287}
288unsafe extern "C" {
289 #[doc = " Destroys vector contents, replacing them with `new_size` copies of `value`.\n\n If `new_size > CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
290 pub fn CSTL_vector_assign_n(
291 instance: CSTL_VectorRef,
292 type_: CSTL_Type,
293 copy: CSTL_CopyTypeCRef,
294 new_size: usize,
295 value: *const ::std::os::raw::c_void,
296 alloc: *mut CSTL_Alloc,
297 ) -> bool;
298}
299unsafe extern "C" {
300 #[doc = " Swaps vector contents.\n\n You are responsible for swapping the allocators.\n"]
301 pub fn CSTL_vector_swap(instance: CSTL_VectorRef, other_instance: CSTL_VectorRef);
302}
303unsafe extern "C" {
304 #[doc = " Returns a pointer to the element at `pos`.\n\n If `pos >= CSTL_vector_size(instance, type)` the behavior is undefined.\n"]
305 pub fn CSTL_vector_index(
306 instance: CSTL_VectorRef,
307 type_: CSTL_Type,
308 pos: usize,
309 ) -> *mut ::std::os::raw::c_void;
310}
311unsafe extern "C" {
312 #[doc = " Returns a const pointer to the element at `pos`.\n\n If `pos >= CSTL_vector_size(instance, type)` the behavior is undefined.\n"]
313 pub fn CSTL_vector_const_index(
314 instance: CSTL_VectorCRef,
315 type_: CSTL_Type,
316 pos: usize,
317 ) -> *const ::std::os::raw::c_void;
318}
319unsafe extern "C" {
320 #[doc = " Returns a pointer to the element at `pos`.\n\n If `pos >= CSTL_vector_size(instance, type)` a null pointer is returned.\n"]
321 pub fn CSTL_vector_at(
322 instance: CSTL_VectorRef,
323 type_: CSTL_Type,
324 pos: usize,
325 ) -> *mut ::std::os::raw::c_void;
326}
327unsafe extern "C" {
328 #[doc = " Returns a const pointer to the element at `pos`.\n\n If `pos >= CSTL_vector_size(instance, type)` a null pointer is returned.\n"]
329 pub fn CSTL_vector_const_at(
330 instance: CSTL_VectorCRef,
331 type_: CSTL_Type,
332 pos: usize,
333 ) -> *const ::std::os::raw::c_void;
334}
335unsafe extern "C" {
336 #[doc = " Returns a pointer to the first element in the vector.\n\n If `CSTL_vector_empty(instance) == true` the behavior is undefined.\n"]
337 pub fn CSTL_vector_front(instance: CSTL_VectorRef) -> *mut ::std::os::raw::c_void;
338}
339unsafe extern "C" {
340 #[doc = " Returns a const pointer to the first element in the vector.\n\n If `CSTL_vector_empty(instance) == true` the behavior is undefined.\n"]
341 pub fn CSTL_vector_const_front(instance: CSTL_VectorCRef) -> *const ::std::os::raw::c_void;
342}
343unsafe extern "C" {
344 #[doc = " Returns a pointer to the last element in the vector.\n\n If `CSTL_vector_empty(instance) == true` the behavior is undefined.\n"]
345 pub fn CSTL_vector_back(
346 instance: CSTL_VectorRef,
347 type_: CSTL_Type,
348 ) -> *mut ::std::os::raw::c_void;
349}
350unsafe extern "C" {
351 #[doc = " Returns a const pointer to the last element in the vector.\n\n If `CSTL_vector_empty(instance) == true` the behavior is undefined.\n"]
352 pub fn CSTL_vector_const_back(
353 instance: CSTL_VectorCRef,
354 type_: CSTL_Type,
355 ) -> *const ::std::os::raw::c_void;
356}
357unsafe extern "C" {
358 #[doc = " Returns a pointer to the underlying storage.\n\n The returned pointer is valid even if the vector is empty,\n in which case it is not dereferenceable.\n"]
359 pub fn CSTL_vector_data(instance: CSTL_VectorRef) -> *mut ::std::os::raw::c_void;
360}
361unsafe extern "C" {
362 #[doc = " Returns a pointer to the underlying storage.\n\n The returned pointer is valid even if the vector is empty,\n in which case it is not dereferenceable.\n"]
363 pub fn CSTL_vector_const_data(instance: CSTL_VectorCRef) -> *const ::std::os::raw::c_void;
364}
365unsafe extern "C" {
366 #[doc = " Construct an iterator to the first element of the vector.\n\n If the vector is empty: `CSTL_vector_iterator_eq(begin, end) == true`.\n"]
367 pub fn CSTL_vector_begin(instance: CSTL_VectorCRef, type_: CSTL_Type) -> CSTL_VectorIter;
368}
369unsafe extern "C" {
370 #[doc = " Construct an iterator past the last element of the vector.\n\n If the vector is empty: `CSTL_vector_iterator_eq(begin, end) == true`.\n"]
371 pub fn CSTL_vector_end(instance: CSTL_VectorCRef, type_: CSTL_Type) -> CSTL_VectorIter;
372}
373unsafe extern "C" {
374 #[doc = " Seeks the iterator forwards by `n` elements.\n\n Returns a new iterator at the resulting iterator position.\n"]
375 pub fn CSTL_vector_iterator_add(iterator: CSTL_VectorIter, n: isize) -> CSTL_VectorIter;
376}
377unsafe extern "C" {
378 #[doc = " Seeks the iterator backwards by `n` elements.\n\n Returns a new iterator at the resulting iterator position.\n"]
379 pub fn CSTL_vector_iterator_sub(iterator: CSTL_VectorIter, n: isize) -> CSTL_VectorIter;
380}
381unsafe extern "C" {
382 #[doc = " Dereferences the iterator at the element it's pointing to.\n\n Returns a pointer to the element.\n\n `iterator` must be dereferenceable, not value initialized\n and pointing to a valid element inside the vector.\n\n It is not valid to mutate an element derived from an iterator obtained with\n a const vector pointer.\n"]
383 pub fn CSTL_vector_iterator_deref(iterator: CSTL_VectorIter) -> *mut ::std::os::raw::c_void;
384}
385unsafe extern "C" {
386 #[doc = " Dereferences the iterator at an element offset `n`.\n\n Returns a pointer to the element.\n\n `iterator` must be dereferenceable at its new position, not value initialized\n and pointing to a valid element inside the vector.\n\n It is not valid to mutate an element derived from an iterator obtained with\n a const vector pointer.\n"]
387 pub fn CSTL_vector_iterator_index(
388 iterator: CSTL_VectorIter,
389 n: isize,
390 ) -> *mut ::std::os::raw::c_void;
391}
392unsafe extern "C" {
393 #[doc = " Subtracts two iterators and returns the distance measured in elements.\n\n Returns the signed number of elements between two iterators.\n\n They must belong to the same vector.\n"]
394 pub fn CSTL_vector_iterator_distance(lhs: CSTL_VectorIter, rhs: CSTL_VectorIter) -> isize;
395}
396unsafe extern "C" {
397 #[doc = " Compares iterators for equality.\n\n They must belong to the same vector.\n"]
398 pub fn CSTL_vector_iterator_eq(lhs: CSTL_VectorIter, rhs: CSTL_VectorIter) -> bool;
399}
400unsafe extern "C" {
401 #[doc = " Compares iterators for less than.\n\n They must belong to the same vector.\n"]
402 pub fn CSTL_vector_iterator_lt(lhs: CSTL_VectorIter, rhs: CSTL_VectorIter) -> bool;
403}
404unsafe extern "C" {
405 #[doc = " Returns `true` if the vector is empty or `false` otherwise.\n"]
406 pub fn CSTL_vector_empty(instance: CSTL_VectorCRef) -> bool;
407}
408unsafe extern "C" {
409 #[doc = " Returns the number of elements in the vector.\n"]
410 pub fn CSTL_vector_size(instance: CSTL_VectorCRef, type_: CSTL_Type) -> usize;
411}
412unsafe extern "C" {
413 #[doc = " Returns the total element capacity of the vector.\n"]
414 pub fn CSTL_vector_capacity(instance: CSTL_VectorCRef, type_: CSTL_Type) -> usize;
415}
416unsafe extern "C" {
417 #[doc = " Returns the maximum possible number of elements in the vector.\n\n As if by `(PTRDIFF_MAX - 1) / CSTL_type_size(type)`.\n"]
418 pub fn CSTL_vector_max_size(type_: CSTL_Type) -> usize;
419}
420unsafe extern "C" {
421 #[doc = " Resizes the vector to contain `new_size` elements.\n\n If `new_size > CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
422 pub fn CSTL_vector_resize(
423 instance: CSTL_VectorRef,
424 type_: CSTL_Type,
425 copy: CSTL_CopyTypeCRef,
426 new_size: usize,
427 value: *const ::std::os::raw::c_void,
428 alloc: *mut CSTL_Alloc,
429 ) -> bool;
430}
431unsafe extern "C" {
432 #[doc = " Truncates the vector to contain `new_size` elements, removing any excess.\n\n Has no effect if `new_size >= CSTL_vector_size(instance, type)`.\n\n If `new_size > CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
433 pub fn CSTL_vector_truncate(
434 instance: CSTL_VectorRef,
435 type_: CSTL_Type,
436 drop: CSTL_DropTypeCRef,
437 new_size: usize,
438 );
439}
440unsafe extern "C" {
441 #[doc = " If `new_capacity > CSTL_vector_capacity(instance, type)`, reallocates and expands\n the vector storage.\n\n If `new_capacity` exceeds `CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
442 pub fn CSTL_vector_reserve(
443 instance: CSTL_VectorRef,
444 type_: CSTL_Type,
445 move_: CSTL_MoveTypeCRef,
446 new_capacity: usize,
447 alloc: *mut CSTL_Alloc,
448 ) -> bool;
449}
450unsafe extern "C" {
451 #[doc = " Request removal of unused capacity.\n\n If a reallocation occurs and fails returns `false`, otherwise\n always returns `true`.\n"]
452 pub fn CSTL_vector_shrink_to_fit(
453 instance: CSTL_VectorRef,
454 type_: CSTL_Type,
455 move_: CSTL_MoveTypeCRef,
456 alloc: *mut CSTL_Alloc,
457 ) -> bool;
458}
459unsafe extern "C" {
460 #[doc = " Erase all elements from the vector without affecting capacity.\n"]
461 pub fn CSTL_vector_clear(instance: CSTL_VectorRef, drop: CSTL_DropTypeCRef);
462}
463unsafe extern "C" {
464 #[doc = " Appends a copy of `value` to the end of the vector.\n\n If `CSTL_vector_size(instance, type) == CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
465 pub fn CSTL_vector_copy_push_back(
466 instance: CSTL_VectorRef,
467 type_: CSTL_Type,
468 copy: CSTL_CopyTypeCRef,
469 value: *const ::std::os::raw::c_void,
470 alloc: *mut CSTL_Alloc,
471 ) -> bool;
472}
473unsafe extern "C" {
474 #[doc = " Appends `value` to the end of the vector by moving it.\n\n If `CSTL_vector_size(instance, type) == CSTL_vector_max_size(type)` (vector too long)\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
475 pub fn CSTL_vector_move_push_back(
476 instance: CSTL_VectorRef,
477 type_: CSTL_Type,
478 move_: CSTL_MoveTypeCRef,
479 value: *mut ::std::os::raw::c_void,
480 alloc: *mut CSTL_Alloc,
481 ) -> bool;
482}
483unsafe extern "C" {
484 #[doc = " Removes the last element from the vector.\n\n If `CSTL_vector_empty(instance) == true` the behavior is undefined.\n"]
485 pub fn CSTL_vector_pop_back(
486 instance: CSTL_VectorRef,
487 type_: CSTL_Type,
488 drop: CSTL_DropTypeCRef,
489 );
490}
491unsafe extern "C" {
492 #[doc = " Inserts a copy of `value` into the vector before `where` and returns\n an iterator to the newly inserted element.\n\n If `CSTL_vector_size(instance, ...) == CSTL_vector_max_size(...)` (vector too long)\n this function has no effect and returns `CSTL_vector_end(instance, ...)`.\n"]
493 pub fn CSTL_vector_copy_insert(
494 instance: CSTL_VectorRef,
495 copy: CSTL_CopyTypeCRef,
496 where_: CSTL_VectorIter,
497 value: *const ::std::os::raw::c_void,
498 alloc: *mut CSTL_Alloc,
499 ) -> CSTL_VectorIter;
500}
501unsafe extern "C" {
502 #[doc = " Inserts `value` into the vector before `where` by moving it and returns\n an iterator to the newly inserted element.\n\n If `CSTL_vector_size(instance, ...) == CSTL_vector_max_size(...)` (vector too long)\n this function has no effect and returns `CSTL_vector_end(instance, ...)`.\n"]
503 pub fn CSTL_vector_move_insert(
504 instance: CSTL_VectorRef,
505 move_: CSTL_MoveTypeCRef,
506 where_: CSTL_VectorIter,
507 value: *mut ::std::os::raw::c_void,
508 alloc: *mut CSTL_Alloc,
509 ) -> CSTL_VectorIter;
510}
511unsafe extern "C" {
512 #[doc = " Inserts a copy of the range `[range_first, range_last)` into the vector before `where` and returns\n an iterator to the newly inserted elements.\n\n Exceeding the maximum possible vector size has the same effect as `CSTL_vector_copy_insert`,\n returning `CSTL_vector_end(instance, ...)`.\n"]
513 pub fn CSTL_vector_copy_insert_range(
514 instance: CSTL_VectorRef,
515 copy: CSTL_CopyTypeCRef,
516 where_: CSTL_VectorIter,
517 range_first: *const ::std::os::raw::c_void,
518 range_last: *const ::std::os::raw::c_void,
519 alloc: *mut CSTL_Alloc,
520 ) -> CSTL_VectorIter;
521}
522unsafe extern "C" {
523 #[doc = " Inserts the range `[range_first, range_last)` into the vector before `where` by moving it and returns\n an iterator to the newly inserted elements.\n\n Exceeding the maximum possible vector size has the same effect as `CSTL_vector_move_insert`,\n returning `CSTL_vector_end(instance, ...)`.\n"]
524 pub fn CSTL_vector_move_insert_range(
525 instance: CSTL_VectorRef,
526 move_: CSTL_MoveTypeCRef,
527 where_: CSTL_VectorIter,
528 range_first: *mut ::std::os::raw::c_void,
529 range_last: *mut ::std::os::raw::c_void,
530 alloc: *mut CSTL_Alloc,
531 ) -> CSTL_VectorIter;
532}
533unsafe extern "C" {
534 #[doc = " Inserts `count` copies of `value` into the vector before `where` and returns\n an iterator to the first newly inserted element.\n\n If `count > CSTL_vector_max_size(...) - CSTL_vector_size(instance, ...)` (vector too long)\n this function has no effect and returns `CSTL_vector_end(instance, ...)`.\n"]
535 pub fn CSTL_vector_insert_n(
536 instance: CSTL_VectorRef,
537 copy: CSTL_CopyTypeCRef,
538 where_: CSTL_VectorIter,
539 count: usize,
540 value: *const ::std::os::raw::c_void,
541 alloc: *mut CSTL_Alloc,
542 ) -> CSTL_VectorIter;
543}
544unsafe extern "C" {
545 #[doc = " Removes the element at `where` and returns an iterator following the\n removed element.\n\n The iterator `where` must be valid and dereferenceable.\n"]
546 pub fn CSTL_vector_erase(
547 instance: CSTL_VectorRef,
548 move_: CSTL_MoveTypeCRef,
549 where_: CSTL_VectorIter,
550 ) -> CSTL_VectorIter;
551}
552unsafe extern "C" {
553 #[doc = " Removes elements in the range `[first, last)` and returns an iterator following the\n removed elements.\n\n If `first == last`, no operation is performed.\n"]
554 pub fn CSTL_vector_erase_range(
555 instance: CSTL_VectorRef,
556 move_: CSTL_MoveTypeCRef,
557 first: CSTL_VectorIter,
558 last: CSTL_VectorIter,
559 ) -> CSTL_VectorIter;
560}
561#[doc = " STL ABI `std::basic_string` layout.\n\n Does not include the allocator, which nonetheless is a part of the `std::basic_string`\n structure! You are responsible for including it, since it can take on any form.\n\n Do not manipulate the members directly, use the associated functions!\n"]
562#[repr(C)]
563#[derive(Copy, Clone)]
564pub struct CSTL_StringVal {
565 pub bx: CSTL_StringUnion,
566 pub size: usize,
567 pub res: usize,
568}
569#[repr(C)]
570#[derive(Copy, Clone)]
571pub union CSTL_StringUnion {
572 pub buf: [::std::os::raw::c_char; 16usize],
573 pub ptr: *mut ::std::os::raw::c_char,
574}
575#[allow(clippy::unnecessary_operation, clippy::identity_op)]
576const _: () = {
577 ["Size of CSTL_StringUnion"][::std::mem::size_of::<CSTL_StringUnion>() - 16usize];
578 ["Alignment of CSTL_StringUnion"][::std::mem::align_of::<CSTL_StringUnion>() - 8usize];
579 ["Offset of field: CSTL_StringUnion::buf"]
580 [::std::mem::offset_of!(CSTL_StringUnion, buf) - 0usize];
581 ["Offset of field: CSTL_StringUnion::ptr"]
582 [::std::mem::offset_of!(CSTL_StringUnion, ptr) - 0usize];
583};
584#[allow(clippy::unnecessary_operation, clippy::identity_op)]
585const _: () = {
586 ["Size of CSTL_StringVal"][::std::mem::size_of::<CSTL_StringVal>() - 32usize];
587 ["Alignment of CSTL_StringVal"][::std::mem::align_of::<CSTL_StringVal>() - 8usize];
588 ["Offset of field: CSTL_StringVal::bx"][::std::mem::offset_of!(CSTL_StringVal, bx) - 0usize];
589 ["Offset of field: CSTL_StringVal::size"]
590 [::std::mem::offset_of!(CSTL_StringVal, size) - 16usize];
591 ["Offset of field: CSTL_StringVal::res"][::std::mem::offset_of!(CSTL_StringVal, res) - 24usize];
592};
593#[doc = " Reference to a mutable `CSTL_StringVal`.\n\n Must not be null.\n"]
594pub type CSTL_StringRef = *mut CSTL_StringVal;
595#[doc = " Reference to a const `CSTL_StringVal`.\n\n Must not be null.\n"]
596pub type CSTL_StringCRef = *const CSTL_StringVal;
597unsafe extern "C" {
598 #[doc = " Initializes the string, but does not allocate any memory.\n\n An initialized string can be trivially destroyed without leaks as long\n as its owned string is small enough to be inline (smaller than CSTL_string_alloc_mask).\n\n Re-initializing a string with a backing memory allocation will leak the old\n memory allocation.\n"]
599 pub fn CSTL_string_construct(new_instance: *mut CSTL_StringVal);
600}
601unsafe extern "C" {
602 #[doc = " Destroys the string, freeing the backing storage if necessary.\n"]
603 pub fn CSTL_string_destroy(instance: CSTL_StringRef, alloc: *mut CSTL_Alloc);
604}
605unsafe extern "C" {
606 #[doc = " Initializes the string with the substring at offset `other_off`\n in `other` with the length given by `count`.\n\n If `new_instance == NULL` or if `other_off` is outside of the range\n `[other, other + CSTL_string_size(other)]` returns `false` and does nothing,\n otherwise it returns `true`.\n\n If `new_instance == other` the substring operation is performed in-place without\n de-initializing `other`.\n\n Remember that re-initializing a different string with a backing memory allocation\n will leak the old memory allocation.\n"]
607 pub fn CSTL_string_substr(
608 new_instance: *mut CSTL_StringVal,
609 other: CSTL_StringCRef,
610 other_off: usize,
611 count: usize,
612 alloc: *mut CSTL_Alloc,
613 ) -> bool;
614}
615unsafe extern "C" {
616 #[doc = " Replaces the contents of `instance` with the null-terminated string at `ptr`.\n\n If the length of the string at `ptr` is greater than `CSTL_string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
617 pub fn CSTL_string_assign(
618 instance: CSTL_StringRef,
619 ptr: *const ::std::os::raw::c_char,
620 alloc: *mut CSTL_Alloc,
621 ) -> bool;
622}
623unsafe extern "C" {
624 #[doc = " Replaces the contents of `instance` with the first `count` characters of the string at `ptr`.\n\n If `n` is greater than `CSTL_string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
625 pub fn CSTL_string_assign_n(
626 instance: CSTL_StringRef,
627 ptr: *const ::std::os::raw::c_char,
628 count: usize,
629 alloc: *mut CSTL_Alloc,
630 ) -> bool;
631}
632unsafe extern "C" {
633 #[doc = " Replaces the contents of `instance` with the `count` copies of the character `ch`.\n\n If `count` is greater than `CSTL_string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
634 pub fn CSTL_string_assign_char(
635 instance: CSTL_StringRef,
636 count: usize,
637 ch: ::std::os::raw::c_char,
638 alloc: *mut CSTL_Alloc,
639 ) -> bool;
640}
641unsafe extern "C" {
642 #[doc = " Replaces the contents of `instance` with the substring at offset `other_off` in `other`\n with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_string_size(other)]` returns\n `false` and does nothing, otherwise it returns `true`.\n"]
643 pub fn CSTL_string_assign_substr(
644 instance: CSTL_StringRef,
645 other: CSTL_StringCRef,
646 other_off: usize,
647 count: usize,
648 alloc: *mut CSTL_Alloc,
649 ) -> bool;
650}
651unsafe extern "C" {
652 #[doc = " Replaces the contents of `instance` with the contents of `other_instance`.\n\n If `propagate_alloc == true && alloc != other_alloc` then storage\n is freed with `alloc` and allocated again with `other_alloc` before contents\n are copied. Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false` `instance` keeps using `alloc` as its allocator,\n potentially reusing its storage.\n\n You are responsible for replacing the allocator outside of `CSTL_StringVal` if applicable.\n"]
653 pub fn CSTL_string_copy_assign(
654 instance: CSTL_StringRef,
655 alloc: *mut CSTL_Alloc,
656 other_instance: CSTL_StringCRef,
657 other_alloc: *mut CSTL_Alloc,
658 propagate_alloc: bool,
659 );
660}
661unsafe extern "C" {
662 #[doc = " Moves the contents of `other_instance` to the contents of `instance`.\n\n If `propagate_alloc == true` storage is replaced with storage of `other_instance`.\n Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false && alloc != other_alloc` then storage is reused\n and individual characters of `other` are moved in. Then, `instance` uses `alloc` as its allocator.\n\n You are responsible for replacing the allocator outside of `CSTL_StringVal` if applicable.\n"]
663 pub fn CSTL_string_move_assign(
664 instance: CSTL_StringRef,
665 alloc: *mut CSTL_Alloc,
666 other_instance: CSTL_StringRef,
667 other_alloc: *mut CSTL_Alloc,
668 propagate_alloc: bool,
669 );
670}
671unsafe extern "C" {
672 #[doc = " Swaps string contents.\n\n You are responsible for swapping the allocators.\n"]
673 pub fn CSTL_string_swap(instance: CSTL_StringRef, other_instance: CSTL_StringRef);
674}
675unsafe extern "C" {
676 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_string_length(instance)` the behavior is undefined.\n"]
677 pub fn CSTL_string_index(instance: CSTL_StringRef, pos: usize) -> *mut ::std::os::raw::c_char;
678}
679unsafe extern "C" {
680 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_string_length(instance)` the behavior is undefined.\n"]
681 pub fn CSTL_string_const_index(
682 instance: CSTL_StringCRef,
683 pos: usize,
684 ) -> *const ::std::os::raw::c_char;
685}
686unsafe extern "C" {
687 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_string_length(instance)` a null pointer is returned.\n"]
688 pub fn CSTL_string_at(instance: CSTL_StringRef, pos: usize) -> *mut ::std::os::raw::c_char;
689}
690unsafe extern "C" {
691 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_string_length(instance)` a null pointer is returned.\n"]
692 pub fn CSTL_string_const_at(
693 instance: CSTL_StringCRef,
694 pos: usize,
695 ) -> *const ::std::os::raw::c_char;
696}
697unsafe extern "C" {
698 #[doc = " Returns a pointer to the first character.\n\n If `CSTL_string_empty(instance) == true` the behavior is undefined.\n"]
699 pub fn CSTL_string_front(instance: CSTL_StringRef) -> *mut ::std::os::raw::c_char;
700}
701unsafe extern "C" {
702 #[doc = " Returns a const pointer to the first character.\n\n If `CSTL_string_empty(instance) == true` the behavior is undefined.\n"]
703 pub fn CSTL_string_const_front(instance: CSTL_StringCRef) -> *const ::std::os::raw::c_char;
704}
705unsafe extern "C" {
706 #[doc = " Returns a pointer to the last character.\n\n If `CSTL_string_empty(instance) == true` the behavior is undefined.\n"]
707 pub fn CSTL_string_back(instance: CSTL_StringRef) -> *mut ::std::os::raw::c_char;
708}
709unsafe extern "C" {
710 #[doc = " Returns a const pointer to the last character.\n\n If `CSTL_string_empty(instance) == true` the behavior is undefined.\n"]
711 pub fn CSTL_string_const_back(instance: CSTL_StringCRef) -> *const ::std::os::raw::c_char;
712}
713unsafe extern "C" {
714 #[doc = " Returns a pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_string_data(instance), CSTL_string_data(instance) + size]`\n is always valid.\n\n The array may be mutated through the returned pointer excluding\n the past-the-end null terminator.\n"]
715 pub fn CSTL_string_data(instance: CSTL_StringRef) -> *mut ::std::os::raw::c_char;
716}
717unsafe extern "C" {
718 #[doc = " Returns a const pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_string_c_str(instance), CSTL_string_c_str(instance) + size]`\n is always valid.\n"]
719 pub fn CSTL_string_c_str(instance: CSTL_StringCRef) -> *const ::std::os::raw::c_char;
720}
721unsafe extern "C" {
722 #[doc = " Returns an iterator (pointer) to the first character of the string.\n\n If `CSTL_string_empty(instance) == true` then\n `CSTL_string_begin(instance) == CSTL_string_end(instance)`.\n"]
723 pub fn CSTL_string_begin(instance: CSTL_StringRef) -> *mut ::std::os::raw::c_char;
724}
725unsafe extern "C" {
726 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_string_empty(instance) == true` then\n `CSTL_string_begin(instance) == CSTL_string_end(instance)`.\n"]
727 pub fn CSTL_string_const_begin(instance: CSTL_StringCRef) -> *const ::std::os::raw::c_char;
728}
729unsafe extern "C" {
730 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_string_empty(instance) == true` then\n `CSTL_string_begin(instance) == CSTL_string_end(instance)`.\n"]
731 pub fn CSTL_string_end(instance: CSTL_StringRef) -> *mut ::std::os::raw::c_char;
732}
733unsafe extern "C" {
734 #[doc = " Returns a const iterator (pointer) past the last character of the string.\n\n If `CSTL_string_empty(instance) == true` then\n `CSTL_string_const_begin(instance) == CSTL_string_const_end(instance)`.\n"]
735 pub fn CSTL_string_const_end(instance: CSTL_StringCRef) -> *const ::std::os::raw::c_char;
736}
737unsafe extern "C" {
738 #[doc = " Returns `true` if the string is empty or `false` otherwise.\n"]
739 pub fn CSTL_string_empty(instance: CSTL_StringCRef) -> bool;
740}
741unsafe extern "C" {
742 #[doc = " Returns the number of characters in the string.\n"]
743 pub fn CSTL_string_size(instance: CSTL_StringCRef) -> usize;
744}
745unsafe extern "C" {
746 #[doc = " Returns the number of characters in the string.\n"]
747 pub fn CSTL_string_length(instance: CSTL_StringCRef) -> usize;
748}
749unsafe extern "C" {
750 #[doc = " Returns the total characters capacity of the string.\n"]
751 pub fn CSTL_string_capacity(instance: CSTL_StringCRef) -> usize;
752}
753unsafe extern "C" {
754 #[doc = " Returns the maximum possible number of characters in the string.\n"]
755 pub fn CSTL_string_max_size() -> usize;
756}
757unsafe extern "C" {
758 #[doc = " If `new_capacity > CSTL_string_capacity(instance)`, reallocates and expands\n the underlying array storage.\n\n If `new_capacity` exceeds `CSTL_string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
759 pub fn CSTL_string_reserve(
760 instance: CSTL_StringRef,
761 new_capacity: usize,
762 alloc: *mut CSTL_Alloc,
763 ) -> bool;
764}
765unsafe extern "C" {
766 #[doc = " Request removal of unused capacity.\n"]
767 pub fn CSTL_string_shrink_to_fit(instance: CSTL_StringRef, alloc: *mut CSTL_Alloc);
768}
769unsafe extern "C" {
770 #[doc = " Erase all characters from the string without affecting capacity.\n"]
771 pub fn CSTL_string_clear(instance: CSTL_StringRef);
772}
773unsafe extern "C" {
774 #[doc = " Inserts the null-terminated string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
775 pub fn CSTL_string_insert(
776 instance: CSTL_StringRef,
777 where_: *const ::std::os::raw::c_char,
778 ptr: *const ::std::os::raw::c_char,
779 alloc: *mut CSTL_Alloc,
780 ) -> *mut ::std::os::raw::c_char;
781}
782unsafe extern "C" {
783 #[doc = " Inserts the first `count` characters of the string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
784 pub fn CSTL_string_insert_n(
785 instance: CSTL_StringRef,
786 where_: *const ::std::os::raw::c_char,
787 ptr: *const ::std::os::raw::c_char,
788 count: usize,
789 alloc: *mut CSTL_Alloc,
790 ) -> *mut ::std::os::raw::c_char;
791}
792unsafe extern "C" {
793 #[doc = " Inserts `count` copies of the character `ch` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
794 pub fn CSTL_string_insert_char(
795 instance: CSTL_StringRef,
796 where_: *const ::std::os::raw::c_char,
797 count: usize,
798 ch: ::std::os::raw::c_char,
799 alloc: *mut CSTL_Alloc,
800 ) -> *mut ::std::os::raw::c_char;
801}
802unsafe extern "C" {
803 #[doc = " Inserts the string `other` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
804 pub fn CSTL_string_insert_str(
805 instance: CSTL_StringRef,
806 where_: *const ::std::os::raw::c_char,
807 other: CSTL_StringCRef,
808 alloc: *mut CSTL_Alloc,
809 ) -> *mut ::std::os::raw::c_char;
810}
811unsafe extern "C" {
812 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at the pointer `where` in `instance`.\n\n If `other_off` is outside of the range `[other, other + CSTL_string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
813 pub fn CSTL_string_insert_substr(
814 instance: CSTL_StringRef,
815 where_: *const ::std::os::raw::c_char,
816 other: CSTL_StringCRef,
817 other_off: usize,
818 count: usize,
819 alloc: *mut CSTL_Alloc,
820 ) -> *mut ::std::os::raw::c_char;
821}
822unsafe extern "C" {
823 #[doc = " Inserts the null-terminated string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
824 pub fn CSTL_string_insert_at(
825 instance: CSTL_StringRef,
826 off: usize,
827 ptr: *const ::std::os::raw::c_char,
828 alloc: *mut CSTL_Alloc,
829 ) -> bool;
830}
831unsafe extern "C" {
832 #[doc = " Inserts the first `count` characters of the string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
833 pub fn CSTL_string_insert_n_at(
834 instance: CSTL_StringRef,
835 off: usize,
836 ptr: *const ::std::os::raw::c_char,
837 count: usize,
838 alloc: *mut CSTL_Alloc,
839 ) -> bool;
840}
841unsafe extern "C" {
842 #[doc = " Inserts `count` copies of the character `ch` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
843 pub fn CSTL_string_insert_char_at(
844 instance: CSTL_StringRef,
845 off: usize,
846 count: usize,
847 ch: ::std::os::raw::c_char,
848 alloc: *mut CSTL_Alloc,
849 ) -> bool;
850}
851unsafe extern "C" {
852 #[doc = " Inserts the string `other` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
853 pub fn CSTL_string_insert_str_at(
854 instance: CSTL_StringRef,
855 off: usize,
856 other: CSTL_StringCRef,
857 alloc: *mut CSTL_Alloc,
858 ) -> bool;
859}
860unsafe extern "C" {
861 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
862 pub fn CSTL_string_insert_substr_at(
863 instance: CSTL_StringRef,
864 off: usize,
865 other: CSTL_StringCRef,
866 other_off: usize,
867 count: usize,
868 alloc: *mut CSTL_Alloc,
869 ) -> bool;
870}
871unsafe extern "C" {
872 #[doc = " Removes the character at `where` and returns a pointer following the\n removed character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
873 pub fn CSTL_string_erase(
874 instance: CSTL_StringRef,
875 where_: *const ::std::os::raw::c_char,
876 ) -> *mut ::std::os::raw::c_char;
877}
878unsafe extern "C" {
879 #[doc = " Removes the characters in the range `[first, last)` and returns a pointer following the\n removed character.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
880 pub fn CSTL_string_erase_substr(
881 instance: CSTL_StringRef,
882 first: *const ::std::os::raw::c_char,
883 last: *const ::std::os::raw::c_char,
884 ) -> *mut ::std::os::raw::c_char;
885}
886unsafe extern "C" {
887 #[doc = " Removes the character at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
888 pub fn CSTL_string_erase_at(instance: CSTL_StringRef, off: usize) -> bool;
889}
890unsafe extern "C" {
891 #[doc = " Removes the substring at offset `off` in `instance` with the length given by `count`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
892 pub fn CSTL_string_erase_substr_at(instance: CSTL_StringRef, off: usize, count: usize) -> bool;
893}
894unsafe extern "C" {
895 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_string_size(instance) == CSTL_string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
896 pub fn CSTL_string_push_back(
897 instance: CSTL_StringRef,
898 ch: ::std::os::raw::c_char,
899 alloc: *mut CSTL_Alloc,
900 ) -> bool;
901}
902unsafe extern "C" {
903 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_string_size(instance) == CSTL_string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
904 pub fn CSTL_string_pop_back(instance: CSTL_StringRef);
905}
906unsafe extern "C" {
907 #[doc = " Appends the null-terminated string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
908 pub fn CSTL_string_append(
909 instance: CSTL_StringRef,
910 ptr: *const ::std::os::raw::c_char,
911 alloc: *mut CSTL_Alloc,
912 ) -> bool;
913}
914unsafe extern "C" {
915 #[doc = " Appends the first `count` characters of the string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
916 pub fn CSTL_string_append_n(
917 instance: CSTL_StringRef,
918 ptr: *const ::std::os::raw::c_char,
919 count: usize,
920 alloc: *mut CSTL_Alloc,
921 ) -> bool;
922}
923unsafe extern "C" {
924 #[doc = " Appends `count` copies of the character `ch` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
925 pub fn CSTL_string_append_char(
926 instance: CSTL_StringRef,
927 count: usize,
928 ch: ::std::os::raw::c_char,
929 alloc: *mut CSTL_Alloc,
930 ) -> bool;
931}
932unsafe extern "C" {
933 #[doc = " Appends the string `other` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
934 pub fn CSTL_string_append_str(
935 instance: CSTL_StringRef,
936 other: CSTL_StringCRef,
937 alloc: *mut CSTL_Alloc,
938 ) -> bool;
939}
940unsafe extern "C" {
941 #[doc = " Appends the substring at offset `other_off` in `other` with the length\n given by `count` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
942 pub fn CSTL_string_append_substr(
943 instance: CSTL_StringRef,
944 other: CSTL_StringCRef,
945 other_off: usize,
946 count: usize,
947 alloc: *mut CSTL_Alloc,
948 ) -> bool;
949}
950unsafe extern "C" {
951 #[doc = " Replaces the characters in the range `[first, last)` with the null-terminated\n string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
952 pub fn CSTL_string_replace(
953 instance: CSTL_StringRef,
954 first: *const ::std::os::raw::c_char,
955 last: *const ::std::os::raw::c_char,
956 ptr: *const ::std::os::raw::c_char,
957 alloc: *mut CSTL_Alloc,
958 ) -> bool;
959}
960unsafe extern "C" {
961 #[doc = " Replaces the characters in the range `[first, last)` with the first `count`\n characters of the string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
962 pub fn CSTL_string_replace_n(
963 instance: CSTL_StringRef,
964 first: *const ::std::os::raw::c_char,
965 last: *const ::std::os::raw::c_char,
966 ptr: *const ::std::os::raw::c_char,
967 count: usize,
968 alloc: *mut CSTL_Alloc,
969 ) -> bool;
970}
971unsafe extern "C" {
972 #[doc = " Replaces the characters in the range `[first, last)` with `count` copies\n of the character `ch`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
973 pub fn CSTL_string_replace_char(
974 instance: CSTL_StringRef,
975 first: *const ::std::os::raw::c_char,
976 last: *const ::std::os::raw::c_char,
977 count: usize,
978 ch: ::std::os::raw::c_char,
979 alloc: *mut CSTL_Alloc,
980 ) -> bool;
981}
982unsafe extern "C" {
983 #[doc = " Replaces the characters in the range `[first, last)` with the string `other`.\n\n If the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
984 pub fn CSTL_string_replace_str(
985 instance: CSTL_StringRef,
986 first: *const ::std::os::raw::c_char,
987 last: *const ::std::os::raw::c_char,
988 other: CSTL_StringCRef,
989 alloc: *mut CSTL_Alloc,
990 ) -> bool;
991}
992unsafe extern "C" {
993 #[doc = " Replaces the characters in the range `[first, last)` with the substring\n at offset `other_off` in `other` with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
994 pub fn CSTL_string_replace_substr(
995 instance: CSTL_StringRef,
996 first: *const ::std::os::raw::c_char,
997 last: *const ::std::os::raw::c_char,
998 other: CSTL_StringCRef,
999 other_off: usize,
1000 count: usize,
1001 alloc: *mut CSTL_Alloc,
1002 ) -> bool;
1003}
1004unsafe extern "C" {
1005 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the null-terminated string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1006 pub fn CSTL_string_replace_at(
1007 instance: CSTL_StringRef,
1008 off: usize,
1009 count: usize,
1010 ptr: *const ::std::os::raw::c_char,
1011 alloc: *mut CSTL_Alloc,
1012 ) -> bool;
1013}
1014unsafe extern "C" {
1015 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the first `count2` characters of the string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1016 pub fn CSTL_string_replace_n_at(
1017 instance: CSTL_StringRef,
1018 off: usize,
1019 count: usize,
1020 ptr: *const ::std::os::raw::c_char,
1021 count2: usize,
1022 alloc: *mut CSTL_Alloc,
1023 ) -> bool;
1024}
1025unsafe extern "C" {
1026 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with `count` copies of the character `ch`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1027 pub fn CSTL_string_replace_char_at(
1028 instance: CSTL_StringRef,
1029 off: usize,
1030 count: usize,
1031 count2: usize,
1032 ch: ::std::os::raw::c_char,
1033 alloc: *mut CSTL_Alloc,
1034 ) -> bool;
1035}
1036unsafe extern "C" {
1037 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the string `other`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1038 pub fn CSTL_string_replace_str_at(
1039 instance: CSTL_StringRef,
1040 off: usize,
1041 count: usize,
1042 other: CSTL_StringCRef,
1043 alloc: *mut CSTL_Alloc,
1044 ) -> bool;
1045}
1046unsafe extern "C" {
1047 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the substring at offset `other_off` in `other` with the length\n given by `count2`.\n\n If `off` is outside of the range `[instance, instance + CSTL_string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1048 pub fn CSTL_string_replace_substr_at(
1049 instance: CSTL_StringRef,
1050 off: usize,
1051 count: usize,
1052 other: CSTL_StringCRef,
1053 other_off: usize,
1054 count2: usize,
1055 alloc: *mut CSTL_Alloc,
1056 ) -> bool;
1057}
1058unsafe extern "C" {
1059 #[doc = " Copies a substring `[off, off + count)` to character string pointed to by\n `dest`. The resulting character string is not null terminated.\n\n Returns the number of characters copied or `CSTL_string_npos` if\n `off > CSTL_string_size(instance)` (out of range).\n"]
1060 pub fn CSTL_string_copy(
1061 instance: CSTL_StringCRef,
1062 dest: *mut ::std::os::raw::c_char,
1063 count: usize,
1064 off: usize,
1065 ) -> usize;
1066}
1067unsafe extern "C" {
1068 #[doc = " Resizes the string to contain `new_size` characters, appending `ch`\n if current size is less than `new_size`.\n\n If `new_size` is greater than `CSTL_string_max_size()` this\n function has no effect and returns `false`, otherwise it returns `true`.\n"]
1069 pub fn CSTL_string_resize(
1070 instance: CSTL_StringRef,
1071 new_size: usize,
1072 ch: ::std::os::raw::c_char,
1073 alloc: *mut CSTL_Alloc,
1074 ) -> bool;
1075}
1076unsafe extern "C" {
1077 #[doc = " Find the first from offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1078 pub fn CSTL_string_find(
1079 instance: CSTL_StringCRef,
1080 ptr: *const ::std::os::raw::c_char,
1081 off: usize,
1082 ) -> usize;
1083}
1084unsafe extern "C" {
1085 #[doc = " Find the first from offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1086 pub fn CSTL_string_find_n(
1087 instance: CSTL_StringCRef,
1088 ptr: *const ::std::os::raw::c_char,
1089 off: usize,
1090 count: usize,
1091 ) -> usize;
1092}
1093unsafe extern "C" {
1094 #[doc = " Find the first from offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1095 pub fn CSTL_string_find_char(
1096 instance: CSTL_StringCRef,
1097 ch: ::std::os::raw::c_char,
1098 off: usize,
1099 ) -> usize;
1100}
1101unsafe extern "C" {
1102 #[doc = " Find the first from offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1103 pub fn CSTL_string_find_str(
1104 instance: CSTL_StringCRef,
1105 other: CSTL_StringCRef,
1106 off: usize,
1107 ) -> usize;
1108}
1109unsafe extern "C" {
1110 #[doc = " Find the last before offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1111 pub fn CSTL_string_rfind(
1112 instance: CSTL_StringCRef,
1113 ptr: *const ::std::os::raw::c_char,
1114 off: usize,
1115 ) -> usize;
1116}
1117unsafe extern "C" {
1118 #[doc = " Find the last before offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1119 pub fn CSTL_string_rfind_n(
1120 instance: CSTL_StringCRef,
1121 ptr: *const ::std::os::raw::c_char,
1122 off: usize,
1123 count: usize,
1124 ) -> usize;
1125}
1126unsafe extern "C" {
1127 #[doc = " Find the last before offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1128 pub fn CSTL_string_rfind_char(
1129 instance: CSTL_StringCRef,
1130 ch: ::std::os::raw::c_char,
1131 off: usize,
1132 ) -> usize;
1133}
1134unsafe extern "C" {
1135 #[doc = " Find the last before offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1136 pub fn CSTL_string_rfind_str(
1137 instance: CSTL_StringCRef,
1138 other: CSTL_StringCRef,
1139 off: usize,
1140 ) -> usize;
1141}
1142unsafe extern "C" {
1143 #[doc = " Compare two null-terminated character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
1144 pub fn CSTL_string_compare(
1145 left: *const ::std::os::raw::c_char,
1146 right: *const ::std::os::raw::c_char,
1147 ) -> ::std::os::raw::c_int;
1148}
1149unsafe extern "C" {
1150 #[doc = " Compare an explicit length character sequence with a null-terminated one.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n To compare an explicit length `left` and a null-terminated `right`,\n swap them and negate the result: `-CSTL_string_compare_n(right, left, left_count)`.\n\n There is no `CSTL_String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
1151 pub fn CSTL_string_compare_n(
1152 left: *const ::std::os::raw::c_char,
1153 right: *const ::std::os::raw::c_char,
1154 right_count: usize,
1155 ) -> ::std::os::raw::c_int;
1156}
1157unsafe extern "C" {
1158 #[doc = " Compare two explicit length character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
1159 pub fn CSTL_string_compare_nn(
1160 left: *const ::std::os::raw::c_char,
1161 left_count: usize,
1162 right: *const ::std::os::raw::c_char,
1163 right_count: usize,
1164 ) -> ::std::os::raw::c_int;
1165}
1166#[doc = " STL ABI `std::basic_string` layout.\n\n Does not include the allocator, which nonetheless is a part of the `std::basic_string`\n structure! You are responsible for including it, since it can take on any form.\n\n Do not manipulate the members directly, use the associated functions!\n"]
1167#[repr(C)]
1168#[derive(Copy, Clone)]
1169pub struct CSTL_WideStringVal {
1170 pub bx: CSTL_WideStringUnion,
1171 pub size: usize,
1172 pub res: usize,
1173}
1174#[repr(C)]
1175#[derive(Copy, Clone)]
1176pub union CSTL_WideStringUnion {
1177 pub buf: [wchar_t; 8usize],
1178 pub ptr: *mut wchar_t,
1179}
1180#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1181const _: () = {
1182 ["Size of CSTL_WideStringUnion"][::std::mem::size_of::<CSTL_WideStringUnion>() - 16usize];
1183 ["Alignment of CSTL_WideStringUnion"][::std::mem::align_of::<CSTL_WideStringUnion>() - 8usize];
1184 ["Offset of field: CSTL_WideStringUnion::buf"]
1185 [::std::mem::offset_of!(CSTL_WideStringUnion, buf) - 0usize];
1186 ["Offset of field: CSTL_WideStringUnion::ptr"]
1187 [::std::mem::offset_of!(CSTL_WideStringUnion, ptr) - 0usize];
1188};
1189#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1190const _: () = {
1191 ["Size of CSTL_WideStringVal"][::std::mem::size_of::<CSTL_WideStringVal>() - 32usize];
1192 ["Alignment of CSTL_WideStringVal"][::std::mem::align_of::<CSTL_WideStringVal>() - 8usize];
1193 ["Offset of field: CSTL_WideStringVal::bx"]
1194 [::std::mem::offset_of!(CSTL_WideStringVal, bx) - 0usize];
1195 ["Offset of field: CSTL_WideStringVal::size"]
1196 [::std::mem::offset_of!(CSTL_WideStringVal, size) - 16usize];
1197 ["Offset of field: CSTL_WideStringVal::res"]
1198 [::std::mem::offset_of!(CSTL_WideStringVal, res) - 24usize];
1199};
1200#[doc = " Reference to a mutable `CSTL_WideStringVal`.\n\n Must not be null.\n"]
1201pub type CSTL_WideStringRef = *mut CSTL_WideStringVal;
1202#[doc = " Reference to a const `CSTL_WideStringVal`.\n\n Must not be null.\n"]
1203pub type CSTL_WideStringCRef = *const CSTL_WideStringVal;
1204unsafe extern "C" {
1205 #[doc = " Initializes the string, but does not allocate any memory.\n\n An initialized string can be trivially destroyed without leaks as long\n as its owned string is small enough to be inline (smaller than CSTL_string_alloc_mask).\n\n Re-initializing a string with a backing memory allocation will leak the old\n memory allocation.\n"]
1206 pub fn CSTL_wstring_construct(new_instance: *mut CSTL_WideStringVal);
1207}
1208unsafe extern "C" {
1209 #[doc = " Destroys the string, freeing the backing storage if necessary.\n"]
1210 pub fn CSTL_wstring_destroy(instance: CSTL_WideStringRef, alloc: *mut CSTL_Alloc);
1211}
1212unsafe extern "C" {
1213 #[doc = " Initializes the string with the substring at offset `other_off`\n in `other` with the length given by `count`.\n\n If `new_instance == NULL` or if `other_off` is outside of the range\n `[other, other + CSTL_wstring_size(other)]` returns `false` and does nothing,\n otherwise it returns `true`.\n\n If `new_instance == other` the substring operation is performed in-place without\n de-initializing `other`.\n\n Remember that re-initializing a different string with a backing memory allocation\n will leak the old memory allocation.\n"]
1214 pub fn CSTL_wstring_substr(
1215 new_instance: *mut CSTL_WideStringVal,
1216 other: CSTL_WideStringCRef,
1217 other_off: usize,
1218 count: usize,
1219 alloc: *mut CSTL_Alloc,
1220 ) -> bool;
1221}
1222unsafe extern "C" {
1223 #[doc = " Replaces the contents of `instance` with the null-terminated string at `ptr`.\n\n If the length of the string at `ptr` is greater than `CSTL_wstring_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
1224 pub fn CSTL_wstring_assign(
1225 instance: CSTL_WideStringRef,
1226 ptr: *const wchar_t,
1227 alloc: *mut CSTL_Alloc,
1228 ) -> bool;
1229}
1230unsafe extern "C" {
1231 #[doc = " Replaces the contents of `instance` with the first `count` characters of the string at `ptr`.\n\n If `n` is greater than `CSTL_wstring_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
1232 pub fn CSTL_wstring_assign_n(
1233 instance: CSTL_WideStringRef,
1234 ptr: *const wchar_t,
1235 count: usize,
1236 alloc: *mut CSTL_Alloc,
1237 ) -> bool;
1238}
1239unsafe extern "C" {
1240 #[doc = " Replaces the contents of `instance` with the `count` copies of the character `ch`.\n\n If `count` is greater than `CSTL_wstring_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
1241 pub fn CSTL_wstring_assign_char(
1242 instance: CSTL_WideStringRef,
1243 count: usize,
1244 ch: wchar_t,
1245 alloc: *mut CSTL_Alloc,
1246 ) -> bool;
1247}
1248unsafe extern "C" {
1249 #[doc = " Replaces the contents of `instance` with the substring at offset `other_off` in `other`\n with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_wstring_size(other)]` returns\n `false` and does nothing, otherwise it returns `true`.\n"]
1250 pub fn CSTL_wstring_assign_substr(
1251 instance: CSTL_WideStringRef,
1252 other: CSTL_WideStringCRef,
1253 other_off: usize,
1254 count: usize,
1255 alloc: *mut CSTL_Alloc,
1256 ) -> bool;
1257}
1258unsafe extern "C" {
1259 #[doc = " Replaces the contents of `instance` with the contents of `other_instance`.\n\n If `propagate_alloc == true && alloc != other_alloc` then storage\n is freed with `alloc` and allocated again with `other_alloc` before contents\n are copied. Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false` `instance` keeps using `alloc` as its allocator,\n potentially reusing its storage.\n\n You are responsible for replacing the allocator outside of `CSTL_WideStringVal` if applicable.\n"]
1260 pub fn CSTL_wstring_copy_assign(
1261 instance: CSTL_WideStringRef,
1262 alloc: *mut CSTL_Alloc,
1263 other_instance: CSTL_WideStringCRef,
1264 other_alloc: *mut CSTL_Alloc,
1265 propagate_alloc: bool,
1266 );
1267}
1268unsafe extern "C" {
1269 #[doc = " Moves the contents of `other_instance` to the contents of `instance`.\n\n If `propagate_alloc == true` storage is replaced with storage of `other_instance`.\n Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false && alloc != other_alloc` then storage is reused\n and individual characters of `other` are moved in. Then, `instance` uses `alloc` as its allocator.\n\n You are responsible for replacing the allocator outside of `CSTL_WideStringVal` if applicable.\n"]
1270 pub fn CSTL_wstring_move_assign(
1271 instance: CSTL_WideStringRef,
1272 alloc: *mut CSTL_Alloc,
1273 other_instance: CSTL_WideStringRef,
1274 other_alloc: *mut CSTL_Alloc,
1275 propagate_alloc: bool,
1276 );
1277}
1278unsafe extern "C" {
1279 #[doc = " Swaps string contents.\n\n You are responsible for swapping the allocators.\n"]
1280 pub fn CSTL_wstring_swap(instance: CSTL_WideStringRef, other_instance: CSTL_WideStringRef);
1281}
1282unsafe extern "C" {
1283 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_wstring_length(instance)` the behavior is undefined.\n"]
1284 pub fn CSTL_wstring_index(instance: CSTL_WideStringRef, pos: usize) -> *mut wchar_t;
1285}
1286unsafe extern "C" {
1287 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_wstring_length(instance)` the behavior is undefined.\n"]
1288 pub fn CSTL_wstring_const_index(instance: CSTL_WideStringCRef, pos: usize) -> *const wchar_t;
1289}
1290unsafe extern "C" {
1291 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_wstring_length(instance)` a null pointer is returned.\n"]
1292 pub fn CSTL_wstring_at(instance: CSTL_WideStringRef, pos: usize) -> *mut wchar_t;
1293}
1294unsafe extern "C" {
1295 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_wstring_length(instance)` a null pointer is returned.\n"]
1296 pub fn CSTL_wstring_const_at(instance: CSTL_WideStringCRef, pos: usize) -> *const wchar_t;
1297}
1298unsafe extern "C" {
1299 #[doc = " Returns a pointer to the first character.\n\n If `CSTL_wstring_empty(instance) == true` the behavior is undefined.\n"]
1300 pub fn CSTL_wstring_front(instance: CSTL_WideStringRef) -> *mut wchar_t;
1301}
1302unsafe extern "C" {
1303 #[doc = " Returns a const pointer to the first character.\n\n If `CSTL_wstring_empty(instance) == true` the behavior is undefined.\n"]
1304 pub fn CSTL_wstring_const_front(instance: CSTL_WideStringCRef) -> *const wchar_t;
1305}
1306unsafe extern "C" {
1307 #[doc = " Returns a pointer to the last character.\n\n If `CSTL_wstring_empty(instance) == true` the behavior is undefined.\n"]
1308 pub fn CSTL_wstring_back(instance: CSTL_WideStringRef) -> *mut wchar_t;
1309}
1310unsafe extern "C" {
1311 #[doc = " Returns a const pointer to the last character.\n\n If `CSTL_wstring_empty(instance) == true` the behavior is undefined.\n"]
1312 pub fn CSTL_wstring_const_back(instance: CSTL_WideStringCRef) -> *const wchar_t;
1313}
1314unsafe extern "C" {
1315 #[doc = " Returns a pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_wstring_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_wstring_data(instance), CSTL_wstring_data(instance) + size]`\n is always valid.\n\n The array may be mutated through the returned pointer excluding\n the past-the-end null terminator.\n"]
1316 pub fn CSTL_wstring_data(instance: CSTL_WideStringRef) -> *mut wchar_t;
1317}
1318unsafe extern "C" {
1319 #[doc = " Returns a const pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_wstring_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_wstring_c_str(instance), CSTL_wstring_c_str(instance) + size]`\n is always valid.\n"]
1320 pub fn CSTL_wstring_c_str(instance: CSTL_WideStringCRef) -> *const wchar_t;
1321}
1322unsafe extern "C" {
1323 #[doc = " Returns an iterator (pointer) to the first character of the string.\n\n If `CSTL_wstring_empty(instance) == true` then\n `CSTL_wstring_begin(instance) == CSTL_wstring_end(instance)`.\n"]
1324 pub fn CSTL_wstring_begin(instance: CSTL_WideStringRef) -> *mut wchar_t;
1325}
1326unsafe extern "C" {
1327 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_wstring_empty(instance) == true` then\n `CSTL_wstring_begin(instance) == CSTL_wstring_end(instance)`.\n"]
1328 pub fn CSTL_wstring_const_begin(instance: CSTL_WideStringCRef) -> *const wchar_t;
1329}
1330unsafe extern "C" {
1331 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_wstring_empty(instance) == true` then\n `CSTL_wstring_begin(instance) == CSTL_wstring_end(instance)`.\n"]
1332 pub fn CSTL_wstring_end(instance: CSTL_WideStringRef) -> *mut wchar_t;
1333}
1334unsafe extern "C" {
1335 #[doc = " Returns a const iterator (pointer) past the last character of the string.\n\n If `CSTL_wstring_empty(instance) == true` then\n `CSTL_wstring_const_begin(instance) == CSTL_wstring_const_end(instance)`.\n"]
1336 pub fn CSTL_wstring_const_end(instance: CSTL_WideStringCRef) -> *const wchar_t;
1337}
1338unsafe extern "C" {
1339 #[doc = " Returns `true` if the string is empty or `false` otherwise.\n"]
1340 pub fn CSTL_wstring_empty(instance: CSTL_WideStringCRef) -> bool;
1341}
1342unsafe extern "C" {
1343 #[doc = " Returns the number of characters in the string.\n"]
1344 pub fn CSTL_wstring_size(instance: CSTL_WideStringCRef) -> usize;
1345}
1346unsafe extern "C" {
1347 #[doc = " Returns the number of characters in the string.\n"]
1348 pub fn CSTL_wstring_length(instance: CSTL_WideStringCRef) -> usize;
1349}
1350unsafe extern "C" {
1351 #[doc = " Returns the total characters capacity of the string.\n"]
1352 pub fn CSTL_wstring_capacity(instance: CSTL_WideStringCRef) -> usize;
1353}
1354unsafe extern "C" {
1355 #[doc = " Returns the maximum possible number of characters in the string.\n"]
1356 pub fn CSTL_wstring_max_size() -> usize;
1357}
1358unsafe extern "C" {
1359 #[doc = " If `new_capacity > CSTL_wstring_capacity(instance)`, reallocates and expands\n the underlying array storage.\n\n If `new_capacity` exceeds `CSTL_wstring_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
1360 pub fn CSTL_wstring_reserve(
1361 instance: CSTL_WideStringRef,
1362 new_capacity: usize,
1363 alloc: *mut CSTL_Alloc,
1364 ) -> bool;
1365}
1366unsafe extern "C" {
1367 #[doc = " Request removal of unused capacity.\n"]
1368 pub fn CSTL_wstring_shrink_to_fit(instance: CSTL_WideStringRef, alloc: *mut CSTL_Alloc);
1369}
1370unsafe extern "C" {
1371 #[doc = " Erase all characters from the string without affecting capacity.\n"]
1372 pub fn CSTL_wstring_clear(instance: CSTL_WideStringRef);
1373}
1374unsafe extern "C" {
1375 #[doc = " Inserts the null-terminated string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1376 pub fn CSTL_wstring_insert(
1377 instance: CSTL_WideStringRef,
1378 where_: *const wchar_t,
1379 ptr: *const wchar_t,
1380 alloc: *mut CSTL_Alloc,
1381 ) -> *mut wchar_t;
1382}
1383unsafe extern "C" {
1384 #[doc = " Inserts the first `count` characters of the string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1385 pub fn CSTL_wstring_insert_n(
1386 instance: CSTL_WideStringRef,
1387 where_: *const wchar_t,
1388 ptr: *const wchar_t,
1389 count: usize,
1390 alloc: *mut CSTL_Alloc,
1391 ) -> *mut wchar_t;
1392}
1393unsafe extern "C" {
1394 #[doc = " Inserts `count` copies of the character `ch` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1395 pub fn CSTL_wstring_insert_char(
1396 instance: CSTL_WideStringRef,
1397 where_: *const wchar_t,
1398 count: usize,
1399 ch: wchar_t,
1400 alloc: *mut CSTL_Alloc,
1401 ) -> *mut wchar_t;
1402}
1403unsafe extern "C" {
1404 #[doc = " Inserts the string `other` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1405 pub fn CSTL_wstring_insert_str(
1406 instance: CSTL_WideStringRef,
1407 where_: *const wchar_t,
1408 other: CSTL_WideStringCRef,
1409 alloc: *mut CSTL_Alloc,
1410 ) -> *mut wchar_t;
1411}
1412unsafe extern "C" {
1413 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at the pointer `where` in `instance`.\n\n If `other_off` is outside of the range `[other, other + CSTL_wstring_size(other)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1414 pub fn CSTL_wstring_insert_substr(
1415 instance: CSTL_WideStringRef,
1416 where_: *const wchar_t,
1417 other: CSTL_WideStringCRef,
1418 other_off: usize,
1419 count: usize,
1420 alloc: *mut CSTL_Alloc,
1421 ) -> *mut wchar_t;
1422}
1423unsafe extern "C" {
1424 #[doc = " Inserts the null-terminated string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1425 pub fn CSTL_wstring_insert_at(
1426 instance: CSTL_WideStringRef,
1427 off: usize,
1428 ptr: *const wchar_t,
1429 alloc: *mut CSTL_Alloc,
1430 ) -> bool;
1431}
1432unsafe extern "C" {
1433 #[doc = " Inserts the first `count` characters of the string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1434 pub fn CSTL_wstring_insert_n_at(
1435 instance: CSTL_WideStringRef,
1436 off: usize,
1437 ptr: *const wchar_t,
1438 count: usize,
1439 alloc: *mut CSTL_Alloc,
1440 ) -> bool;
1441}
1442unsafe extern "C" {
1443 #[doc = " Inserts `count` copies of the character `ch` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1444 pub fn CSTL_wstring_insert_char_at(
1445 instance: CSTL_WideStringRef,
1446 off: usize,
1447 count: usize,
1448 ch: wchar_t,
1449 alloc: *mut CSTL_Alloc,
1450 ) -> bool;
1451}
1452unsafe extern "C" {
1453 #[doc = " Inserts the string `other` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1454 pub fn CSTL_wstring_insert_str_at(
1455 instance: CSTL_WideStringRef,
1456 off: usize,
1457 other: CSTL_WideStringCRef,
1458 alloc: *mut CSTL_Alloc,
1459 ) -> bool;
1460}
1461unsafe extern "C" {
1462 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_wstring_size(other)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1463 pub fn CSTL_wstring_insert_substr_at(
1464 instance: CSTL_WideStringRef,
1465 off: usize,
1466 other: CSTL_WideStringCRef,
1467 other_off: usize,
1468 count: usize,
1469 alloc: *mut CSTL_Alloc,
1470 ) -> bool;
1471}
1472unsafe extern "C" {
1473 #[doc = " Removes the character at `where` and returns a pointer following the\n removed character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1474 pub fn CSTL_wstring_erase(instance: CSTL_WideStringRef, where_: *const wchar_t)
1475 -> *mut wchar_t;
1476}
1477unsafe extern "C" {
1478 #[doc = " Removes the characters in the range `[first, last)` and returns a pointer following the\n removed character.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
1479 pub fn CSTL_wstring_erase_substr(
1480 instance: CSTL_WideStringRef,
1481 first: *const wchar_t,
1482 last: *const wchar_t,
1483 ) -> *mut wchar_t;
1484}
1485unsafe extern "C" {
1486 #[doc = " Removes the character at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1487 pub fn CSTL_wstring_erase_at(instance: CSTL_WideStringRef, off: usize) -> bool;
1488}
1489unsafe extern "C" {
1490 #[doc = " Removes the substring at offset `off` in `instance` with the length given by `count`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1491 pub fn CSTL_wstring_erase_substr_at(
1492 instance: CSTL_WideStringRef,
1493 off: usize,
1494 count: usize,
1495 ) -> bool;
1496}
1497unsafe extern "C" {
1498 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_wstring_size(instance) == CSTL_wstring_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
1499 pub fn CSTL_wstring_push_back(
1500 instance: CSTL_WideStringRef,
1501 ch: wchar_t,
1502 alloc: *mut CSTL_Alloc,
1503 ) -> bool;
1504}
1505unsafe extern "C" {
1506 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_wstring_size(instance) == CSTL_wstring_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
1507 pub fn CSTL_wstring_pop_back(instance: CSTL_WideStringRef);
1508}
1509unsafe extern "C" {
1510 #[doc = " Appends the null-terminated string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1511 pub fn CSTL_wstring_append(
1512 instance: CSTL_WideStringRef,
1513 ptr: *const wchar_t,
1514 alloc: *mut CSTL_Alloc,
1515 ) -> bool;
1516}
1517unsafe extern "C" {
1518 #[doc = " Appends the first `count` characters of the string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1519 pub fn CSTL_wstring_append_n(
1520 instance: CSTL_WideStringRef,
1521 ptr: *const wchar_t,
1522 count: usize,
1523 alloc: *mut CSTL_Alloc,
1524 ) -> bool;
1525}
1526unsafe extern "C" {
1527 #[doc = " Appends `count` copies of the character `ch` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1528 pub fn CSTL_wstring_append_char(
1529 instance: CSTL_WideStringRef,
1530 count: usize,
1531 ch: wchar_t,
1532 alloc: *mut CSTL_Alloc,
1533 ) -> bool;
1534}
1535unsafe extern "C" {
1536 #[doc = " Appends the string `other` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1537 pub fn CSTL_wstring_append_str(
1538 instance: CSTL_WideStringRef,
1539 other: CSTL_WideStringCRef,
1540 alloc: *mut CSTL_Alloc,
1541 ) -> bool;
1542}
1543unsafe extern "C" {
1544 #[doc = " Appends the substring at offset `other_off` in `other` with the length\n given by `count` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1545 pub fn CSTL_wstring_append_substr(
1546 instance: CSTL_WideStringRef,
1547 other: CSTL_WideStringCRef,
1548 other_off: usize,
1549 count: usize,
1550 alloc: *mut CSTL_Alloc,
1551 ) -> bool;
1552}
1553unsafe extern "C" {
1554 #[doc = " Replaces the characters in the range `[first, last)` with the null-terminated\n string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
1555 pub fn CSTL_wstring_replace(
1556 instance: CSTL_WideStringRef,
1557 first: *const wchar_t,
1558 last: *const wchar_t,
1559 ptr: *const wchar_t,
1560 alloc: *mut CSTL_Alloc,
1561 ) -> bool;
1562}
1563unsafe extern "C" {
1564 #[doc = " Replaces the characters in the range `[first, last)` with the first `count`\n characters of the string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
1565 pub fn CSTL_wstring_replace_n(
1566 instance: CSTL_WideStringRef,
1567 first: *const wchar_t,
1568 last: *const wchar_t,
1569 ptr: *const wchar_t,
1570 count: usize,
1571 alloc: *mut CSTL_Alloc,
1572 ) -> bool;
1573}
1574unsafe extern "C" {
1575 #[doc = " Replaces the characters in the range `[first, last)` with `count` copies\n of the character `ch`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
1576 pub fn CSTL_wstring_replace_char(
1577 instance: CSTL_WideStringRef,
1578 first: *const wchar_t,
1579 last: *const wchar_t,
1580 count: usize,
1581 ch: wchar_t,
1582 alloc: *mut CSTL_Alloc,
1583 ) -> bool;
1584}
1585unsafe extern "C" {
1586 #[doc = " Replaces the characters in the range `[first, last)` with the string `other`.\n\n If the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
1587 pub fn CSTL_wstring_replace_str(
1588 instance: CSTL_WideStringRef,
1589 first: *const wchar_t,
1590 last: *const wchar_t,
1591 other: CSTL_WideStringCRef,
1592 alloc: *mut CSTL_Alloc,
1593 ) -> bool;
1594}
1595unsafe extern "C" {
1596 #[doc = " Replaces the characters in the range `[first, last)` with the substring\n at offset `other_off` in `other` with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_wstring_size(other)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
1597 pub fn CSTL_wstring_replace_substr(
1598 instance: CSTL_WideStringRef,
1599 first: *const wchar_t,
1600 last: *const wchar_t,
1601 other: CSTL_WideStringCRef,
1602 other_off: usize,
1603 count: usize,
1604 alloc: *mut CSTL_Alloc,
1605 ) -> bool;
1606}
1607unsafe extern "C" {
1608 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the null-terminated string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1609 pub fn CSTL_wstring_replace_at(
1610 instance: CSTL_WideStringRef,
1611 off: usize,
1612 count: usize,
1613 ptr: *const wchar_t,
1614 alloc: *mut CSTL_Alloc,
1615 ) -> bool;
1616}
1617unsafe extern "C" {
1618 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the first `count2` characters of the string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1619 pub fn CSTL_wstring_replace_n_at(
1620 instance: CSTL_WideStringRef,
1621 off: usize,
1622 count: usize,
1623 ptr: *const wchar_t,
1624 count2: usize,
1625 alloc: *mut CSTL_Alloc,
1626 ) -> bool;
1627}
1628unsafe extern "C" {
1629 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with `count` copies of the character `ch`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1630 pub fn CSTL_wstring_replace_char_at(
1631 instance: CSTL_WideStringRef,
1632 off: usize,
1633 count: usize,
1634 count2: usize,
1635 ch: wchar_t,
1636 alloc: *mut CSTL_Alloc,
1637 ) -> bool;
1638}
1639unsafe extern "C" {
1640 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the string `other`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1641 pub fn CSTL_wstring_replace_str_at(
1642 instance: CSTL_WideStringRef,
1643 off: usize,
1644 count: usize,
1645 other: CSTL_WideStringCRef,
1646 alloc: *mut CSTL_Alloc,
1647 ) -> bool;
1648}
1649unsafe extern "C" {
1650 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the substring at offset `other_off` in `other` with the length\n given by `count2`.\n\n If `off` is outside of the range `[instance, instance + CSTL_wstring_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_wstring_size(other)]`\n or if the length of the resulting string is greater than `CSTL_wstring_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
1651 pub fn CSTL_wstring_replace_substr_at(
1652 instance: CSTL_WideStringRef,
1653 off: usize,
1654 count: usize,
1655 other: CSTL_WideStringCRef,
1656 other_off: usize,
1657 count2: usize,
1658 alloc: *mut CSTL_Alloc,
1659 ) -> bool;
1660}
1661unsafe extern "C" {
1662 #[doc = " Copies a substring `[off, off + count)` to character string pointed to by\n `dest`. The resulting character string is not null terminated.\n\n Returns the number of characters copied or `CSTL_string_npos` if\n `off > CSTL_wstring_size(instance)` (out of range).\n"]
1663 pub fn CSTL_wstring_copy(
1664 instance: CSTL_WideStringCRef,
1665 dest: *mut wchar_t,
1666 count: usize,
1667 off: usize,
1668 ) -> usize;
1669}
1670unsafe extern "C" {
1671 #[doc = " Resizes the string to contain `new_size` characters, appending `ch`\n if current size is less than `new_size`.\n\n If `new_size` is greater than `CSTL_wstring_max_size()` this\n function has no effect and returns `false`, otherwise it returns `true`.\n"]
1672 pub fn CSTL_wstring_resize(
1673 instance: CSTL_WideStringRef,
1674 new_size: usize,
1675 ch: wchar_t,
1676 alloc: *mut CSTL_Alloc,
1677 ) -> bool;
1678}
1679unsafe extern "C" {
1680 #[doc = " Find the first from offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1681 pub fn CSTL_wstring_find(
1682 instance: CSTL_WideStringCRef,
1683 ptr: *const wchar_t,
1684 off: usize,
1685 ) -> usize;
1686}
1687unsafe extern "C" {
1688 #[doc = " Find the first from offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1689 pub fn CSTL_wstring_find_n(
1690 instance: CSTL_WideStringCRef,
1691 ptr: *const wchar_t,
1692 off: usize,
1693 count: usize,
1694 ) -> usize;
1695}
1696unsafe extern "C" {
1697 #[doc = " Find the first from offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1698 pub fn CSTL_wstring_find_char(instance: CSTL_WideStringCRef, ch: wchar_t, off: usize) -> usize;
1699}
1700unsafe extern "C" {
1701 #[doc = " Find the first from offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1702 pub fn CSTL_wstring_find_str(
1703 instance: CSTL_WideStringCRef,
1704 other: CSTL_WideStringCRef,
1705 off: usize,
1706 ) -> usize;
1707}
1708unsafe extern "C" {
1709 #[doc = " Find the last before offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1710 pub fn CSTL_wstring_rfind(
1711 instance: CSTL_WideStringCRef,
1712 ptr: *const wchar_t,
1713 off: usize,
1714 ) -> usize;
1715}
1716unsafe extern "C" {
1717 #[doc = " Find the last before offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1718 pub fn CSTL_wstring_rfind_n(
1719 instance: CSTL_WideStringCRef,
1720 ptr: *const wchar_t,
1721 off: usize,
1722 count: usize,
1723 ) -> usize;
1724}
1725unsafe extern "C" {
1726 #[doc = " Find the last before offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1727 pub fn CSTL_wstring_rfind_char(instance: CSTL_WideStringCRef, ch: wchar_t, off: usize)
1728 -> usize;
1729}
1730unsafe extern "C" {
1731 #[doc = " Find the last before offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
1732 pub fn CSTL_wstring_rfind_str(
1733 instance: CSTL_WideStringCRef,
1734 other: CSTL_WideStringCRef,
1735 off: usize,
1736 ) -> usize;
1737}
1738unsafe extern "C" {
1739 #[doc = " Compare two null-terminated character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_WideString` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
1740 pub fn CSTL_wstring_compare(
1741 left: *const wchar_t,
1742 right: *const wchar_t,
1743 ) -> ::std::os::raw::c_int;
1744}
1745unsafe extern "C" {
1746 #[doc = " Compare an explicit length character sequence with a null-terminated one.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n To compare an explicit length `left` and a null-terminated `right`,\n swap them and negate the result: `-CSTL_wstring_compare_n(right, left, left_count)`.\n\n There is no `CSTL_WideString` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
1747 pub fn CSTL_wstring_compare_n(
1748 left: *const wchar_t,
1749 right: *const wchar_t,
1750 right_count: usize,
1751 ) -> ::std::os::raw::c_int;
1752}
1753unsafe extern "C" {
1754 #[doc = " Compare two explicit length character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_WideString` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
1755 pub fn CSTL_wstring_compare_nn(
1756 left: *const wchar_t,
1757 left_count: usize,
1758 right: *const wchar_t,
1759 right_count: usize,
1760 ) -> ::std::os::raw::c_int;
1761}
1762pub type char16_t = ::std::os::raw::c_ushort;
1763pub type char32_t = ::std::os::raw::c_uint;
1764pub type char8_t = ::std::os::raw::c_uchar;
1765#[doc = " STL ABI `std::basic_string` layout.\n\n Does not include the allocator, which nonetheless is a part of the `std::basic_string`\n structure! You are responsible for including it, since it can take on any form.\n\n Do not manipulate the members directly, use the associated functions!\n"]
1766#[repr(C)]
1767#[derive(Copy, Clone)]
1768pub struct CSTL_UTF8StringVal {
1769 pub bx: CSTL_UTF8StringUnion,
1770 pub size: usize,
1771 pub res: usize,
1772}
1773#[repr(C)]
1774#[derive(Copy, Clone)]
1775pub union CSTL_UTF8StringUnion {
1776 pub buf: [char8_t; 16usize],
1777 pub ptr: *mut char8_t,
1778}
1779#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1780const _: () = {
1781 ["Size of CSTL_UTF8StringUnion"][::std::mem::size_of::<CSTL_UTF8StringUnion>() - 16usize];
1782 ["Alignment of CSTL_UTF8StringUnion"][::std::mem::align_of::<CSTL_UTF8StringUnion>() - 8usize];
1783 ["Offset of field: CSTL_UTF8StringUnion::buf"]
1784 [::std::mem::offset_of!(CSTL_UTF8StringUnion, buf) - 0usize];
1785 ["Offset of field: CSTL_UTF8StringUnion::ptr"]
1786 [::std::mem::offset_of!(CSTL_UTF8StringUnion, ptr) - 0usize];
1787};
1788#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1789const _: () = {
1790 ["Size of CSTL_UTF8StringVal"][::std::mem::size_of::<CSTL_UTF8StringVal>() - 32usize];
1791 ["Alignment of CSTL_UTF8StringVal"][::std::mem::align_of::<CSTL_UTF8StringVal>() - 8usize];
1792 ["Offset of field: CSTL_UTF8StringVal::bx"]
1793 [::std::mem::offset_of!(CSTL_UTF8StringVal, bx) - 0usize];
1794 ["Offset of field: CSTL_UTF8StringVal::size"]
1795 [::std::mem::offset_of!(CSTL_UTF8StringVal, size) - 16usize];
1796 ["Offset of field: CSTL_UTF8StringVal::res"]
1797 [::std::mem::offset_of!(CSTL_UTF8StringVal, res) - 24usize];
1798};
1799#[doc = " Reference to a mutable `CSTL_UTF8StringVal`.\n\n Must not be null.\n"]
1800pub type CSTL_UTF8StringRef = *mut CSTL_UTF8StringVal;
1801#[doc = " Reference to a const `CSTL_UTF8StringVal`.\n\n Must not be null.\n"]
1802pub type CSTL_UTF8StringCRef = *const CSTL_UTF8StringVal;
1803unsafe extern "C" {
1804 #[doc = " Initializes the string, but does not allocate any memory.\n\n An initialized string can be trivially destroyed without leaks as long\n as its owned string is small enough to be inline (smaller than CSTL_string_alloc_mask).\n\n Re-initializing a string with a backing memory allocation will leak the old\n memory allocation.\n"]
1805 pub fn CSTL_u8string_construct(new_instance: *mut CSTL_UTF8StringVal);
1806}
1807unsafe extern "C" {
1808 #[doc = " Destroys the string, freeing the backing storage if necessary.\n"]
1809 pub fn CSTL_u8string_destroy(instance: CSTL_UTF8StringRef, alloc: *mut CSTL_Alloc);
1810}
1811unsafe extern "C" {
1812 #[doc = " Initializes the string with the substring at offset `other_off`\n in `other` with the length given by `count`.\n\n If `new_instance == NULL` or if `other_off` is outside of the range\n `[other, other + CSTL_u8string_size(other)]` returns `false` and does nothing,\n otherwise it returns `true`.\n\n If `new_instance == other` the substring operation is performed in-place without\n de-initializing `other`.\n\n Remember that re-initializing a different string with a backing memory allocation\n will leak the old memory allocation.\n"]
1813 pub fn CSTL_u8string_substr(
1814 new_instance: *mut CSTL_UTF8StringVal,
1815 other: CSTL_UTF8StringCRef,
1816 other_off: usize,
1817 count: usize,
1818 alloc: *mut CSTL_Alloc,
1819 ) -> bool;
1820}
1821unsafe extern "C" {
1822 #[doc = " Replaces the contents of `instance` with the null-terminated string at `ptr`.\n\n If the length of the string at `ptr` is greater than `CSTL_u8string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
1823 pub fn CSTL_u8string_assign(
1824 instance: CSTL_UTF8StringRef,
1825 ptr: *const char8_t,
1826 alloc: *mut CSTL_Alloc,
1827 ) -> bool;
1828}
1829unsafe extern "C" {
1830 #[doc = " Replaces the contents of `instance` with the first `count` characters of the string at `ptr`.\n\n If `n` is greater than `CSTL_u8string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
1831 pub fn CSTL_u8string_assign_n(
1832 instance: CSTL_UTF8StringRef,
1833 ptr: *const char8_t,
1834 count: usize,
1835 alloc: *mut CSTL_Alloc,
1836 ) -> bool;
1837}
1838unsafe extern "C" {
1839 #[doc = " Replaces the contents of `instance` with the `count` copies of the character `ch`.\n\n If `count` is greater than `CSTL_u8string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
1840 pub fn CSTL_u8string_assign_char(
1841 instance: CSTL_UTF8StringRef,
1842 count: usize,
1843 ch: char8_t,
1844 alloc: *mut CSTL_Alloc,
1845 ) -> bool;
1846}
1847unsafe extern "C" {
1848 #[doc = " Replaces the contents of `instance` with the substring at offset `other_off` in `other`\n with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u8string_size(other)]` returns\n `false` and does nothing, otherwise it returns `true`.\n"]
1849 pub fn CSTL_u8string_assign_substr(
1850 instance: CSTL_UTF8StringRef,
1851 other: CSTL_UTF8StringCRef,
1852 other_off: usize,
1853 count: usize,
1854 alloc: *mut CSTL_Alloc,
1855 ) -> bool;
1856}
1857unsafe extern "C" {
1858 #[doc = " Replaces the contents of `instance` with the contents of `other_instance`.\n\n If `propagate_alloc == true && alloc != other_alloc` then storage\n is freed with `alloc` and allocated again with `other_alloc` before contents\n are copied. Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false` `instance` keeps using `alloc` as its allocator,\n potentially reusing its storage.\n\n You are responsible for replacing the allocator outside of `CSTL_UTF8StringVal` if applicable.\n"]
1859 pub fn CSTL_u8string_copy_assign(
1860 instance: CSTL_UTF8StringRef,
1861 alloc: *mut CSTL_Alloc,
1862 other_instance: CSTL_UTF8StringCRef,
1863 other_alloc: *mut CSTL_Alloc,
1864 propagate_alloc: bool,
1865 );
1866}
1867unsafe extern "C" {
1868 #[doc = " Moves the contents of `other_instance` to the contents of `instance`.\n\n If `propagate_alloc == true` storage is replaced with storage of `other_instance`.\n Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false && alloc != other_alloc` then storage is reused\n and individual characters of `other` are moved in. Then, `instance` uses `alloc` as its allocator.\n\n You are responsible for replacing the allocator outside of `CSTL_UTF8StringVal` if applicable.\n"]
1869 pub fn CSTL_u8string_move_assign(
1870 instance: CSTL_UTF8StringRef,
1871 alloc: *mut CSTL_Alloc,
1872 other_instance: CSTL_UTF8StringRef,
1873 other_alloc: *mut CSTL_Alloc,
1874 propagate_alloc: bool,
1875 );
1876}
1877unsafe extern "C" {
1878 #[doc = " Swaps string contents.\n\n You are responsible for swapping the allocators.\n"]
1879 pub fn CSTL_u8string_swap(instance: CSTL_UTF8StringRef, other_instance: CSTL_UTF8StringRef);
1880}
1881unsafe extern "C" {
1882 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_u8string_length(instance)` the behavior is undefined.\n"]
1883 pub fn CSTL_u8string_index(instance: CSTL_UTF8StringRef, pos: usize) -> *mut char8_t;
1884}
1885unsafe extern "C" {
1886 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_u8string_length(instance)` the behavior is undefined.\n"]
1887 pub fn CSTL_u8string_const_index(instance: CSTL_UTF8StringCRef, pos: usize) -> *const char8_t;
1888}
1889unsafe extern "C" {
1890 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_u8string_length(instance)` a null pointer is returned.\n"]
1891 pub fn CSTL_u8string_at(instance: CSTL_UTF8StringRef, pos: usize) -> *mut char8_t;
1892}
1893unsafe extern "C" {
1894 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_u8string_length(instance)` a null pointer is returned.\n"]
1895 pub fn CSTL_u8string_const_at(instance: CSTL_UTF8StringCRef, pos: usize) -> *const char8_t;
1896}
1897unsafe extern "C" {
1898 #[doc = " Returns a pointer to the first character.\n\n If `CSTL_u8string_empty(instance) == true` the behavior is undefined.\n"]
1899 pub fn CSTL_u8string_front(instance: CSTL_UTF8StringRef) -> *mut char8_t;
1900}
1901unsafe extern "C" {
1902 #[doc = " Returns a const pointer to the first character.\n\n If `CSTL_u8string_empty(instance) == true` the behavior is undefined.\n"]
1903 pub fn CSTL_u8string_const_front(instance: CSTL_UTF8StringCRef) -> *const char8_t;
1904}
1905unsafe extern "C" {
1906 #[doc = " Returns a pointer to the last character.\n\n If `CSTL_u8string_empty(instance) == true` the behavior is undefined.\n"]
1907 pub fn CSTL_u8string_back(instance: CSTL_UTF8StringRef) -> *mut char8_t;
1908}
1909unsafe extern "C" {
1910 #[doc = " Returns a const pointer to the last character.\n\n If `CSTL_u8string_empty(instance) == true` the behavior is undefined.\n"]
1911 pub fn CSTL_u8string_const_back(instance: CSTL_UTF8StringCRef) -> *const char8_t;
1912}
1913unsafe extern "C" {
1914 #[doc = " Returns a pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_u8string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_u8string_data(instance), CSTL_u8string_data(instance) + size]`\n is always valid.\n\n The array may be mutated through the returned pointer excluding\n the past-the-end null terminator.\n"]
1915 pub fn CSTL_u8string_data(instance: CSTL_UTF8StringRef) -> *mut char8_t;
1916}
1917unsafe extern "C" {
1918 #[doc = " Returns a const pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_u8string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_u8string_c_str(instance), CSTL_u8string_c_str(instance) + size]`\n is always valid.\n"]
1919 pub fn CSTL_u8string_c_str(instance: CSTL_UTF8StringCRef) -> *const char8_t;
1920}
1921unsafe extern "C" {
1922 #[doc = " Returns an iterator (pointer) to the first character of the string.\n\n If `CSTL_u8string_empty(instance) == true` then\n `CSTL_u8string_begin(instance) == CSTL_u8string_end(instance)`.\n"]
1923 pub fn CSTL_u8string_begin(instance: CSTL_UTF8StringRef) -> *mut char8_t;
1924}
1925unsafe extern "C" {
1926 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_u8string_empty(instance) == true` then\n `CSTL_u8string_begin(instance) == CSTL_u8string_end(instance)`.\n"]
1927 pub fn CSTL_u8string_const_begin(instance: CSTL_UTF8StringCRef) -> *const char8_t;
1928}
1929unsafe extern "C" {
1930 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_u8string_empty(instance) == true` then\n `CSTL_u8string_begin(instance) == CSTL_u8string_end(instance)`.\n"]
1931 pub fn CSTL_u8string_end(instance: CSTL_UTF8StringRef) -> *mut char8_t;
1932}
1933unsafe extern "C" {
1934 #[doc = " Returns a const iterator (pointer) past the last character of the string.\n\n If `CSTL_u8string_empty(instance) == true` then\n `CSTL_u8string_const_begin(instance) == CSTL_u8string_const_end(instance)`.\n"]
1935 pub fn CSTL_u8string_const_end(instance: CSTL_UTF8StringCRef) -> *const char8_t;
1936}
1937unsafe extern "C" {
1938 #[doc = " Returns `true` if the string is empty or `false` otherwise.\n"]
1939 pub fn CSTL_u8string_empty(instance: CSTL_UTF8StringCRef) -> bool;
1940}
1941unsafe extern "C" {
1942 #[doc = " Returns the number of characters in the string.\n"]
1943 pub fn CSTL_u8string_size(instance: CSTL_UTF8StringCRef) -> usize;
1944}
1945unsafe extern "C" {
1946 #[doc = " Returns the number of characters in the string.\n"]
1947 pub fn CSTL_u8string_length(instance: CSTL_UTF8StringCRef) -> usize;
1948}
1949unsafe extern "C" {
1950 #[doc = " Returns the total characters capacity of the string.\n"]
1951 pub fn CSTL_u8string_capacity(instance: CSTL_UTF8StringCRef) -> usize;
1952}
1953unsafe extern "C" {
1954 #[doc = " Returns the maximum possible number of characters in the string.\n"]
1955 pub fn CSTL_u8string_max_size() -> usize;
1956}
1957unsafe extern "C" {
1958 #[doc = " If `new_capacity > CSTL_u8string_capacity(instance)`, reallocates and expands\n the underlying array storage.\n\n If `new_capacity` exceeds `CSTL_u8string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
1959 pub fn CSTL_u8string_reserve(
1960 instance: CSTL_UTF8StringRef,
1961 new_capacity: usize,
1962 alloc: *mut CSTL_Alloc,
1963 ) -> bool;
1964}
1965unsafe extern "C" {
1966 #[doc = " Request removal of unused capacity.\n"]
1967 pub fn CSTL_u8string_shrink_to_fit(instance: CSTL_UTF8StringRef, alloc: *mut CSTL_Alloc);
1968}
1969unsafe extern "C" {
1970 #[doc = " Erase all characters from the string without affecting capacity.\n"]
1971 pub fn CSTL_u8string_clear(instance: CSTL_UTF8StringRef);
1972}
1973unsafe extern "C" {
1974 #[doc = " Inserts the null-terminated string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1975 pub fn CSTL_u8string_insert(
1976 instance: CSTL_UTF8StringRef,
1977 where_: *const char8_t,
1978 ptr: *const char8_t,
1979 alloc: *mut CSTL_Alloc,
1980 ) -> *mut char8_t;
1981}
1982unsafe extern "C" {
1983 #[doc = " Inserts the first `count` characters of the string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1984 pub fn CSTL_u8string_insert_n(
1985 instance: CSTL_UTF8StringRef,
1986 where_: *const char8_t,
1987 ptr: *const char8_t,
1988 count: usize,
1989 alloc: *mut CSTL_Alloc,
1990 ) -> *mut char8_t;
1991}
1992unsafe extern "C" {
1993 #[doc = " Inserts `count` copies of the character `ch` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
1994 pub fn CSTL_u8string_insert_char(
1995 instance: CSTL_UTF8StringRef,
1996 where_: *const char8_t,
1997 count: usize,
1998 ch: char8_t,
1999 alloc: *mut CSTL_Alloc,
2000 ) -> *mut char8_t;
2001}
2002unsafe extern "C" {
2003 #[doc = " Inserts the string `other` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2004 pub fn CSTL_u8string_insert_str(
2005 instance: CSTL_UTF8StringRef,
2006 where_: *const char8_t,
2007 other: CSTL_UTF8StringCRef,
2008 alloc: *mut CSTL_Alloc,
2009 ) -> *mut char8_t;
2010}
2011unsafe extern "C" {
2012 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at the pointer `where` in `instance`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u8string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2013 pub fn CSTL_u8string_insert_substr(
2014 instance: CSTL_UTF8StringRef,
2015 where_: *const char8_t,
2016 other: CSTL_UTF8StringCRef,
2017 other_off: usize,
2018 count: usize,
2019 alloc: *mut CSTL_Alloc,
2020 ) -> *mut char8_t;
2021}
2022unsafe extern "C" {
2023 #[doc = " Inserts the null-terminated string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2024 pub fn CSTL_u8string_insert_at(
2025 instance: CSTL_UTF8StringRef,
2026 off: usize,
2027 ptr: *const char8_t,
2028 alloc: *mut CSTL_Alloc,
2029 ) -> bool;
2030}
2031unsafe extern "C" {
2032 #[doc = " Inserts the first `count` characters of the string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2033 pub fn CSTL_u8string_insert_n_at(
2034 instance: CSTL_UTF8StringRef,
2035 off: usize,
2036 ptr: *const char8_t,
2037 count: usize,
2038 alloc: *mut CSTL_Alloc,
2039 ) -> bool;
2040}
2041unsafe extern "C" {
2042 #[doc = " Inserts `count` copies of the character `ch` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2043 pub fn CSTL_u8string_insert_char_at(
2044 instance: CSTL_UTF8StringRef,
2045 off: usize,
2046 count: usize,
2047 ch: char8_t,
2048 alloc: *mut CSTL_Alloc,
2049 ) -> bool;
2050}
2051unsafe extern "C" {
2052 #[doc = " Inserts the string `other` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2053 pub fn CSTL_u8string_insert_str_at(
2054 instance: CSTL_UTF8StringRef,
2055 off: usize,
2056 other: CSTL_UTF8StringCRef,
2057 alloc: *mut CSTL_Alloc,
2058 ) -> bool;
2059}
2060unsafe extern "C" {
2061 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_u8string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2062 pub fn CSTL_u8string_insert_substr_at(
2063 instance: CSTL_UTF8StringRef,
2064 off: usize,
2065 other: CSTL_UTF8StringCRef,
2066 other_off: usize,
2067 count: usize,
2068 alloc: *mut CSTL_Alloc,
2069 ) -> bool;
2070}
2071unsafe extern "C" {
2072 #[doc = " Removes the character at `where` and returns a pointer following the\n removed character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2073 pub fn CSTL_u8string_erase(
2074 instance: CSTL_UTF8StringRef,
2075 where_: *const char8_t,
2076 ) -> *mut char8_t;
2077}
2078unsafe extern "C" {
2079 #[doc = " Removes the characters in the range `[first, last)` and returns a pointer following the\n removed character.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2080 pub fn CSTL_u8string_erase_substr(
2081 instance: CSTL_UTF8StringRef,
2082 first: *const char8_t,
2083 last: *const char8_t,
2084 ) -> *mut char8_t;
2085}
2086unsafe extern "C" {
2087 #[doc = " Removes the character at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2088 pub fn CSTL_u8string_erase_at(instance: CSTL_UTF8StringRef, off: usize) -> bool;
2089}
2090unsafe extern "C" {
2091 #[doc = " Removes the substring at offset `off` in `instance` with the length given by `count`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2092 pub fn CSTL_u8string_erase_substr_at(
2093 instance: CSTL_UTF8StringRef,
2094 off: usize,
2095 count: usize,
2096 ) -> bool;
2097}
2098unsafe extern "C" {
2099 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_u8string_size(instance) == CSTL_u8string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
2100 pub fn CSTL_u8string_push_back(
2101 instance: CSTL_UTF8StringRef,
2102 ch: char8_t,
2103 alloc: *mut CSTL_Alloc,
2104 ) -> bool;
2105}
2106unsafe extern "C" {
2107 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_u8string_size(instance) == CSTL_u8string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
2108 pub fn CSTL_u8string_pop_back(instance: CSTL_UTF8StringRef);
2109}
2110unsafe extern "C" {
2111 #[doc = " Appends the null-terminated string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2112 pub fn CSTL_u8string_append(
2113 instance: CSTL_UTF8StringRef,
2114 ptr: *const char8_t,
2115 alloc: *mut CSTL_Alloc,
2116 ) -> bool;
2117}
2118unsafe extern "C" {
2119 #[doc = " Appends the first `count` characters of the string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2120 pub fn CSTL_u8string_append_n(
2121 instance: CSTL_UTF8StringRef,
2122 ptr: *const char8_t,
2123 count: usize,
2124 alloc: *mut CSTL_Alloc,
2125 ) -> bool;
2126}
2127unsafe extern "C" {
2128 #[doc = " Appends `count` copies of the character `ch` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2129 pub fn CSTL_u8string_append_char(
2130 instance: CSTL_UTF8StringRef,
2131 count: usize,
2132 ch: char8_t,
2133 alloc: *mut CSTL_Alloc,
2134 ) -> bool;
2135}
2136unsafe extern "C" {
2137 #[doc = " Appends the string `other` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2138 pub fn CSTL_u8string_append_str(
2139 instance: CSTL_UTF8StringRef,
2140 other: CSTL_UTF8StringCRef,
2141 alloc: *mut CSTL_Alloc,
2142 ) -> bool;
2143}
2144unsafe extern "C" {
2145 #[doc = " Appends the substring at offset `other_off` in `other` with the length\n given by `count` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2146 pub fn CSTL_u8string_append_substr(
2147 instance: CSTL_UTF8StringRef,
2148 other: CSTL_UTF8StringCRef,
2149 other_off: usize,
2150 count: usize,
2151 alloc: *mut CSTL_Alloc,
2152 ) -> bool;
2153}
2154unsafe extern "C" {
2155 #[doc = " Replaces the characters in the range `[first, last)` with the null-terminated\n string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2156 pub fn CSTL_u8string_replace(
2157 instance: CSTL_UTF8StringRef,
2158 first: *const char8_t,
2159 last: *const char8_t,
2160 ptr: *const char8_t,
2161 alloc: *mut CSTL_Alloc,
2162 ) -> bool;
2163}
2164unsafe extern "C" {
2165 #[doc = " Replaces the characters in the range `[first, last)` with the first `count`\n characters of the string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2166 pub fn CSTL_u8string_replace_n(
2167 instance: CSTL_UTF8StringRef,
2168 first: *const char8_t,
2169 last: *const char8_t,
2170 ptr: *const char8_t,
2171 count: usize,
2172 alloc: *mut CSTL_Alloc,
2173 ) -> bool;
2174}
2175unsafe extern "C" {
2176 #[doc = " Replaces the characters in the range `[first, last)` with `count` copies\n of the character `ch`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2177 pub fn CSTL_u8string_replace_char(
2178 instance: CSTL_UTF8StringRef,
2179 first: *const char8_t,
2180 last: *const char8_t,
2181 count: usize,
2182 ch: char8_t,
2183 alloc: *mut CSTL_Alloc,
2184 ) -> bool;
2185}
2186unsafe extern "C" {
2187 #[doc = " Replaces the characters in the range `[first, last)` with the string `other`.\n\n If the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2188 pub fn CSTL_u8string_replace_str(
2189 instance: CSTL_UTF8StringRef,
2190 first: *const char8_t,
2191 last: *const char8_t,
2192 other: CSTL_UTF8StringCRef,
2193 alloc: *mut CSTL_Alloc,
2194 ) -> bool;
2195}
2196unsafe extern "C" {
2197 #[doc = " Replaces the characters in the range `[first, last)` with the substring\n at offset `other_off` in `other` with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u8string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2198 pub fn CSTL_u8string_replace_substr(
2199 instance: CSTL_UTF8StringRef,
2200 first: *const char8_t,
2201 last: *const char8_t,
2202 other: CSTL_UTF8StringCRef,
2203 other_off: usize,
2204 count: usize,
2205 alloc: *mut CSTL_Alloc,
2206 ) -> bool;
2207}
2208unsafe extern "C" {
2209 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the null-terminated string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2210 pub fn CSTL_u8string_replace_at(
2211 instance: CSTL_UTF8StringRef,
2212 off: usize,
2213 count: usize,
2214 ptr: *const char8_t,
2215 alloc: *mut CSTL_Alloc,
2216 ) -> bool;
2217}
2218unsafe extern "C" {
2219 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the first `count2` characters of the string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2220 pub fn CSTL_u8string_replace_n_at(
2221 instance: CSTL_UTF8StringRef,
2222 off: usize,
2223 count: usize,
2224 ptr: *const char8_t,
2225 count2: usize,
2226 alloc: *mut CSTL_Alloc,
2227 ) -> bool;
2228}
2229unsafe extern "C" {
2230 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with `count` copies of the character `ch`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2231 pub fn CSTL_u8string_replace_char_at(
2232 instance: CSTL_UTF8StringRef,
2233 off: usize,
2234 count: usize,
2235 count2: usize,
2236 ch: char8_t,
2237 alloc: *mut CSTL_Alloc,
2238 ) -> bool;
2239}
2240unsafe extern "C" {
2241 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the string `other`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2242 pub fn CSTL_u8string_replace_str_at(
2243 instance: CSTL_UTF8StringRef,
2244 off: usize,
2245 count: usize,
2246 other: CSTL_UTF8StringCRef,
2247 alloc: *mut CSTL_Alloc,
2248 ) -> bool;
2249}
2250unsafe extern "C" {
2251 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the substring at offset `other_off` in `other` with the length\n given by `count2`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u8string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_u8string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u8string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2252 pub fn CSTL_u8string_replace_substr_at(
2253 instance: CSTL_UTF8StringRef,
2254 off: usize,
2255 count: usize,
2256 other: CSTL_UTF8StringCRef,
2257 other_off: usize,
2258 count2: usize,
2259 alloc: *mut CSTL_Alloc,
2260 ) -> bool;
2261}
2262unsafe extern "C" {
2263 #[doc = " Copies a substring `[off, off + count)` to character string pointed to by\n `dest`. The resulting character string is not null terminated.\n\n Returns the number of characters copied or `CSTL_string_npos` if\n `off > CSTL_u8string_size(instance)` (out of range).\n"]
2264 pub fn CSTL_u8string_copy(
2265 instance: CSTL_UTF8StringCRef,
2266 dest: *mut char8_t,
2267 count: usize,
2268 off: usize,
2269 ) -> usize;
2270}
2271unsafe extern "C" {
2272 #[doc = " Resizes the string to contain `new_size` characters, appending `ch`\n if current size is less than `new_size`.\n\n If `new_size` is greater than `CSTL_u8string_max_size()` this\n function has no effect and returns `false`, otherwise it returns `true`.\n"]
2273 pub fn CSTL_u8string_resize(
2274 instance: CSTL_UTF8StringRef,
2275 new_size: usize,
2276 ch: char8_t,
2277 alloc: *mut CSTL_Alloc,
2278 ) -> bool;
2279}
2280unsafe extern "C" {
2281 #[doc = " Find the first from offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2282 pub fn CSTL_u8string_find(
2283 instance: CSTL_UTF8StringCRef,
2284 ptr: *const char8_t,
2285 off: usize,
2286 ) -> usize;
2287}
2288unsafe extern "C" {
2289 #[doc = " Find the first from offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2290 pub fn CSTL_u8string_find_n(
2291 instance: CSTL_UTF8StringCRef,
2292 ptr: *const char8_t,
2293 off: usize,
2294 count: usize,
2295 ) -> usize;
2296}
2297unsafe extern "C" {
2298 #[doc = " Find the first from offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2299 pub fn CSTL_u8string_find_char(instance: CSTL_UTF8StringCRef, ch: char8_t, off: usize)
2300 -> usize;
2301}
2302unsafe extern "C" {
2303 #[doc = " Find the first from offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2304 pub fn CSTL_u8string_find_str(
2305 instance: CSTL_UTF8StringCRef,
2306 other: CSTL_UTF8StringCRef,
2307 off: usize,
2308 ) -> usize;
2309}
2310unsafe extern "C" {
2311 #[doc = " Find the last before offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2312 pub fn CSTL_u8string_rfind(
2313 instance: CSTL_UTF8StringCRef,
2314 ptr: *const char8_t,
2315 off: usize,
2316 ) -> usize;
2317}
2318unsafe extern "C" {
2319 #[doc = " Find the last before offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2320 pub fn CSTL_u8string_rfind_n(
2321 instance: CSTL_UTF8StringCRef,
2322 ptr: *const char8_t,
2323 off: usize,
2324 count: usize,
2325 ) -> usize;
2326}
2327unsafe extern "C" {
2328 #[doc = " Find the last before offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2329 pub fn CSTL_u8string_rfind_char(
2330 instance: CSTL_UTF8StringCRef,
2331 ch: char8_t,
2332 off: usize,
2333 ) -> usize;
2334}
2335unsafe extern "C" {
2336 #[doc = " Find the last before offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2337 pub fn CSTL_u8string_rfind_str(
2338 instance: CSTL_UTF8StringCRef,
2339 other: CSTL_UTF8StringCRef,
2340 off: usize,
2341 ) -> usize;
2342}
2343unsafe extern "C" {
2344 #[doc = " Compare two null-terminated character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_UTF8String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
2345 pub fn CSTL_u8string_compare(
2346 left: *const char8_t,
2347 right: *const char8_t,
2348 ) -> ::std::os::raw::c_int;
2349}
2350unsafe extern "C" {
2351 #[doc = " Compare an explicit length character sequence with a null-terminated one.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n To compare an explicit length `left` and a null-terminated `right`,\n swap them and negate the result: `-CSTL_u8string_compare_n(right, left, left_count)`.\n\n There is no `CSTL_UTF8String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
2352 pub fn CSTL_u8string_compare_n(
2353 left: *const char8_t,
2354 right: *const char8_t,
2355 right_count: usize,
2356 ) -> ::std::os::raw::c_int;
2357}
2358unsafe extern "C" {
2359 #[doc = " Compare two explicit length character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_UTF8String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
2360 pub fn CSTL_u8string_compare_nn(
2361 left: *const char8_t,
2362 left_count: usize,
2363 right: *const char8_t,
2364 right_count: usize,
2365 ) -> ::std::os::raw::c_int;
2366}
2367#[doc = " STL ABI `std::basic_string` layout.\n\n Does not include the allocator, which nonetheless is a part of the `std::basic_string`\n structure! You are responsible for including it, since it can take on any form.\n\n Do not manipulate the members directly, use the associated functions!\n"]
2368#[repr(C)]
2369#[derive(Copy, Clone)]
2370pub struct CSTL_UTF16StringVal {
2371 pub bx: CSTL_UTF16StringUnion,
2372 pub size: usize,
2373 pub res: usize,
2374}
2375#[repr(C)]
2376#[derive(Copy, Clone)]
2377pub union CSTL_UTF16StringUnion {
2378 pub buf: [char16_t; 8usize],
2379 pub ptr: *mut char16_t,
2380}
2381#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2382const _: () = {
2383 ["Size of CSTL_UTF16StringUnion"][::std::mem::size_of::<CSTL_UTF16StringUnion>() - 16usize];
2384 ["Alignment of CSTL_UTF16StringUnion"]
2385 [::std::mem::align_of::<CSTL_UTF16StringUnion>() - 8usize];
2386 ["Offset of field: CSTL_UTF16StringUnion::buf"]
2387 [::std::mem::offset_of!(CSTL_UTF16StringUnion, buf) - 0usize];
2388 ["Offset of field: CSTL_UTF16StringUnion::ptr"]
2389 [::std::mem::offset_of!(CSTL_UTF16StringUnion, ptr) - 0usize];
2390};
2391#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2392const _: () = {
2393 ["Size of CSTL_UTF16StringVal"][::std::mem::size_of::<CSTL_UTF16StringVal>() - 32usize];
2394 ["Alignment of CSTL_UTF16StringVal"][::std::mem::align_of::<CSTL_UTF16StringVal>() - 8usize];
2395 ["Offset of field: CSTL_UTF16StringVal::bx"]
2396 [::std::mem::offset_of!(CSTL_UTF16StringVal, bx) - 0usize];
2397 ["Offset of field: CSTL_UTF16StringVal::size"]
2398 [::std::mem::offset_of!(CSTL_UTF16StringVal, size) - 16usize];
2399 ["Offset of field: CSTL_UTF16StringVal::res"]
2400 [::std::mem::offset_of!(CSTL_UTF16StringVal, res) - 24usize];
2401};
2402#[doc = " Reference to a mutable `CSTL_UTF16StringVal`.\n\n Must not be null.\n"]
2403pub type CSTL_UTF16StringRef = *mut CSTL_UTF16StringVal;
2404#[doc = " Reference to a const `CSTL_UTF16StringVal`.\n\n Must not be null.\n"]
2405pub type CSTL_UTF16StringCRef = *const CSTL_UTF16StringVal;
2406unsafe extern "C" {
2407 #[doc = " Initializes the string, but does not allocate any memory.\n\n An initialized string can be trivially destroyed without leaks as long\n as its owned string is small enough to be inline (smaller than CSTL_string_alloc_mask).\n\n Re-initializing a string with a backing memory allocation will leak the old\n memory allocation.\n"]
2408 pub fn CSTL_u16string_construct(new_instance: *mut CSTL_UTF16StringVal);
2409}
2410unsafe extern "C" {
2411 #[doc = " Destroys the string, freeing the backing storage if necessary.\n"]
2412 pub fn CSTL_u16string_destroy(instance: CSTL_UTF16StringRef, alloc: *mut CSTL_Alloc);
2413}
2414unsafe extern "C" {
2415 #[doc = " Initializes the string with the substring at offset `other_off`\n in `other` with the length given by `count`.\n\n If `new_instance == NULL` or if `other_off` is outside of the range\n `[other, other + CSTL_u16string_size(other)]` returns `false` and does nothing,\n otherwise it returns `true`.\n\n If `new_instance == other` the substring operation is performed in-place without\n de-initializing `other`.\n\n Remember that re-initializing a different string with a backing memory allocation\n will leak the old memory allocation.\n"]
2416 pub fn CSTL_u16string_substr(
2417 new_instance: *mut CSTL_UTF16StringVal,
2418 other: CSTL_UTF16StringCRef,
2419 other_off: usize,
2420 count: usize,
2421 alloc: *mut CSTL_Alloc,
2422 ) -> bool;
2423}
2424unsafe extern "C" {
2425 #[doc = " Replaces the contents of `instance` with the null-terminated string at `ptr`.\n\n If the length of the string at `ptr` is greater than `CSTL_u16string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
2426 pub fn CSTL_u16string_assign(
2427 instance: CSTL_UTF16StringRef,
2428 ptr: *const char16_t,
2429 alloc: *mut CSTL_Alloc,
2430 ) -> bool;
2431}
2432unsafe extern "C" {
2433 #[doc = " Replaces the contents of `instance` with the first `count` characters of the string at `ptr`.\n\n If `n` is greater than `CSTL_u16string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
2434 pub fn CSTL_u16string_assign_n(
2435 instance: CSTL_UTF16StringRef,
2436 ptr: *const char16_t,
2437 count: usize,
2438 alloc: *mut CSTL_Alloc,
2439 ) -> bool;
2440}
2441unsafe extern "C" {
2442 #[doc = " Replaces the contents of `instance` with the `count` copies of the character `ch`.\n\n If `count` is greater than `CSTL_u16string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
2443 pub fn CSTL_u16string_assign_char(
2444 instance: CSTL_UTF16StringRef,
2445 count: usize,
2446 ch: char16_t,
2447 alloc: *mut CSTL_Alloc,
2448 ) -> bool;
2449}
2450unsafe extern "C" {
2451 #[doc = " Replaces the contents of `instance` with the substring at offset `other_off` in `other`\n with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u16string_size(other)]` returns\n `false` and does nothing, otherwise it returns `true`.\n"]
2452 pub fn CSTL_u16string_assign_substr(
2453 instance: CSTL_UTF16StringRef,
2454 other: CSTL_UTF16StringCRef,
2455 other_off: usize,
2456 count: usize,
2457 alloc: *mut CSTL_Alloc,
2458 ) -> bool;
2459}
2460unsafe extern "C" {
2461 #[doc = " Replaces the contents of `instance` with the contents of `other_instance`.\n\n If `propagate_alloc == true && alloc != other_alloc` then storage\n is freed with `alloc` and allocated again with `other_alloc` before contents\n are copied. Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false` `instance` keeps using `alloc` as its allocator,\n potentially reusing its storage.\n\n You are responsible for replacing the allocator outside of `CSTL_UTF16StringVal` if applicable.\n"]
2462 pub fn CSTL_u16string_copy_assign(
2463 instance: CSTL_UTF16StringRef,
2464 alloc: *mut CSTL_Alloc,
2465 other_instance: CSTL_UTF16StringCRef,
2466 other_alloc: *mut CSTL_Alloc,
2467 propagate_alloc: bool,
2468 );
2469}
2470unsafe extern "C" {
2471 #[doc = " Moves the contents of `other_instance` to the contents of `instance`.\n\n If `propagate_alloc == true` storage is replaced with storage of `other_instance`.\n Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false && alloc != other_alloc` then storage is reused\n and individual characters of `other` are moved in. Then, `instance` uses `alloc` as its allocator.\n\n You are responsible for replacing the allocator outside of `CSTL_UTF16StringVal` if applicable.\n"]
2472 pub fn CSTL_u16string_move_assign(
2473 instance: CSTL_UTF16StringRef,
2474 alloc: *mut CSTL_Alloc,
2475 other_instance: CSTL_UTF16StringRef,
2476 other_alloc: *mut CSTL_Alloc,
2477 propagate_alloc: bool,
2478 );
2479}
2480unsafe extern "C" {
2481 #[doc = " Swaps string contents.\n\n You are responsible for swapping the allocators.\n"]
2482 pub fn CSTL_u16string_swap(instance: CSTL_UTF16StringRef, other_instance: CSTL_UTF16StringRef);
2483}
2484unsafe extern "C" {
2485 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_u16string_length(instance)` the behavior is undefined.\n"]
2486 pub fn CSTL_u16string_index(instance: CSTL_UTF16StringRef, pos: usize) -> *mut char16_t;
2487}
2488unsafe extern "C" {
2489 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_u16string_length(instance)` the behavior is undefined.\n"]
2490 pub fn CSTL_u16string_const_index(
2491 instance: CSTL_UTF16StringCRef,
2492 pos: usize,
2493 ) -> *const char16_t;
2494}
2495unsafe extern "C" {
2496 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_u16string_length(instance)` a null pointer is returned.\n"]
2497 pub fn CSTL_u16string_at(instance: CSTL_UTF16StringRef, pos: usize) -> *mut char16_t;
2498}
2499unsafe extern "C" {
2500 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_u16string_length(instance)` a null pointer is returned.\n"]
2501 pub fn CSTL_u16string_const_at(instance: CSTL_UTF16StringCRef, pos: usize) -> *const char16_t;
2502}
2503unsafe extern "C" {
2504 #[doc = " Returns a pointer to the first character.\n\n If `CSTL_u16string_empty(instance) == true` the behavior is undefined.\n"]
2505 pub fn CSTL_u16string_front(instance: CSTL_UTF16StringRef) -> *mut char16_t;
2506}
2507unsafe extern "C" {
2508 #[doc = " Returns a const pointer to the first character.\n\n If `CSTL_u16string_empty(instance) == true` the behavior is undefined.\n"]
2509 pub fn CSTL_u16string_const_front(instance: CSTL_UTF16StringCRef) -> *const char16_t;
2510}
2511unsafe extern "C" {
2512 #[doc = " Returns a pointer to the last character.\n\n If `CSTL_u16string_empty(instance) == true` the behavior is undefined.\n"]
2513 pub fn CSTL_u16string_back(instance: CSTL_UTF16StringRef) -> *mut char16_t;
2514}
2515unsafe extern "C" {
2516 #[doc = " Returns a const pointer to the last character.\n\n If `CSTL_u16string_empty(instance) == true` the behavior is undefined.\n"]
2517 pub fn CSTL_u16string_const_back(instance: CSTL_UTF16StringCRef) -> *const char16_t;
2518}
2519unsafe extern "C" {
2520 #[doc = " Returns a pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_u16string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_u16string_data(instance), CSTL_u16string_data(instance) + size]`\n is always valid.\n\n The array may be mutated through the returned pointer excluding\n the past-the-end null terminator.\n"]
2521 pub fn CSTL_u16string_data(instance: CSTL_UTF16StringRef) -> *mut char16_t;
2522}
2523unsafe extern "C" {
2524 #[doc = " Returns a const pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_u16string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_u16string_c_str(instance), CSTL_u16string_c_str(instance) + size]`\n is always valid.\n"]
2525 pub fn CSTL_u16string_c_str(instance: CSTL_UTF16StringCRef) -> *const char16_t;
2526}
2527unsafe extern "C" {
2528 #[doc = " Returns an iterator (pointer) to the first character of the string.\n\n If `CSTL_u16string_empty(instance) == true` then\n `CSTL_u16string_begin(instance) == CSTL_u16string_end(instance)`.\n"]
2529 pub fn CSTL_u16string_begin(instance: CSTL_UTF16StringRef) -> *mut char16_t;
2530}
2531unsafe extern "C" {
2532 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_u16string_empty(instance) == true` then\n `CSTL_u16string_begin(instance) == CSTL_u16string_end(instance)`.\n"]
2533 pub fn CSTL_u16string_const_begin(instance: CSTL_UTF16StringCRef) -> *const char16_t;
2534}
2535unsafe extern "C" {
2536 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_u16string_empty(instance) == true` then\n `CSTL_u16string_begin(instance) == CSTL_u16string_end(instance)`.\n"]
2537 pub fn CSTL_u16string_end(instance: CSTL_UTF16StringRef) -> *mut char16_t;
2538}
2539unsafe extern "C" {
2540 #[doc = " Returns a const iterator (pointer) past the last character of the string.\n\n If `CSTL_u16string_empty(instance) == true` then\n `CSTL_u16string_const_begin(instance) == CSTL_u16string_const_end(instance)`.\n"]
2541 pub fn CSTL_u16string_const_end(instance: CSTL_UTF16StringCRef) -> *const char16_t;
2542}
2543unsafe extern "C" {
2544 #[doc = " Returns `true` if the string is empty or `false` otherwise.\n"]
2545 pub fn CSTL_u16string_empty(instance: CSTL_UTF16StringCRef) -> bool;
2546}
2547unsafe extern "C" {
2548 #[doc = " Returns the number of characters in the string.\n"]
2549 pub fn CSTL_u16string_size(instance: CSTL_UTF16StringCRef) -> usize;
2550}
2551unsafe extern "C" {
2552 #[doc = " Returns the number of characters in the string.\n"]
2553 pub fn CSTL_u16string_length(instance: CSTL_UTF16StringCRef) -> usize;
2554}
2555unsafe extern "C" {
2556 #[doc = " Returns the total characters capacity of the string.\n"]
2557 pub fn CSTL_u16string_capacity(instance: CSTL_UTF16StringCRef) -> usize;
2558}
2559unsafe extern "C" {
2560 #[doc = " Returns the maximum possible number of characters in the string.\n"]
2561 pub fn CSTL_u16string_max_size() -> usize;
2562}
2563unsafe extern "C" {
2564 #[doc = " If `new_capacity > CSTL_u16string_capacity(instance)`, reallocates and expands\n the underlying array storage.\n\n If `new_capacity` exceeds `CSTL_u16string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
2565 pub fn CSTL_u16string_reserve(
2566 instance: CSTL_UTF16StringRef,
2567 new_capacity: usize,
2568 alloc: *mut CSTL_Alloc,
2569 ) -> bool;
2570}
2571unsafe extern "C" {
2572 #[doc = " Request removal of unused capacity.\n"]
2573 pub fn CSTL_u16string_shrink_to_fit(instance: CSTL_UTF16StringRef, alloc: *mut CSTL_Alloc);
2574}
2575unsafe extern "C" {
2576 #[doc = " Erase all characters from the string without affecting capacity.\n"]
2577 pub fn CSTL_u16string_clear(instance: CSTL_UTF16StringRef);
2578}
2579unsafe extern "C" {
2580 #[doc = " Inserts the null-terminated string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2581 pub fn CSTL_u16string_insert(
2582 instance: CSTL_UTF16StringRef,
2583 where_: *const char16_t,
2584 ptr: *const char16_t,
2585 alloc: *mut CSTL_Alloc,
2586 ) -> *mut char16_t;
2587}
2588unsafe extern "C" {
2589 #[doc = " Inserts the first `count` characters of the string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2590 pub fn CSTL_u16string_insert_n(
2591 instance: CSTL_UTF16StringRef,
2592 where_: *const char16_t,
2593 ptr: *const char16_t,
2594 count: usize,
2595 alloc: *mut CSTL_Alloc,
2596 ) -> *mut char16_t;
2597}
2598unsafe extern "C" {
2599 #[doc = " Inserts `count` copies of the character `ch` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2600 pub fn CSTL_u16string_insert_char(
2601 instance: CSTL_UTF16StringRef,
2602 where_: *const char16_t,
2603 count: usize,
2604 ch: char16_t,
2605 alloc: *mut CSTL_Alloc,
2606 ) -> *mut char16_t;
2607}
2608unsafe extern "C" {
2609 #[doc = " Inserts the string `other` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2610 pub fn CSTL_u16string_insert_str(
2611 instance: CSTL_UTF16StringRef,
2612 where_: *const char16_t,
2613 other: CSTL_UTF16StringCRef,
2614 alloc: *mut CSTL_Alloc,
2615 ) -> *mut char16_t;
2616}
2617unsafe extern "C" {
2618 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at the pointer `where` in `instance`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u16string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2619 pub fn CSTL_u16string_insert_substr(
2620 instance: CSTL_UTF16StringRef,
2621 where_: *const char16_t,
2622 other: CSTL_UTF16StringCRef,
2623 other_off: usize,
2624 count: usize,
2625 alloc: *mut CSTL_Alloc,
2626 ) -> *mut char16_t;
2627}
2628unsafe extern "C" {
2629 #[doc = " Inserts the null-terminated string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2630 pub fn CSTL_u16string_insert_at(
2631 instance: CSTL_UTF16StringRef,
2632 off: usize,
2633 ptr: *const char16_t,
2634 alloc: *mut CSTL_Alloc,
2635 ) -> bool;
2636}
2637unsafe extern "C" {
2638 #[doc = " Inserts the first `count` characters of the string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2639 pub fn CSTL_u16string_insert_n_at(
2640 instance: CSTL_UTF16StringRef,
2641 off: usize,
2642 ptr: *const char16_t,
2643 count: usize,
2644 alloc: *mut CSTL_Alloc,
2645 ) -> bool;
2646}
2647unsafe extern "C" {
2648 #[doc = " Inserts `count` copies of the character `ch` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2649 pub fn CSTL_u16string_insert_char_at(
2650 instance: CSTL_UTF16StringRef,
2651 off: usize,
2652 count: usize,
2653 ch: char16_t,
2654 alloc: *mut CSTL_Alloc,
2655 ) -> bool;
2656}
2657unsafe extern "C" {
2658 #[doc = " Inserts the string `other` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2659 pub fn CSTL_u16string_insert_str_at(
2660 instance: CSTL_UTF16StringRef,
2661 off: usize,
2662 other: CSTL_UTF16StringCRef,
2663 alloc: *mut CSTL_Alloc,
2664 ) -> bool;
2665}
2666unsafe extern "C" {
2667 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_u16string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2668 pub fn CSTL_u16string_insert_substr_at(
2669 instance: CSTL_UTF16StringRef,
2670 off: usize,
2671 other: CSTL_UTF16StringCRef,
2672 other_off: usize,
2673 count: usize,
2674 alloc: *mut CSTL_Alloc,
2675 ) -> bool;
2676}
2677unsafe extern "C" {
2678 #[doc = " Removes the character at `where` and returns a pointer following the\n removed character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
2679 pub fn CSTL_u16string_erase(
2680 instance: CSTL_UTF16StringRef,
2681 where_: *const char16_t,
2682 ) -> *mut char16_t;
2683}
2684unsafe extern "C" {
2685 #[doc = " Removes the characters in the range `[first, last)` and returns a pointer following the\n removed character.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2686 pub fn CSTL_u16string_erase_substr(
2687 instance: CSTL_UTF16StringRef,
2688 first: *const char16_t,
2689 last: *const char16_t,
2690 ) -> *mut char16_t;
2691}
2692unsafe extern "C" {
2693 #[doc = " Removes the character at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2694 pub fn CSTL_u16string_erase_at(instance: CSTL_UTF16StringRef, off: usize) -> bool;
2695}
2696unsafe extern "C" {
2697 #[doc = " Removes the substring at offset `off` in `instance` with the length given by `count`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2698 pub fn CSTL_u16string_erase_substr_at(
2699 instance: CSTL_UTF16StringRef,
2700 off: usize,
2701 count: usize,
2702 ) -> bool;
2703}
2704unsafe extern "C" {
2705 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_u16string_size(instance) == CSTL_u16string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
2706 pub fn CSTL_u16string_push_back(
2707 instance: CSTL_UTF16StringRef,
2708 ch: char16_t,
2709 alloc: *mut CSTL_Alloc,
2710 ) -> bool;
2711}
2712unsafe extern "C" {
2713 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_u16string_size(instance) == CSTL_u16string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
2714 pub fn CSTL_u16string_pop_back(instance: CSTL_UTF16StringRef);
2715}
2716unsafe extern "C" {
2717 #[doc = " Appends the null-terminated string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2718 pub fn CSTL_u16string_append(
2719 instance: CSTL_UTF16StringRef,
2720 ptr: *const char16_t,
2721 alloc: *mut CSTL_Alloc,
2722 ) -> bool;
2723}
2724unsafe extern "C" {
2725 #[doc = " Appends the first `count` characters of the string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2726 pub fn CSTL_u16string_append_n(
2727 instance: CSTL_UTF16StringRef,
2728 ptr: *const char16_t,
2729 count: usize,
2730 alloc: *mut CSTL_Alloc,
2731 ) -> bool;
2732}
2733unsafe extern "C" {
2734 #[doc = " Appends `count` copies of the character `ch` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2735 pub fn CSTL_u16string_append_char(
2736 instance: CSTL_UTF16StringRef,
2737 count: usize,
2738 ch: char16_t,
2739 alloc: *mut CSTL_Alloc,
2740 ) -> bool;
2741}
2742unsafe extern "C" {
2743 #[doc = " Appends the string `other` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2744 pub fn CSTL_u16string_append_str(
2745 instance: CSTL_UTF16StringRef,
2746 other: CSTL_UTF16StringCRef,
2747 alloc: *mut CSTL_Alloc,
2748 ) -> bool;
2749}
2750unsafe extern "C" {
2751 #[doc = " Appends the substring at offset `other_off` in `other` with the length\n given by `count` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2752 pub fn CSTL_u16string_append_substr(
2753 instance: CSTL_UTF16StringRef,
2754 other: CSTL_UTF16StringCRef,
2755 other_off: usize,
2756 count: usize,
2757 alloc: *mut CSTL_Alloc,
2758 ) -> bool;
2759}
2760unsafe extern "C" {
2761 #[doc = " Replaces the characters in the range `[first, last)` with the null-terminated\n string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2762 pub fn CSTL_u16string_replace(
2763 instance: CSTL_UTF16StringRef,
2764 first: *const char16_t,
2765 last: *const char16_t,
2766 ptr: *const char16_t,
2767 alloc: *mut CSTL_Alloc,
2768 ) -> bool;
2769}
2770unsafe extern "C" {
2771 #[doc = " Replaces the characters in the range `[first, last)` with the first `count`\n characters of the string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2772 pub fn CSTL_u16string_replace_n(
2773 instance: CSTL_UTF16StringRef,
2774 first: *const char16_t,
2775 last: *const char16_t,
2776 ptr: *const char16_t,
2777 count: usize,
2778 alloc: *mut CSTL_Alloc,
2779 ) -> bool;
2780}
2781unsafe extern "C" {
2782 #[doc = " Replaces the characters in the range `[first, last)` with `count` copies\n of the character `ch`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2783 pub fn CSTL_u16string_replace_char(
2784 instance: CSTL_UTF16StringRef,
2785 first: *const char16_t,
2786 last: *const char16_t,
2787 count: usize,
2788 ch: char16_t,
2789 alloc: *mut CSTL_Alloc,
2790 ) -> bool;
2791}
2792unsafe extern "C" {
2793 #[doc = " Replaces the characters in the range `[first, last)` with the string `other`.\n\n If the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2794 pub fn CSTL_u16string_replace_str(
2795 instance: CSTL_UTF16StringRef,
2796 first: *const char16_t,
2797 last: *const char16_t,
2798 other: CSTL_UTF16StringCRef,
2799 alloc: *mut CSTL_Alloc,
2800 ) -> bool;
2801}
2802unsafe extern "C" {
2803 #[doc = " Replaces the characters in the range `[first, last)` with the substring\n at offset `other_off` in `other` with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u16string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
2804 pub fn CSTL_u16string_replace_substr(
2805 instance: CSTL_UTF16StringRef,
2806 first: *const char16_t,
2807 last: *const char16_t,
2808 other: CSTL_UTF16StringCRef,
2809 other_off: usize,
2810 count: usize,
2811 alloc: *mut CSTL_Alloc,
2812 ) -> bool;
2813}
2814unsafe extern "C" {
2815 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the null-terminated string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2816 pub fn CSTL_u16string_replace_at(
2817 instance: CSTL_UTF16StringRef,
2818 off: usize,
2819 count: usize,
2820 ptr: *const char16_t,
2821 alloc: *mut CSTL_Alloc,
2822 ) -> bool;
2823}
2824unsafe extern "C" {
2825 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the first `count2` characters of the string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2826 pub fn CSTL_u16string_replace_n_at(
2827 instance: CSTL_UTF16StringRef,
2828 off: usize,
2829 count: usize,
2830 ptr: *const char16_t,
2831 count2: usize,
2832 alloc: *mut CSTL_Alloc,
2833 ) -> bool;
2834}
2835unsafe extern "C" {
2836 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with `count` copies of the character `ch`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2837 pub fn CSTL_u16string_replace_char_at(
2838 instance: CSTL_UTF16StringRef,
2839 off: usize,
2840 count: usize,
2841 count2: usize,
2842 ch: char16_t,
2843 alloc: *mut CSTL_Alloc,
2844 ) -> bool;
2845}
2846unsafe extern "C" {
2847 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the string `other`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2848 pub fn CSTL_u16string_replace_str_at(
2849 instance: CSTL_UTF16StringRef,
2850 off: usize,
2851 count: usize,
2852 other: CSTL_UTF16StringCRef,
2853 alloc: *mut CSTL_Alloc,
2854 ) -> bool;
2855}
2856unsafe extern "C" {
2857 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the substring at offset `other_off` in `other` with the length\n given by `count2`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u16string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_u16string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u16string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
2858 pub fn CSTL_u16string_replace_substr_at(
2859 instance: CSTL_UTF16StringRef,
2860 off: usize,
2861 count: usize,
2862 other: CSTL_UTF16StringCRef,
2863 other_off: usize,
2864 count2: usize,
2865 alloc: *mut CSTL_Alloc,
2866 ) -> bool;
2867}
2868unsafe extern "C" {
2869 #[doc = " Copies a substring `[off, off + count)` to character string pointed to by\n `dest`. The resulting character string is not null terminated.\n\n Returns the number of characters copied or `CSTL_string_npos` if\n `off > CSTL_u16string_size(instance)` (out of range).\n"]
2870 pub fn CSTL_u16string_copy(
2871 instance: CSTL_UTF16StringCRef,
2872 dest: *mut char16_t,
2873 count: usize,
2874 off: usize,
2875 ) -> usize;
2876}
2877unsafe extern "C" {
2878 #[doc = " Resizes the string to contain `new_size` characters, appending `ch`\n if current size is less than `new_size`.\n\n If `new_size` is greater than `CSTL_u16string_max_size()` this\n function has no effect and returns `false`, otherwise it returns `true`.\n"]
2879 pub fn CSTL_u16string_resize(
2880 instance: CSTL_UTF16StringRef,
2881 new_size: usize,
2882 ch: char16_t,
2883 alloc: *mut CSTL_Alloc,
2884 ) -> bool;
2885}
2886unsafe extern "C" {
2887 #[doc = " Find the first from offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2888 pub fn CSTL_u16string_find(
2889 instance: CSTL_UTF16StringCRef,
2890 ptr: *const char16_t,
2891 off: usize,
2892 ) -> usize;
2893}
2894unsafe extern "C" {
2895 #[doc = " Find the first from offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2896 pub fn CSTL_u16string_find_n(
2897 instance: CSTL_UTF16StringCRef,
2898 ptr: *const char16_t,
2899 off: usize,
2900 count: usize,
2901 ) -> usize;
2902}
2903unsafe extern "C" {
2904 #[doc = " Find the first from offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2905 pub fn CSTL_u16string_find_char(
2906 instance: CSTL_UTF16StringCRef,
2907 ch: char16_t,
2908 off: usize,
2909 ) -> usize;
2910}
2911unsafe extern "C" {
2912 #[doc = " Find the first from offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2913 pub fn CSTL_u16string_find_str(
2914 instance: CSTL_UTF16StringCRef,
2915 other: CSTL_UTF16StringCRef,
2916 off: usize,
2917 ) -> usize;
2918}
2919unsafe extern "C" {
2920 #[doc = " Find the last before offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2921 pub fn CSTL_u16string_rfind(
2922 instance: CSTL_UTF16StringCRef,
2923 ptr: *const char16_t,
2924 off: usize,
2925 ) -> usize;
2926}
2927unsafe extern "C" {
2928 #[doc = " Find the last before offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2929 pub fn CSTL_u16string_rfind_n(
2930 instance: CSTL_UTF16StringCRef,
2931 ptr: *const char16_t,
2932 off: usize,
2933 count: usize,
2934 ) -> usize;
2935}
2936unsafe extern "C" {
2937 #[doc = " Find the last before offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2938 pub fn CSTL_u16string_rfind_char(
2939 instance: CSTL_UTF16StringCRef,
2940 ch: char16_t,
2941 off: usize,
2942 ) -> usize;
2943}
2944unsafe extern "C" {
2945 #[doc = " Find the last before offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
2946 pub fn CSTL_u16string_rfind_str(
2947 instance: CSTL_UTF16StringCRef,
2948 other: CSTL_UTF16StringCRef,
2949 off: usize,
2950 ) -> usize;
2951}
2952unsafe extern "C" {
2953 #[doc = " Compare two null-terminated character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_UTF16String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
2954 pub fn CSTL_u16string_compare(
2955 left: *const char16_t,
2956 right: *const char16_t,
2957 ) -> ::std::os::raw::c_int;
2958}
2959unsafe extern "C" {
2960 #[doc = " Compare an explicit length character sequence with a null-terminated one.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n To compare an explicit length `left` and a null-terminated `right`,\n swap them and negate the result: `-CSTL_u16string_compare_n(right, left, left_count)`.\n\n There is no `CSTL_UTF16String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
2961 pub fn CSTL_u16string_compare_n(
2962 left: *const char16_t,
2963 right: *const char16_t,
2964 right_count: usize,
2965 ) -> ::std::os::raw::c_int;
2966}
2967unsafe extern "C" {
2968 #[doc = " Compare two explicit length character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_UTF16String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
2969 pub fn CSTL_u16string_compare_nn(
2970 left: *const char16_t,
2971 left_count: usize,
2972 right: *const char16_t,
2973 right_count: usize,
2974 ) -> ::std::os::raw::c_int;
2975}
2976#[doc = " STL ABI `std::basic_string` layout.\n\n Does not include the allocator, which nonetheless is a part of the `std::basic_string`\n structure! You are responsible for including it, since it can take on any form.\n\n Do not manipulate the members directly, use the associated functions!\n"]
2977#[repr(C)]
2978#[derive(Copy, Clone)]
2979pub struct CSTL_UTF32StringVal {
2980 pub bx: CSTL_UTF32StringUnion,
2981 pub size: usize,
2982 pub res: usize,
2983}
2984#[repr(C)]
2985#[derive(Copy, Clone)]
2986pub union CSTL_UTF32StringUnion {
2987 pub buf: [char32_t; 4usize],
2988 pub ptr: *mut char32_t,
2989}
2990#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2991const _: () = {
2992 ["Size of CSTL_UTF32StringUnion"][::std::mem::size_of::<CSTL_UTF32StringUnion>() - 16usize];
2993 ["Alignment of CSTL_UTF32StringUnion"]
2994 [::std::mem::align_of::<CSTL_UTF32StringUnion>() - 8usize];
2995 ["Offset of field: CSTL_UTF32StringUnion::buf"]
2996 [::std::mem::offset_of!(CSTL_UTF32StringUnion, buf) - 0usize];
2997 ["Offset of field: CSTL_UTF32StringUnion::ptr"]
2998 [::std::mem::offset_of!(CSTL_UTF32StringUnion, ptr) - 0usize];
2999};
3000#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3001const _: () = {
3002 ["Size of CSTL_UTF32StringVal"][::std::mem::size_of::<CSTL_UTF32StringVal>() - 32usize];
3003 ["Alignment of CSTL_UTF32StringVal"][::std::mem::align_of::<CSTL_UTF32StringVal>() - 8usize];
3004 ["Offset of field: CSTL_UTF32StringVal::bx"]
3005 [::std::mem::offset_of!(CSTL_UTF32StringVal, bx) - 0usize];
3006 ["Offset of field: CSTL_UTF32StringVal::size"]
3007 [::std::mem::offset_of!(CSTL_UTF32StringVal, size) - 16usize];
3008 ["Offset of field: CSTL_UTF32StringVal::res"]
3009 [::std::mem::offset_of!(CSTL_UTF32StringVal, res) - 24usize];
3010};
3011#[doc = " Reference to a mutable `CSTL_UTF32StringVal`.\n\n Must not be null.\n"]
3012pub type CSTL_UTF32StringRef = *mut CSTL_UTF32StringVal;
3013#[doc = " Reference to a const `CSTL_UTF32StringVal`.\n\n Must not be null.\n"]
3014pub type CSTL_UTF32StringCRef = *const CSTL_UTF32StringVal;
3015unsafe extern "C" {
3016 #[doc = " Initializes the string, but does not allocate any memory.\n\n An initialized string can be trivially destroyed without leaks as long\n as its owned string is small enough to be inline (smaller than CSTL_string_alloc_mask).\n\n Re-initializing a string with a backing memory allocation will leak the old\n memory allocation.\n"]
3017 pub fn CSTL_u32string_construct(new_instance: *mut CSTL_UTF32StringVal);
3018}
3019unsafe extern "C" {
3020 #[doc = " Destroys the string, freeing the backing storage if necessary.\n"]
3021 pub fn CSTL_u32string_destroy(instance: CSTL_UTF32StringRef, alloc: *mut CSTL_Alloc);
3022}
3023unsafe extern "C" {
3024 #[doc = " Initializes the string with the substring at offset `other_off`\n in `other` with the length given by `count`.\n\n If `new_instance == NULL` or if `other_off` is outside of the range\n `[other, other + CSTL_u32string_size(other)]` returns `false` and does nothing,\n otherwise it returns `true`.\n\n If `new_instance == other` the substring operation is performed in-place without\n de-initializing `other`.\n\n Remember that re-initializing a different string with a backing memory allocation\n will leak the old memory allocation.\n"]
3025 pub fn CSTL_u32string_substr(
3026 new_instance: *mut CSTL_UTF32StringVal,
3027 other: CSTL_UTF32StringCRef,
3028 other_off: usize,
3029 count: usize,
3030 alloc: *mut CSTL_Alloc,
3031 ) -> bool;
3032}
3033unsafe extern "C" {
3034 #[doc = " Replaces the contents of `instance` with the null-terminated string at `ptr`.\n\n If the length of the string at `ptr` is greater than `CSTL_u32string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
3035 pub fn CSTL_u32string_assign(
3036 instance: CSTL_UTF32StringRef,
3037 ptr: *const char32_t,
3038 alloc: *mut CSTL_Alloc,
3039 ) -> bool;
3040}
3041unsafe extern "C" {
3042 #[doc = " Replaces the contents of `instance` with the first `count` characters of the string at `ptr`.\n\n If `n` is greater than `CSTL_u32string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
3043 pub fn CSTL_u32string_assign_n(
3044 instance: CSTL_UTF32StringRef,
3045 ptr: *const char32_t,
3046 count: usize,
3047 alloc: *mut CSTL_Alloc,
3048 ) -> bool;
3049}
3050unsafe extern "C" {
3051 #[doc = " Replaces the contents of `instance` with the `count` copies of the character `ch`.\n\n If `count` is greater than `CSTL_u32string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
3052 pub fn CSTL_u32string_assign_char(
3053 instance: CSTL_UTF32StringRef,
3054 count: usize,
3055 ch: char32_t,
3056 alloc: *mut CSTL_Alloc,
3057 ) -> bool;
3058}
3059unsafe extern "C" {
3060 #[doc = " Replaces the contents of `instance` with the substring at offset `other_off` in `other`\n with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u32string_size(other)]` returns\n `false` and does nothing, otherwise it returns `true`.\n"]
3061 pub fn CSTL_u32string_assign_substr(
3062 instance: CSTL_UTF32StringRef,
3063 other: CSTL_UTF32StringCRef,
3064 other_off: usize,
3065 count: usize,
3066 alloc: *mut CSTL_Alloc,
3067 ) -> bool;
3068}
3069unsafe extern "C" {
3070 #[doc = " Replaces the contents of `instance` with the contents of `other_instance`.\n\n If `propagate_alloc == true && alloc != other_alloc` then storage\n is freed with `alloc` and allocated again with `other_alloc` before contents\n are copied. Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false` `instance` keeps using `alloc` as its allocator,\n potentially reusing its storage.\n\n You are responsible for replacing the allocator outside of `CSTL_UTF32StringVal` if applicable.\n"]
3071 pub fn CSTL_u32string_copy_assign(
3072 instance: CSTL_UTF32StringRef,
3073 alloc: *mut CSTL_Alloc,
3074 other_instance: CSTL_UTF32StringCRef,
3075 other_alloc: *mut CSTL_Alloc,
3076 propagate_alloc: bool,
3077 );
3078}
3079unsafe extern "C" {
3080 #[doc = " Moves the contents of `other_instance` to the contents of `instance`.\n\n If `propagate_alloc == true` storage is replaced with storage of `other_instance`.\n Then, `instance` uses `other_alloc` as its allocator.\n\n If `propagate_alloc == false && alloc != other_alloc` then storage is reused\n and individual characters of `other` are moved in. Then, `instance` uses `alloc` as its allocator.\n\n You are responsible for replacing the allocator outside of `CSTL_UTF32StringVal` if applicable.\n"]
3081 pub fn CSTL_u32string_move_assign(
3082 instance: CSTL_UTF32StringRef,
3083 alloc: *mut CSTL_Alloc,
3084 other_instance: CSTL_UTF32StringRef,
3085 other_alloc: *mut CSTL_Alloc,
3086 propagate_alloc: bool,
3087 );
3088}
3089unsafe extern "C" {
3090 #[doc = " Swaps string contents.\n\n You are responsible for swapping the allocators.\n"]
3091 pub fn CSTL_u32string_swap(instance: CSTL_UTF32StringRef, other_instance: CSTL_UTF32StringRef);
3092}
3093unsafe extern "C" {
3094 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_u32string_length(instance)` the behavior is undefined.\n"]
3095 pub fn CSTL_u32string_index(instance: CSTL_UTF32StringRef, pos: usize) -> *mut char32_t;
3096}
3097unsafe extern "C" {
3098 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_u32string_length(instance)` the behavior is undefined.\n"]
3099 pub fn CSTL_u32string_const_index(
3100 instance: CSTL_UTF32StringCRef,
3101 pos: usize,
3102 ) -> *const char32_t;
3103}
3104unsafe extern "C" {
3105 #[doc = " Returns a pointer to the character at `pos`.\n\n If `pos >= CSTL_u32string_length(instance)` a null pointer is returned.\n"]
3106 pub fn CSTL_u32string_at(instance: CSTL_UTF32StringRef, pos: usize) -> *mut char32_t;
3107}
3108unsafe extern "C" {
3109 #[doc = " Returns a const pointer to the character at `pos`.\n\n If `pos >= CSTL_u32string_length(instance)` a null pointer is returned.\n"]
3110 pub fn CSTL_u32string_const_at(instance: CSTL_UTF32StringCRef, pos: usize) -> *const char32_t;
3111}
3112unsafe extern "C" {
3113 #[doc = " Returns a pointer to the first character.\n\n If `CSTL_u32string_empty(instance) == true` the behavior is undefined.\n"]
3114 pub fn CSTL_u32string_front(instance: CSTL_UTF32StringRef) -> *mut char32_t;
3115}
3116unsafe extern "C" {
3117 #[doc = " Returns a const pointer to the first character.\n\n If `CSTL_u32string_empty(instance) == true` the behavior is undefined.\n"]
3118 pub fn CSTL_u32string_const_front(instance: CSTL_UTF32StringCRef) -> *const char32_t;
3119}
3120unsafe extern "C" {
3121 #[doc = " Returns a pointer to the last character.\n\n If `CSTL_u32string_empty(instance) == true` the behavior is undefined.\n"]
3122 pub fn CSTL_u32string_back(instance: CSTL_UTF32StringRef) -> *mut char32_t;
3123}
3124unsafe extern "C" {
3125 #[doc = " Returns a const pointer to the last character.\n\n If `CSTL_u32string_empty(instance) == true` the behavior is undefined.\n"]
3126 pub fn CSTL_u32string_const_back(instance: CSTL_UTF32StringCRef) -> *const char32_t;
3127}
3128unsafe extern "C" {
3129 #[doc = " Returns a pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_u32string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_u32string_data(instance), CSTL_u32string_data(instance) + size]`\n is always valid.\n\n The array may be mutated through the returned pointer excluding\n the past-the-end null terminator.\n"]
3130 pub fn CSTL_u32string_data(instance: CSTL_UTF32StringRef) -> *mut char32_t;
3131}
3132unsafe extern "C" {
3133 #[doc = " Returns a const pointer to the underlying null-terminated array\n serving as character storage.\n\n If `CSTL_u32string_empty(instance) == true` the pointer is still\n valid and points to a single null character.\n\n The range `[CSTL_u32string_c_str(instance), CSTL_u32string_c_str(instance) + size]`\n is always valid.\n"]
3134 pub fn CSTL_u32string_c_str(instance: CSTL_UTF32StringCRef) -> *const char32_t;
3135}
3136unsafe extern "C" {
3137 #[doc = " Returns an iterator (pointer) to the first character of the string.\n\n If `CSTL_u32string_empty(instance) == true` then\n `CSTL_u32string_begin(instance) == CSTL_u32string_end(instance)`.\n"]
3138 pub fn CSTL_u32string_begin(instance: CSTL_UTF32StringRef) -> *mut char32_t;
3139}
3140unsafe extern "C" {
3141 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_u32string_empty(instance) == true` then\n `CSTL_u32string_begin(instance) == CSTL_u32string_end(instance)`.\n"]
3142 pub fn CSTL_u32string_const_begin(instance: CSTL_UTF32StringCRef) -> *const char32_t;
3143}
3144unsafe extern "C" {
3145 #[doc = " Returns an iterator (pointer) past the last character of the string.\n\n If `CSTL_u32string_empty(instance) == true` then\n `CSTL_u32string_begin(instance) == CSTL_u32string_end(instance)`.\n"]
3146 pub fn CSTL_u32string_end(instance: CSTL_UTF32StringRef) -> *mut char32_t;
3147}
3148unsafe extern "C" {
3149 #[doc = " Returns a const iterator (pointer) past the last character of the string.\n\n If `CSTL_u32string_empty(instance) == true` then\n `CSTL_u32string_const_begin(instance) == CSTL_u32string_const_end(instance)`.\n"]
3150 pub fn CSTL_u32string_const_end(instance: CSTL_UTF32StringCRef) -> *const char32_t;
3151}
3152unsafe extern "C" {
3153 #[doc = " Returns `true` if the string is empty or `false` otherwise.\n"]
3154 pub fn CSTL_u32string_empty(instance: CSTL_UTF32StringCRef) -> bool;
3155}
3156unsafe extern "C" {
3157 #[doc = " Returns the number of characters in the string.\n"]
3158 pub fn CSTL_u32string_size(instance: CSTL_UTF32StringCRef) -> usize;
3159}
3160unsafe extern "C" {
3161 #[doc = " Returns the number of characters in the string.\n"]
3162 pub fn CSTL_u32string_length(instance: CSTL_UTF32StringCRef) -> usize;
3163}
3164unsafe extern "C" {
3165 #[doc = " Returns the total characters capacity of the string.\n"]
3166 pub fn CSTL_u32string_capacity(instance: CSTL_UTF32StringCRef) -> usize;
3167}
3168unsafe extern "C" {
3169 #[doc = " Returns the maximum possible number of characters in the string.\n"]
3170 pub fn CSTL_u32string_max_size() -> usize;
3171}
3172unsafe extern "C" {
3173 #[doc = " If `new_capacity > CSTL_u32string_capacity(instance)`, reallocates and expands\n the underlying array storage.\n\n If `new_capacity` exceeds `CSTL_u32string_max_size()` this function has no effect\n and returns `false`, otherwise it returns `true`.\n"]
3174 pub fn CSTL_u32string_reserve(
3175 instance: CSTL_UTF32StringRef,
3176 new_capacity: usize,
3177 alloc: *mut CSTL_Alloc,
3178 ) -> bool;
3179}
3180unsafe extern "C" {
3181 #[doc = " Request removal of unused capacity.\n"]
3182 pub fn CSTL_u32string_shrink_to_fit(instance: CSTL_UTF32StringRef, alloc: *mut CSTL_Alloc);
3183}
3184unsafe extern "C" {
3185 #[doc = " Erase all characters from the string without affecting capacity.\n"]
3186 pub fn CSTL_u32string_clear(instance: CSTL_UTF32StringRef);
3187}
3188unsafe extern "C" {
3189 #[doc = " Inserts the null-terminated string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
3190 pub fn CSTL_u32string_insert(
3191 instance: CSTL_UTF32StringRef,
3192 where_: *const char32_t,
3193 ptr: *const char32_t,
3194 alloc: *mut CSTL_Alloc,
3195 ) -> *mut char32_t;
3196}
3197unsafe extern "C" {
3198 #[doc = " Inserts the first `count` characters of the string at `ptr` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
3199 pub fn CSTL_u32string_insert_n(
3200 instance: CSTL_UTF32StringRef,
3201 where_: *const char32_t,
3202 ptr: *const char32_t,
3203 count: usize,
3204 alloc: *mut CSTL_Alloc,
3205 ) -> *mut char32_t;
3206}
3207unsafe extern "C" {
3208 #[doc = " Inserts `count` copies of the character `ch` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
3209 pub fn CSTL_u32string_insert_char(
3210 instance: CSTL_UTF32StringRef,
3211 where_: *const char32_t,
3212 count: usize,
3213 ch: char32_t,
3214 alloc: *mut CSTL_Alloc,
3215 ) -> *mut char32_t;
3216}
3217unsafe extern "C" {
3218 #[doc = " Inserts the string `other` at the pointer `where` in `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
3219 pub fn CSTL_u32string_insert_str(
3220 instance: CSTL_UTF32StringRef,
3221 where_: *const char32_t,
3222 other: CSTL_UTF32StringCRef,
3223 alloc: *mut CSTL_Alloc,
3224 ) -> *mut char32_t;
3225}
3226unsafe extern "C" {
3227 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at the pointer `where` in `instance`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u32string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `NULL`, otherwise it returns a pointer\n to the first inserted character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
3228 pub fn CSTL_u32string_insert_substr(
3229 instance: CSTL_UTF32StringRef,
3230 where_: *const char32_t,
3231 other: CSTL_UTF32StringCRef,
3232 other_off: usize,
3233 count: usize,
3234 alloc: *mut CSTL_Alloc,
3235 ) -> *mut char32_t;
3236}
3237unsafe extern "C" {
3238 #[doc = " Inserts the null-terminated string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3239 pub fn CSTL_u32string_insert_at(
3240 instance: CSTL_UTF32StringRef,
3241 off: usize,
3242 ptr: *const char32_t,
3243 alloc: *mut CSTL_Alloc,
3244 ) -> bool;
3245}
3246unsafe extern "C" {
3247 #[doc = " Inserts the first `count` characters of the string at `ptr` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3248 pub fn CSTL_u32string_insert_n_at(
3249 instance: CSTL_UTF32StringRef,
3250 off: usize,
3251 ptr: *const char32_t,
3252 count: usize,
3253 alloc: *mut CSTL_Alloc,
3254 ) -> bool;
3255}
3256unsafe extern "C" {
3257 #[doc = " Inserts `count` copies of the character `ch` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3258 pub fn CSTL_u32string_insert_char_at(
3259 instance: CSTL_UTF32StringRef,
3260 off: usize,
3261 count: usize,
3262 ch: char32_t,
3263 alloc: *mut CSTL_Alloc,
3264 ) -> bool;
3265}
3266unsafe extern "C" {
3267 #[doc = " Inserts the string `other` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3268 pub fn CSTL_u32string_insert_str_at(
3269 instance: CSTL_UTF32StringRef,
3270 off: usize,
3271 other: CSTL_UTF32StringCRef,
3272 alloc: *mut CSTL_Alloc,
3273 ) -> bool;
3274}
3275unsafe extern "C" {
3276 #[doc = " Inserts the substring at offset `other_off` in `other` with the length\n given by `count` at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_u32string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3277 pub fn CSTL_u32string_insert_substr_at(
3278 instance: CSTL_UTF32StringRef,
3279 off: usize,
3280 other: CSTL_UTF32StringCRef,
3281 other_off: usize,
3282 count: usize,
3283 alloc: *mut CSTL_Alloc,
3284 ) -> bool;
3285}
3286unsafe extern "C" {
3287 #[doc = " Removes the character at `where` and returns a pointer following the\n removed character.\n\n The pointer `where` must be valid and dereferenceable on `instance`.\n"]
3288 pub fn CSTL_u32string_erase(
3289 instance: CSTL_UTF32StringRef,
3290 where_: *const char32_t,
3291 ) -> *mut char32_t;
3292}
3293unsafe extern "C" {
3294 #[doc = " Removes the characters in the range `[first, last)` and returns a pointer following the\n removed character.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
3295 pub fn CSTL_u32string_erase_substr(
3296 instance: CSTL_UTF32StringRef,
3297 first: *const char32_t,
3298 last: *const char32_t,
3299 ) -> *mut char32_t;
3300}
3301unsafe extern "C" {
3302 #[doc = " Removes the character at offset `off` in `instance`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3303 pub fn CSTL_u32string_erase_at(instance: CSTL_UTF32StringRef, off: usize) -> bool;
3304}
3305unsafe extern "C" {
3306 #[doc = " Removes the substring at offset `off` in `instance` with the length given by `count`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3307 pub fn CSTL_u32string_erase_substr_at(
3308 instance: CSTL_UTF32StringRef,
3309 off: usize,
3310 count: usize,
3311 ) -> bool;
3312}
3313unsafe extern "C" {
3314 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_u32string_size(instance) == CSTL_u32string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
3315 pub fn CSTL_u32string_push_back(
3316 instance: CSTL_UTF32StringRef,
3317 ch: char32_t,
3318 alloc: *mut CSTL_Alloc,
3319 ) -> bool;
3320}
3321unsafe extern "C" {
3322 #[doc = " Appends the character `ch` to the end of the string.\n\n If `CSTL_u32string_size(instance) == CSTL_u32string_max_size()` this function\n has no effect and returns `false`, otherwise it returns `true`.\n"]
3323 pub fn CSTL_u32string_pop_back(instance: CSTL_UTF32StringRef);
3324}
3325unsafe extern "C" {
3326 #[doc = " Appends the null-terminated string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3327 pub fn CSTL_u32string_append(
3328 instance: CSTL_UTF32StringRef,
3329 ptr: *const char32_t,
3330 alloc: *mut CSTL_Alloc,
3331 ) -> bool;
3332}
3333unsafe extern "C" {
3334 #[doc = " Appends the first `count` characters of the string at `ptr` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3335 pub fn CSTL_u32string_append_n(
3336 instance: CSTL_UTF32StringRef,
3337 ptr: *const char32_t,
3338 count: usize,
3339 alloc: *mut CSTL_Alloc,
3340 ) -> bool;
3341}
3342unsafe extern "C" {
3343 #[doc = " Appends `count` copies of the character `ch` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3344 pub fn CSTL_u32string_append_char(
3345 instance: CSTL_UTF32StringRef,
3346 count: usize,
3347 ch: char32_t,
3348 alloc: *mut CSTL_Alloc,
3349 ) -> bool;
3350}
3351unsafe extern "C" {
3352 #[doc = " Appends the string `other` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3353 pub fn CSTL_u32string_append_str(
3354 instance: CSTL_UTF32StringRef,
3355 other: CSTL_UTF32StringCRef,
3356 alloc: *mut CSTL_Alloc,
3357 ) -> bool;
3358}
3359unsafe extern "C" {
3360 #[doc = " Appends the substring at offset `other_off` in `other` with the length\n given by `count` to `instance`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3361 pub fn CSTL_u32string_append_substr(
3362 instance: CSTL_UTF32StringRef,
3363 other: CSTL_UTF32StringCRef,
3364 other_off: usize,
3365 count: usize,
3366 alloc: *mut CSTL_Alloc,
3367 ) -> bool;
3368}
3369unsafe extern "C" {
3370 #[doc = " Replaces the characters in the range `[first, last)` with the null-terminated\n string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
3371 pub fn CSTL_u32string_replace(
3372 instance: CSTL_UTF32StringRef,
3373 first: *const char32_t,
3374 last: *const char32_t,
3375 ptr: *const char32_t,
3376 alloc: *mut CSTL_Alloc,
3377 ) -> bool;
3378}
3379unsafe extern "C" {
3380 #[doc = " Replaces the characters in the range `[first, last)` with the first `count`\n characters of the string at `ptr`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
3381 pub fn CSTL_u32string_replace_n(
3382 instance: CSTL_UTF32StringRef,
3383 first: *const char32_t,
3384 last: *const char32_t,
3385 ptr: *const char32_t,
3386 count: usize,
3387 alloc: *mut CSTL_Alloc,
3388 ) -> bool;
3389}
3390unsafe extern "C" {
3391 #[doc = " Replaces the characters in the range `[first, last)` with `count` copies\n of the character `ch`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
3392 pub fn CSTL_u32string_replace_char(
3393 instance: CSTL_UTF32StringRef,
3394 first: *const char32_t,
3395 last: *const char32_t,
3396 count: usize,
3397 ch: char32_t,
3398 alloc: *mut CSTL_Alloc,
3399 ) -> bool;
3400}
3401unsafe extern "C" {
3402 #[doc = " Replaces the characters in the range `[first, last)` with the string `other`.\n\n If the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
3403 pub fn CSTL_u32string_replace_str(
3404 instance: CSTL_UTF32StringRef,
3405 first: *const char32_t,
3406 last: *const char32_t,
3407 other: CSTL_UTF32StringCRef,
3408 alloc: *mut CSTL_Alloc,
3409 ) -> bool;
3410}
3411unsafe extern "C" {
3412 #[doc = " Replaces the characters in the range `[first, last)` with the substring\n at offset `other_off` in `other` with the length given by `count`.\n\n If `other_off` is outside of the range `[other, other + CSTL_u32string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n\n If `first == last`, no operation is performed.\n\n The range `[first, last)` must be valid and dereferenceable on `instance`.\n"]
3413 pub fn CSTL_u32string_replace_substr(
3414 instance: CSTL_UTF32StringRef,
3415 first: *const char32_t,
3416 last: *const char32_t,
3417 other: CSTL_UTF32StringCRef,
3418 other_off: usize,
3419 count: usize,
3420 alloc: *mut CSTL_Alloc,
3421 ) -> bool;
3422}
3423unsafe extern "C" {
3424 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the null-terminated string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3425 pub fn CSTL_u32string_replace_at(
3426 instance: CSTL_UTF32StringRef,
3427 off: usize,
3428 count: usize,
3429 ptr: *const char32_t,
3430 alloc: *mut CSTL_Alloc,
3431 ) -> bool;
3432}
3433unsafe extern "C" {
3434 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the first `count2` characters of the string at `ptr`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3435 pub fn CSTL_u32string_replace_n_at(
3436 instance: CSTL_UTF32StringRef,
3437 off: usize,
3438 count: usize,
3439 ptr: *const char32_t,
3440 count2: usize,
3441 alloc: *mut CSTL_Alloc,
3442 ) -> bool;
3443}
3444unsafe extern "C" {
3445 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with `count` copies of the character `ch`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3446 pub fn CSTL_u32string_replace_char_at(
3447 instance: CSTL_UTF32StringRef,
3448 off: usize,
3449 count: usize,
3450 count2: usize,
3451 ch: char32_t,
3452 alloc: *mut CSTL_Alloc,
3453 ) -> bool;
3454}
3455unsafe extern "C" {
3456 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the string `other`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3457 pub fn CSTL_u32string_replace_str_at(
3458 instance: CSTL_UTF32StringRef,
3459 off: usize,
3460 count: usize,
3461 other: CSTL_UTF32StringCRef,
3462 alloc: *mut CSTL_Alloc,
3463 ) -> bool;
3464}
3465unsafe extern "C" {
3466 #[doc = " Replaces the substring at offset `off` in `instance` with the length given by `count`\n with the substring at offset `other_off` in `other` with the length\n given by `count2`.\n\n If `off` is outside of the range `[instance, instance + CSTL_u32string_size(instance)]`\n or if `other_off` is outside of the range `[other, other + CSTL_u32string_size(other)]`\n or if the length of the resulting string is greater than `CSTL_u32string_max_size()`\n this function has no effect and returns `false`, otherwise it returns `true`.\n"]
3467 pub fn CSTL_u32string_replace_substr_at(
3468 instance: CSTL_UTF32StringRef,
3469 off: usize,
3470 count: usize,
3471 other: CSTL_UTF32StringCRef,
3472 other_off: usize,
3473 count2: usize,
3474 alloc: *mut CSTL_Alloc,
3475 ) -> bool;
3476}
3477unsafe extern "C" {
3478 #[doc = " Copies a substring `[off, off + count)` to character string pointed to by\n `dest`. The resulting character string is not null terminated.\n\n Returns the number of characters copied or `CSTL_string_npos` if\n `off > CSTL_u32string_size(instance)` (out of range).\n"]
3479 pub fn CSTL_u32string_copy(
3480 instance: CSTL_UTF32StringCRef,
3481 dest: *mut char32_t,
3482 count: usize,
3483 off: usize,
3484 ) -> usize;
3485}
3486unsafe extern "C" {
3487 #[doc = " Resizes the string to contain `new_size` characters, appending `ch`\n if current size is less than `new_size`.\n\n If `new_size` is greater than `CSTL_u32string_max_size()` this\n function has no effect and returns `false`, otherwise it returns `true`.\n"]
3488 pub fn CSTL_u32string_resize(
3489 instance: CSTL_UTF32StringRef,
3490 new_size: usize,
3491 ch: char32_t,
3492 alloc: *mut CSTL_Alloc,
3493 ) -> bool;
3494}
3495unsafe extern "C" {
3496 #[doc = " Find the first from offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3497 pub fn CSTL_u32string_find(
3498 instance: CSTL_UTF32StringCRef,
3499 ptr: *const char32_t,
3500 off: usize,
3501 ) -> usize;
3502}
3503unsafe extern "C" {
3504 #[doc = " Find the first from offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3505 pub fn CSTL_u32string_find_n(
3506 instance: CSTL_UTF32StringCRef,
3507 ptr: *const char32_t,
3508 off: usize,
3509 count: usize,
3510 ) -> usize;
3511}
3512unsafe extern "C" {
3513 #[doc = " Find the first from offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3514 pub fn CSTL_u32string_find_char(
3515 instance: CSTL_UTF32StringCRef,
3516 ch: char32_t,
3517 off: usize,
3518 ) -> usize;
3519}
3520unsafe extern "C" {
3521 #[doc = " Find the first from offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3522 pub fn CSTL_u32string_find_str(
3523 instance: CSTL_UTF32StringCRef,
3524 other: CSTL_UTF32StringCRef,
3525 off: usize,
3526 ) -> usize;
3527}
3528unsafe extern "C" {
3529 #[doc = " Find the last before offset `off` substring equal to the null-terminated string `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3530 pub fn CSTL_u32string_rfind(
3531 instance: CSTL_UTF32StringCRef,
3532 ptr: *const char32_t,
3533 off: usize,
3534 ) -> usize;
3535}
3536unsafe extern "C" {
3537 #[doc = " Find the last before offset `off` substring equal to the first `count` characters at `ptr`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3538 pub fn CSTL_u32string_rfind_n(
3539 instance: CSTL_UTF32StringCRef,
3540 ptr: *const char32_t,
3541 off: usize,
3542 count: usize,
3543 ) -> usize;
3544}
3545unsafe extern "C" {
3546 #[doc = " Find the last before offset `off` occurence of the character `ch`\n and return its position from the start of the string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3547 pub fn CSTL_u32string_rfind_char(
3548 instance: CSTL_UTF32StringCRef,
3549 ch: char32_t,
3550 off: usize,
3551 ) -> usize;
3552}
3553unsafe extern "C" {
3554 #[doc = " Find the last before offset `off` substring equal to the string `other`\n and return its position from the start of the original string.\n\n If no match is found `CSTL_string_npos` is returned.\n"]
3555 pub fn CSTL_u32string_rfind_str(
3556 instance: CSTL_UTF32StringCRef,
3557 other: CSTL_UTF32StringCRef,
3558 off: usize,
3559 ) -> usize;
3560}
3561unsafe extern "C" {
3562 #[doc = " Compare two null-terminated character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_UTF32String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
3563 pub fn CSTL_u32string_compare(
3564 left: *const char32_t,
3565 right: *const char32_t,
3566 ) -> ::std::os::raw::c_int;
3567}
3568unsafe extern "C" {
3569 #[doc = " Compare an explicit length character sequence with a null-terminated one.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n To compare an explicit length `left` and a null-terminated `right`,\n swap them and negate the result: `-CSTL_u32string_compare_n(right, left, left_count)`.\n\n There is no `CSTL_UTF32String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
3570 pub fn CSTL_u32string_compare_n(
3571 left: *const char32_t,
3572 right: *const char32_t,
3573 right_count: usize,
3574 ) -> ::std::os::raw::c_int;
3575}
3576unsafe extern "C" {
3577 #[doc = " Compare two explicit length character sequences.\n\n The return value is negative if `left` compares less than `right`,\n positive if it compares greater and zero if `left` and `right`\n compare equal.\n\n There is no `CSTL_UTF32String` version of this function as the return\n value does not allow for reporting out of bounds errors.\n"]
3578 pub fn CSTL_u32string_compare_nn(
3579 left: *const char32_t,
3580 left_count: usize,
3581 right: *const char32_t,
3582 right_count: usize,
3583 ) -> ::std::os::raw::c_int;
3584}