File: e-dbhash.h

package info (click to toggle)
evolution-data-server 2.30.3-2%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 45,704 kB
  • ctags: 26,968
  • sloc: ansic: 223,692; sh: 10,413; makefile: 2,646; xml: 386; perl: 204; python: 30
file content (49 lines) | stat: -rw-r--r-- 1,123 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* -*- 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@ximian.com)
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 */

#ifndef __E_DBHASH_H__
#define __E_DBHASH_H__

#include <glib.h>

G_BEGIN_DECLS

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 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);

G_END_DECLS

#endif /* __E_DBHASH_H__ */