[Mt-daapd-cvs] mt-daapd/src config.c,1.1,1.2 config.h,1.1,1.2
Status: Beta
Brought to you by:
andrew40
From: Ron P. <rp...@us...> - 2006-01-25 22:32:01
|
Update of /cvsroot/mt-daapd/mt-daapd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27886 Modified Files: config.c config.h Log Message: just saving my changes Index: config.h =================================================================== RCS file: /cvsroot/mt-daapd/mt-daapd/src/config.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.h 24 Jan 2006 23:41:05 -0000 1.1 --- config.h 25 Jan 2006 22:31:53 -0000 1.2 *************** *** 23,26 **** --- 23,30 ---- #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); Index: config.c =================================================================== RCS file: /cvsroot/mt-daapd/mt-daapd/src/config.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.c 24 Jan 2006 23:41:05 -0000 1.1 --- config.c 25 Jan 2006 22:31:53 -0000 1.2 *************** *** 38,42 **** /** Globals */ ! /** --- 38,43 ---- /** Globals */ ! int ecode; ! BAG_HANDLE config_main; /** *************** *** 47,55 **** */ int config_read(char *file) { - } - int config_write(WS_CONNINFO *pwsc) { } --- 48,69 ---- */ int config_read(char *file) { + FILE *fin; + int err; + + fin=fopen(file,"r"); + if(!fin) { + ecode = errno; + return CONFIG_E_FOPEN; + } + + 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; } |