[evolution/webkit-composer: 118/130] Document e_spell_dictionary_compare().



commit e5aedd5193ba11944d20bdc39ec9180db44cc14f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jan 17 07:44:33 2013 -0500

    Document e_spell_dictionary_compare().

 doc/reference/libeutil/libeutil-sections.txt |    2 +-
 e-util/e-spell-dictionary.c                  |   36 ++++++++++++++++++--------
 e-util/e-spell-dictionary.h                  |    4 +-
 3 files changed, 28 insertions(+), 14 deletions(-)
---
diff --git a/doc/reference/libeutil/libeutil-sections.txt b/doc/reference/libeutil/libeutil-sections.txt
index 0d1fb51..5cca6f4 100644
--- a/doc/reference/libeutil/libeutil-sections.txt
+++ b/doc/reference/libeutil/libeutil-sections.txt
@@ -3684,6 +3684,7 @@ ESpellDictionary
 e_spell_dictionary_new
 e_spell_dictionary_hash
 e_spell_dictionary_equal
+e_spell_dictionary_compare
 e_spell_dictionary_get_name
 e_spell_dictionary_get_code
 e_spell_dictionary_check
@@ -3693,7 +3694,6 @@ e_spell_dictionary_get_suggestions
 e_spell_dictionary_free_suggestions
 e_spell_dictionary_store_correction
 e_spell_dictionary_get_parent_checker
-e_spell_dictionary_compare
 <SUBSECTION Standard>
 E_SPELL_DICTIONARY
 E_IS_SPELL_DICTIONARY
diff --git a/e-util/e-spell-dictionary.c b/e-util/e-spell-dictionary.c
index a629bbd..eb3d39d 100644
--- a/e-util/e-spell-dictionary.c
+++ b/e-util/e-spell-dictionary.c
@@ -531,6 +531,31 @@ e_spell_dictionary_equal (ESpellDictionary *dictionary1,
 }
 
 /**
+ * e_spell_dictionary_compare:
+ * @dictionary1: an #ESpellDictionary
+ * @dictionary2: another #ESpellDictionary
+ *
+ * Compares @dictionary1 and @dictionary2 by their display names for
+ * the purpose of lexicographical sorting.  Use this function where a
+ * #GCompareFunc callback is required, such as g_list_sort().
+ *
+ * Returns: 0 if the names match,
+ *          a negative value if @dictionary1 < @dictionary2,
+ *          or a positive value of @dictionary1 > @dictionary2
+ **/
+gint
+e_spell_dictionary_compare (ESpellDictionary *dictionary1,
+                            ESpellDictionary *dictionary2)
+{
+	g_return_val_if_fail (E_IS_SPELL_DICTIONARY (dictionary1), 0);
+	g_return_val_if_fail (E_IS_SPELL_DICTIONARY (dictionary2), 0);
+
+	return strcmp (
+		dictionary1->priv->collate_key,
+		dictionary2->priv->collate_key);
+}
+
+/**
  * e_spell_dictionary_get_name:
  * @dictionary: an #ESpellDictionary
  *
@@ -719,14 +744,3 @@ e_spell_dictionary_get_parent_checker (ESpellDictionary *dictionary)
 	return dictionary->priv->spell_checker;
 }
 
-gint
-e_spell_dictionary_compare (ESpellDictionary *dictionary1,
-                            ESpellDictionary *dictionary2)
-{
-	g_return_val_if_fail (E_IS_SPELL_DICTIONARY (dictionary1), 0);
-	g_return_val_if_fail (E_IS_SPELL_DICTIONARY (dictionary2), 0);
-
-	return strcmp (
-		dictionary1->priv->collate_key,
-		dictionary2->priv->collate_key);
-}
diff --git a/e-util/e-spell-dictionary.h b/e-util/e-spell-dictionary.h
index e8c467a..7d92a56 100644
--- a/e-util/e-spell-dictionary.h
+++ b/e-util/e-spell-dictionary.h
@@ -68,6 +68,8 @@ ESpellDictionary *
 guint		e_spell_dictionary_hash		(ESpellDictionary *dictionary);
 gboolean	e_spell_dictionary_equal	(ESpellDictionary *dictionary1,
 						 ESpellDictionary *dictionary2);
+gint		e_spell_dictionary_compare	(ESpellDictionary *dictionary1,
+						 ESpellDictionary *dictionary2);
 const gchar *	e_spell_dictionary_get_name	(ESpellDictionary *dictionary);
 const gchar *	e_spell_dictionary_get_code	(ESpellDictionary *dictionary);
 gboolean	e_spell_dictionary_check	(ESpellDictionary *dictionary,
@@ -93,8 +95,6 @@ void		e_spell_dictionary_store_correction
 						 gsize correction_len);
 ESpellChecker *	e_spell_dictionary_get_parent_checker
 						(ESpellDictionary *dictionary);
-gint		e_spell_dictionary_compare	(ESpellDictionary *dictionary1,
-						 ESpellDictionary *dictionary2);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]