It'd be useful to be able to test if a particular section exists before trying to read anything from it. This would allow for creating relevant structures in advance. And it would be especially useful in situations when you cannot rely on any key/value pair being always present if a section exists.
Is this something that could be supported without expanding existing API? e.g.,
ini_get(config, "owner", NULL) == NULL // section doesn't exist
ini_get(config, "owner", NULL) != NULL // section exists
If that sounds OK to you I could create a PR.
It'd be useful to be able to test if a particular section exists before trying to read anything from it. This would allow for creating relevant structures in advance. And it would be especially useful in situations when you cannot rely on any key/value pair being always present if a section exists.
Is this something that could be supported without expanding existing API? e.g.,
ini_get(config, "owner", NULL) == NULL // section doesn't existini_get(config, "owner", NULL) != NULL // section existsIf that sounds OK to you I could create a PR.