Function stack_graphs::c::sg_stack_graph_get_or_create_nodes
source · #[no_mangle]
pub extern "C" fn sg_stack_graph_get_or_create_nodes(
graph: *mut sg_stack_graph,
count: usize,
nodes: *const sg_node,
handles_out: *mut sg_node_handle
)
Expand description
Adds new nodes to the stack graph. You provide an array of struct sg_node
instances. You
also provide an output array, which must have the same length as nodes
, in which we will
place each node’s handle in the stack graph.
We copy the node content into the stack graph. The array you pass in does not need to outlive the call to this function.
You cannot add new instances of the root node or “jump to scope” node, since those are singletons and already exist in the stack graph.
If you try to add a new node that has the same ID as an existing node in the stack graph, the
new node will be ignored, and the corresponding entry in the handles_out
array will contain
the handle of the existing node with that ID.
If any node that you pass in is invalid, it will not be added to the graph, and the
corresponding entry in the handles_out
array will be null.