From 593bcda38f42c31ee9f12d06829edf9882c34c36 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Wed, 25 Jan 2006 22:31:53 +0000 Subject: [PATCH] just saving my changes --- src/config.c | 20 +++++++++++++++++--- src/config.h | 4 ++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/config.c b/src/config.c index fecd1391..48a24a62 100644 --- a/src/config.c +++ b/src/config.c @@ -37,7 +37,8 @@ #include "daap.h" /** Globals */ - +int ecode; +BAG_HANDLE config_main; /** * read a configfile into a bag @@ -46,11 +47,24 @@ * @returns TRUE if successful, FALSE otherwise */ int config_read(char *file) { + FILE *fin; + int err; -} + fin=fopen(file,"r"); + if(!fin) { + ecode = errno; + return CONFIG_E_FOPEN; + } -int config_write(WS_CONNINFO *pwsc) { + if((err=bag_create(&config_main)) != BAG_E_SUCCESS) { + DPRINTF(E_LOG,L_CONF,"Error creating bag: %d\n",err); + return CONFIG_E_UNKNOWN; + } + + + fclose(fin); + return CONFIG_E_SUCCESS; } int config_close(void) { diff --git a/src/config.h b/src/config.h index e911384c..a154f105 100644 --- a/src/config.h +++ b/src/config.h @@ -22,6 +22,10 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ +#define CONFIG_E_SUCCESS 0 +#define CONFIG_E_FOPEN 1 +#define CONFIG_E_UNKNOWN 2 + extern int config_read(char *file); extern int config_write(WS_CONNINFO *pwsc); extern int config_close(void);