X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fstore.c;h=5cc475efcdbd2dc7c8ae0a08cc4b947a5f0641cb;hb=1b4b1366b18685f5680ab01b58b8e49d32b14e7e;hp=23e70472ae257593ab449eee7f2e1de755df51f4;hpb=a099afff8856bd80a1d974530c06fa78452e6c8c;p=bluesky.git diff --git a/bluesky/store.c b/bluesky/store.c index 23e7047..5cc475e 100644 --- a/bluesky/store.c +++ b/bluesky/store.c @@ -501,6 +501,32 @@ static BlueSkyStoreImplementation filestore_impl = { .cleanup = filestore_cleanup, }; +/* A store implementation which simply discards all data, for testing. */ +static gpointer nullstore_create(const gchar *path) +{ + return (gpointer)nullstore_create; +} + +static void nullstore_destroy(gpointer store) +{ +} + +static void nullstore_submit(gpointer s, BlueSkyStoreAsync *async) +{ + bluesky_store_async_mark_complete(async); +} + +static void nullstore_cleanup(gpointer store, BlueSkyStoreAsync *async) +{ +} + +static BlueSkyStoreImplementation nullstore_impl = { + .create = nullstore_create, + .destroy = nullstore_destroy, + .submit = nullstore_submit, + .cleanup = nullstore_cleanup, +}; + void bluesky_store_init() { store_implementations = g_hash_table_new(g_str_hash, g_str_equal); @@ -508,4 +534,5 @@ void bluesky_store_init() bluesky_max_threads, FALSE, NULL); bluesky_store_register(&memstore_impl, "mem"); bluesky_store_register(&filestore_impl, "file"); + bluesky_store_register(&nullstore_impl, "null"); }