utf8proc-sys 0.1.2

Unsafe rust bindings to the utf8proc library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
/* automatically generated by rust-bindgen 0.72.0 */

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
    storage: Storage,
}
impl<Storage> __BindgenBitfieldUnit<Storage> {
    #[inline]
    pub const fn new(storage: Storage) -> Self {
        Self { storage }
    }
}
impl<Storage> __BindgenBitfieldUnit<Storage>
where
    Storage: AsRef<[u8]> + AsMut<[u8]>,
{
    #[inline]
    fn extract_bit(byte: u8, index: usize) -> bool {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        byte & mask == mask
    }
    #[inline]
    pub fn get_bit(&self, index: usize) -> bool {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = self.storage.as_ref()[byte_index];
        Self::extract_bit(byte, index)
    }
    #[inline]
    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte = unsafe { *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) };
        Self::extract_bit(byte, index)
    }
    #[inline]
    fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        if val { byte | mask } else { byte & !mask }
    }
    #[inline]
    pub fn set_bit(&mut self, index: usize, val: bool) {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = &mut self.storage.as_mut()[byte_index];
        *byte = Self::change_bit(*byte, index, val);
    }
    #[inline]
    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte = unsafe { (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) };
        unsafe { *byte = Self::change_bit(*byte, index, val) };
    }
    #[inline]
    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if self.get_bit(i + bit_offset) {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            self.set_bit(index + bit_offset, val_bit_is_set);
        }
    }
    #[inline]
    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
        }
    }
}
pub type utf8proc_int8_t = i8;
pub type utf8proc_uint8_t = u8;
pub type utf8proc_int16_t = i16;
pub type utf8proc_uint16_t = u16;
pub type utf8proc_int32_t = i32;
pub type utf8proc_uint32_t = u32;
pub type utf8proc_size_t = usize;
pub type utf8proc_ssize_t = isize;
pub type utf8proc_bool = bool;
impl utf8proc_option_t {
    #[doc = " The given UTF-8 input is NULL terminated."]
    pub const UTF8PROC_NULLTERM: utf8proc_option_t = utf8proc_option_t(1);
    #[doc = " Unicode Versioning Stability has to be respected."]
    pub const UTF8PROC_STABLE: utf8proc_option_t = utf8proc_option_t(2);
    #[doc = " Compatibility decomposition (i.e. formatting information is lost)."]
    pub const UTF8PROC_COMPAT: utf8proc_option_t = utf8proc_option_t(4);
    #[doc = " Return a result with decomposed characters."]
    pub const UTF8PROC_COMPOSE: utf8proc_option_t = utf8proc_option_t(8);
    #[doc = " Return a result with decomposed characters."]
    pub const UTF8PROC_DECOMPOSE: utf8proc_option_t = utf8proc_option_t(16);
    #[doc = " Strip \"default ignorable characters\" such as SOFT-HYPHEN or ZERO-WIDTH-SPACE."]
    pub const UTF8PROC_IGNORE: utf8proc_option_t = utf8proc_option_t(32);
    #[doc = " Return an error, if the input contains unassigned codepoints."]
    pub const UTF8PROC_REJECTNA: utf8proc_option_t = utf8proc_option_t(64);
    #[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)."]
    pub const UTF8PROC_NLF2LS: utf8proc_option_t = utf8proc_option_t(128);
    #[doc = " Indicating that NLF-sequences are representing a paragraph break, and\n should be converted to the codepoint for paragraph separation\n (PS)."]
    pub const UTF8PROC_NLF2PS: utf8proc_option_t = utf8proc_option_t(256);
    #[doc = " Indicating that the meaning of NLF-sequences is unknown."]
    pub const UTF8PROC_NLF2LF: utf8proc_option_t = utf8proc_option_t(384);
    #[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."]
    pub const UTF8PROC_STRIPCC: utf8proc_option_t = utf8proc_option_t(512);
    #[doc = " Performs unicode case folding, to be able to do a case-insensitive\n string comparison."]
    pub const UTF8PROC_CASEFOLD: utf8proc_option_t = utf8proc_option_t(1024);
    #[doc = " Inserts 0xFF bytes at the beginning of each sequence which is\n representing a single grapheme cluster (see UAX#29)."]
    pub const UTF8PROC_CHARBOUND: utf8proc_option_t = utf8proc_option_t(2048);
    #[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)."]
    pub const UTF8PROC_LUMP: utf8proc_option_t = utf8proc_option_t(4096);
    #[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"]
    pub const UTF8PROC_STRIPMARK: utf8proc_option_t = utf8proc_option_t(8192);
    #[doc = " Strip unassigned codepoints."]
    pub const UTF8PROC_STRIPNA: utf8proc_option_t = utf8proc_option_t(16384);
}
impl ::std::ops::BitOr<utf8proc_option_t> for utf8proc_option_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        utf8proc_option_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for utf8proc_option_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: utf8proc_option_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<utf8proc_option_t> for utf8proc_option_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        utf8proc_option_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for utf8proc_option_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: utf8proc_option_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[doc = " Option flags used by several functions in the library."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct utf8proc_option_t(pub ::std::os::raw::c_uint);
#[doc = " Holds the value of a property."]
pub type utf8proc_propval_t = utf8proc_int16_t;
#[doc = " Struct containing information about a codepoint."]
#[repr(C)]
#[repr(align(4))]
#[derive(Debug, Copy, Clone)]
pub struct utf8proc_property_struct {
    #[doc = " Unicode category.\n @see utf8proc_category_t."]
    pub category: utf8proc_propval_t,
    pub combining_class: utf8proc_propval_t,
    #[doc = " Bidirectional class.\n @see utf8proc_bidi_class_t."]
    pub bidi_class: utf8proc_propval_t,
    #[doc = " @anchor Decomposition type.\n @see utf8proc_decomp_type_t."]
    pub decomp_type: utf8proc_propval_t,
    pub decomp_seqindex: utf8proc_uint16_t,
    pub casefold_seqindex: utf8proc_uint16_t,
    pub uppercase_seqindex: utf8proc_uint16_t,
    pub lowercase_seqindex: utf8proc_uint16_t,
    pub titlecase_seqindex: utf8proc_uint16_t,
    pub _bitfield_align_1: [u16; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
    pub __bindgen_padding_0: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of utf8proc_property_struct"][::std::mem::size_of::<utf8proc_property_struct>() - 24usize];
    ["Alignment of utf8proc_property_struct"][::std::mem::align_of::<utf8proc_property_struct>() - 4usize];
    ["Offset of field: utf8proc_property_struct::category"]
        [::std::mem::offset_of!(utf8proc_property_struct, category) - 0usize];
    ["Offset of field: utf8proc_property_struct::combining_class"]
        [::std::mem::offset_of!(utf8proc_property_struct, combining_class) - 2usize];
    ["Offset of field: utf8proc_property_struct::bidi_class"]
        [::std::mem::offset_of!(utf8proc_property_struct, bidi_class) - 4usize];
    ["Offset of field: utf8proc_property_struct::decomp_type"]
        [::std::mem::offset_of!(utf8proc_property_struct, decomp_type) - 6usize];
    ["Offset of field: utf8proc_property_struct::decomp_seqindex"]
        [::std::mem::offset_of!(utf8proc_property_struct, decomp_seqindex) - 8usize];
    ["Offset of field: utf8proc_property_struct::casefold_seqindex"]
        [::std::mem::offset_of!(utf8proc_property_struct, casefold_seqindex) - 10usize];
    ["Offset of field: utf8proc_property_struct::uppercase_seqindex"]
        [::std::mem::offset_of!(utf8proc_property_struct, uppercase_seqindex) - 12usize];
    ["Offset of field: utf8proc_property_struct::lowercase_seqindex"]
        [::std::mem::offset_of!(utf8proc_property_struct, lowercase_seqindex) - 14usize];
    ["Offset of field: utf8proc_property_struct::titlecase_seqindex"]
        [::std::mem::offset_of!(utf8proc_property_struct, titlecase_seqindex) - 16usize];
};
impl utf8proc_property_struct {
    #[inline]
    pub fn comb_index(&self) -> utf8proc_uint16_t {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 10u8) as u16) }
    }
    #[inline]
    pub fn set_comb_index(&mut self, val: utf8proc_uint16_t) {
        unsafe {
            let val: u16 = ::std::mem::transmute(val);
            self._bitfield_1.set(0usize, 10u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn comb_index_raw(this: *const Self) -> utf8proc_uint16_t {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                10u8,
            ) as u16)
        }
    }
    #[inline]
    pub unsafe fn set_comb_index_raw(this: *mut Self, val: utf8proc_uint16_t) {
        unsafe {
            let val: u16 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                10u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn comb_length(&self) -> utf8proc_uint16_t {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 5u8) as u16) }
    }
    #[inline]
    pub fn set_comb_length(&mut self, val: utf8proc_uint16_t) {
        unsafe {
            let val: u16 = ::std::mem::transmute(val);
            self._bitfield_1.set(10usize, 5u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn comb_length_raw(this: *const Self) -> utf8proc_uint16_t {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                10usize,
                5u8,
            ) as u16)
        }
    }
    #[inline]
    pub unsafe fn set_comb_length_raw(this: *mut Self, val: utf8proc_uint16_t) {
        unsafe {
            let val: u16 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                10usize,
                5u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn comb_issecond(&self) -> utf8proc_uint16_t {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
    }
    #[inline]
    pub fn set_comb_issecond(&mut self, val: utf8proc_uint16_t) {
        unsafe {
            let val: u16 = ::std::mem::transmute(val);
            self._bitfield_1.set(15usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn comb_issecond_raw(this: *const Self) -> utf8proc_uint16_t {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                15usize,
                1u8,
            ) as u16)
        }
    }
    #[inline]
    pub unsafe fn set_comb_issecond_raw(this: *mut Self, val: utf8proc_uint16_t) {
        unsafe {
            let val: u16 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                15usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn bidi_mirrored(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_bidi_mirrored(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(16usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn bidi_mirrored_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                16usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_bidi_mirrored_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                16usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn comp_exclusion(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_comp_exclusion(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(17usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn comp_exclusion_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                17usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_comp_exclusion_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                17usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn ignorable(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_ignorable(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(18usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn ignorable_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                18usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_ignorable_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                18usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn control_boundary(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_control_boundary(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(19usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn control_boundary_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                19usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_control_boundary_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                19usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn charwidth(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 2u8) as u32) }
    }
    #[inline]
    pub fn set_charwidth(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(20usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn charwidth_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                20usize,
                2u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_charwidth_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                20usize,
                2u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn ambiguous_width(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_ambiguous_width(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(22usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn ambiguous_width_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                22usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_ambiguous_width_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                22usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn pad(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_pad(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(23usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn pad_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                23usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_pad_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                23usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn boundclass(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 6u8) as u32) }
    }
    #[inline]
    pub fn set_boundclass(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(24usize, 6u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn boundclass_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                24usize,
                6u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_boundclass_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                24usize,
                6u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn indic_conjunct_break(&self) -> ::std::os::raw::c_uint {
        unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 2u8) as u32) }
    }
    #[inline]
    pub fn set_indic_conjunct_break(&mut self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            self._bitfield_1.set(30usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn indic_conjunct_break_raw(this: *const Self) -> ::std::os::raw::c_uint {
        unsafe {
            ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::std::ptr::addr_of!((*this)._bitfield_1),
                30usize,
                2u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_indic_conjunct_break_raw(this: *mut Self, val: ::std::os::raw::c_uint) {
        unsafe {
            let val: u32 = ::std::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::std::ptr::addr_of_mut!((*this)._bitfield_1),
                30usize,
                2u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        comb_index: utf8proc_uint16_t,
        comb_length: utf8proc_uint16_t,
        comb_issecond: utf8proc_uint16_t,
        bidi_mirrored: ::std::os::raw::c_uint,
        comp_exclusion: ::std::os::raw::c_uint,
        ignorable: ::std::os::raw::c_uint,
        control_boundary: ::std::os::raw::c_uint,
        charwidth: ::std::os::raw::c_uint,
        ambiguous_width: ::std::os::raw::c_uint,
        pad: ::std::os::raw::c_uint,
        boundclass: ::std::os::raw::c_uint,
        indic_conjunct_break: ::std::os::raw::c_uint,
    ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 10u8, {
            let comb_index: u16 = unsafe { ::std::mem::transmute(comb_index) };
            comb_index as u64
        });
        __bindgen_bitfield_unit.set(10usize, 5u8, {
            let comb_length: u16 = unsafe { ::std::mem::transmute(comb_length) };
            comb_length as u64
        });
        __bindgen_bitfield_unit.set(15usize, 1u8, {
            let comb_issecond: u16 = unsafe { ::std::mem::transmute(comb_issecond) };
            comb_issecond as u64
        });
        __bindgen_bitfield_unit.set(16usize, 1u8, {
            let bidi_mirrored: u32 = unsafe { ::std::mem::transmute(bidi_mirrored) };
            bidi_mirrored as u64
        });
        __bindgen_bitfield_unit.set(17usize, 1u8, {
            let comp_exclusion: u32 = unsafe { ::std::mem::transmute(comp_exclusion) };
            comp_exclusion as u64
        });
        __bindgen_bitfield_unit.set(18usize, 1u8, {
            let ignorable: u32 = unsafe { ::std::mem::transmute(ignorable) };
            ignorable as u64
        });
        __bindgen_bitfield_unit.set(19usize, 1u8, {
            let control_boundary: u32 = unsafe { ::std::mem::transmute(control_boundary) };
            control_boundary as u64
        });
        __bindgen_bitfield_unit.set(20usize, 2u8, {
            let charwidth: u32 = unsafe { ::std::mem::transmute(charwidth) };
            charwidth as u64
        });
        __bindgen_bitfield_unit.set(22usize, 1u8, {
            let ambiguous_width: u32 = unsafe { ::std::mem::transmute(ambiguous_width) };
            ambiguous_width as u64
        });
        __bindgen_bitfield_unit.set(23usize, 1u8, {
            let pad: u32 = unsafe { ::std::mem::transmute(pad) };
            pad as u64
        });
        __bindgen_bitfield_unit.set(24usize, 6u8, {
            let boundclass: u32 = unsafe { ::std::mem::transmute(boundclass) };
            boundclass as u64
        });
        __bindgen_bitfield_unit.set(30usize, 2u8, {
            let indic_conjunct_break: u32 = unsafe { ::std::mem::transmute(indic_conjunct_break) };
            indic_conjunct_break as u64
        });
        __bindgen_bitfield_unit
    }
}
#[doc = " Struct containing information about a codepoint."]
pub type utf8proc_property_t = utf8proc_property_struct;
impl utf8proc_category_t {
    #[doc = "< Other, not assigned"]
    pub const UTF8PROC_CATEGORY_CN: utf8proc_category_t = utf8proc_category_t(0);
    #[doc = "< Letter, uppercase"]
    pub const UTF8PROC_CATEGORY_LU: utf8proc_category_t = utf8proc_category_t(1);
    #[doc = "< Letter, lowercase"]
    pub const UTF8PROC_CATEGORY_LL: utf8proc_category_t = utf8proc_category_t(2);
    #[doc = "< Letter, titlecase"]
    pub const UTF8PROC_CATEGORY_LT: utf8proc_category_t = utf8proc_category_t(3);
    #[doc = "< Letter, modifier"]
    pub const UTF8PROC_CATEGORY_LM: utf8proc_category_t = utf8proc_category_t(4);
    #[doc = "< Letter, other"]
    pub const UTF8PROC_CATEGORY_LO: utf8proc_category_t = utf8proc_category_t(5);
    #[doc = "< Mark, nonspacing"]
    pub const UTF8PROC_CATEGORY_MN: utf8proc_category_t = utf8proc_category_t(6);
    #[doc = "< Mark, spacing combining"]
    pub const UTF8PROC_CATEGORY_MC: utf8proc_category_t = utf8proc_category_t(7);
    #[doc = "< Mark, enclosing"]
    pub const UTF8PROC_CATEGORY_ME: utf8proc_category_t = utf8proc_category_t(8);
    #[doc = "< Number, decimal digit"]
    pub const UTF8PROC_CATEGORY_ND: utf8proc_category_t = utf8proc_category_t(9);
    #[doc = "< Number, letter"]
    pub const UTF8PROC_CATEGORY_NL: utf8proc_category_t = utf8proc_category_t(10);
    #[doc = "< Number, other"]
    pub const UTF8PROC_CATEGORY_NO: utf8proc_category_t = utf8proc_category_t(11);
    #[doc = "< Punctuation, connector"]
    pub const UTF8PROC_CATEGORY_PC: utf8proc_category_t = utf8proc_category_t(12);
    #[doc = "< Punctuation, dash"]
    pub const UTF8PROC_CATEGORY_PD: utf8proc_category_t = utf8proc_category_t(13);
    #[doc = "< Punctuation, open"]
    pub const UTF8PROC_CATEGORY_PS: utf8proc_category_t = utf8proc_category_t(14);
    #[doc = "< Punctuation, close"]
    pub const UTF8PROC_CATEGORY_PE: utf8proc_category_t = utf8proc_category_t(15);
    #[doc = "< Punctuation, initial quote"]
    pub const UTF8PROC_CATEGORY_PI: utf8proc_category_t = utf8proc_category_t(16);
    #[doc = "< Punctuation, final quote"]
    pub const UTF8PROC_CATEGORY_PF: utf8proc_category_t = utf8proc_category_t(17);
    #[doc = "< Punctuation, other"]
    pub const UTF8PROC_CATEGORY_PO: utf8proc_category_t = utf8proc_category_t(18);
    #[doc = "< Symbol, math"]
    pub const UTF8PROC_CATEGORY_SM: utf8proc_category_t = utf8proc_category_t(19);
    #[doc = "< Symbol, currency"]
    pub const UTF8PROC_CATEGORY_SC: utf8proc_category_t = utf8proc_category_t(20);
    #[doc = "< Symbol, modifier"]
    pub const UTF8PROC_CATEGORY_SK: utf8proc_category_t = utf8proc_category_t(21);
    #[doc = "< Symbol, other"]
    pub const UTF8PROC_CATEGORY_SO: utf8proc_category_t = utf8proc_category_t(22);
    #[doc = "< Separator, space"]
    pub const UTF8PROC_CATEGORY_ZS: utf8proc_category_t = utf8proc_category_t(23);
    #[doc = "< Separator, line"]
    pub const UTF8PROC_CATEGORY_ZL: utf8proc_category_t = utf8proc_category_t(24);
    #[doc = "< Separator, paragraph"]
    pub const UTF8PROC_CATEGORY_ZP: utf8proc_category_t = utf8proc_category_t(25);
    #[doc = "< Other, control"]
    pub const UTF8PROC_CATEGORY_CC: utf8proc_category_t = utf8proc_category_t(26);
    #[doc = "< Other, format"]
    pub const UTF8PROC_CATEGORY_CF: utf8proc_category_t = utf8proc_category_t(27);
    #[doc = "< Other, surrogate"]
    pub const UTF8PROC_CATEGORY_CS: utf8proc_category_t = utf8proc_category_t(28);
    #[doc = "< Other, private use"]
    pub const UTF8PROC_CATEGORY_CO: utf8proc_category_t = utf8proc_category_t(29);
}
#[repr(transparent)]
#[doc = " Unicode categories."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct utf8proc_category_t(pub ::std::os::raw::c_uint);
impl utf8proc_bidi_class_t {
    #[doc = "< Left-to-Right"]
    pub const UTF8PROC_BIDI_CLASS_L: utf8proc_bidi_class_t = utf8proc_bidi_class_t(1);
    #[doc = "< Left-to-Right Embedding"]
    pub const UTF8PROC_BIDI_CLASS_LRE: utf8proc_bidi_class_t = utf8proc_bidi_class_t(2);
    #[doc = "< Left-to-Right Override"]
    pub const UTF8PROC_BIDI_CLASS_LRO: utf8proc_bidi_class_t = utf8proc_bidi_class_t(3);
    #[doc = "< Right-to-Left"]
    pub const UTF8PROC_BIDI_CLASS_R: utf8proc_bidi_class_t = utf8proc_bidi_class_t(4);
    #[doc = "< Right-to-Left Arabic"]
    pub const UTF8PROC_BIDI_CLASS_AL: utf8proc_bidi_class_t = utf8proc_bidi_class_t(5);
    #[doc = "< Right-to-Left Embedding"]
    pub const UTF8PROC_BIDI_CLASS_RLE: utf8proc_bidi_class_t = utf8proc_bidi_class_t(6);
    #[doc = "< Right-to-Left Override"]
    pub const UTF8PROC_BIDI_CLASS_RLO: utf8proc_bidi_class_t = utf8proc_bidi_class_t(7);
    #[doc = "< Pop Directional Format"]
    pub const UTF8PROC_BIDI_CLASS_PDF: utf8proc_bidi_class_t = utf8proc_bidi_class_t(8);
    #[doc = "< European Number"]
    pub const UTF8PROC_BIDI_CLASS_EN: utf8proc_bidi_class_t = utf8proc_bidi_class_t(9);
    #[doc = "< European Separator"]
    pub const UTF8PROC_BIDI_CLASS_ES: utf8proc_bidi_class_t = utf8proc_bidi_class_t(10);
    #[doc = "< European Number Terminator"]
    pub const UTF8PROC_BIDI_CLASS_ET: utf8proc_bidi_class_t = utf8proc_bidi_class_t(11);
    #[doc = "< Arabic Number"]
    pub const UTF8PROC_BIDI_CLASS_AN: utf8proc_bidi_class_t = utf8proc_bidi_class_t(12);
    #[doc = "< Common Number Separator"]
    pub const UTF8PROC_BIDI_CLASS_CS: utf8proc_bidi_class_t = utf8proc_bidi_class_t(13);
    #[doc = "< Nonspacing Mark"]
    pub const UTF8PROC_BIDI_CLASS_NSM: utf8proc_bidi_class_t = utf8proc_bidi_class_t(14);
    #[doc = "< Boundary Neutral"]
    pub const UTF8PROC_BIDI_CLASS_BN: utf8proc_bidi_class_t = utf8proc_bidi_class_t(15);
    #[doc = "< Paragraph Separator"]
    pub const UTF8PROC_BIDI_CLASS_B: utf8proc_bidi_class_t = utf8proc_bidi_class_t(16);
    #[doc = "< Segment Separator"]
    pub const UTF8PROC_BIDI_CLASS_S: utf8proc_bidi_class_t = utf8proc_bidi_class_t(17);
    #[doc = "< Whitespace"]
    pub const UTF8PROC_BIDI_CLASS_WS: utf8proc_bidi_class_t = utf8proc_bidi_class_t(18);
    #[doc = "< Other Neutrals"]
    pub const UTF8PROC_BIDI_CLASS_ON: utf8proc_bidi_class_t = utf8proc_bidi_class_t(19);
    #[doc = "< Left-to-Right Isolate"]
    pub const UTF8PROC_BIDI_CLASS_LRI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(20);
    #[doc = "< Right-to-Left Isolate"]
    pub const UTF8PROC_BIDI_CLASS_RLI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(21);
    #[doc = "< First Strong Isolate"]
    pub const UTF8PROC_BIDI_CLASS_FSI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(22);
    #[doc = "< Pop Directional Isolate"]
    pub const UTF8PROC_BIDI_CLASS_PDI: utf8proc_bidi_class_t = utf8proc_bidi_class_t(23);
}
#[repr(transparent)]
#[doc = " Bidirectional character classes."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct utf8proc_bidi_class_t(pub ::std::os::raw::c_uint);
impl utf8proc_decomp_type_t {
    #[doc = "< Font"]
    pub const UTF8PROC_DECOMP_TYPE_FONT: utf8proc_decomp_type_t = utf8proc_decomp_type_t(1);
    #[doc = "< Nobreak"]
    pub const UTF8PROC_DECOMP_TYPE_NOBREAK: utf8proc_decomp_type_t = utf8proc_decomp_type_t(2);
    #[doc = "< Initial"]
    pub const UTF8PROC_DECOMP_TYPE_INITIAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(3);
    #[doc = "< Medial"]
    pub const UTF8PROC_DECOMP_TYPE_MEDIAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(4);
    #[doc = "< Final"]
    pub const UTF8PROC_DECOMP_TYPE_FINAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(5);
    #[doc = "< Isolated"]
    pub const UTF8PROC_DECOMP_TYPE_ISOLATED: utf8proc_decomp_type_t = utf8proc_decomp_type_t(6);
    #[doc = "< Circle"]
    pub const UTF8PROC_DECOMP_TYPE_CIRCLE: utf8proc_decomp_type_t = utf8proc_decomp_type_t(7);
    #[doc = "< Super"]
    pub const UTF8PROC_DECOMP_TYPE_SUPER: utf8proc_decomp_type_t = utf8proc_decomp_type_t(8);
    #[doc = "< Sub"]
    pub const UTF8PROC_DECOMP_TYPE_SUB: utf8proc_decomp_type_t = utf8proc_decomp_type_t(9);
    #[doc = "< Vertical"]
    pub const UTF8PROC_DECOMP_TYPE_VERTICAL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(10);
    #[doc = "< Wide"]
    pub const UTF8PROC_DECOMP_TYPE_WIDE: utf8proc_decomp_type_t = utf8proc_decomp_type_t(11);
    #[doc = "< Narrow"]
    pub const UTF8PROC_DECOMP_TYPE_NARROW: utf8proc_decomp_type_t = utf8proc_decomp_type_t(12);
    #[doc = "< Small"]
    pub const UTF8PROC_DECOMP_TYPE_SMALL: utf8proc_decomp_type_t = utf8proc_decomp_type_t(13);
    #[doc = "< Square"]
    pub const UTF8PROC_DECOMP_TYPE_SQUARE: utf8proc_decomp_type_t = utf8proc_decomp_type_t(14);
    #[doc = "< Fraction"]
    pub const UTF8PROC_DECOMP_TYPE_FRACTION: utf8proc_decomp_type_t = utf8proc_decomp_type_t(15);
    #[doc = "< Compat"]
    pub const UTF8PROC_DECOMP_TYPE_COMPAT: utf8proc_decomp_type_t = utf8proc_decomp_type_t(16);
}
#[repr(transparent)]
#[doc = " Decomposition type."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct utf8proc_decomp_type_t(pub ::std::os::raw::c_uint);
impl utf8proc_boundclass_t {
    #[doc = "< Start"]
    pub const UTF8PROC_BOUNDCLASS_START: utf8proc_boundclass_t = utf8proc_boundclass_t(0);
    #[doc = "< Other"]
    pub const UTF8PROC_BOUNDCLASS_OTHER: utf8proc_boundclass_t = utf8proc_boundclass_t(1);
    #[doc = "< Cr"]
    pub const UTF8PROC_BOUNDCLASS_CR: utf8proc_boundclass_t = utf8proc_boundclass_t(2);
    #[doc = "< Lf"]
    pub const UTF8PROC_BOUNDCLASS_LF: utf8proc_boundclass_t = utf8proc_boundclass_t(3);
    #[doc = "< Control"]
    pub const UTF8PROC_BOUNDCLASS_CONTROL: utf8proc_boundclass_t = utf8proc_boundclass_t(4);
    #[doc = "< Extend"]
    pub const UTF8PROC_BOUNDCLASS_EXTEND: utf8proc_boundclass_t = utf8proc_boundclass_t(5);
    #[doc = "< L"]
    pub const UTF8PROC_BOUNDCLASS_L: utf8proc_boundclass_t = utf8proc_boundclass_t(6);
    #[doc = "< V"]
    pub const UTF8PROC_BOUNDCLASS_V: utf8proc_boundclass_t = utf8proc_boundclass_t(7);
    #[doc = "< T"]
    pub const UTF8PROC_BOUNDCLASS_T: utf8proc_boundclass_t = utf8proc_boundclass_t(8);
    #[doc = "< Lv"]
    pub const UTF8PROC_BOUNDCLASS_LV: utf8proc_boundclass_t = utf8proc_boundclass_t(9);
    #[doc = "< Lvt"]
    pub const UTF8PROC_BOUNDCLASS_LVT: utf8proc_boundclass_t = utf8proc_boundclass_t(10);
    #[doc = "< Regional indicator"]
    pub const UTF8PROC_BOUNDCLASS_REGIONAL_INDICATOR: utf8proc_boundclass_t = utf8proc_boundclass_t(11);
    #[doc = "< Spacingmark"]
    pub const UTF8PROC_BOUNDCLASS_SPACINGMARK: utf8proc_boundclass_t = utf8proc_boundclass_t(12);
    #[doc = "< Prepend"]
    pub const UTF8PROC_BOUNDCLASS_PREPEND: utf8proc_boundclass_t = utf8proc_boundclass_t(13);
    #[doc = "< Zero Width Joiner"]
    pub const UTF8PROC_BOUNDCLASS_ZWJ: utf8proc_boundclass_t = utf8proc_boundclass_t(14);
    #[doc = "< Emoji Base"]
    pub const UTF8PROC_BOUNDCLASS_E_BASE: utf8proc_boundclass_t = utf8proc_boundclass_t(15);
    #[doc = "< Emoji Modifier"]
    pub const UTF8PROC_BOUNDCLASS_E_MODIFIER: utf8proc_boundclass_t = utf8proc_boundclass_t(16);
    #[doc = "< Glue_After_ZWJ"]
    pub const UTF8PROC_BOUNDCLASS_GLUE_AFTER_ZWJ: utf8proc_boundclass_t = utf8proc_boundclass_t(17);
    #[doc = "< E_BASE + GLUE_AFTER_ZJW"]
    pub const UTF8PROC_BOUNDCLASS_E_BASE_GAZ: utf8proc_boundclass_t = utf8proc_boundclass_t(18);
    pub const UTF8PROC_BOUNDCLASS_EXTENDED_PICTOGRAPHIC: utf8proc_boundclass_t = utf8proc_boundclass_t(19);
    pub const UTF8PROC_BOUNDCLASS_E_ZWG: utf8proc_boundclass_t = utf8proc_boundclass_t(20);
}
#[repr(transparent)]
#[doc = " Boundclass property. (TR29)"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct utf8proc_boundclass_t(pub ::std::os::raw::c_uint);
impl utf8proc_indic_conjunct_break_t {
    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_NONE: utf8proc_indic_conjunct_break_t = utf8proc_indic_conjunct_break_t(0);
    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_LINKER: utf8proc_indic_conjunct_break_t =
        utf8proc_indic_conjunct_break_t(1);
    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_CONSONANT: utf8proc_indic_conjunct_break_t =
        utf8proc_indic_conjunct_break_t(2);
    pub const UTF8PROC_INDIC_CONJUNCT_BREAK_EXTEND: utf8proc_indic_conjunct_break_t =
        utf8proc_indic_conjunct_break_t(3);
}
#[repr(transparent)]
#[doc = " Indic_Conjunct_Break property. (TR44)"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct utf8proc_indic_conjunct_break_t(pub ::std::os::raw::c_uint);
#[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."]
pub type utf8proc_custom_func = ::std::option::Option<
    unsafe extern "C" fn(codepoint: utf8proc_int32_t, data: *mut ::std::os::raw::c_void) -> utf8proc_int32_t,
>;
unsafe extern "C" {
    #[doc = " Array containing the byte lengths of a UTF-8 encoded codepoint based\n on the first byte."]
    pub static utf8proc_utf8class: [utf8proc_int8_t; 256usize];
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_version() -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = " Returns the utf8proc supported Unicode version as a string MAJOR.MINOR.PATCH."]
    pub fn utf8proc_unicode_version() -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[doc = " Returns an informative error string for the given utf8proc error code\n (e.g. the error codes returned by utf8proc_map())."]
    pub fn utf8proc_errmsg(errcode: utf8proc_ssize_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_iterate(
        str_: *const utf8proc_uint8_t,
        strlen: utf8proc_ssize_t,
        codepoint_ref: *mut utf8proc_int32_t,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_codepoint_valid(codepoint: utf8proc_int32_t) -> utf8proc_bool;
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_encode_char(codepoint: utf8proc_int32_t, dst: *mut utf8proc_uint8_t) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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)."]
    pub fn utf8proc_get_property(codepoint: utf8proc_int32_t) -> *const utf8proc_property_t;
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_decompose_char(
        codepoint: utf8proc_int32_t,
        dst: *mut utf8proc_int32_t,
        bufsize: utf8proc_ssize_t,
        options: utf8proc_option_t,
        last_boundclass: *mut ::std::os::raw::c_int,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_decompose(
        str_: *const utf8proc_uint8_t,
        strlen: utf8proc_ssize_t,
        buffer: *mut utf8proc_int32_t,
        bufsize: utf8proc_ssize_t,
        options: utf8proc_option_t,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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()."]
    pub fn utf8proc_decompose_custom(
        str_: *const utf8proc_uint8_t,
        strlen: utf8proc_ssize_t,
        buffer: *mut utf8proc_int32_t,
        bufsize: utf8proc_ssize_t,
        options: utf8proc_option_t,
        custom_func: utf8proc_custom_func,
        custom_data: *mut ::std::os::raw::c_void,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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!"]
    pub fn utf8proc_normalize_utf32(
        buffer: *mut utf8proc_int32_t,
        length: utf8proc_ssize_t,
        options: utf8proc_option_t,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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!"]
    pub fn utf8proc_reencode(
        buffer: *mut utf8proc_int32_t,
        length: utf8proc_ssize_t,
        options: utf8proc_option_t,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_grapheme_break_stateful(
        codepoint1: utf8proc_int32_t,
        codepoint2: utf8proc_int32_t,
        state: *mut utf8proc_int32_t,
    ) -> utf8proc_bool;
}
unsafe extern "C" {
    #[doc = " Same as utf8proc_grapheme_break_stateful(), except without support for the\n Unicode 9 additions to the algorithm. Supported for legacy reasons."]
    pub fn utf8proc_grapheme_break(codepoint1: utf8proc_int32_t, codepoint2: utf8proc_int32_t) -> utf8proc_bool;
}
unsafe extern "C" {
    #[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`."]
    pub fn utf8proc_tolower(c: utf8proc_int32_t) -> utf8proc_int32_t;
}
unsafe extern "C" {
    #[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`."]
    pub fn utf8proc_toupper(c: utf8proc_int32_t) -> utf8proc_int32_t;
}
unsafe extern "C" {
    #[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`."]
    pub fn utf8proc_totitle(c: utf8proc_int32_t) -> utf8proc_int32_t;
}
unsafe extern "C" {
    #[doc = " Given a codepoint `c`, return `1` if the codepoint corresponds to a lower-case character\n and `0` otherwise."]
    pub fn utf8proc_islower(c: utf8proc_int32_t) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[doc = " Given a codepoint `c`, return `1` if the codepoint corresponds to an upper-case character\n and `0` otherwise."]
    pub fn utf8proc_isupper(c: utf8proc_int32_t) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[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()."]
    pub fn utf8proc_charwidth(codepoint: utf8proc_int32_t) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
    #[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."]
    pub fn utf8proc_charwidth_ambiguous(codepoint: utf8proc_int32_t) -> utf8proc_bool;
}
unsafe extern "C" {
    #[doc = " Return the Unicode category for the codepoint (one of the\n @ref utf8proc_category_t constants.)"]
    pub fn utf8proc_category(codepoint: utf8proc_int32_t) -> utf8proc_category_t;
}
unsafe extern "C" {
    #[doc = " Return the two-letter (nul-terminated) Unicode category string for\n the codepoint (e.g. `\"Lu\"` or `\"Co\"`)."]
    pub fn utf8proc_category_string(codepoint: utf8proc_int32_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
    #[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`."]
    pub fn utf8proc_map(
        str_: *const utf8proc_uint8_t,
        strlen: utf8proc_ssize_t,
        dstptr: *mut *mut utf8proc_uint8_t,
        options: utf8proc_option_t,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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`."]
    pub fn utf8proc_map_custom(
        str_: *const utf8proc_uint8_t,
        strlen: utf8proc_ssize_t,
        dstptr: *mut *mut utf8proc_uint8_t,
        options: utf8proc_option_t,
        custom_func: utf8proc_custom_func,
        custom_data: *mut ::std::os::raw::c_void,
    ) -> utf8proc_ssize_t;
}
unsafe extern "C" {
    #[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)."]
    pub fn utf8proc_NFD(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
}
unsafe extern "C" {
    #[doc = " NFC normalization (@ref UTF8PROC_COMPOSE)."]
    pub fn utf8proc_NFC(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
}
unsafe extern "C" {
    #[doc = " NFKD normalization (@ref UTF8PROC_DECOMPOSE and @ref UTF8PROC_COMPAT)."]
    pub fn utf8proc_NFKD(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
}
unsafe extern "C" {
    #[doc = " NFKC normalization (@ref UTF8PROC_COMPOSE and @ref UTF8PROC_COMPAT)."]
    pub fn utf8proc_NFKC(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
}
unsafe extern "C" {
    #[doc = " NFKC_Casefold normalization (@ref UTF8PROC_COMPOSE and @ref UTF8PROC_COMPAT\n and @ref UTF8PROC_CASEFOLD and @ref UTF8PROC_IGNORE)."]
    pub fn utf8proc_NFKC_Casefold(str_: *const utf8proc_uint8_t) -> *mut utf8proc_uint8_t;
}