[cvslog] (2002-10-10 07:48:57 UTC) Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Oct 10 02:49:00 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2002-10-10 07:48:57 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Added files:
     lib/eggdrop/eggconfig.c lib/eggdrop/eggconfig.h

Log message:

* Beginning of config system. Right now it's based on xml but it should be easy to replace it later or add a module backend system.

---------------------- diff included ----------------------
Index: eggdrop1.7/lib/eggdrop/eggconfig.c
diff -u /dev/null eggdrop1.7/lib/eggdrop/eggconfig.c:1.1
--- /dev/null	Thu Oct 10 02:48:57 2002
+++ eggdrop1.7/lib/eggdrop/eggconfig.c	Thu Oct 10 02:48:47 2002
@@ -0,0 +1,49 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "xml.h"
+
+int config_init()
+{
+	return(0);
+}
+
+void *config_load(const char *fname)
+{
+	xml_node_t *root;
+
+	root = xml_node_new();
+	xml_read(root, fname);
+	return(0);
+}
+
+int config_save(void *config_root, const char *fname)
+{
+	xml_node_t *root = config_root;
+	FILE *fp;
+
+	if (!fname) fname = "config.xml";
+	fp = fopen(fname, "w");
+	if (!fp) return(-1);
+	xml_write_node(fp, root, 0);
+	fclose(fp);
+	return(0);
+}
+
+int config_destroy(void *config_root)
+{
+	xml_node_t *root = config_root;
+
+	xml_node_destroy(root);
+	free(root);
+	return(0);
+}
+
+int config_get_int(int *intptr, void *config_root, ...)
+{
+}
+
+int config_get_str(char **strptr, void *config_root, ...)
+{
+}
Index: eggdrop1.7/lib/eggdrop/eggconfig.h
diff -u /dev/null eggdrop1.7/lib/eggdrop/eggconfig.h:1.1
--- /dev/null	Thu Oct 10 02:48:57 2002
+++ eggdrop1.7/lib/eggdrop/eggconfig.h	Thu Oct 10 02:48:47 2002
@@ -0,0 +1,4 @@
+#ifndef _EGGCONFIG_H_
+#define _EGGCONFIG_H_
+
+#endif
----------------------- End of diff -----------------------



More information about the Changes mailing list