aboutsummaryrefslogtreecommitdiff
path: root/src/seen-db.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-24 20:26:43 -0500
committerTed Gould <ted@gould.cx>2010-03-24 20:26:43 -0500
commit2597b609c3a84e80be1babbb547bac1ccb25f75f (patch)
tree3702c7da395a3b6f50a284511936750672b53f6d /src/seen-db.c
parent9e0c000273432a04fe431e9e750a0c1a63e411fe (diff)
downloadayatana-indicator-messages-2597b609c3a84e80be1babbb547bac1ccb25f75f.tar.gz
ayatana-indicator-messages-2597b609c3a84e80be1babbb547bac1ccb25f75f.tar.bz2
ayatana-indicator-messages-2597b609c3a84e80be1babbb547bac1ccb25f75f.zip
Making a basic interface for the seen database.
Diffstat (limited to 'src/seen-db.c')
-rw-r--r--src/seen-db.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/seen-db.c b/src/seen-db.c
new file mode 100644
index 0000000..dd164f8
--- /dev/null
+++ b/src/seen-db.c
@@ -0,0 +1,25 @@
+#include "seen-db.h"
+
+SeenDB *
+seen_db_init(void)
+{
+ GHashTable * hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
+
+ return hash;
+}
+
+void
+seen_db_add (SeenDB * seendb, const gchar * desktop)
+{
+ g_hash_table_insert(seendb,
+ g_strdup(desktop),
+ GINT_TO_POINTER(TRUE));
+
+ return;
+}
+
+gboolean
+seen_db_seen (SeenDB * seendb, const gchar * desktop)
+{
+ return GPOINTER_TO_INT(g_hash_table_lookup(seendb, desktop));
+}