Crate libuci_sys[−][src]
Expand description
FFI bindings to OpenWRT UCI
This crate provides an unsafe interface to OpenWRT’s Unified Configuration Interface C-Library.
Building
Both UCI libraries and headers are required to build this crate. There are multiple options available to locate UCI.
Inside OpenWRT SDK
If building inside the OpenWRT SDK with OpenWRT’s UCI package set the environment variable
UCI_DIR=$(STAGING_DIR)/usr
using the corresponding Makefile.
rust-uci will automatically use the headers and libraries for the target system.
Vendored
If no UCI_DIR
variable is set, rust-uci will compile against the distributed libuci source files licensed under GPLv2.
Structs
uci_backend | |
uci_context | |
uci_delta | |
uci_element | |
uci_list | |
uci_option | |
uci_package | |
uci_parse_context | |
uci_parse_option | |
uci_ptr | |
uci_section |
Constants
UCI_OK | |
uci_option_type_UCI_TYPE_STRING | |
uci_ptr_UCI_LOOKUP_COMPLETE | |
uci_type_UCI_TYPE_OPTION | |
uci_type_UCI_TYPE_SECTION |
Functions
uci_add_delta_path⚠ | uci_add_delta_path: add a directory to the search path for change delta files @ctx: uci context @dir: directory name |
uci_add_list⚠ | uci_add_list: Append a string to an element list @ctx: uci context @ptr: uci pointer (with value) |
uci_add_section⚠ | uci_add_section: Add an unnamed section @ctx: uci context @p: package to add the section to @type: section type @res: pointer to store a reference to the new section in |
uci_alloc_context⚠ | uci_alloc_context: Allocate a new uci context |
uci_commit⚠ | uci_commit: commit changes to a package @ctx: uci context @p: uci_package struct pointer @overwrite: overwrite existing config data and flush delta |
uci_del_list⚠ | uci_del_list: Remove a string from an element list @ctx: uci context @ptr: uci pointer (with value) |
uci_delete⚠ | uci_delete: Delete a section or option @ctx: uci context @ptr: uci pointer |
uci_export⚠ | uci_export: Export one or all uci config packages @ctx: uci context @stream: output stream @package: (optional) uci config package to export @header: include the package header |
uci_free_context⚠ | uci_free_context: Free the uci context including all of its data |
uci_get_errorstr⚠ | uci_geterror: Get an error string for the last uci error @ctx: uci context @dest: target pointer for the string @str: prefix for the error message |
uci_hash_options⚠ | uci_hash_options: build a hash over a list of options @tb: list of option pointers @n_opts: number of options |
uci_import⚠ | uci_import: Import uci config data from a stream @ctx: uci context @stream: file stream to import from @name: (optional) assume the config has the given name @package: (optional) store the last parsed config package in this variable @single: ignore the ‘package’ keyword and parse everything into a single package |
uci_list_configs⚠ | uci_list_configs: List available uci config files @ctx: uci context |
uci_load⚠ | uci_load: Parse an uci config file and store it in the uci context |
uci_lookup_next⚠ | uci_lookup_next: lookup a child element @ctx: uci context @e: target element pointer @list: list of elements @name: name of the child element |
uci_lookup_ptr⚠ | uci_lookup_ptr: Split an uci tuple string and look up an element tree @ctx: uci context @ptr: lookup result struct @str: uci tuple string to look up @extended: allow extended syntax lookup |
uci_parse_argument⚠ | uci_parse_argument: parse a shell-style argument, with an arbitrary quoting style @ctx: uci context @stream: input stream @str: pointer to the current line (use NULL for parsing the next line) @result: pointer for the result |
uci_parse_ptr⚠ | uci_parse_ptr: parse a uci string into a uci_ptr @ctx: uci context @ptr: target data structure @str: string to parse |
uci_parse_section⚠ | uci_parse_section: look up a set of options @s: uci section @opts: list of options to look up @n_opts: number of options to look up @tb: array of pointers to found options |
uci_perror⚠ | uci_perror: Print the last uci error that occured @ctx: uci context @str: string to print before the error message |
uci_rename⚠ | uci_rename: Rename an element @ctx: uci context @ptr: uci pointer (with value) |
uci_reorder_section⚠ | uci_reorder: Reposition a section @ctx: uci context @s: uci section to reposition @pos: new position in the section list |
uci_revert⚠ | uci_revert: revert all changes to a config item @ctx: uci context @ptr: uci pointer |
uci_save⚠ | uci_save: save change delta for a package @ctx: uci context @p: uci_package struct |
uci_set⚠ | uci_set: Set an element’s value; create the element if necessary @ctx: uci context @ptr: uci pointer |
uci_set_backend⚠ | uci_set_backend: change the default backend @ctx: uci context @name: name of the backend |
uci_set_confdir⚠ | uci_set_savedir: override the default config storage directory @ctx: uci context @dir: directory name |
uci_set_savedir⚠ | uci_set_savedir: override the default delta save directory @ctx: uci context @dir: directory name |
uci_unload⚠ | uci_unload: Unload a config file from the uci context |
uci_validate_text⚠ | uci_validate_text: validate a value string for uci options @str: value |
Type Definitions
uci_command | |
uci_flags | |
uci_option_type | |
uci_type |