diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 6b5866223..b94f7103c 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -599,6 +599,7 @@ HB_SET_VALUE_INVALID hb_set_add hb_set_add_range hb_set_allocation_successful +hb_set_copy hb_set_clear hb_set_create hb_set_del diff --git a/src/hb-set.cc b/src/hb-set.cc index d75e57fd7..d7d5f79e5 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -172,6 +172,24 @@ hb_set_allocation_successful (const hb_set_t *set) return set->successful; } +/** + * hb_set_copy: + * @set: A set + * + * Allocate a copy of @set. + * + * Return value: Newly-allocated set. + * + * Since: REPLACEME + **/ +hb_set_t * +hb_set_copy (const hb_set_t *set) +{ + hb_set_t *copy = hb_set_create (); + copy->set (set); + return copy; +} + /** * hb_set_clear: * @set: A set diff --git a/src/hb-set.h b/src/hb-set.h index 0ad27f4bb..7f2112e69 100644 --- a/src/hb-set.h +++ b/src/hb-set.h @@ -85,6 +85,9 @@ hb_set_get_user_data (hb_set_t *set, HB_EXTERN hb_bool_t hb_set_allocation_successful (const hb_set_t *set); +HB_EXTERN hb_set_t * +hb_set_copy (const hb_set_t *set); + HB_EXTERN void hb_set_clear (hb_set_t *set);