Skip to content

andhm/ini_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ini_parser

a simple ini file parser

Usage

dictionary_t *dict;

// parse file
INI_ERROR err  = ini_parse_file("./php.ini", &dict);

// OR parse string
// INI_ERROR err  = ini_parse_string("XXXX"/*something to parse*/, &dict);

if (err != SUCCESS) {
	printf("Failed info:%s:\n", get_parse_error());
}

// dump parsed info
ini_dump(dict);

// find the key of the section
bucket_t *p_bucket = ini_parameter_find(dict, "soap", "soap.wsdl_cache_dir");
if (p_bucket) {
	printf("Find key %s, val is %s\n", p_bucket->p_key, (char*)p_bucket->p_val);
}

// destroy the all
ini_destroy(dict);

Installation

make && make example

About

a simple ini file parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published