utf8proc_sys/
generated.rs

1/* automatically generated by rust-bindgen 0.72.0 */
2
3#[repr(C)]
4#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub struct __BindgenBitfieldUnit<Storage> {
6    storage: Storage,
7}
8impl<Storage> __BindgenBitfieldUnit<Storage> {
9    #[inline]
10    pub const fn new(storage: Storage) -> Self {
11        Self { storage }
12    }
13}
14impl<Storage> __BindgenBitfieldUnit<Storage>
15where
16    Storage: AsRef<[u8]> + AsMut<[u8]>,
17{
18    #[inline]
19    fn extract_bit(byte: u8, index: usize) -> bool {
20        let bit_index = if cfg!(target_endian = "big") {
21            7 - (index % 8)
22        } else {
23            index % 8
24        };
25        let mask = 1 << bit_index;
26        byte & mask == mask
27    }
28    #[inline]
29    pub fn get_bit(&self, index: usize) -> bool {
30        debug_assert!(index / 8 < self.storage.as_ref().len());
31        let byte_index = index / 8;
32        let byte = self.storage.as_ref()[byte_index];
33        Self::extract_bit(byte, index)
34    }
35    #[inline]
36    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
37        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
38        let byte_index = index / 8;
39        let byte = unsafe { *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) };
40        Self::extract_bit(byte, index)
41    }
42    #[inline]
43    fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
44        let bit_index = if cfg!(target_endian = "big") {
45            7 - (index % 8)
46        } else {
47            index % 8
48        };
49        let mask = 1 << bit_index;
50        if val { byte | mask } else { byte & !mask }
51    }
52    #[inline]
53    pub fn set_bit(&mut self, index: usize, val: bool) {
54        debug_assert!(index / 8 < self.storage.as_ref().len());
55        let byte_index = index / 8;
56        let byte = &mut self.storage.as_mut()[byte_index];
57        *byte = Self::change_bit(*byte, index, val);
58    }
59    #[inline]
60    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
61        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
62        let byte_index = index / 8;
63        let byte = unsafe { (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) };
64        unsafe { *byte = Self::change_bit(*byte, index, val) };
65    }
66    #[inline]
67    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
68        debug_assert!(bit_width <= 64);
69        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
70        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
71        let mut val = 0;
72        for i in 0..(bit_width as usize) {
73            if self.get_bit(i + bit_offset) {
74                let index = if cfg!(target_endian = "big") {
75                    bit_width as usize - 1 - i
76                } else {
77                    i
78                };
79                val |= 1 << index;
80            }
81        }
82        val
83    }
84    #[inline]
85    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
86        debug_assert!(bit_width <= 64);
87        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
88        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
89        let mut val = 0;
90        for i in 0..(bit_width as usize) {
91            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
92                let index = if cfg!(target_endian = "big") {
93                    bit_width as usize - 1 - i
94                } else {
95                    i
96                };
97                val |= 1 << index;
98            }
99        }
100        val
101    }
102    #[inline]
103    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
104        debug_assert!(bit_width <= 64);
105        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
106        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
107        for i in 0..(bit_width as usize) {
108            let mask = 1 << i;
109            let val_bit_is_set = val & mask == mask;
110            let index = if cfg!(target_endian = "big") {
111                bit_width as usize - 1 - i
112            } else {
113                i
114            };
115            self.set_bit(index + bit_offset, val_bit_is_set);
116        }
117    }
118    #[inline]
119    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
120        debug_assert!(bit_width <= 64);
121        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
122        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
123        for i in 0..(bit_width as usize) {
124            let mask = 1 << i;
125            let val_bit_is_set = val & mask == mask;
126            let index = if cfg!(target_endian = "big") {
127                bit_width as usize - 1 - i
128            } else {
129                i
130            };
131            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
132        }
133    }
134}
135pub type utf8proc_int8_t = i8;
136pub type utf8proc_uint8_t = u8;
137pub type utf8proc_int16_t = i16;
138pub type utf8proc_uint16_t = u16;
139pub type utf8proc_int32_t = i32;
140pub type utf8proc_uint32_t = u32;
141pub type utf8proc_size_t = usize;
142pub type utf8proc_ssize_t = isize;
143pub type utf8proc_bool = bool;
144impl utf8proc_option_t {
145    #[doc = " The given UTF-8 input is NULL terminated."]
146    pub const UTF8PROC_NULLTERM: utf8proc_option_t = utf8proc_option_t(1);
147    #[doc = " Unicode Versioning Stability has to be respected."]
148    pub const UTF8PROC_STABLE: utf8proc_option_t = utf8proc_option_t(2);
149    #[doc = " Compatibility decomposition (i.e. formatting information is lost)."]
150    pub const UTF8PROC_COMPAT: utf8proc_option_t = utf8proc_option_t(4);
151    #[doc = " Return a result with decomposed characters."]
152    pub const UTF8PROC_COMPOSE: utf8proc_option_t = utf8proc_option_t(8);
153    #[doc = " Return a result with decomposed characters."]
154    pub const UTF8PROC_DECOMPOSE: utf8proc_option_t = utf8proc_option_t(16);
155    #[doc = " Strip \"default ignorable characters\" such as SOFT-HYPHEN or ZERO-WIDTH-SPACE."]
156    pub const UTF8PROC_IGNORE: utf8proc_option_t = utf8proc_option_t(32);
157    #[doc = " Return an error, if the input contains unassigned codepoints."]
158    pub const UTF8PROC_REJECTNA: utf8proc_option_t = utf8proc_option_t(64);
159    #[doc = " Indicating that NLF-sequences (LF, CRLF, CR, NEL) are representing a\n line break, and should be converted to the codepoint for line\n separation (LS)."]
160    pub const UTF8PROC_NLF2LS: utf8proc_option_t = utf8proc_option_t(128);
161    #[doc = " Indicating that NLF-sequences are representing a paragraph break, and\n should be converted to the codepoint for paragraph separation\n (PS)."]
162    pub const UTF8PROC_NLF2PS: utf8proc_option_t = utf8proc_option_t(256);
163    #[doc = " Indicating that the meaning of NLF-sequences is unknown."]
164    pub const UTF8PROC_NLF2LF: utf8proc_option_t = utf8proc_option_t(384);
165    #[doc = " Strips and/or convers control characters.\n\n NLF-sequences are transformed into space, except if one of the\n NLF2LS/PS/LF options is given. HorizontalTab (HT) and FormFeed (FF)\n are treated as a NLF-sequence in this case.  All other control\n characters are simply removed."]
166    pub const UTF8PROC_STRIPCC: utf8proc_option_t = utf8proc_option_t(512);
167    #[doc = " Performs unicode case folding, to be able to do a case-insensitive\n string comparison."]
168    pub const UTF8PROC_CASEFOLD: utf8proc_option_t = utf8proc_option_t(1024);
169    #[doc = " Inserts 0xFF bytes at the beginning of each sequence which is\n representing a single grapheme cluster (see UAX#29)."]
170    pub const UTF8PROC_CHARBOUND: utf8proc_option_t = utf8proc_option_t(2048);
171    #[doc = " Lumps certain characters together.\n\n E.g. HYPHEN U+2010 and MINUS U+2212 to ASCII \"-\". See lump.md for details.\n\n If NLF2LF is set, this includes a transformation of paragraph and\n line separators to ASCII line-feed (LF)."]
172    pub const UTF8PROC_LUMP: utf8proc_option_t = utf8proc_option_t(4096);
173    #[doc = " Strips all character markings.\n\n This includes non-spacing, spacing and enclosing (i.e. accents).\n @note This option works only with @ref UTF8PROC_COMPOSE or\n       @ref UTF8PROC_DECOMPOSE"]
174    pub const UTF8PROC_STRIPMARK: utf8proc_option_t = utf8proc_option_t(8192);
175    #[doc = " Strip unassigned codepoints."]
176    pub const UTF8PROC_STRIPNA: utf8proc_option_t = utf8proc_option_t(16384);
177}
178impl ::std::ops::BitOr<utf8proc_option_t> for utf8proc_option_t {
179    type Output = Self;
180    #[inline]
181    fn bitor(self, other: Self) -> Self {
182        utf8proc_option_t(self.0 | other.0)
183    }
184}
185impl ::std::ops::BitOrAssign for utf8proc_option_t {
186    #[inline]
187    fn bitor_assign(&mut self, rhs: utf8proc_option_t) {
188        self.0 |= rhs.0;
189    }
190}
191impl ::std::ops::BitAnd<utf8proc_option_t> for utf8proc_option_t {
192    type Output = Self;
193    #[inline]
194    fn bitand(self, other: Self) -> Self {
195        utf8proc_option_t(self.0 & other.0)
196    }
197}
198impl ::std::ops::BitAndAssign for utf8proc_option_t {
199    #[inline]
200    fn bitand_assign(&mut self, rhs: utf8proc_option_t) {
201        self.0 &= rhs.0;
202    }
203}
204#[repr(transparent)]
205#[doc = " Option flags used by several functions in the library."]
206#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
207pub struct utf8proc_option_t(pub ::std::os::raw::c_uint);
208#[doc = " Holds the value of a property."]
209pub type utf8proc_propval_t = utf8proc_int16_t;
210#[doc = " Struct containing information about a codepoint."]
211#[repr(C)]
212#[repr(align(4))]
213#[derive(Debug, Copy, Clone)]
214pub struct utf8proc_property_struct {
215    #[doc = " Unicode category.\n @see utf8proc_category_t."]
216    pub category: utf8proc_propval_t,
217    pub combining_class: utf8proc_propval_t,
218    #[doc = " Bidirectional class.\n @see utf8proc_bidi_class_t."]
219    pub bidi_class: utf8proc_propval_t,
220    #[doc = " @anchor Decomposition type.\n @see utf8proc_decomp_type_t."]
221    pub decomp_type: utf8proc_propval_t,
222    pub decomp_seqindex: utf8proc_uint16_t,
223    pub casefold_seqindex: utf8proc_uint16_t,
224    pub uppercase_seqindex: utf8proc_uint16_t,
225    pub lowercase_seqindex: utf8proc_uint16_t,
226    pub titlecase_seqindex: utf8proc_uint16_t,
227    pub _bitfield_align_1: [u16; 0],
228    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
229    pub __bindgen_padding_0: u16,
230}
231#[allow(clippy::unnecessary_operation, clippy::identity_op)]
232const _: () = {
233    ["Size of utf8proc_property_struct"][::std::mem::size_of::<utf8proc_property_struct>() - 24usize];
234    ["Alignment of utf8proc_property_struct"][::std::mem::align_of::<utf8proc_property_struct>() - 4usize];
235    ["Offset of field: utf8proc_property_struct::category"]
236        [::std::mem::offset_of!(utf8proc_property_struct, category) - 0usize];
237    ["Offset of field: utf8proc_property_struct::combining_class"]
238        [::std::mem::offset_of!(utf8proc_property_struct, combining_class) - 2usize];
239    ["Offset of field: utf8proc_property_struct::bidi_class"]
240        [::std::mem::offset_of!(utf8proc_property_struct, bidi_class) - 4usize];
241    ["Offset of field: utf8proc_property_struct::decomp_type"]
242        [::std::mem::offset_of!(utf8proc_property_struct, decomp_type) - 6usize];
243    ["Offset of field: utf8proc_property_struct::decomp_seqindex"]
244        [::std::mem::offset_of!(utf8proc_property_struct, decomp_seqindex) - 8usize];
245    ["Offset of field: utf8proc_property_struct::casefold_seqindex"]
246        [::std::mem::offset_of!(utf8proc_property_struct, casefold_seqindex) - 10usize];
247    ["Offset of field: utf8proc_property_struct::uppercase_seqindex"]
248        [::std::mem::offset_of!(utf8proc_property_struct, uppercase_seqindex) - 12usize];
249    ["Offset of field: utf8proc_property_struct::lowercase_seqindex"]
250        [::std::mem::offset_of!(utf8proc_property_struct, lowercase_seqindex) - 14usize];
251    ["Offset of field: utf8proc_property_struct::titlecase_seqindex"]
252        [::std::mem::offset_of!(utf8proc_property_struct, titlecase_seqindex) - 16usize];
253};
254impl utf8proc_property_struct {
255    #[inline]
256    pub fn comb_index(&self) -> utf8proc_uint16_t {
257        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 10u8) as u16) }
258    }
259    #[inline]
260    pub fn set_comb_index(&mut self, val: utf8proc_uint16_t) {
261        unsafe {
262            let val: u16 = ::std::mem::transmute(val);
263            self._bitfield_1.set(0usize, 10u8, val as u64)
264        }
265    }
266    #[inline]
267    pub unsafe fn comb_index_raw(this: *const Self) -> utf8proc_uint16_t {
268        unsafe {
269            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
270                ::std::ptr::addr_of!((*this)._bitfield_1),
271                0usize,
272                10u8,
273            ) as u16)
274        }
275    }
276    #[inline]
277    pub unsafe fn set_comb_index_raw(this: *mut Self, val: utf8proc_uint16_t) {
278        unsafe {
279            let val: u16 = ::std::mem::transmute(val);
280            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
281                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
282                0usize,
283                10u8,
284                val as u64,
285            )
286        }
287    }
288    #[inline]
289    pub fn comb_length(&self) -> utf8proc_uint16_t {
290        unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 5u8) as u16) }
291    }
292    #[inline]
293    pub fn set_comb_length(&mut self, val: utf8proc_uint16_t) {
294        unsafe {
295            let val: u16 = ::std::mem::transmute(val);
296            self._bitfield_1.set(10usize, 5u8, val as u64)
297        }
298    }
299    #[inline]
300    pub unsafe fn comb_length_raw(this: *const Self) -> utf8proc_uint16_t {
301        unsafe {
302            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
303                ::std::ptr::addr_of!((*this)._bitfield_1),
304                10usize,
305                5u8,
306            ) as u16)
307        }
308    }
309    #[inline]
310    pub unsafe fn set_comb_length_raw(this: *mut Self, val: utf8proc_uint16_t) {
311        unsafe {
312            let val: u16 = ::std::mem::transmute(val);
313            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
314                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
315                10usize,
316                5u8,
317                val as u64,
318            )
319        }
320    }
321    #[inline]
322    pub fn comb_issecond(&self) -> utf8proc_uint16_t {
323        unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
324    }
325    #[inline]
326    pub fn set_comb_issecond(&mut self, val: utf8proc_uint16_t) {
327        unsafe {
328            let val: u16 = ::std::mem::transmute(val);
329            self._bitfield_1.set(15usize, 1u8, val as u64)
330        }
331    }
332    #[inline]
333    pub unsafe fn comb_issecond_raw(this: *const Self) -> utf8proc_uint16_t {
334        unsafe {
335            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
336                ::std::ptr::addr_of!((*this)._bitfield_1),
337                15usize,
338                1u8,
339            ) as u16)
340        }
341    }
342    #[inline]
343    pub unsafe fn set_comb_issecond_raw(this: *mut Self, val: utf8proc_uint16_t) {
344        unsafe {
345            let val: u16 = ::std::mem::transmute(val);
346            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
347                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
348                15usize,
349                1u8,
350                val as u64,
351            )
352        }
353    }
354    #[inline]
355    pub fn bidi_mirrored(&self) -> ::std::os::raw::c_uint {
356        unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) }
357    }
358    #[inline]
359    pub fn set_bidi_mirrored(&mut self, val: ::std::os::raw::c_uint) {
360        unsafe {
361            let val: u32 = ::std::mem::transmute(val);
362            self._bitfield_1.set(16usize, 1u8, val as u64)
363        }
364    }
365    #[inline]
366    pub unsafe fn bidi_mirrored_raw(this: *const Self) -> ::std::os::raw::c_uint {
367        unsafe {
368            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
369                ::std::ptr::addr_of!((*this)._bitfield_1),
370                16usize,
371                1u8,
372            ) as u32)
373        }
374    }
375    #[inline]
376    pub unsafe fn set_bidi_mirrored_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
377        unsafe {
378            let val: u32 = ::std::mem::transmute(val);
379            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
380                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
381                16usize,
382                1u8,
383                val as u64,
384            )
385        }
386    }
387    #[inline]
388    pub fn comp_exclusion(&self) -> ::std::os::raw::c_uint {
389        unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) }
390    }
391    #[inline]
392    pub fn set_comp_exclusion(&mut self, val: ::std::os::raw::c_uint) {
393        unsafe {
394            let val: u32 = ::std::mem::transmute(val);
395            self._bitfield_1.set(17usize, 1u8, val as u64)
396        }
397    }
398    #[inline]
399    pub unsafe fn comp_exclusion_raw(this: *const Self) -> ::std::os::raw::c_uint {
400        unsafe {
401            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
402                ::std::ptr::addr_of!((*this)._bitfield_1),
403                17usize,
404                1u8,
405            ) as u32)
406        }
407    }
408    #[inline]
409    pub unsafe fn set_comp_exclusion_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
410        unsafe {
411            let val: u32 = ::std::mem::transmute(val);
412            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
413                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
414                17usize,
415                1u8,
416                val as u64,
417            )
418        }
419    }
420    #[inline]
421    pub fn ignorable(&self) -> ::std::os::raw::c_uint {
422        unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) }
423    }
424    #[inline]
425    pub fn set_ignorable(&mut self, val: ::std::os::raw::c_uint) {
426        unsafe {
427            let val: u32 = ::std::mem::transmute(val);
428            self._bitfield_1.set(18usize, 1u8, val as u64)
429        }
430    }
431    #[inline]
432    pub unsafe fn ignorable_raw(this: *const Self) -> ::std::os::raw::c_uint {
433        unsafe {
434            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
435                ::std::ptr::addr_of!((*this)._bitfield_1),
436                18usize,
437                1u8,
438            ) as u32)
439        }
440    }
441    #[inline]
442    pub unsafe fn set_ignorable_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
443        unsafe {
444            let val: u32 = ::std::mem::transmute(val);
445            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
446                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
447                18usize,
448                1u8,
449                val as u64,
450            )
451        }
452    }
453    #[inline]
454    pub fn control_boundary(&self) -> ::std::os::raw::c_uint {
455        unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) }
456    }
457    #[inline]
458    pub fn set_control_boundary(&mut self, val: ::std::os::raw::c_uint) {
459        unsafe {
460            let val: u32 = ::std::mem::transmute(val);
461            self._bitfield_1.set(19usize, 1u8, val as u64)
462        }
463    }
464    #[inline]
465    pub unsafe fn control_boundary_raw(this: *const Self) -> ::std::os::raw::c_uint {
466        unsafe {
467            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
468                ::std::ptr::addr_of!((*this)._bitfield_1),
469                19usize,
470                1u8,
471            ) as u32)
472        }
473    }
474    #[inline]
475    pub unsafe fn set_control_boundary_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
476        unsafe {
477            let val: u32 = ::std::mem::transmute(val);
478            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
479                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
480                19usize,
481                1u8,
482                val as u64,
483            )
484        }
485    }
486    #[inline]
487    pub fn charwidth(&self) -> ::std::os::raw::c_uint {
488        unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 2u8) as u32) }
489    }
490    #[inline]
491    pub fn set_charwidth(&mut self, val: ::std::os::raw::c_uint) {
492        unsafe {
493            let val: u32 = ::std::mem::transmute(val);
494            self._bitfield_1.set(20usize, 2u8, val as u64)
495        }
496    }
497    #[inline]
498    pub unsafe fn charwidth_raw(this: *const Self) -> ::std::os::raw::c_uint {
499        unsafe {
500            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
501                ::std::ptr::addr_of!((*this)._bitfield_1),
502                20usize,
503                2u8,
504            ) as u32)
505        }
506    }
507    #[inline]
508    pub unsafe fn set_charwidth_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
509        unsafe {
510            let val: u32 = ::std::mem::transmute(val);
511            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
512                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
513                20usize,
514                2u8,
515                val as u64,
516            )
517        }
518    }
519    #[inline]
520    pub fn ambiguous_width(&self) -> ::std::os::raw::c_uint {
521        unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) }
522    }
523    #[inline]
524    pub fn set_ambiguous_width(&mut self, val: ::std::os::raw::c_uint) {
525        unsafe {
526            let val: u32 = ::std::mem::transmute(val);
527            self._bitfield_1.set(22usize, 1u8, val as u64)
528        }
529    }
530    #[inline]
531    pub unsafe fn ambiguous_width_raw(this: *const Self) -> ::std::os::raw::c_uint {
532        unsafe {
533            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
534                ::std::ptr::addr_of!((*this)._bitfield_1),
535                22usize,
536                1u8,
537            ) as u32)
538        }
539    }
540    #[inline]
541    pub unsafe fn set_ambiguous_width_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
542        unsafe {
543            let val: u32 = ::std::mem::transmute(val);
544            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
545                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
546                22usize,
547                1u8,
548                val as u64,
549            )
550        }
551    }
552    #[inline]
553    pub fn pad(&self) -> ::std::os::raw::c_uint {
554        unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) }
555    }
556    #[inline]
557    pub fn set_pad(&mut self, val: ::std::os::raw::c_uint) {
558        unsafe {
559            let val: u32 = ::std::mem::transmute(val);
560            self._bitfield_1.set(23usize, 1u8, val as u64)
561        }
562    }
563    #[inline]
564    pub unsafe fn pad_raw(this: *const Self) -> ::std::os::raw::c_uint {
565        unsafe {
566            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
567                ::std::ptr::addr_of!((*this)._bitfield_1),
568                23usize,
569                1u8,
570            ) as u32)
571        }
572    }
573    #[inline]
574    pub unsafe fn set_pad_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
575        unsafe {
576            let val: u32 = ::std::mem::transmute(val);
577            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
578                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
579                23usize,
580                1u8,
581                val as u64,
582            )
583        }
584    }
585    #[inline]
586    pub fn boundclass(&self) -> ::std::os::raw::c_uint {
587        unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 6u8) as u32) }
588    }
589    #[inline]
590    pub fn set_boundclass(&mut self, val: ::std::os::raw::c_uint) {
591        unsafe {
592            let val: u32 = ::std::mem::transmute(val);
593            self._bitfield_1.set(24usize, 6u8, val as u64)
594        }
595    }
596    #[inline]
597    pub unsafe fn boundclass_raw(this: *const Self) -> ::std::os::raw::c_uint {
598        unsafe {
599            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
600                ::std::ptr::addr_of!((*this)._bitfield_1),
601                24usize,
602                6u8,
603            ) as u32)
604        }
605    }
606    #[inline]
607    pub unsafe fn set_boundclass_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
608        unsafe {
609            let val: u32 = ::std::mem::transmute(val);
610            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
611                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
612                24usize,
613                6u8,
614                val as u64,
615            )
616        }
617    }
618    #[inline]
619    pub fn indic_conjunct_break(&self) -> ::std::os::raw::c_uint {
620        unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 2u8) as u32) }
621    }
622    #[inline]
623    pub fn set_indic_conjunct_break(&mut self, val: ::std::os::raw::c_uint) {
624        unsafe {
625            let val: u32 = ::std::mem::transmute(val);
626            self._bitfield_1.set(30usize, 2u8, val as u64)
627        }
628    }
629    #[inline]
630    pub unsafe fn indic_conjunct_break_raw(this: *const Self) -> ::std::os::raw::c_uint {
631        unsafe {
632            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
633                ::std::ptr::addr_of!((*this)._bitfield_1),
634                30usize,
635                2u8,
636            ) as u32)
637        }
638    }
639    #[inline]
640    pub unsafe fn set_indic_conjunct_break_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
641        unsafe {
642            let val: u32 = ::std::mem::transmute(val);
643            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
644                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
645                30usize,
646                2u8,
647                val as u64,
648            )
649        }
650    }
651    #[inline]
652    pub fn new_bitfield_1(
653        comb_index: utf8proc_uint16_t,
654        comb_length: utf8proc_uint16_t,
655        comb_issecond: utf8proc_uint16_t,
656        bidi_mirrored: ::std::os::raw::c_uint,
657        comp_exclusion: ::std::os::raw::c_uint,
658        ignorable: ::std::os::raw::c_uint,
659        control_boundary: ::std::os::raw::c_uint,
660        charwidth: ::std::os::raw::c_uint,
661        ambiguous_width: ::std::os::raw::c_uint,
662        pad: ::std::os::raw::c_uint,
663        boundclass: ::std::os::raw::c_uint,
664        indic_conjunct_break: ::std::os::raw::c_uint,
665    ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
666        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
667        __bindgen_bitfield_unit.set(0usize, 10u8, {
668            let comb_index: u16 = unsafe { ::std::mem::transmute(comb_index) };
669            comb_index as u64
670        });
671        __bindgen_bitfield_unit.set(10usize, 5u8, {
672            let comb_length: u16 = unsafe { ::std::mem::transmute(comb_length) };
673            comb_length as u64
674        });
675        __bindgen_bitfield_unit.set(15usize, 1u8, {
676            let comb_issecond: u16 = unsafe { ::std::mem::transmute(comb_issecond) };
677            comb_issecond as u64
678        });
679        __bindgen_bitfield_unit.set(16usize, 1u8, {
680            let bidi_mirrored: u32 = unsafe { ::std::mem::transmute(bidi_mirrored) };
681            bidi_mirrored as u64
682        });
683        __bindgen_bitfield_unit.set(17usize, 1u8, {
684            let comp_exclusion: u32 = unsafe { ::std::mem::transmute(comp_exclusion) };
685            comp_exclusion as u64
686        });
687        __bindgen_bitfield_unit.set(18usize, 1u8, {
688            let ignorable: u32 = unsafe { ::std::mem::transmute(ignorable) };
689            ignorable as u64
690        });
691        __bindgen_bitfield_unit.set(19usize, 1u8, {
692            let control_boundary: u32 = unsafe { ::std::mem::transmute(control_boundary) };
693            control_boundary as u64
694        });
695        __bindgen_bitfield_unit.set(20usize, 2u8, {
696            let charwidth: u32 = unsafe { ::std::mem::transmute(charwidth) };
697            charwidth as u64
698        });
699        __bindgen_bitfield_unit.set(22usize, 1u8, {
700            let ambiguous_width: u32 = unsafe { ::std::mem::transmute(ambiguous_width) };
701            ambiguous_width as u64
702        });
703        __bindgen_bitfield_unit.set(23usize, 1u8, {
704            let pad: u32 = unsafe { ::std::mem::transmute(pad) };
705            pad as u64
706        });
707        __bindgen_bitfield_unit.set(24usize, 6u8, {
708            let boundclass: u32 = unsafe { ::std::mem::transmute(boundclass) };
709            boundclass as u64
710        });
711        __bindgen_bitfield_unit.set(30usize, 2u8, {
712            let indic_conjunct_break: u32 = unsafe { ::std::mem::transmute(indic_conjunct_break) };
713            indic_conjunct_break as u64
714        });
715        __bindgen_bitfield_unit
716    }
717}
718#[doc = " Struct containing information about a codepoint."]
719pub type utf8proc_property_t = utf8proc_property_struct;
720impl utf8proc_category_t {
721    #[doc = "< Other, not assigned"]
722    pub const UTF8PROC_CATEGORY_CN: utf8proc_category_t = utf8proc_category_t(0);
723    #[doc = "< Letter, uppercase"]
724    pub const UTF8PROC_CATEGORY_LU: utf8proc_category_t = utf8proc_category_t(1);
725    #[doc = "< Letter, lowercase"]
726    pub const UTF8PROC_CATEGORY_LL: utf8proc_category_t = utf8proc_category_t(2);
727    #[doc = "< Letter, titlecase"]
728    pub const UTF8PROC_CATEGORY_LT: utf8proc_category_t = utf8proc_category_t(3);
729    #[doc = "< Letter, modifier"]
730    pub const UTF8PROC_CATEGORY_LM: utf8proc_category_t = utf8proc_category_t(4);
731    #[doc = "< Letter, other"]
732    pub const UTF8PROC_CATEGORY_LO: utf8proc_category_t = utf8proc_category_t(5);
733    #[doc = "< Mark, nonspacing"]
734    pub const UTF8PROC_CATEGORY_MN: utf8proc_category_t = utf8proc_category_t(6);
735    #[doc = "< Mark, spacing combining"]
736    pub const UTF8PROC_CATEGORY_MC: utf8proc_category_t = utf8proc_category_t(7);
737    #[doc = "< Mark, enclosing"]
738    pub const UTF8PROC_CATEGORY_ME: utf8proc_category_t = utf8proc_category_t(8);
739    #[doc = "< Number, decimal digit"]
740    pub const UTF8PROC_CATEGORY_ND: utf8proc_category_t = utf8proc_category_t(9);
741    #[doc = "< Number, letter"]
742    pub const UTF8PROC_CATEGORY_NL: utf8proc_category_t = utf8proc_category_t(10);
743    #[doc = "< Number, other"]
744    pub const UTF8PROC_CATEGORY_NO: utf8proc_category_t = utf8proc_category_t(11);
745    #[doc = "< Punctuation, connector"]
746    pub const UTF8PROC_CATEGORY_PC: utf8proc_category_t = utf8proc_category_t(12);
747    #[doc = "< Punctuation, dash"]
748    pub const UTF8PROC_CATEGORY_PD: utf8proc_category_t = utf8proc_category_t(13);
749    #[doc = "< Punctuation, open"]
750    pub const UTF8PROC_CATEGORY_PS: utf8proc_category_t = utf8proc_category_t(14);
751    #[doc = "< Punctuation, close"]
752    pub const UTF8PROC_CATEGORY_PE: utf8proc_category_t = utf8proc_category_t(15);
753    #[doc = "< Punctuation, initial quote"]
754    pub const UTF8PROC_CATEGORY_PI: utf8proc_category_t = utf8proc_category_t(16);
755    #[doc = "< Punctuation, final quote"]
756    pub const UTF8PROC_CATEGORY_PF: utf8proc_category_t = utf8proc_category_t(17);
757    #[doc = "< Punctuation, other"]
758    pub const UTF8PROC_CATEGORY_PO: utf8proc_category_t = utf8proc_category_t(18);
759    #[doc = "< Symbol, math"]
760    pub const UTF8PROC_CATEGORY_SM: utf8proc_category_t = utf8proc_category_t(19);
761    #[doc = "< Symbol, currency"]
762    pub const UTF8PROC_CATEGORY_SC: utf8proc_category_t = utf8proc_category_t(20);
763    #[doc = "< Symbol, modifier"]
764    pub const UTF8PROC_CATEGORY_SK: utf8proc_category_t = utf8proc_category_t(21);
765    #[doc = "< Symbol, other"]
766    pub const UTF8PROC_CATEGORY_SO: utf8proc_category_t = utf8proc_category_t(22);
767    #[doc = "< Separator, space"]
768    pub const UTF8PROC_CATEGORY_ZS: utf8proc_category_t = utf8proc_category_t(23);
769    #[doc = "< Separator, line"]
770    pub const UTF8PROC_CATEGORY_ZL: utf8proc_category_t = utf8proc_category_t(24);
771    #[doc = "< Separator, paragraph"]
772    pub const UTF8PROC_CATEGORY_ZP: utf8proc_category_t = utf8proc_category_t(25);
773    #[doc = "< Other, control"]
774    pub const UTF8PROC_CATEGORY_CC: utf8proc_category_t = utf8proc_category_t(26);
775    #[doc = "< Other, format"]
776    pub const UTF8PROC_CATEGORY_CF: utf8proc_category_t = utf8proc_category_t(27);
777    #[doc = "< Other, surrogate"]
778    pub const UTF8PROC_CATEGORY_CS: utf8proc_category_t = utf8proc_category_t(28);
779    #[doc = "< Other, private use"]
780    pub const UTF8PROC_CATEGORY_CO: utf8proc_category_t = utf8proc_category_t(29);
781}
782#[repr(transparent)]
783#[doc = " Unicode categories."]
784#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
785pub struct utf8proc_category_t(pub ::std::os::raw::c_uint);
786impl utf8proc_bidi_class_t {
787    #[doc = "< Left-to-Right"]
788    pub const UTF8PROC_BIDI_CLASS_L: utf8proc_bidi_class_t = utf8proc_bidi_class_t(1);
789    #[doc = "< Left-to-Right Embedding"]
790    pub const UTF8PROC_BIDI_CLASS_LRE: utf8proc_bidi_class_t = utf8proc_bidi_class_t(2);
791    #[doc = "< Left-to-Right Override"]
792    pub const UTF8PROC_BIDI_CLASS_LRO: utf8proc_bidi_class_t = utf8proc_bidi_class_t(3);
793    #[doc = "< Right-to-Left"]
794    pub const UTF8PROC_BIDI_CLASS_R: utf8proc_bidi_class_t = utf8proc_bidi_class_t(4);
795    #[doc = "< Right-to-Left Arabic"]
796    pub const UTF8PROC_BIDI_CLASS_AL: utf8proc_bidi_class_t = utf8proc_bidi_class_t(5);
797    #[doc = "< Right-to-Left Embedding"]
798    pub const UTF8PROC_BIDI_CLASS_RLE: utf8proc_bidi_class_t = utf8proc_bidi_class_t(6);
799    #[doc = "< Right-to-Left Override"]
800    pub const UTF8PROC_BIDI_CLASS_RLO: utf8proc_bidi_class_t = utf8proc_bidi_class_t(7);
801    #[doc = "< Pop Directional Format"]
802    pub const UTF8PROC_BIDI_CLASS_PDF: utf8proc_bidi_class_t = utf8proc_bidi_class_t(8);
803    #[doc = "< European Number"]
804    pub const UTF8PROC_BIDI_CLASS_EN: utf8proc_bidi_class_t = utf8proc_bidi_class_t(9);
805    #[doc = "< European Separator"]
806    pub const UTF8PROC_BIDI_CLASS_ES: utf8proc_bidi_class_t = utf8proc_bidi_class_t(10);
807    #[doc = "< European Number Terminator"]
808    pub const UTF8PROC_BIDI_CLASS_ET: utf8proc_bidi_class_t = utf8proc_bidi_class_t(11);
809    #[doc = "< Arabic Number"]
810    pub const UTF8PROC_BIDI_CLASS_AN: utf8proc_bidi_class_t = utf8proc_bidi_class_t(12);
811    #[doc = "< Common Number Separator"]
812    pub const UTF8PROC_BIDI_CLASS_CS: utf8proc_bidi_class_t = utf8proc_bidi_class_t(13);
813    #[doc = "< Nonspacing Mark"]
814    pub const UTF8PROC_BIDI_CLASS_NSM: utf8proc_bidi_class_t = utf8proc_bidi_class_t(14);
815    #[doc = "< Boundary Neutral"]
816    pub const UTF8PROC_BIDI_CLASS_BN: utf8proc_bidi_class_t = utf8proc_bidi_class_t(15);
817    #[doc = "< Paragraph Separator"]
818    pub const UTF8PROC_BIDI_CLASS_B: utf8proc_bidi_class_t = utf8proc_bidi_class_t(16);
819    #[doc = "< Segment Separator"]
820    pub const UTF8PROC_BIDI_CLASS_S: utf8proc_bidi_class_t = utf8proc_bidi_class_t(17);
821    #[doc = "< Whitespace"]
822    pub const UTF8PROC_BIDI_CLASS_WS: utf8proc_bidi_class_t = utf8proc_bidi_class_t(18);
823    #[doc = "< Other Neutrals"]
824    pub const UTF8PROC_BIDI_CLASS_ON: utf8proc_bidi_class_t = utf8proc_bidi_class_t(19);
825    #[doc = "< Left-to-Right Isolate"]
826    pub const UTF8PROC_BIDI_CLASS_LRI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(20);
827    #[doc = "< Right-to-Left Isolate"]
828    pub const UTF8PROC_BIDI_CLASS_RLI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(21);
829    #[doc = "< First Strong Isolate"]
830    pub const UTF8PROC_BIDI_CLASS_FSI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(22);
831    #[doc = "< Pop Directional Isolate"]
832    pub const UTF8PROC_BIDI_CLASS_PDI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(23);
833}
834#[repr(transparent)]
835#[doc = " Bidirectional character classes."]
836#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
837pub struct utf8proc_bidi_class_t(pub ::std::os::raw::c_uint);
838impl utf8proc_decomp_type_t {
839    #[doc = "< Font"]
840    pub const UTF8PROC_DECOMP_TYPE_FONT: utf8proc_decomp_type_t = utf8proc_decomp_type_t(1);
841    #[doc = "< Nobreak"]
842    pub const UTF8PROC_DECOMP_TYPE_NOBREAK: utf8proc_decomp_type_t = utf8proc_decomp_type_t(2);
843    #[doc = "< Initial"]
844    pub const UTF8PROC_DECOMP_TYPE_INITIAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(3);
845    #[doc = "< Medial"]
846    pub const UTF8PROC_DECOMP_TYPE_MEDIAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(4);
847    #[doc = "< Final"]
848    pub const UTF8PROC_DECOMP_TYPE_FINAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(5);
849    #[doc = "< Isolated"]
850    pub const UTF8PROC_DECOMP_TYPE_ISOLATED: utf8proc_decomp_type_t = utf8proc_decomp_type_t(6);
851    #[doc = "< Circle"]
852    pub const UTF8PROC_DECOMP_TYPE_CIRCLE: utf8proc_decomp_type_t = utf8proc_decomp_type_t(7);
853    #[doc = "< Super"]
854    pub const UTF8PROC_DECOMP_TYPE_SUPER: utf8proc_decomp_type_t = utf8proc_decomp_type_t(8);
855    #[doc = "< Sub"]
856    pub const UTF8PROC_DECOMP_TYPE_SUB: utf8proc_decomp_type_t = utf8proc_decomp_type_t(9);
857    #[doc = "< Vertical"]
858    pub const UTF8PROC_DECOMP_TYPE_VERTICAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(10);
859    #[doc = "< Wide"]
860    pub const UTF8PROC_DECOMP_TYPE_WIDE: utf8proc_decomp_type_t = utf8proc_decomp_type_t(11);
861    #[doc = "< Narrow"]
862    pub const UTF8PROC_DECOMP_TYPE_NARROW: utf8proc_decomp_type_t = utf8proc_decomp_type_t(12);
863    #[doc = "< Small"]
864    pub const UTF8PROC_DECOMP_TYPE_SMALL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(13);
865    #[doc = "< Square"]
866    pub const UTF8PROC_DECOMP_TYPE_SQUARE: utf8proc_decomp_type_t = utf8proc_decomp_type_t(14);
867    #[doc = "< Fraction"]
868    pub const UTF8PROC_DECOMP_TYPE_FRACTION: utf8proc_decomp_type_t = utf8proc_decomp_type_t(15);
869    #[doc = "< Compat"]
870    pub const UTF8PROC_DECOMP_TYPE_COMPAT: utf8proc_decomp_type_t = utf8proc_decomp_type_t(16);
871}
872#[repr(transparent)]
873#[doc = " Decomposition type."]
874#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
875pub struct utf8proc_decomp_type_t(pub ::std::os::raw::c_uint);
876impl utf8proc_boundclass_t {
877    #[doc = "< Start"]
878    pub const UTF8PROC_BOUNDCLASS_START: utf8proc_boundclass_t = utf8proc_boundclass_t(0);
879    #[doc = "< Other"]
880    pub const UTF8PROC_BOUNDCLASS_OTHER: utf8proc_boundclass_t = utf8proc_boundclass_t(1);
881    #[doc = "< Cr"]
882    pub const UTF8PROC_BOUNDCLASS_CR: utf8proc_boundclass_t = utf8proc_boundclass_t(2);
883    #[doc = "< Lf"]
884    pub const UTF8PROC_BOUNDCLASS_LF: utf8proc_boundclass_t = utf8proc_boundclass_t(3);
885    #[doc = "< Control"]
886    pub const UTF8PROC_BOUNDCLASS_CONTROL: utf8proc_boundclass_t = utf8proc_boundclass_t(4);
887    #[doc = "< Extend"]
888    pub const UTF8PROC_BOUNDCLASS_EXTEND: utf8proc_boundclass_t = utf8proc_boundclass_t(5);
889    #[doc = "< L"]
890    pub const UTF8PROC_BOUNDCLASS_L: utf8proc_boundclass_t = utf8proc_boundclass_t(6);
891    #[doc = "< V"]
892    pub const UTF8PROC_BOUNDCLASS_V: utf8proc_boundclass_t = utf8proc_boundclass_t(7);
893    #[doc = "< T"]
894    pub const UTF8PROC_BOUNDCLASS_T: utf8proc_boundclass_t = utf8proc_boundclass_t(8);
895    #[doc = "< Lv"]
896    pub const UTF8PROC_BOUNDCLASS_LV: utf8proc_boundclass_t = utf8proc_boundclass_t(9);
897    #[doc = "< Lvt"]
898    pub const UTF8PROC_BOUNDCLASS_LVT: utf8proc_boundclass_t = utf8proc_boundclass_t(10);
899    #[doc = "< Regional indicator"]
900    pub const UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR: utf8proc_boundclass_t = utf8proc_boundclass_t(11);
901    #[doc = "< Spacingmark"]
902    pub const UTF8PROC_BOUNDCLASS_SPACINGMARK: utf8proc_boundclass_t = utf8proc_boundclass_t(12);
903    #[doc = "< Prepend"]
904    pub const UTF8PROC_BOUNDCLASS_PREPEND: utf8proc_boundclass_t = utf8proc_boundclass_t(13);
905    #[doc = "< Zero Width Joiner"]
906    pub const UTF8PROC_BOUNDCLASS_ZWJ: utf8proc_boundclass_t = utf8proc_boundclass_t(14);
907    #[doc = "< Emoji Base"]
908    pub const UTF8PROC_BOUNDCLASS_E_BASE: utf8proc_boundclass_t = utf8proc_boundclass_t(15);
909    #[doc = "< Emoji Modifier"]
910    pub const UTF8PROC_BOUNDCLASS_E_MODIFIER: utf8proc_boundclass_t = utf8proc_boundclass_t(16);
911    #[doc = "< Glue_After_ZWJ"]
912    pub const UTF8PROC_BOUNDCLASS_GLUE_AFTER_ZWJ: utf8proc_boundclass_t = utf8proc_boundclass_t(17);
913    #[doc = "< E_BASE + GLUE_AFTER_ZJW"]
914    pub const UTF8PROC_BOUNDCLASS_E_BASE_GAZ: utf8proc_boundclass_t = utf8proc_boundclass_t(18);
915    pub const UTF8PROC_BOUNDCLASS_EXTENDED_PICTOGRAPHIC: utf8proc_boundclass_t = utf8proc_boundclass_t(19);
916    pub const UTF8PROC_BOUNDCLASS_E_ZWG: utf8proc_boundclass_t = utf8proc_boundclass_t(20);
917}
918#[repr(transparent)]
919#[doc = " Boundclass property. (TR29)"]
920#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
921pub struct utf8proc_boundclass_t(pub ::std::os::raw::c_uint);
922impl utf8proc_indic_conjunct_break_t {
923    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_NONE: utf8proc_indic_conjunct_break_t = utf8proc_indic_conjunct_break_t(0);
924    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_LINKER: utf8proc_indic_conjunct_break_t =
925        utf8proc_indic_conjunct_break_t(1);
926    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_CONSONANT: utf8proc_indic_conjunct_break_t =
927        utf8proc_indic_conjunct_break_t(2);
928    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_EXTEND: utf8proc_indic_conjunct_break_t =
929        utf8proc_indic_conjunct_break_t(3);
930}
931#[repr(transparent)]
932#[doc = " Indic_Conjunct_Break property. (TR44)"]
933#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
934pub struct utf8proc_indic_conjunct_break_t(pub ::std::os::raw::c_uint);
935#[doc = " Function pointer type passed to utf8proc_map_custom() and\n utf8proc_decompose_custom(), which is used to specify a user-defined\n mapping of codepoints to be applied in conjunction with other mappings."]
936pub type utf8proc_custom_func = ::std::option::Option<
937    unsafe extern "C" fn(codepoint: utf8proc_int32_t, data: *mut ::std::os::raw::c_void) -> utf8proc_int32_t,
938>;
939unsafe extern "C" {
940    #[doc = " Array containing the byte lengths of a UTF-8 encoded codepoint based\n on the first byte."]
941    pub static utf8proc_utf8class: [utf8proc_int8_t; 256usize];
942}
943unsafe extern "C" {
944    #[doc = " Returns the utf8proc API version as a string MAJOR.MINOR.PATCH\n (http://semver.org format), possibly with a \"-dev\" suffix for\n development versions."]
945    pub fn utf8proc_version() -> *const ::std::os::raw::c_char;
946}
947unsafe extern "C" {
948    #[doc = " Returns the utf8proc supported Unicode version as a string MAJOR.MINOR.PATCH."]
949    pub fn utf8proc_unicode_version() -> *const ::std::os::raw::c_char;
950}
951unsafe extern "C" {
952    #[doc = " Returns an informative error string for the given utf8proc error code\n (e.g. the error codes returned by utf8proc_map())."]
953    pub fn utf8proc_errmsg(errcode: utf8proc_ssize_t) -> *const ::std::os::raw::c_char;
954}
955unsafe extern "C" {
956    #[doc = " Reads a single codepoint from the UTF-8 sequence being pointed to by `str`.\n The maximum number of bytes read is `strlen`, unless `strlen` is\n negative (in which case up to 4 bytes are read).\n\n If a valid codepoint could be read, it is stored in the variable\n pointed to by `codepoint_ref`, otherwise that variable will be set to -1.\n In case of success, the number of bytes read is returned; otherwise, a\n negative error code is returned."]
957    pub fn utf8proc_iterate(
958        str_: *const utf8proc_uint8_t,
959        strlen: utf8proc_ssize_t,
960        codepoint_ref: *mut utf8proc_int32_t,
961    ) -> utf8proc_ssize_t;
962}
963unsafe extern "C" {
964    #[doc = " Check if a codepoint is valid (regardless of whether it has been\n assigned a value by the current Unicode standard).\n\n @return 1 if the given `codepoint` is valid and otherwise return 0."]
965    pub fn utf8proc_codepoint_valid(codepoint: utf8proc_int32_t) -> utf8proc_bool;
966}
967unsafe extern "C" {
968    #[doc = " Encodes the codepoint as an UTF-8 string in the byte array pointed\n to by `dst`. This array must be at least 4 bytes long.\n\n In case of success the number of bytes written is returned, and\n otherwise 0 is returned.\n\n This function does not check whether `codepoint` is valid Unicode."]
969    pub fn utf8proc_encode_char(codepoint: utf8proc_int32_t, dst: *mut utf8proc_uint8_t) -> utf8proc_ssize_t;
970}
971unsafe extern "C" {
972    #[doc = " Look up the properties for a given codepoint.\n\n @param codepoint The Unicode codepoint.\n\n @returns\n A pointer to a (constant) struct containing information about\n the codepoint.\n @par\n If the codepoint is unassigned or invalid, a pointer to a special struct is\n returned in which `category` is 0 (@ref UTF8PROC_CATEGORY_CN)."]
973    pub fn utf8proc_get_property(codepoint: utf8proc_int32_t) -> *const utf8proc_property_t;
974}
975unsafe extern "C" {
976    #[doc = " Decompose a codepoint into an array of codepoints.\n\n @param codepoint the codepoint.\n @param dst the destination buffer.\n @param bufsize the size of the destination buffer.\n @param options one or more of the following flags:\n - @ref UTF8PROC_REJECTNA  - return an error `codepoint` is unassigned\n - @ref UTF8PROC_IGNORE    - strip \"default ignorable\" codepoints\n - @ref UTF8PROC_CASEFOLD  - apply Unicode casefolding\n - @ref UTF8PROC_COMPAT    - replace certain codepoints with their\n                             compatibility decomposition\n - @ref UTF8PROC_CHARBOUND - insert 0xFF bytes before each grapheme cluster\n - @ref UTF8PROC_LUMP      - lump certain different codepoints together\n - @ref UTF8PROC_STRIPMARK - remove all character marks\n - @ref UTF8PROC_STRIPNA   - remove unassigned codepoints\n @param last_boundclass\n Pointer to an integer variable containing\n the previous codepoint's (boundclass + indic_conjunct_break << 1) if the @ref UTF8PROC_CHARBOUND\n option is used.  If the string is being processed in order, this can be initialized to 0 for\n the beginning of the string, and is thereafter updated automatically.  Otherwise, this parameter is ignored.\n\n @return\n In case of success, the number of codepoints written is returned; in case\n of an error, a negative error code is returned (utf8proc_errmsg()).\n @par\n If the number of written codepoints would be bigger than `bufsize`, the\n required buffer size is returned, while the buffer will be overwritten with\n undefined data."]
977    pub fn utf8proc_decompose_char(
978        codepoint: utf8proc_int32_t,
979        dst: *mut utf8proc_int32_t,
980        bufsize: utf8proc_ssize_t,
981        options: utf8proc_option_t,
982        last_boundclass: *mut ::std::os::raw::c_int,
983    ) -> utf8proc_ssize_t;
984}
985unsafe extern "C" {
986    #[doc = " The same as utf8proc_decompose_char(), but acts on a whole UTF-8\n string and orders the decomposed sequences correctly.\n\n If the @ref UTF8PROC_NULLTERM flag in `options` is set, processing\n will be stopped, when a NULL byte is encountered, otherwise `strlen`\n bytes are processed.  The result (in the form of 32-bit unicode\n codepoints) is written into the buffer being pointed to by\n `buffer` (which must contain at least `bufsize` entries).  In case of\n success, the number of codepoints written is returned; in case of an\n error, a negative error code is returned (utf8proc_errmsg()).\n See utf8proc_decompose_custom() to supply additional transformations.\n\n If the number of written codepoints would be bigger than `bufsize`, the\n required buffer size is returned, while the buffer will be overwritten with\n undefined data."]
987    pub fn utf8proc_decompose(
988        str_: *const utf8proc_uint8_t,
989        strlen: utf8proc_ssize_t,
990        buffer: *mut utf8proc_int32_t,
991        bufsize: utf8proc_ssize_t,
992        options: utf8proc_option_t,
993    ) -> utf8proc_ssize_t;
994}
995unsafe extern "C" {
996    #[doc = " The same as utf8proc_decompose(), but also takes a `custom_func` mapping function\n that is called on each codepoint in `str` before any other transformations\n (along with a `custom_data` pointer that is passed through to `custom_func`).\n The `custom_func` argument is ignored if it is `NULL`.  See also utf8proc_map_custom()."]
997    pub fn utf8proc_decompose_custom(
998        str_: *const utf8proc_uint8_t,
999        strlen: utf8proc_ssize_t,
1000        buffer: *mut utf8proc_int32_t,
1001        bufsize: utf8proc_ssize_t,
1002        options: utf8proc_option_t,
1003        custom_func: utf8proc_custom_func,
1004        custom_data: *mut ::std::os::raw::c_void,
1005    ) -> utf8proc_ssize_t;
1006}
1007unsafe extern "C" {
1008    #[doc = " Normalizes the sequence of `length` codepoints pointed to by `buffer`\n in-place (i.e., the result is also stored in `buffer`).\n\n @param buffer the (native-endian UTF-32) unicode codepoints to re-encode.\n @param length the length (in codepoints) of the buffer.\n @param options a bitwise or (`|`) of one or more of the following flags:\n - @ref UTF8PROC_NLF2LS  - convert LF, CRLF, CR and NEL into LS\n - @ref UTF8PROC_NLF2PS  - convert LF, CRLF, CR and NEL into PS\n - @ref UTF8PROC_NLF2LF  - convert LF, CRLF, CR and NEL into LF\n - @ref UTF8PROC_STRIPCC - strip or convert all non-affected control characters\n - @ref UTF8PROC_COMPOSE - try to combine decomposed codepoints into composite\n                           codepoints\n - @ref UTF8PROC_STABLE  - prohibit combining characters that would violate\n                           the unicode versioning stability\n\n @return\n In case of success, the length (in codepoints) of the normalized UTF-32 string is\n returned; otherwise, a negative error code is returned (utf8proc_errmsg()).\n\n @warning The entries of the array pointed to by `str` have to be in the\n          range `0x0000` to `0x10FFFF`. Otherwise, the program might crash!"]
1009    pub fn utf8proc_normalize_utf32(
1010        buffer: *mut utf8proc_int32_t,
1011        length: utf8proc_ssize_t,
1012        options: utf8proc_option_t,
1013    ) -> utf8proc_ssize_t;
1014}
1015unsafe extern "C" {
1016    #[doc = " Reencodes the sequence of `length` codepoints pointed to by `buffer`\n UTF-8 data in-place (i.e., the result is also stored in `buffer`).\n Can optionally normalize the UTF-32 sequence prior to UTF-8 conversion.\n\n @param buffer the (native-endian UTF-32) unicode codepoints to re-encode.\n @param length the length (in codepoints) of the buffer.\n @param options a bitwise or (`|`) of one or more of the following flags:\n - @ref UTF8PROC_NLF2LS  - convert LF, CRLF, CR and NEL into LS\n - @ref UTF8PROC_NLF2PS  - convert LF, CRLF, CR and NEL into PS\n - @ref UTF8PROC_NLF2LF  - convert LF, CRLF, CR and NEL into LF\n - @ref UTF8PROC_STRIPCC - strip or convert all non-affected control characters\n - @ref UTF8PROC_COMPOSE - try to combine decomposed codepoints into composite\n                           codepoints\n - @ref UTF8PROC_STABLE  - prohibit combining characters that would violate\n                           the unicode versioning stability\n - @ref UTF8PROC_CHARBOUND - insert 0xFF bytes before each grapheme cluster\n\n @return\n In case of success, the length (in bytes) of the resulting nul-terminated\n UTF-8 string is returned; otherwise, a negative error code is returned\n (utf8proc_errmsg()).\n\n @warning The amount of free space pointed to by `buffer` must\n          exceed the amount of the input data by one byte, and the\n          entries of the array pointed to by `str` have to be in the\n          range `0x0000` to `0x10FFFF`. Otherwise, the program might crash!"]
1017    pub fn utf8proc_reencode(
1018        buffer: *mut utf8proc_int32_t,
1019        length: utf8proc_ssize_t,
1020        options: utf8proc_option_t,
1021    ) -> utf8proc_ssize_t;
1022}
1023unsafe extern "C" {
1024    #[doc = " Given a pair of consecutive codepoints, return whether a grapheme break is\n permitted between them (as defined by the extended grapheme clusters in UAX#29).\n\n @param codepoint1 The first codepoint.\n @param codepoint2 The second codepoint, occurring consecutively after `codepoint1`.\n @param state Beginning with Version 29 (Unicode 9.0.0), this algorithm requires\n              state to break graphemes. This state can be passed in as a pointer\n              in the `state` argument and should initially be set to 0. If the\n              state is not passed in (i.e. a null pointer is passed), UAX#29 rules\n              GB10/12/13 which require this state will not be applied, essentially\n              matching the rules in Unicode 8.0.0.\n\n @warning If the state parameter is used, `utf8proc_grapheme_break_stateful` must\n          be called IN ORDER on ALL potential breaks in a string.  However, it\n          is safe to reset the state to zero after a grapheme break."]
1025    pub fn utf8proc_grapheme_break_stateful(
1026        codepoint1: utf8proc_int32_t,
1027        codepoint2: utf8proc_int32_t,
1028        state: *mut utf8proc_int32_t,
1029    ) -> utf8proc_bool;
1030}
1031unsafe extern "C" {
1032    #[doc = " Same as utf8proc_grapheme_break_stateful(), except without support for the\n Unicode 9 additions to the algorithm. Supported for legacy reasons."]
1033    pub fn utf8proc_grapheme_break(codepoint1: utf8proc_int32_t, codepoint2: utf8proc_int32_t) -> utf8proc_bool;
1034}
1035unsafe extern "C" {
1036    #[doc = " Given a codepoint `c`, return the codepoint of the corresponding\n lower-case character, if any; otherwise (if there is no lower-case\n variant, or if `c` is not a valid codepoint) return `c`."]
1037    pub fn utf8proc_tolower(c: utf8proc_int32_t) -> utf8proc_int32_t;
1038}
1039unsafe extern "C" {
1040    #[doc = " Given a codepoint `c`, return the codepoint of the corresponding\n upper-case character, if any; otherwise (if there is no upper-case\n variant, or if `c` is not a valid codepoint) return `c`."]
1041    pub fn utf8proc_toupper(c: utf8proc_int32_t) -> utf8proc_int32_t;
1042}
1043unsafe extern "C" {
1044    #[doc = " Given a codepoint `c`, return the codepoint of the corresponding\n title-case character, if any; otherwise (if there is no title-case\n variant, or if `c` is not a valid codepoint) return `c`."]
1045    pub fn utf8proc_totitle(c: utf8proc_int32_t) -> utf8proc_int32_t;
1046}
1047unsafe extern "C" {
1048    #[doc = " Given a codepoint `c`, return `1` if the codepoint corresponds to a lower-case character\n and `0` otherwise."]
1049    pub fn utf8proc_islower(c: utf8proc_int32_t) -> ::std::os::raw::c_int;
1050}
1051unsafe extern "C" {
1052    #[doc = " Given a codepoint `c`, return `1` if the codepoint corresponds to an upper-case character\n and `0` otherwise."]
1053    pub fn utf8proc_isupper(c: utf8proc_int32_t) -> ::std::os::raw::c_int;
1054}
1055unsafe extern "C" {
1056    #[doc = " Given a codepoint, return a character width analogous to `wcwidth(codepoint)`,\n except that a width of 0 is returned for non-printable codepoints\n instead of -1 as in `wcwidth`.\n\n @note\n If you want to check for particular types of non-printable characters,\n (analogous to `isprint` or `iscntrl`), use utf8proc_category()."]
1057    pub fn utf8proc_charwidth(codepoint: utf8proc_int32_t) -> ::std::os::raw::c_int;
1058}
1059unsafe extern "C" {
1060    #[doc = " Given a codepoint, return whether it has East Asian width class A (Ambiguous)\n\n Codepoints with this property are considered to have charwidth 1 (if they are printable)\n but some East Asian fonts render them as double width."]
1061    pub fn utf8proc_charwidth_ambiguous(codepoint: utf8proc_int32_t) -> utf8proc_bool;
1062}
1063unsafe extern "C" {
1064    #[doc = " Return the Unicode category for the codepoint (one of the\n @ref utf8proc_category_t constants.)"]
1065    pub fn utf8proc_category(codepoint: utf8proc_int32_t) -> utf8proc_category_t;
1066}
1067unsafe extern "C" {
1068    #[doc = " Return the two-letter (nul-terminated) Unicode category string for\n the codepoint (e.g. `\"Lu\"` or `\"Co\"`)."]
1069    pub fn utf8proc_category_string(codepoint: utf8proc_int32_t) -> *const ::std::os::raw::c_char;
1070}
1071unsafe extern "C" {
1072    #[doc = " Maps the given UTF-8 string pointed to by `str` to a new UTF-8\n string, allocated dynamically by `malloc` and returned via `dstptr`.\n\n If the @ref UTF8PROC_NULLTERM flag in the `options` field is set,\n the length is determined by a NULL terminator, otherwise the\n parameter `strlen` is evaluated to determine the string length, but\n in any case the result will be NULL terminated (though it might\n contain NULL characters with the string if `str` contained NULL\n characters). Other flags in the `options` field are passed to the\n functions defined above, and regarded as described.  See also\n utf8proc_map_custom() to supply a custom codepoint transformation.\n\n In case of success the length of the new string is returned,\n otherwise a negative error code is returned.\n\n @note The memory of the new UTF-8 string will have been allocated\n with `malloc`, and should therefore be deallocated with `free`."]
1073    pub fn utf8proc_map(
1074        str_: *const utf8proc_uint8_t,
1075        strlen: utf8proc_ssize_t,
1076        dstptr: *mut *mut utf8proc_uint8_t,
1077        options: utf8proc_option_t,
1078    ) -> utf8proc_ssize_t;
1079}
1080unsafe extern "C" {
1081    #[doc = " Like utf8proc_map(), but also takes a `custom_func` mapping function\n that is called on each codepoint in `str` before any other transformations\n (along with a `custom_data` pointer that is passed through to `custom_func`).\n The `custom_func` argument is ignored if it is `NULL`."]
1082    pub fn utf8proc_map_custom(
1083        str_: *const utf8proc_uint8_t,
1084        strlen: utf8proc_ssize_t,
1085        dstptr: *mut *mut utf8proc_uint8_t,
1086        options: utf8proc_option_t,
1087        custom_func: utf8proc_custom_func,
1088        custom_data: *mut ::std::os::raw::c_void,
1089    ) -> utf8proc_ssize_t;
1090}
1091unsafe extern "C" {
1092    #[doc = " @name Unicode normalization\n\n Returns a pointer to newly allocated memory of a NFD, NFC, NFKD, NFKC or\n NFKC_Casefold normalized version of the null-terminated string `str`.  These\n are shortcuts to calling utf8proc_map() with @ref UTF8PROC_NULLTERM\n combined with @ref UTF8PROC_STABLE and flags indicating the normalization.\n/\n/** @{ */\n/** NFD normalization (@ref UTF8PROC_DECOMPOSE)."]
1093    pub fn utf8proc_NFD(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
1094}
1095unsafe extern "C" {
1096    #[doc = " NFC normalization (@ref UTF8PROC_COMPOSE)."]
1097    pub fn utf8proc_NFC(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
1098}
1099unsafe extern "C" {
1100    #[doc = " NFKD normalization (@ref UTF8PROC_DECOMPOSE and @ref UTF8PROC_COMPAT)."]
1101    pub fn utf8proc_NFKD(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
1102}
1103unsafe extern "C" {
1104    #[doc = " NFKC normalization (@ref UTF8PROC_COMPOSE and @ref UTF8PROC_COMPAT)."]
1105    pub fn utf8proc_NFKC(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
1106}
1107unsafe extern "C" {
1108    #[doc = " NFKC_Casefold normalization (@ref UTF8PROC_COMPOSE and @ref UTF8PROC_COMPAT\n and @ref UTF8PROC_CASEFOLD and @ref UTF8PROC_IGNORE)."]
1109    pub fn utf8proc_NFKC_Casefold(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
1110}