projects
/
bluesky.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix required package list (need git-core, not git).
[bluesky.git]
/
bluesky
/
store.c
diff --git
a/bluesky/store.c
b/bluesky/store.c
index
785372b
..
d83fe03
100644
(file)
--- a/
bluesky/store.c
+++ b/
bluesky/store.c
@@
-45,13
+45,25
@@
BlueSkyStore *bluesky_store_new(const gchar *type)
{
const BlueSkyStoreImplementation *impl;
{
const BlueSkyStoreImplementation *impl;
- impl = g_hash_table_lookup(store_implementations, type);
- if (impl == NULL)
+ gchar *scheme, *path;
+ scheme = g_strdup(type);
+ path = strchr(scheme, ':');
+ if (path != NULL) {
+ *path = '\0';
+ path++;
+ }
+
+ impl = g_hash_table_lookup(store_implementations, scheme);
+ if (impl == NULL) {
+ g_free(scheme);
return NULL;
return NULL;
+ }
- gpointer handle = impl->create();
- if (handle == NULL)
+ gpointer handle = impl->create(path);
+ if (handle == NULL) {
+ g_free(scheme);
return NULL;
return NULL;
+ }
BlueSkyStore *store = g_new(BlueSkyStore, 1);
store->impl = impl;
BlueSkyStore *store = g_new(BlueSkyStore, 1);
store->impl = impl;
@@
-59,6
+71,7
@@
BlueSkyStore *bluesky_store_new(const gchar *type)
store->lock = g_mutex_new();
store->cond_idle = g_cond_new();
store->pending = 0;
store->lock = g_mutex_new();
store->cond_idle = g_cond_new();
store->pending = 0;
+ g_free(scheme);
return store;
}
return store;
}
@@
-88,6
+101,11
@@
BlueSkyStoreAsync *bluesky_store_async_new(BlueSkyStore *store)
return async;
}
return async;
}
+gpointer bluesky_store_async_get_handle(BlueSkyStoreAsync *async)
+{
+ return async->store->handle;
+}
+
void bluesky_store_async_ref(BlueSkyStoreAsync *async)
{
if (async == NULL)
void bluesky_store_async_ref(BlueSkyStoreAsync *async)
{
if (async == NULL)
@@
-296,7
+314,7
@@
typedef struct {
GHashTable *store;
} MemStore;
GHashTable *store;
} MemStore;
-static gpointer memstore_create()
+static gpointer memstore_create(
const gchar *path
)
{
MemStore *store = g_new(MemStore, 1);
store->lock = g_mutex_new();
{
MemStore *store = g_new(MemStore, 1);
store->lock = g_mutex_new();
@@
-362,7
+380,7
@@
static BlueSkyStoreImplementation memstore_impl = {
};
/* Store implementation which writes data as files to disk. */
};
/* Store implementation which writes data as files to disk. */
-static gpointer filestore_create()
+static gpointer filestore_create(
const gchar *path
)
{
return GINT_TO_POINTER(1);
}
{
return GINT_TO_POINTER(1);
}