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