Skip to content

Add Uci::add_list#22

Closed
MarkusPettersson98 wants to merge 9 commits intonamib-project:mainfrom
MarkusPettersson98:add-list
Closed

Add Uci::add_list#22
MarkusPettersson98 wants to merge 9 commits intonamib-project:mainfrom
MarkusPettersson98:add-list

Conversation

@MarkusPettersson98
Copy link
Copy Markdown
Contributor

This PR adds safe wrappers for uci_add_list and uci_save, exposing Uci::add_list as a public API. Uci::save could potentially be made public, but for now it uses the private UciPointer type so I skipped that. The PR also contains some cleanup commits unlocked by adding Uci::save, along with a potential time-of-check to time-of-use bug fix in Uci::delete.

I would love to have Uci::add_list in order to set DHCP options.

This PR builds on top of #21. I can split it up if you desire.

It was assumed that the &str argument containing the directory was
indeed a valid directory, which is likely but not enforced by the API.
The corresponding libuci functions are sparsely documented, but the also
assume a valid directory name.
Add common helper methods for working with the unsafe uci C-ffi.
Hold onto the global mutex for the entire duration of Uci::delete to
prevent a potential race between calling get_ptr and uci_delete.
@MarkusPettersson98 MarkusPettersson98 marked this pull request as draft April 25, 2026 15:43
@MarkusPettersson98
Copy link
Copy Markdown
Contributor Author

Closing in favor of #24

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