summaryrefslogtreecommitdiff
path: root/config_load.h
blob: 8d32ed75e1ed0683122d6b65dc62d38afc4901df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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