| Evolution-Data-Server Manual: Backend Utilities (libebackend) | ||||
|---|---|---|---|---|
| Top | Description | ||||
struct EDbHash; enum EDbHashStatus; void (*EDbHashFunc) (const gchar *key,gpointer user_data); EDbHash * e_dbhash_new (const gchar *filename); void e_dbhash_add (EDbHash *edbh,const gchar *key,const gchar *data); void e_dbhash_remove (EDbHash *edbh,const gchar *key); EDbHashStatus e_dbhash_compare (EDbHash *edbh,const gchar *key,const gchar *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);
An EDbHash is a simple hash table of strings backed by a Berkeley DB file for permanent storage.
struct EDbHash {
EDbHashPrivate *priv;
};
EDbHash is deprecated and should not be used in newly-written code.
Contains only private data that should be read and manipulated using the functions below.
typedef enum {
E_DBHASH_STATUS_SAME,
E_DBHASH_STATUS_DIFFERENT,
E_DBHASH_STATUS_NOT_FOUND
} EDbHashStatus;
EDbHashStatus is deprecated and should not be used in newly-written code.
Return codes for e_dbhash_compare().
void (*EDbHashFunc) (const gchar *key,gpointer user_data);
EDbHashFunc is deprecated and should not be used in newly-written code.
Callback function used in e_dbhash_foreach_key().
|
a database key |
|
user data passed to e_dbhash_foreach_key()
|
EDbHash * e_dbhash_new (const gchar *filename);
e_dbhash_new is deprecated and should not be used in newly-written code.
Creates a new EDbHash structure and opens the given Berkeley DB file, creating the DB file if necessary.
|
path to a Berkeley DB file |
Returns : |
a new EDbHash |
void e_dbhash_add (EDbHash *edbh,const gchar *key,const gchar *data);
e_dbhash_add is deprecated and should not be used in newly-written code.
Adds a database object for key.
|
an EDbHash |
|
a database key |
|
a database object for key
|
void e_dbhash_remove (EDbHash *edbh,const gchar *key);
e_dbhash_remove is deprecated and should not be used in newly-written code.
Removes the database object corresponding to key.
|
an EDbHash |
|
a database key |
EDbHashStatus e_dbhash_compare (EDbHash *edbh,const gchar *key,const gchar *compare_data);
e_dbhash_compare is deprecated and should not be used in newly-written code.
Compares compare_data to the database object corresponding to
key using an MD5 checksum. Returns E_DBHASH_STATUS_SAME if the
checksums match, E_DBHASH_STATUS_DIFFERENT if the checksums differ,
or E_DBHASH_STATUS_NOT_FOUND if key is not present in the database.
|
an EDbHash |
|
a database key |
|
data to compare against the database |
Returns : |
a checksum comparison status |
void e_dbhash_foreach_key (EDbHash *edbh,EDbHashFunc func,gpointer user_data);
e_dbhash_foreach_key is deprecated and should not be used in newly-written code.
Calls func for each database object.
|
an EDbHash |
|
a callback function |
|
data to pass to func
|
void e_dbhash_write (EDbHash *edbh);
e_dbhash_write is deprecated and should not be used in newly-written code.
Flushes database changes to disk.
|
an EDbHash |