Function libuci_sys::uci_lookup_ptr [−][src]
pub unsafe extern "C" fn uci_lookup_ptr(
ctx: *mut uci_context,
ptr: *mut uci_ptr,
str_: *mut c_char,
extended: bool
) -> c_int
Expand description
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
if extended is set to true, uci_lookup_ptr supports the following extended syntax:
Examples: network.@interface[0].ifname (‘ifname’ option of the first interface section) network.@interface[-1] (last interface section) Note: uci_lookup_ptr will automatically load a config package if necessary @str must not be constant, as it will be modified and used for the strings inside @ptr, thus it must also be available as long as @ptr is in use.
This function returns UCI_ERR_NOTFOUND if the package specified in the tuple string cannot be found. Otherwise it will return UCI_OK.
Note that failures in looking up other parts, if they are also specfied, including section and option, will also have a return value UCI_OK but with ptr->flags * UCI_LOOKUP_COMPLETE not set.