summaryrefslogtreecommitdiffstats
path: root/config_parser.h
blob: 73941f83734a4933dbf5937aae5f5bf1d96e6d54 (plain)
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
/*
 *
 * File		:	config_parser.c
 *
 * Author	:	Zurcher Jeremy
 *
 * Date		:
 *
 * Purpose	:
 *
 */

#ifndef CONFIG_PARSER_H
#define CONFIG_PARSER_H

#define BUFFLEN 64

/**
 * callback
 * @param token the parsed token
 * @param incomplete set to 1 if the token is too big for the buffer
 */
typedef int(*config_callback)(char *token, int incomplete);

/**
 * read_config 
 * 
 * @param filename the path to the configuration file to parse
 * @param callback function called with each token
 */
int parse_config(char *filename, config_callback callabck);

#endif /* CONFIG_PARSER_H */