summaryrefslogtreecommitdiff
path: root/pkcs11/gkm
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2010-11-23 22:56:30 +0000
committerStef Walter <stefw@collabora.co.uk>2010-11-23 23:02:42 +0000
commit170b4e05fcf3ecb14b4413ba523704ab4152a2c2 (patch)
tree7f46c5f3dc1c377ffe24c145528d0a2c422996b8 /pkcs11/gkm
parent4d593dceae8876d7887dc8ac5f838abe5c149dba (diff)
downloadgnome-keyring-170b4e05fcf3ecb14b4413ba523704ab4152a2c2.tar.gz
[egg] Add utilities so GByteArray can be used in GHashTable.
Update xdg pkcs11 module to use these new utils.
Diffstat (limited to 'pkcs11/gkm')
-rw-r--r--pkcs11/gkm/gkm-util.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/pkcs11/gkm/gkm-util.c b/pkcs11/gkm/gkm-util.c
index 6e1f29cb..37561d90 100644
--- a/pkcs11/gkm/gkm-util.c
+++ b/pkcs11/gkm/gkm-util.c
@@ -67,67 +67,7 @@
/* Only access using atomic operations */
static gint next_handle = 0x00000010;
-GkmMemory*
-gkm_util_memory_new (gconstpointer data, gsize n_data)
-{
- GkmMemory *memory;
-
- memory = g_malloc (n_data + sizeof (GkmMemory));
- memory->n_data = n_data;
- memory->data = memory + 1;
-
- if (n_data) {
- g_assert (data);
- memcpy (memory + 1, data, n_data);
- }
- return memory;
-}
-
-guint
-gkm_util_memory_hash (gconstpointer v)
-{
- const GkmMemory *memory = v;
- const signed char *p;
- guint32 h = 0;
- gsize i;
-
- g_assert (memory);
- g_assert (memory->data);
- p = memory->data;
-
- /* 31 bit hash function */
- for (i = 0; i < memory->n_data; ++i, ++p)
- h = (h << 5) - h + *p;
-
- return h;
-}
-
-gboolean
-gkm_util_memory_equal (gconstpointer v1, gconstpointer v2)
-{
- const GkmMemory *memory_1 = v1;
- const GkmMemory *memory_2 = v2;
-
- if (memory_1 == memory_2)
- return TRUE;
- if (!memory_1 || !memory_2)
- return FALSE;
-
- if (memory_1->n_data != memory_2->n_data)
- return FALSE;
-
- g_assert (memory_1->data);
- g_assert (memory_2->data);
-
- return (memcmp (memory_1->data, memory_2->data, memory_1->n_data) == 0);
-}
-
-void
-gkm_util_memory_free (gpointer memory)
-{
- g_free (memory);
-}
gulong*
gkm_util_ulong_alloc (gulong value)