C实现配置文件(Ini文件)读取,跨平台

config.h

#ifndef __CONFIG_H__
#define __CONFIG_H__

#include \"list.h\"

typedef struct config_node {
	char *section;
	char *name;
	char *value;
} config_node_t;

int config_node_add(list_t *list, char *section, char *name, char *value);
int config_load(list_t **list, const char *filepath);
char *config_get(list_t *list, const char *section, const char *name, const char *def);
void config_free(list_t *list);

#endif /* __CONFIG_H__ */

(全文…)