[set] Add hb_set_copy()

Fixes https://github.com/harfbuzz/harfbuzz/issues/3016
This commit is contained in:
Behdad Esfahbod 2021-06-09 14:02:31 -06:00
parent bc33b87f5e
commit 3962225a72
3 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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);