diff options
author | FreeArtMan <dos21h@gmail.com> | 2017-06-11 18:12:40 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2017-06-11 18:12:40 +0100 |
commit | 803d146aac5212f2c36ae86ea02a16278eab41e5 (patch) | |
tree | 4ddbd4f60decdc5b6c3b805551e140ff959607b4 /config_load.h | |
parent | e162dadf83f682bf67a4177942efc4b781b7a5e2 (diff) | |
download | agni-803d146aac5212f2c36ae86ea02a16278eab41e5.tar.gz agni-803d146aac5212f2c36ae86ea02a16278eab41e5.zip |
Added config loading library
Diffstat (limited to 'config_load.h')
-rw-r--r-- | config_load.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/config_load.h b/config_load.h new file mode 100644 index 0000000..8d32ed7 --- /dev/null +++ b/config_load.h @@ -0,0 +1,40 @@ +#ifndef __CONFIG_LOAD_H +#define __CONFIG_LOAD_H + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + +#include "arg.h" +#include "iniparser.h" +#include "debug.h" + +#include "config_servers.h" +#include "sds.h" +#include "util.h" + +typedef struct config_ini { + dictionary *ini; //dict with configs +} config_ini; + +/* +Load config file to dict +config should be NULL +*/ +int config_load_ini(char *ini_fname, config_ini **config); +/* +How many servers there are to be configured,count +*/ +int config_server_num(config_ini *config); +/* +server_conf should be preallocated +*/ +int config_get_irc_config(config_ini *config, int n, irc_server_conf *server_conf); +/* +free internal structures +*/ +void config_free(config_ini *config); + + +#endif
\ No newline at end of file |