mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-29 08:43:42 -04:00
just saving my changes
This commit is contained in:
parent
a6f5be301c
commit
593bcda38f
20
src/config.c
20
src/config.c
@ -37,7 +37,8 @@
|
|||||||
#include "daap.h"
|
#include "daap.h"
|
||||||
|
|
||||||
/** Globals */
|
/** Globals */
|
||||||
|
int ecode;
|
||||||
|
BAG_HANDLE config_main;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* read a configfile into a bag
|
* read a configfile into a bag
|
||||||
@ -46,11 +47,24 @@
|
|||||||
* @returns TRUE if successful, FALSE otherwise
|
* @returns TRUE if successful, FALSE otherwise
|
||||||
*/
|
*/
|
||||||
int config_read(char *file) {
|
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) {
|
int config_close(void) {
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
#ifndef _CONFIG_H_
|
#ifndef _CONFIG_H_
|
||||||
#define _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_read(char *file);
|
||||||
extern int config_write(WS_CONNINFO *pwsc);
|
extern int config_write(WS_CONNINFO *pwsc);
|
||||||
extern int config_close(void);
|
extern int config_close(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user