aboutsummaryrefslogtreecommitdiffstats
path: root/storage.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2006-10-15 11:41:12 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2006-10-15 11:41:12 +0200
commit69cb62335f8bbe46b2879aabc5fdbe288891b02b (patch)
tree38fcda3162027d741598536c28a2c0cd4c3f52c6 /storage.c
parent695e39232324711816f1db8e25fdba59a0c6456f (diff)
parente97827bee83d3a0663aa284e72a4f6c84b4b4dfe (diff)
Merging with storage-xml. It seems to be working pretty well, so maybe
this way more people will test it. :-)
Diffstat (limited to 'storage.c')
-rw-r--r--storage.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/storage.c b/storage.c
index b766c9e3..06044f80 100644
--- a/storage.c
+++ b/storage.c
@@ -6,6 +6,8 @@
/* Support for multiple storage backends */
+/* Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org> */
+
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,9 +30,9 @@
#include "crypting.h"
extern storage_t storage_text;
+extern storage_t storage_xml;
-static GList text_entry = { &storage_text, NULL, NULL };
-static GList *storage_backends = &text_entry;
+static GList *storage_backends = NULL;
void register_storage_backend(storage_t *backend)
{
@@ -40,7 +42,7 @@ void register_storage_backend(storage_t *backend)
static storage_t *storage_init_single(const char *name)
{
GList *gl;
- storage_t *st;
+ storage_t *st = NULL;
for (gl = storage_backends; gl; gl = gl->next) {
st = gl->data;
@@ -62,9 +64,12 @@ GList *storage_init(const char *primary, char **migrate)
GList *ret = NULL;
int i;
storage_t *storage;
-
+
+ register_storage_backend(&storage_text);
+ register_storage_backend(&storage_xml);
+
storage = storage_init_single(primary);
- if (storage == NULL)
+ if (storage == NULL && storage->save == NULL)
return NULL;
ret = g_list_append(ret, storage);