## hb-set hb-set — Object representing a set of integers |

## Functions

void | hb_set_add ()
void | hb_set_add_range ()
hb_bool_t | hb_set_allocation_successful ()
void | hb_set_clear ()
hb_set_t * | hb_set_create ()
void | hb_set_del ()
void | hb_set_del_range ()
void | hb_set_destroy ()
hb_set_t * | hb_set_get_empty ()
hb_codepoint_t | hb_set_get_max ()
hb_codepoint_t | hb_set_get_min ()
unsigned int | hb_set_get_population ()
void * | hb_set_get_user_data ()
hb_bool_t | hb_set_has ()
void | hb_set_intersect ()
hb_bool_t | hb_set_is_empty ()
hb_bool_t | hb_set_is_equal ()
hb_bool_t | hb_set_is_subset ()
hb_bool_t | hb_set_next ()
hb_bool_t | hb_set_next_range ()
hb_bool_t | hb_set_previous ()
hb_bool_t | hb_set_previous_range ()
hb_set_t * | hb_set_reference ()
void | hb_set_set ()
hb_bool_t | hb_set_set_user_data ()
void | hb_set_subtract ()
void | hb_set_symmetric_difference ()
void | hb_set_union ()

## Types and Values

#define | HB_SET_VALUE_INVALID
typedef | hb_set_t

## Includes

    #include <hb.h>

## Description

Set objects represent a mathematical set of integer values. They are used in non-shaping API to query certain set of characters or glyphs, or other integer values.

## Functions

### hb_set_add ()

    void
    hb_set_add (hb_set_t *set,
                hb_codepoint_t codepoint);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_add_range ()

    void
    hb_set_add_range (hb_set_t *set,
                      hb_codepoint_t first,
                      hb_codepoint_t last);

#### Parameters

set | a set. |

Since: 0.9.7

### hb_set_allocation_successful ()

    hb_bool_t
    hb_set_allocation_successful (const hb_set_t *set);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_clear ()

    void
    hb_set_clear (hb_set_t *set);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_create ()

    hb_set_t *
    hb_set_create (void);

[Xconstructor]

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_set_del ()

    void
    hb_set_del (hb_set_t *set,
                hb_codepoint_t codepoint);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_del_range ()

    void
    hb_set_del_range (hb_set_t *set,
                      hb_codepoint_t first,
                      hb_codepoint_t last);

#### Parameters

set | a set. |

Since: 0.9.7

### hb_set_destroy ()

    void
    hb_set_destroy (hb_set_t *set);

[skip]

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_get_empty ()

    hb_set_t *
    hb_set_get_empty (void);

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_set_get_max ()

    hb_codepoint_t
    hb_set_get_max (const hb_set_t *set);

Finds the maximum number in the set.

#### Parameters

set | a set. |

#### Returns

minimum of the set, or `HB_SET_VALUE_INVALID` if set is empty.

Since: 0.9.7

### hb_set_get_min ()

    hb_codepoint_t
    hb_set_get_min (const hb_set_t *set);

Finds the minimum number in the set.

#### Parameters

set | a set. |

#### Returns

minimum of the set, or `HB_SET_VALUE_INVALID` if set is empty.

Since: 0.9.7

### hb_set_get_population ()

    unsigned int
    hb_set_get_population (const hb_set_t *set);

Returns the number of numbers in the set.

#### Parameters

set | a set. |

#### Returns

set population.

Since: 0.9.7

### hb_set_get_user_data ()

    void *
    hb_set_get_user_data (hb_set_t *set,
                          hb_user_data_key_t *key);

[skip]

#### Parameters

set | a set. |

#### Returns

.

[transfer none]

Since: 0.9.2

### hb_set_has ()

    hb_bool_t
    hb_set_has (const hb_set_t *set,
                hb_codepoint_t codepoint);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_intersect ()

    void
    hb_set_intersect (hb_set_t *set,
                      const hb_set_t *other);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_is_empty ()

    hb_bool_t
    hb_set_is_empty (const hb_set_t *set);

#### Parameters

set | a set. |

Since: 0.9.7

### hb_set_is_equal ()

    hb_bool_t
    hb_set_is_equal (const hb_set_t *set,
                     const hb_set_t *other);

#### Parameters

set | a set. |
other | other set. |

#### Returns

`TRUE` if the two sets are equal, `FALSE` otherwise.

Since: 0.9.7

### hb_set_is_subset ()

    hb_bool_t
    hb_set_is_subset (const hb_set_t *set,
                      const hb_set_t *larger_set);

#### Parameters

set | a set. |
larger_set | other set. |

#### Returns

`TRUE` if the `set` is a subset of (or equal to) `larger_set` , `FALSE` otherwise.

Since: 1.8.1

### hb_set_next ()

    hb_bool_t
    hb_set_next (const hb_set_t *set,
                 hb_codepoint_t *codepoint);

Gets the next number in `set` that is greater than current value of `codepoint` .

Set `codepoint` to `HB_SET_VALUE_INVALID` to get started.

#### Parameters

set | a set. |
codepoint | . | [inout]

#### Returns

whether there was a next value.

Since: 0.9.2

### hb_set_next_range ()

    hb_bool_t
    hb_set_next_range (const hb_set_t *set,
                       hb_codepoint_t *first,
                       hb_codepoint_t *last);

Gets the next consecutive range of numbers in `set` that are greater than current value of `last` .

Set `last` to `HB_SET_VALUE_INVALID` to get started.

#### Parameters

set | a set. |
first | output first codepoint in the range. | [out]
last | input current last and output last codepoint in the range. | [inout]

#### Returns

whether there was a next range.

Since: 0.9.7

### hb_set_previous ()

    hb_bool_t
    hb_set_previous (const hb_set_t *set,
                     hb_codepoint_t *codepoint);

Gets the previous number in `set` that is lower than current value of `codepoint` .

Set `codepoint` to `HB_SET_VALUE_INVALID` to get started.

#### Parameters

set | a set. |
codepoint | . | [inout]

#### Returns

whether there was a previous value.

Since: 1.8.0

### hb_set_previous_range ()

    hb_bool_t
    hb_set_previous_range (const hb_set_t *set,
                           hb_codepoint_t *first,
                           hb_codepoint_t *last);

Gets the previous consecutive range of numbers in `set` that are less than current value of `first` .

Set `first` to `HB_SET_VALUE_INVALID` to get started.

#### Parameters

set | a set. |
first | input current first and output first codepoint in the range. | [inout]
last | output last codepoint in the range. | [out]

#### Returns

whether there was a previous range.

Since: 1.8.0

### hb_set_reference ()

    hb_set_t *
    hb_set_reference (hb_set_t *set);

[skip]

#### Parameters

set | a set. |

#### Returns

.

[transfer full]

Since: 0.9.2

### hb_set_set ()

    void
    hb_set_set (hb_set_t *set,
                const hb_set_t *other);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_set_user_data ()

    hb_bool_t
    hb_set_set_user_data (hb_set_t *set,
                          hb_user_data_key_t *key,
                          void *data,
                          hb_destroy_func_t destroy,
                          hb_bool_t replace);

[skip]

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_subtract ()

    void
    hb_set_subtract (hb_set_t *set,
                     const hb_set_t *other);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_symmetric_difference ()

    void
    hb_set_symmetric_difference (hb_set_t *set,
                                 const hb_set_t *other);

#### Parameters

set | a set. |

Since: 0.9.2

### hb_set_union ()

    void
    hb_set_union (hb_set_t *set,
                  const hb_set_t *other);

#### Parameters

set | a set. |

Since: 0.9.2

## Types and Values

### HB_SET_VALUE_INVALID

    #define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1)

### hb_set_t

    typedef struct hb_set_t hb_set_t;