summaryrefslogtreecommitdiff
path: root/src/config/shibari-cache-config.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-07-22 23:56:08 +0000
committerLaurent Bercot <ska@appnovation.com>2024-07-22 23:56:08 +0000
commit8d5a23bf7fe6bda50bab13f12725f3b7c8976d29 (patch)
tree261fb68fe46d0fc7553b4bab72204e1ec7d1c6d0 /src/config/shibari-cache-config.c
parente5cc55570c2c986c71fc75bcde93620598db7be4 (diff)
downloadshibari-8d5a23bf7fe6bda50bab13f12725f3b7c8976d29.tar.xz
Revamp and improve config system
Now features: - keys can be binary blobs (useful for accept and server) - values can be unique or accumulators Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/config/shibari-cache-config.c')
-rw-r--r--src/config/shibari-cache-config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config/shibari-cache-config.c b/src/config/shibari-cache-config.c
index 0aef2ce..e919c65 100644
--- a/src/config/shibari-cache-config.c
+++ b/src/config/shibari-cache-config.c
@@ -20,7 +20,7 @@
#define USAGE "shibari-cache-config [ -i textfile ] [ -o cdbfile ] [ -m mode ]"
#define dieusage() strerr_dieusage(100, USAGE)
-struct global_s g = GLOBAL_ZERO ;
+repo conf = REPO_ZERO ;
static inline void conf_output (char const *ofile, unsigned int omode)
{
@@ -37,7 +37,7 @@ static inline void conf_output (char const *ofile, unsigned int omode)
unlink_void(otmp) ;
strerr_diefu2sys(111, "cdmake_start ", otmp) ;
}
- if (!conftree_write(&cm))
+ if (!repo_write(&cm, &conf))
{
unlink_void(otmp) ;
strerr_diefu2sys(111, "write config tree into ", otmp) ;
@@ -88,6 +88,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
argc -= l.ind ; argv += l.ind ;
}
+ repo_init(&conf) ;
+
{
int fdr = openc_readb(ifile) ;
char buf[4096] ;