diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 6f0da7218..fafc7c7fc 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -637,6 +637,7 @@ hb_ot_var_normalize_coords HB_SET_VALUE_INVALID hb_set_add hb_set_add_range +hb_set_add_sorted_codepoints hb_set_allocation_successful hb_set_copy hb_set_clear diff --git a/src/hb-set.cc b/src/hb-set.cc index 7c80fc267..b2f9091f3 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -257,9 +257,14 @@ hb_set_add (hb_set_t *set, } /** - * Adds num_codepoints codepoints to a set at once. + * hb_set_add_sorted_array: + * @set: A set + * @sorted_codepoints: (array length=num_codepoints) Array of codepoints to add + * @num_codepoints: Length of @sorted_codepoints + * + * Adds @num_codepoints codepoints to a set at once. * The codepoints array must be in increasing order, - * with size at least num_codepoints. + * with size at least @num_codepoints. * * Since: REPLACEME */ @@ -268,6 +273,7 @@ hb_set_add_sorted_array (hb_set_t *set, const hb_codepoint_t *sorted_codepoints, unsigned int num_codepoints) { + /* Immutible-safe. */ set->add_sorted_array (sorted_codepoints, num_codepoints, sizeof(hb_codepoint_t)); diff --git a/src/hb-set.h b/src/hb-set.h index 19374e022..adf34fb6a 100644 --- a/src/hb-set.h +++ b/src/hb-set.h @@ -60,11 +60,6 @@ typedef struct hb_set_t hb_set_t; HB_EXTERN hb_set_t * hb_set_create (void); -HB_EXTERN void -hb_set_add_sorted_array (hb_set_t *set, - const hb_codepoint_t *sorted_codepoints, - unsigned int num_codepoints); - HB_EXTERN hb_set_t * hb_set_get_empty (void); @@ -115,6 +110,11 @@ hb_set_add_range (hb_set_t *set, hb_codepoint_t first, hb_codepoint_t last); +HB_EXTERN void +hb_set_add_sorted_array (hb_set_t *set, + const hb_codepoint_t *sorted_codepoints, + unsigned int num_codepoints); + HB_EXTERN void hb_set_del (hb_set_t *set, hb_codepoint_t codepoint);