Skip to content

Idea: testing for existence of a particular section #2

@krychu

Description

@krychu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions