C实现配置文件(Ini文件)读取,跨平台
2009年09月24日
by 温 云龙
257 views
0 comments
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__ */