Lines Matching full:set

27 #include "hb-set.hh"
31 * SECTION:hb-set
32 * @title: hb-set
33 * @short_description: Objects representing a set of integers
36 * Set objects represent a mathematical set of integer values. They are
45 * Creates a new, initially empty set.
54 hb_set_t *set; in hb_set_create() local
56 if (!(set = hb_object_create<hb_set_t> ())) in hb_set_create()
59 return set; in hb_set_create()
79 * @set: A set
81 * Increases the reference count on a set.
83 * Return value: (transfer full): The set
88 hb_set_reference (hb_set_t *set) in hb_set_reference() argument
90 return hb_object_reference (set); in hb_set_reference()
95 * @set: A set
97 * Decreases the reference count on a set. When
98 * the reference count reaches zero, the set is
104 hb_set_destroy (hb_set_t *set) in hb_set_destroy() argument
106 if (!hb_object_destroy (set)) return; in hb_set_destroy()
108 hb_free (set); in hb_set_destroy()
113 * @set: A set
114 * @key: The user-data key to set
115 * @data: A pointer to the user data to set
119 * Attaches a user-data key/data pair to the specified set.
126 hb_set_set_user_data (hb_set_t *set, in hb_set_set_user_data() argument
132 return hb_object_set_user_data (set, key, data, destroy, replace); in hb_set_set_user_data()
137 * @set: A set
141 * attached to the specified set.
148 hb_set_get_user_data (const hb_set_t *set, in hb_set_get_user_data() argument
151 return hb_object_get_user_data (set, key); in hb_set_get_user_data()
157 * @set: A set
159 * Tests whether memory allocation for a set was successful.
166 hb_set_allocation_successful (const hb_set_t *set) in hb_set_allocation_successful() argument
168 return !set->in_error (); in hb_set_allocation_successful()
173 * @set: A set
175 * Allocate a copy of @set.
177 * Return value: (transfer full): Newly-allocated set.
182 hb_set_copy (const hb_set_t *set) in hb_set_copy() argument
188 copy->set (*set); in hb_set_copy()
194 * @set: A set
196 * Clears out the contents of a set.
201 hb_set_clear (hb_set_t *set) in hb_set_clear() argument
204 set->clear (); in hb_set_clear()
209 * @set: a set.
211 * Tests whether a set is empty (contains no elements).
213 * Return value: `true` if @set is empty
218 hb_set_is_empty (const hb_set_t *set) in hb_set_is_empty() argument
220 return set->is_empty (); in hb_set_is_empty()
225 * @set: A set
228 * Tests whether @codepoint belongs to @set.
230 * Return value: `true` if @codepoint is in @set, `false` otherwise
235 hb_set_has (const hb_set_t *set, in hb_set_has() argument
238 return set->has (codepoint); in hb_set_has()
243 * @set: A set
244 * @codepoint: The element to add to @set
246 * Adds @codepoint to @set.
251 hb_set_add (hb_set_t *set, in hb_set_add() argument
255 set->add (codepoint); in hb_set_add()
260 * @set: A set
264 * Adds @num_codepoints codepoints to a set at once.
271 hb_set_add_sorted_array (hb_set_t *set, in hb_set_add_sorted_array() argument
276 set->add_sorted_array (sorted_codepoints, in hb_set_add_sorted_array()
283 * @set: A set
284 * @first: The first element to add to @set
285 * @last: The final element to add to @set
288 * (inclusive) to @set.
293 hb_set_add_range (hb_set_t *set, in hb_set_add_range() argument
298 set->add_range (first, last); in hb_set_add_range()
303 * @set: A set
304 * @codepoint: Removes @codepoint from @set
306 * Removes @codepoint from @set.
311 hb_set_del (hb_set_t *set, in hb_set_del() argument
315 set->del (codepoint); in hb_set_del()
320 * @set: A set
321 * @first: The first element to remove from @set
322 * @last: The final element to remove from @set
325 * (inclusive) from @set.
333 hb_set_del_range (hb_set_t *set, in hb_set_del_range() argument
338 set->del_range (first, last); in hb_set_del_range()
343 * @set: A set
344 * @other: Another set
346 * Tests whether @set and @other are equal (contain the same
354 hb_set_is_equal (const hb_set_t *set, in hb_set_is_equal() argument
357 return set->is_equal (*other); in hb_set_is_equal()
362 * @set: A set
364 * Creates a hash representing @set.
367 * A hash of @set.
372 hb_set_hash (const hb_set_t *set) in hb_set_hash() argument
374 return set->hash (); in hb_set_hash()
379 * @set: A set
380 * @larger_set: Another set
382 * Tests whether @set is a subset of @larger_set.
384 * Return value: `true` if the @set is a subset of (or equal to) @larger_set, `false` otherwise.
389 hb_set_is_subset (const hb_set_t *set, in hb_set_is_subset() argument
392 return set->is_subset (*larger_set); in hb_set_is_subset()
397 * @set: A set
398 * @other: Another set
400 * Makes the contents of @set equal to the contents of @other.
405 hb_set_set (hb_set_t *set, in hb_set_set() argument
409 set->set (*other); in hb_set_set()
414 * @set: A set
415 * @other: Another set
417 * Makes @set the union of @set and @other.
422 hb_set_union (hb_set_t *set, in hb_set_union() argument
426 set->union_ (*other); in hb_set_union()
431 * @set: A set
432 * @other: Another set
434 * Makes @set the intersection of @set and @other.
439 hb_set_intersect (hb_set_t *set, in hb_set_intersect() argument
443 set->intersect (*other); in hb_set_intersect()
448 * @set: A set
449 * @other: Another set
451 * Subtracts the contents of @other from @set.
456 hb_set_subtract (hb_set_t *set, in hb_set_subtract() argument
460 set->subtract (*other); in hb_set_subtract()
465 * @set: A set
466 * @other: Another set
468 * Makes @set the symmetric difference of @set
474 hb_set_symmetric_difference (hb_set_t *set, in hb_set_symmetric_difference() argument
478 set->symmetric_difference (*other); in hb_set_symmetric_difference()
483 * @set: A set
485 * Inverts the contents of @set.
490 hb_set_invert (hb_set_t *set) in hb_set_invert() argument
493 set->invert (); in hb_set_invert()
498 * @set: A set
500 * Returns whether the set is inverted.
502 * Return value: `true` if the set is inverted, `false` otherwise
507 hb_set_is_inverted (const hb_set_t *set) in hb_set_is_inverted() argument
509 return set->is_inverted (); in hb_set_is_inverted()
514 * @set: A set
516 * Returns the number of elements in the set.
518 * Return value: The population of @set
523 hb_set_get_population (const hb_set_t *set) in hb_set_get_population() argument
525 return set->get_population (); in hb_set_get_population()
530 * @set: A set
532 * Finds the smallest element in the set.
534 * Return value: minimum of @set, or #HB_SET_VALUE_INVALID if @set is empty.
539 hb_set_get_min (const hb_set_t *set) in hb_set_get_min() argument
541 return set->get_min (); in hb_set_get_min()
546 * @set: A set
548 * Finds the largest element in the set.
550 * Return value: maximum of @set, or #HB_SET_VALUE_INVALID if @set is empty.
555 hb_set_get_max (const hb_set_t *set) in hb_set_get_max() argument
557 return set->get_max (); in hb_set_get_max()
562 * @set: A set
566 * Fetches the next element in @set that is greater than current value of @codepoint.
568 * Set @codepoint to #HB_SET_VALUE_INVALID to get started.
575 hb_set_next (const hb_set_t *set, in hb_set_next() argument
578 return set->next (codepoint); in hb_set_next()
583 * @set: A set
587 * Fetches the previous element in @set that is lower than current value of @codepoint.
589 * Set @codepoint to #HB_SET_VALUE_INVALID to get started.
596 hb_set_previous (const hb_set_t *set, in hb_set_previous() argument
599 return set->previous (codepoint); in hb_set_previous()
604 * @set: A set
609 * Fetches the next consecutive range of elements in @set that
612 * Set @last to #HB_SET_VALUE_INVALID to get started.
619 hb_set_next_range (const hb_set_t *set, in hb_set_next_range() argument
623 return set->next_range (first, last); in hb_set_next_range()
628 * @set: A set
633 * Fetches the previous consecutive range of elements in @set that
636 * Set @first to #HB_SET_VALUE_INVALID to get started.
643 hb_set_previous_range (const hb_set_t *set, in hb_set_previous_range() argument
647 return set->previous_range (first, last); in hb_set_previous_range()
652 * @set: A set
658 * Finds the next element in @set that is greater than @codepoint. Writes out
659 * codepoints to @out, until either the set runs out of elements, or @size
667 hb_set_next_many (const hb_set_t *set, in hb_set_next_many() argument
672 return set->next_many (codepoint, out, size); in hb_set_next_many()