Introduction
This project uses C and linklist to implement and manage INI files. This project is a sample of linklist implementation.
Sample Usage
ini_start("sample.ini");
buffer = get_value("Main","PLC");
printf("value : %s\n",buffer);
printf("last error is %s\n",get_last_error());
ini_end();
How To Implement
This project uses linklist to make a sample tree for collecting INI file data. INI file in this project must separate using "=". This is a sample function to manage INI file.
bool ini_start(const char* filename);
bool load(const char *filename);
bool save(); bool save_as(const char *filename);
char *get_value (const char *sec,const char *key);
char *_get_value(const char *sec,const char *key, char *comment);
bool set_value (const char *sec,const char *key, const char *value);
bool _set_value (const char *sec,const char *key, const char *value,const char *comment,REPLACE_FLAG flag);
int remove_sel (const char *sec,char *key);
int remove_all (const char * sec);
void add_section(const char *sec,const char *comment); int remove_section(char *sec);
void clear();
int content_size();
int section_size(char *sec);
void print_content(); void print_section(); void print_record(char *sec,char *key); void print_allrecord(char *sec);
void ini_end();
void _ini_end(REPLACE_FLAG flag);
char *get_last_error();
History
- 22nd August, 2006: Initial post