* Google Author(s): Behdad Esfahbod
*/
-#include "hb-set-private.hh"
+#include "hb-set.hh"
-/* Public API */
+/**
+ * SECTION:hb-set
+ * @title: hb-set
+ * @short_description: Object representing a set of integers
+ * @include: hb.h
+ *
+ * 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.
+ **/
/**
* Since: 0.9.2
**/
hb_set_t *
-hb_set_create (void)
+hb_set_create ()
{
hb_set_t *set;
if (!(set = hb_object_create<hb_set_t> ()))
return hb_set_get_empty ();
- set->init ();
+ set->init_shallow ();
return set;
}
-static const hb_set_t _hb_set_nil = {
- HB_OBJECT_HEADER_STATIC,
- true, /* in_error */
-
- {0} /* elts */
-};
-
/**
* hb_set_get_empty:
*
* Since: 0.9.2
**/
hb_set_t *
-hb_set_get_empty (void)
+hb_set_get_empty ()
{
- return const_cast<hb_set_t *> (&_hb_set_nil);
+ return const_cast<hb_set_t *> (&Null (hb_set_t));
}
/**
{
if (!hb_object_destroy (set)) return;
- set->finish ();
+ set->fini_shallow ();
free (set);
}
* hb_set_allocation_successful:
* @set: a set.
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.2
**/
hb_bool_t
-hb_set_allocation_successful (const hb_set_t *set HB_UNUSED)
+hb_set_allocation_successful (const hb_set_t *set)
{
- return !set->in_error;
+ return set->successful;
}
/**
* hb_set_clear:
* @set: a set.
*
- *
+ *
*
* Since: 0.9.2
**/
* hb_set_is_empty:
* @set: a set.
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.7
**/
/**
* hb_set_has:
* @set: a set.
- * @codepoint:
+ * @codepoint:
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.2
**/
/**
* hb_set_add:
* @set: a set.
- * @codepoint:
+ * @codepoint:
+ *
*
- *
*
* Since: 0.9.2
**/
/**
* hb_set_add_range:
* @set: a set.
- * @first:
- * @last:
+ * @first:
+ * @last:
+ *
*
- *
*
* Since: 0.9.7
**/
/**
* hb_set_del:
* @set: a set.
- * @codepoint:
+ * @codepoint:
+ *
*
- *
*
* Since: 0.9.2
**/
/**
* hb_set_del_range:
* @set: a set.
- * @first:
- * @last:
+ * @first:
+ * @last:
+ *
*
- *
*
* Since: 0.9.7
**/
/**
* hb_set_is_equal:
* @set: a set.
- * @other:
+ * @other: other set.
*
- *
*
- * Return value:
+ *
+ * Return value: %TRUE if the two sets are equal, %FALSE otherwise.
*
* Since: 0.9.7
**/
}
/**
+ * hb_set_is_subset:
+ * @set: a set.
+ * @larger_set: other set.
+ *
+ *
+ *
+ * Return value: %TRUE if the @set is a subset of (or equal to) @larger_set, %FALSE otherwise.
+ *
+ * Since: 1.8.1
+ **/
+hb_bool_t
+hb_set_is_subset (const hb_set_t *set,
+ const hb_set_t *larger_set)
+{
+ return set->is_subset (larger_set);
+}
+
+/**
* hb_set_set:
* @set: a set.
- * @other:
+ * @other:
+ *
*
- *
*
* Since: 0.9.2
**/
/**
* hb_set_union:
* @set: a set.
- * @other:
+ * @other:
+ *
*
- *
*
* Since: 0.9.2
**/
/**
* hb_set_intersect:
* @set: a set.
- * @other:
+ * @other:
+ *
*
- *
*
* Since: 0.9.2
**/
/**
* hb_set_subtract:
* @set: a set.
- * @other:
+ * @other:
+ *
*
- *
*
* Since: 0.9.2
**/
/**
* hb_set_symmetric_difference:
* @set: a set.
- * @other:
+ * @other:
+ *
*
- *
*
* Since: 0.9.2
**/
set->symmetric_difference (other);
}
+#ifndef HB_DISABLE_DEPRECATED
/**
* hb_set_invert:
* @set: a set.
*
- *
+ *
*
* Since: 0.9.10
*
* Deprecated: 1.6.1
**/
void
-hb_set_invert (hb_set_t *set)
+hb_set_invert (hb_set_t *set HB_UNUSED)
{
}
+#endif
/**
* hb_set_get_population:
* @set: a set.
* @codepoint: (inout):
*
- * Gets the previous number in @set that is slower than current value of @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.
*
* @last: (out): output last codepoint in the range.
*
* Gets the previous consecutive range of numbers in @set that
- * are greater than current value of @last.
+ * are less than current value of @first.
*
* Set @first to %HB_SET_VALUE_INVALID to get started.
*