Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a remove_entry function #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LodenRietveld
Copy link

Removing/modifying entries is not yet possible with this ini lib, but I did need it for a project it's used in.

The function I added frees the entry-to-be-removed's key and value, and then uses memmove to shift all entries after the removed entry forward. Finally, it reduces the section size by 1.

I tested this locally with a simple, small .conf file.

LodenRietveld added 3 commits December 2, 2022 15:57
Removing/modifying entries is not yet possible with this ini lib,
but I did need it for a project it's used in.

The function I added frees the entry-to-be-removed's key and value,
and then uses memmove to shift all entries after the removed entry
forward. Finally, it reduces the section size by 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant