Imported Upstream version 1.7.6
[platform/upstream/harfbuzz.git] / src / hb-set.cc
index f3fe1ba..07cf9d0 100644 (file)
@@ -45,11 +45,18 @@ hb_set_create (void)
   if (!(set = hb_object_create<hb_set_t> ()))
     return hb_set_get_empty ();
 
-  set->clear ();
+  set->init ();
 
   return set;
 }
 
+static const hb_set_t _hb_set_nil = {
+  HB_OBJECT_HEADER_STATIC,
+  true, /* in_error */
+
+  {0} /* elts */
+};
+
 /**
  * hb_set_get_empty:
  *
@@ -60,13 +67,6 @@ hb_set_create (void)
 hb_set_t *
 hb_set_get_empty (void)
 {
-  static const hb_set_t _hb_set_nil = {
-    HB_OBJECT_HEADER_STATIC,
-    true, /* in_error */
-
-    {0} /* elts */
-  };
-
   return const_cast<hb_set_t *> (&_hb_set_nil);
 }
 
@@ -95,7 +95,7 @@ hb_set_destroy (hb_set_t *set)
 {
   if (!hb_object_destroy (set)) return;
 
-  set->fini ();
+  set->finish ();
 
   free (set);
 }
@@ -376,11 +376,12 @@ hb_set_symmetric_difference (hb_set_t       *set,
  * 
  *
  * Since: 0.9.10
+ *
+ * Deprecated: 1.6.1
  **/
 void
 hb_set_invert (hb_set_t *set)
 {
-  set->invert ();
 }
 
 /**
@@ -436,7 +437,9 @@ hb_set_get_max (const hb_set_t *set)
  * @set: a set.
  * @codepoint: (inout):
  *
- * 
+ * Gets the next number in @set that is greater than current value of @codepoint.
+ *
+ * Set @codepoint to %HB_SET_VALUE_INVALID to get started.
  *
  * Return value: whether there was a next value.
  *
@@ -450,6 +453,26 @@ hb_set_next (const hb_set_t *set,
 }
 
 /**
+ * hb_set_previous:
+ * @set: a set.
+ * @codepoint: (inout):
+ *
+ * Gets the previous number in @set that is slower than current value of @codepoint.
+ *
+ * Set @codepoint to %HB_SET_VALUE_INVALID to get started.
+ *
+ * Return value: whether there was a previous value.
+ *
+ * Since: 1.8.0
+ **/
+hb_bool_t
+hb_set_previous (const hb_set_t *set,
+                hb_codepoint_t *codepoint)
+{
+  return set->previous (codepoint);
+}
+
+/**
  * hb_set_next_range:
  * @set: a set.
  * @first: (out): output first codepoint in the range.
@@ -458,6 +481,8 @@ hb_set_next (const hb_set_t *set,
  * 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.
+ *
  * Return value: whether there was a next range.
  *
  * Since: 0.9.7
@@ -469,3 +494,26 @@ hb_set_next_range (const hb_set_t *set,
 {
   return set->next_range (first, last);
 }
+
+/**
+ * hb_set_previous_range:
+ * @set: a set.
+ * @first: (inout): input current first and output first codepoint in the range.
+ * @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.
+ *
+ * Set @first to %HB_SET_VALUE_INVALID to get started.
+ *
+ * Return value: whether there was a previous range.
+ *
+ * Since: 1.8.0
+ **/
+hb_bool_t
+hb_set_previous_range (const hb_set_t *set,
+                      hb_codepoint_t *first,
+                      hb_codepoint_t *last)
+{
+  return set->previous_range (first, last);
+}