Skip to main content

lys_getnext

Function lys_getnext 

Source
pub unsafe extern "C" fn lys_getnext(
    last: *const lysc_node,
    parent: *const lysc_node,
    module: *const lysc_module,
    options: u32,
) -> *const lysc_node
Expand description

@brief Get next schema (sibling) node element in the schema order that can be instantiated in a data tree. Returned node may be from an augment.

::lys_getnext() is supposed to be called sequentially. In the first call, the @p last parameter is usually NULL and function starts returning 1) the first @p parent child (if it is set) or 2) the first top level element of @p module. Consequent calls should provide the previously returned node as @p last and the same @p parent and @p module parameters.

Without options, the function is used to traverse only the schema nodes that can be paired with corresponding data nodes in a data tree. By setting some @p options the behavior can be modified to the extent that all the schema nodes are iteratively returned.

This function does not iterate over extension instance schema nodes. Use ::lys_find_child() to get these nodes.

@param[in] last Previously returned schema tree node, or NULL in case of the first call. @param[in] parent Parent of the subtree to iterate over. If set, @p module is ignored. @param[in] module Module of the top level elements to iterate over. If @p parent is NULL, it must be specified. @param[in] options [ORed options](@ref sgetnextflags). @return Next schema tree node, NULL in case there are no more.