aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-dbhash.h
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-11-08 06:25:34 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-11-08 06:25:34 +0800
commit082bc288ff27d74ae48b78d994eec2a4f0106cd2 (patch)
treea6dc582b9c75b0bee3c35a1f4cd8e01b560d21e7 /e-util/e-dbhash.h
parentba58be670e008ff3c4e2f4222fc782bb114f7cba (diff)
downloadgsoc2013-evolution-082bc288ff27d74ae48b78d994eec2a4f0106cd2.tar
gsoc2013-evolution-082bc288ff27d74ae48b78d994eec2a4f0106cd2.tar.gz
gsoc2013-evolution-082bc288ff27d74ae48b78d994eec2a4f0106cd2.tar.bz2
gsoc2013-evolution-082bc288ff27d74ae48b78d994eec2a4f0106cd2.tar.lz
gsoc2013-evolution-082bc288ff27d74ae48b78d994eec2a4f0106cd2.tar.xz
gsoc2013-evolution-082bc288ff27d74ae48b78d994eec2a4f0106cd2.tar.zst
gsoc2013-evolution-082bc288ff27d74ae48b78d994eec2a4f0106cd2.zip
Build e-dbhash.[hc]
2000-11-07 JP Rosevear <jpr@helixcode.com> * Makefile.am: Build e-dbhash.[hc] * e-dbhash.[hc]: New routines to manage a db database on disk that contains md5 hashed data and indexed by uids. Provides comparison functions and such so the caller does not have to do the md5 bits. 2000-11-07 JP Rosevear <jpr@helixcode.com> * backend/pas/pas-book.h: Update PASRequest structure * backend/pas/pas-book.c (impl_Evolution_Book_get_changes): update param name (pas_book_queue_get_changes): Use PASRequest change_id slot * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy): Properly copy change_id and change_context (pas_backend_file_book_view_free): Free change_id/change_context (pas_backend_file_changes_foreach_key): Callback to figure out the deleted cards (pas_backend_file_changes): Use new e-dbhash stuff to implement. Write out updated hash * backend/idl/addressbook.idl: Rename get_changes param svn path=/trunk/; revision=6489
Diffstat (limited to 'e-util/e-dbhash.h')
-rw-r--r--e-util/e-dbhash.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/e-util/e-dbhash.h b/e-util/e-dbhash.h
new file mode 100644
index 0000000000..11fcdceb80
--- /dev/null
+++ b/e-util/e-dbhash.h
@@ -0,0 +1,45 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Writes hashes that go to/from disk in db form. Hash keys are strings
+ *
+ * Author:
+ * JP Rosevear (jpr@helixcode.com)
+ *
+ * Copyright 2000, Helix Code, Inc.
+ */
+
+#ifndef __E_DBHASH_H__
+#define __E_DBHASH_H__
+
+#include <glib.h>
+
+typedef enum {
+ E_DBHASH_STATUS_SAME,
+ E_DBHASH_STATUS_DIFFERENT,
+ E_DBHASH_STATUS_NOT_FOUND,
+} EDbHashStatus;
+
+typedef struct _EDbHash EDbHash;
+typedef struct _EDbHashPrivate EDbHashPrivate;
+
+struct _EDbHash
+{
+ EDbHashPrivate *priv;
+};
+
+typedef void (*EDbHashFunc) (const char *key, gpointer user_data);
+
+EDbHash *e_dbhash_new (const char *filename);
+
+void e_dbhash_add (EDbHash *edbh, const char *key, const char *data);
+void e_dbhash_remove (EDbHash *edbh, const char *key);
+
+EDbHashStatus e_dbhash_compare (EDbHash *edbh, const char *key, const char *compare_data);
+void e_dbhash_foreach_key (EDbHash *edbh, EDbHashFunc *func, gpointer user_data);
+
+void e_dbhash_write (EDbHash *edbh);
+
+void e_dbhash_destroy (EDbHash *edbh);
+
+#endif /* ! __E_DBHASH_H__ */
+