From 3a28add0b68757c7c929b959c5b5ce3c717f7525 Mon Sep 17 00:00:00 2001 From: kraxel Date: Sun, 25 Apr 2004 16:35:37 +0000 Subject: - fbi config stuff. --- fbiconfig.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 fbiconfig.c (limited to 'fbiconfig.c') diff --git a/fbiconfig.c b/fbiconfig.c new file mode 100644 index 0000000..0d86860 --- /dev/null +++ b/fbiconfig.c @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include + +#include "parseconfig.h" +#include "fbiconfig.h" + +static char *fbi_config = NULL; + +static void init_config(void) +{ + char *home; + + home = getenv("HOME"); + if (NULL == home) + return; + + fbi_config = malloc(strlen(home) + 16); + sprintf(fbi_config,"%s/.fbirc", home); +} + +void fbi_read_config(void) +{ + init_config(); + if (fbi_config) + cfg_parse_file("config", fbi_config); +} + +void fbi_write_config(void) +{ + if (fbi_config) + cfg_write_file("config", fbi_config); +} -- cgit