aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-19 17:01:57 -0600
committerTed Gould <ted@gould.cx>2010-01-19 17:01:57 -0600
commit2f82ed57b751145449506164888281b57819abcc (patch)
tree7d7e6a53800f4533e9174a754dd85daaf7c3d319
parent8b32f5eaf299af29aae5b773921067c783ec8f01 (diff)
downloadayatana-indicator-application-2f82ed57b751145449506164888281b57819abcc.tar.gz
ayatana-indicator-application-2f82ed57b751145449506164888281b57819abcc.tar.bz2
ayatana-indicator-application-2f82ed57b751145449506164888281b57819abcc.zip
Adding some API to our LRU file
-rw-r--r--src/application-service-lru-file.c33
-rw-r--r--src/application-service-lru-file.h4
2 files changed, 37 insertions, 0 deletions
diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c
index 3cbb1dc..47cfab9 100644
--- a/src/application-service-lru-file.c
+++ b/src/application-service-lru-file.c
@@ -54,3 +54,36 @@ app_lru_file_finalize (GObject *object)
G_OBJECT_CLASS (app_lru_file_parent_class)->finalize (object);
return;
}
+
+/* API */
+
+/* Simple helper to create a new object */
+AppLruFile *
+app_lru_file_new (void)
+{
+ return APP_LRU_FILE(g_object_new(APP_LRU_FILE_TYPE, NULL));
+}
+
+/* This updates the timestamp for a particular
+ entry in the database. It also queues up a
+ write out of the database. But that'll happen
+ later. */
+void
+app_lru_file_touch (AppLruFile * lrufile, const gchar * id, const gchar * category)
+{
+ g_return_if_fail(IS_APP_LRU_FILE(lrufile));
+ g_return_if_fail(id != NULL && id[0] != '\0');
+ g_return_if_fail(category != NULL && category[0] != '\0');
+
+ return;
+}
+
+/* Used to sort or compare different applications. */
+gint
+app_lru_file_sort (AppLruFile * lrufile, const gchar * id_a, const gchar * id_b)
+{
+ g_return_val_if_fail(IS_APP_LRU_FILE(lrufile), -1);
+
+
+ return 0;
+}
diff --git a/src/application-service-lru-file.h b/src/application-service-lru-file.h
index 6577278..45d3082 100644
--- a/src/application-service-lru-file.h
+++ b/src/application-service-lru-file.h
@@ -28,6 +28,10 @@ struct _AppLruFile {
GType app_lru_file_get_type (void);
+AppLruFile * app_lru_file_new (void);
+void app_lru_file_touch (AppLruFile * lrufile, const gchar * id, const gchar * category);
+gint app_lru_file_sort (AppLruFile * lrufile, const gchar * id_a, const gchar * id_b);
+
G_END_DECLS
#endif