Use dmini section iteration API in configure_section_drivers#31
Merged
JohnAmadis merged 3 commits intomainfrom Mar 9, 2026
Merged
Use dmini section iteration API in configure_section_drivers#31JohnAmadis merged 3 commits intomainfrom
JohnAmadis merged 3 commits intomainfrom
Conversation
… direct file I/O Replace Dmod_FileOpen/Dmod_FileReadLine with dmini_generate_string so that section enumeration works from the already-parsed in-memory dmini context rather than re-reading the raw config file from disk. This is the intended usage as described in the issue: use the dmini API (dmini_set_active_section) to restrict context scope, not a hand-rolled file parser. - Remove config_path parameter from configure_section_drivers (no longer needed) - Remove unused INI_LINE_BUFFER_SIZE define - Add whitespace trimming for robustness when parsing section names - Use dmini_generate_string to obtain INI content from in-memory context Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update driver name search for each section
Replace manual file re-read in configure_section_drivers with dmini_generate_string
Mar 9, 2026
Contributor
|
@copilot w wersji dmini@0.5 masz juz mozliwosc iterowania po sekcjach - użyj tego |
Replace dmini_generate_string + manual string parsing with the proper dmini@0.5 section iteration API: dmini_section_count() and dmini_section_name(index). This gives direct access to section names from the in-memory context without allocating a serialised string or parsing it manually. The dmini_set_active_section / dmini_clear_active_section usage for scoping the context per driver is unchanged. Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Contributor
Author
Done in 97c9a69. Replaced |
Copilot
AI
changed the title
Replace manual file re-read in configure_section_drivers with dmini_generate_string
Use dmini section iteration API in configure_section_drivers
Mar 9, 2026
JohnAmadis
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per-section
driver_namesupport was implemented by re-opening the raw config file withDmod_FileOpen/Dmod_FileReadLineto enumerate sections — effectively writing a second INI parser. The correct approach is to use the dmini API to enumerate sections and usedmini_set_active_sectionto scope the context before passing it to each driver.Changes
configure_section_drivers: replaceDmod_FileOpen+ line-by-line scan withdmini_section_count/dmini_section_name(dmini@0.5 section iteration API) to walk sections directly from the in-memory context; no buffer allocation or string parsing requiredconfig_pathparameter — no longer needed now that we don't touch the filesystemINI_LINE_BUFFER_SIZEdefineOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.