4 #include <harfbuzz-external.h>
6 #include "tables/category-properties.h"
7 #include "tables/combining-properties.h"
10 HB_GetLineBreakClass(HB_UChar32 ch
) {
16 combining_property_cmp(const void *vkey
, const void *vcandidate
) {
17 const uint32_t key
= (uint32_t) (intptr_t) vkey
;
18 const struct combining_property
*candidate
= vcandidate
;
20 if (key
< candidate
->range_start
) {
22 } else if (key
> candidate
->range_end
) {
30 code_point_to_combining_class(HB_UChar32 cp
) {
31 const void *vprop
= bsearch((void *) (intptr_t) cp
, combining_properties
,
32 combining_properties_count
,
33 sizeof(struct combining_property
),
34 combining_property_cmp
);
38 return ((const struct combining_property
*) vprop
)->klass
;
42 HB_GetUnicodeCharCombiningClass(HB_UChar32 ch
) {
43 return code_point_to_combining_class(ch
);
48 category_property_cmp(const void *vkey
, const void *vcandidate
) {
49 const uint32_t key
= (uint32_t) (intptr_t) vkey
;
50 const struct category_property
*candidate
= vcandidate
;
52 if (key
< candidate
->range_start
) {
54 } else if (key
> candidate
->range_end
) {
61 static HB_CharCategory
62 code_point_to_category(HB_UChar32 cp
) {
63 const void *vprop
= bsearch((void *) (intptr_t) cp
, category_properties
,
64 category_properties_count
,
65 sizeof(struct category_property
),
66 category_property_cmp
);
68 return HB_Other_NotAssigned
;
70 return ((const struct category_property
*) vprop
)->category
;
74 HB_GetUnicodeCharProperties(HB_UChar32 ch
,
75 HB_CharCategory
*category
,
76 int *combiningClass
) {
77 *category
= code_point_to_category(ch
);
78 *combiningClass
= code_point_to_combining_class(ch
);
82 HB_GetUnicodeCharCategory(HB_UChar32 ch
) {
83 return code_point_to_category(ch
);