[evolution/webkit-composer: 115/210] Add e_spell_dictionary_hash().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/webkit-composer: 115/210] Add e_spell_dictionary_hash().
- Date: Mon, 8 Jul 2013 00:55:30 +0000 (UTC)
commit 7a498e12d38f9704749b8693d5c9f8cee91f4948
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jan 17 07:38:13 2013 -0500
Add e_spell_dictionary_hash().
Generates a hash value for a dictionary based on its ISO code.
.../evolution-util/evolution-util-sections.txt | 1 +
e-util/e-spell-dictionary.c | 22 ++++++++++++++++++++
e-util/e-spell-dictionary.h | 1 +
3 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt
b/doc/reference/evolution-util/evolution-util-sections.txt
index 4d48fe4..80bca2c 100644
--- a/doc/reference/evolution-util/evolution-util-sections.txt
+++ b/doc/reference/evolution-util/evolution-util-sections.txt
@@ -3832,6 +3832,7 @@ ESpellCheckerPrivate
<TITLE>ESpellDictionary</TITLE>
ESpellDictionary
e_spell_dictionary_new
+e_spell_dictionary_hash
e_spell_dictionary_get_name
e_spell_dictionary_get_code
e_spell_dictionary_check
diff --git a/e-util/e-spell-dictionary.c b/e-util/e-spell-dictionary.c
index 8a88253..e098e98 100644
--- a/e-util/e-spell-dictionary.c
+++ b/e-util/e-spell-dictionary.c
@@ -481,6 +481,28 @@ e_spell_dictionary_new (ESpellChecker *parent_checker,
}
/**
+ * e_spell_dictionary_hash:
+ * @dictionary: an #ESpellDictionary
+ *
+ * Generates a hash value for @dictionary based on its ISO code.
+ * This function is intended for easily hashing an #ESpellDictionary
+ * to add to a #GHashTable or similar data structure.
+ *
+ * Returns: a hash value for @dictionary
+ **/
+guint
+e_spell_dictionary_hash (ESpellDictionary *dictionary)
+{
+ const gchar *code;
+
+ g_return_val_if_fail (E_IS_SPELL_DICTIONARY (dictionary), 0);
+
+ code = e_spell_dictionary_get_code (dictionary);
+
+ return g_str_hash (code);
+}
+
+/**
* e_spell_dictionary_get_name:
* @dictionary: an #ESpellDictionary
*
diff --git a/e-util/e-spell-dictionary.h b/e-util/e-spell-dictionary.h
index 9f8d2e9..c46f4a7 100644
--- a/e-util/e-spell-dictionary.h
+++ b/e-util/e-spell-dictionary.h
@@ -65,6 +65,7 @@ GType e_spell_dictionary_get_type (void) G_GNUC_CONST;
ESpellDictionary *
e_spell_dictionary_new (ESpellChecker *parent_checker,
EnchantDict *enchant_dict);
+guint e_spell_dictionary_hash (ESpellDictionary *dictionary);
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]