Lines Matching refs: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;
56 if (!(set = hb_object_create<hb_set_t> ()))
59 set->init_shallow ();
61 return set;
81 * @set: A set
83 * Increases the reference count on a set.
85 * Return value: (transfer full): The set
90 hb_set_reference (hb_set_t *set)
92 return hb_object_reference (set);
97 * @set: A set
99 * Decreases the reference count on a set. When
100 * the reference count reaches zero, the set is
106 hb_set_destroy (hb_set_t *set)
108 if (!hb_object_destroy (set)) return;
110 set->fini_shallow ();
112 hb_free (set);
117 * @set: A set
118 * @key: The user-data key to set
119 * @data: A pointer to the user data to set
123 * Attaches a user-data key/data pair to the specified set.
130 hb_set_set_user_data (hb_set_t *set,
136 return hb_object_set_user_data (set, key, data, destroy, replace);
141 * @set: A set
145 * attached to the specified set.
152 hb_set_get_user_data (hb_set_t *set,
155 return hb_object_get_user_data (set, key);
161 * @set: A set
163 * Tests whether memory allocation for a set was successful.
170 hb_set_allocation_successful (const hb_set_t *set)
172 return !set->in_error ();
177 * @set: A set
179 * Allocate a copy of @set.
181 * Return value: Newly-allocated set.
186 hb_set_copy (const hb_set_t *set)
189 copy->set (*set);
195 * @set: A set
197 * Clears out the contents of a set.
202 hb_set_clear (hb_set_t *set)
205 set->clear ();
210 * @set: a set.
212 * Tests whether a set is empty (contains no elements).
214 * Return value: %true if @set is empty
219 hb_set_is_empty (const hb_set_t *set)
221 return set->is_empty ();
226 * @set: A set
229 * Tests whether @codepoint belongs to @set.
231 * Return value: %true if @codepoint is in @set, %false otherwise
236 hb_set_has (const hb_set_t *set,
239 return set->has (codepoint);
244 * @set: A set
245 * @codepoint: The element to add to @set
247 * Adds @codepoint to @set.
252 hb_set_add (hb_set_t *set,
256 set->add (codepoint);
261 * @set: A set
262 * @first: The first element to add to @set
263 * @last: The final element to add to @set
266 * (inclusive) to @set.
271 hb_set_add_range (hb_set_t *set,
276 set->add_range (first, last);
281 * @set: A set
282 * @codepoint: Removes @codepoint from @set
284 * Removes @codepoint from @set.
289 hb_set_del (hb_set_t *set,
293 set->del (codepoint);
298 * @set: A set
299 * @first: The first element to remove from @set
300 * @last: The final element to remove from @set
303 * (inclusive) from @set.
311 hb_set_del_range (hb_set_t *set,
316 set->del_range (first, last);
321 * @set: A set
322 * @other: Another set
324 * Tests whether @set and @other are equal (contain the same
332 hb_set_is_equal (const hb_set_t *set,
335 return set->is_equal (*other);
340 * @set: A set
341 * @larger_set: Another set
343 * Tests whether @set is a subset of @larger_set.
345 * Return value: %true if the @set is a subset of (or equal to) @larger_set, %false otherwise.
350 hb_set_is_subset (const hb_set_t *set,
353 return set->is_subset (*larger_set);
358 * @set: A set
359 * @other: Another set
361 * Makes the contents of @set equal to the contents of @other.
366 hb_set_set (hb_set_t *set,
370 set->set (*other);
375 * @set: A set
376 * @other: Another set
378 * Makes @set the union of @set and @other.
383 hb_set_union (hb_set_t *set,
387 set->union_ (*other);
392 * @set: A set
393 * @other: Another set
395 * Makes @set the intersection of @set and @other.
400 hb_set_intersect (hb_set_t *set,
404 set->intersect (*other);
409 * @set: A set
410 * @other: Another set
412 * Subtracts the contents of @other from @set.
417 hb_set_subtract (hb_set_t *set,
421 set->subtract (*other);
426 * @set: A set
427 * @other: Another set
429 * Makes @set the symmetric difference of @set
435 hb_set_symmetric_difference (hb_set_t *set,
439 set->symmetric_difference (*other);
444 * @set: A set
446 * Inverts the contents of @set.
451 hb_set_invert (hb_set_t *set)
454 set->invert ();
459 * @set: A set
461 * Returns the number of elements in the set.
463 * Return value: The population of @set
468 hb_set_get_population (const hb_set_t *set)
470 return set->get_population ();
475 * @set: A set
477 * Finds the smallest element in the set.
479 * Return value: minimum of @set, or #HB_SET_VALUE_INVALID if @set is empty.
484 hb_set_get_min (const hb_set_t *set)
486 return set->get_min ();
491 * @set: A set
493 * Finds the largest element in the set.
495 * Return value: maximum of @set, or #HB_SET_VALUE_INVALID if @set is empty.
500 hb_set_get_max (const hb_set_t *set)
502 return set->get_max ();
507 * @set: A set
511 * Fetches the next element in @set that is greater than current value of @codepoint.
520 hb_set_next (const hb_set_t *set,
523 return set->next (codepoint);
528 * @set: A set
532 * Fetches the previous element in @set that is lower than current value of @codepoint.
541 hb_set_previous (const hb_set_t *set,
544 return set->previous (codepoint);
549 * @set: A set
554 * Fetches the next consecutive range of elements in @set that
564 hb_set_next_range (const hb_set_t *set,
568 return set->next_range (first, last);
573 * @set: A set
578 * Fetches the previous consecutive range of elements in @set that
588 hb_set_previous_range (const hb_set_t *set,
592 return set->previous_range (first, last);