yumapro  20.10-10
YumaPro SDK
XPath1 Result Support

XPath 1.0 Expression Result Data Structure Support. More...

Collaboration diagram for XPath1 Result Support:

Functions

void xpath1_res_malloc_failed_error (xpath_pcb_t *pcb)
 Generate a malloc failed error if OK. More...
 
xpath_result_txpath1_res_new_result (xpath_pcb_t *pcb, xpath_restype_t restype)
 Get a new result from the cache or malloc if none available. More...
 
void xpath1_res_free_result (xpath_pcb_t *pcb, xpath_result_t *result)
 Free a result struct: put in cache or free if cache maxed out. More...
 
xpath_resnode_txpath1_res_new_obj_resnode (xpath_pcb_t *pcb, boolean dblslash, obj_template_t *objptr)
 Get a new result node from the cache or malloc if none available. More...
 
xpath_resnode_txpath1_res_new_val_resnode (xpath_pcb_t *pcb, boolean dblslash, val_value_t *valptr)
 Get a new result node from the cache or malloc if none available. More...
 
xpath_resnode_txpath1_res_new_valhdr_resnode (xpath_pcb_t *pcb, boolean dblslash, val_child_hdr_t *valhdr)
 Get a new result node from the cache or malloc if none available. More...
 
xpath_resnode_txpath1_res_new_get2_resnode (xpath_pcb_t *pcb, boolean dblslash, val_value_t *nodeptr_val, xpath_get2_cb_t *nodeptr_cb, xpath_get2_form_t get2_form)
 Get a new result node from the cache or malloc if none available. More...
 
void xpath1_res_free_resnode (xpath_pcb_t *pcb, xpath_resnode_t *resnode)
 Free a result node struct: put in cache or free if cache maxed out. More...
 
xpath_result_txpath1_res_new_nodeset (xpath_pcb_t *pcb, obj_template_t *obj, val_value_t *val, boolean dblslash)
 Create a new nodeset. More...
 
xpath_result_txpath1_res_new_cxt_nodeset (xpath_pcb_t *pcb, boolean dblslash)
 Start a nodeset result with the current context node. More...
 
xpath_result_txpath1_res_new_origcxt_nodeset (xpath_pcb_t *pcb, boolean dblslash)
 Start a nodeset result with the original context node. More...
 
val_value_txpath1_res_find_entry (xpath_result_t *result, int64 position)
 Find the Nth entry in the node-set result for the position() function. More...
 
int64 xpath1_res_get_count (xpath_result_t *result)
 Get the number of entries in the node-set result to support the count() function. More...
 
int64 xpath1_res_get_position (xpath_result_t *result, val_value_t *valptr)
 Find the position of the specified entry. More...
 
void xpath1_res_add_resnode (xpath_resnode_t *resnode, xpath_result_t *result)
 Add the specified resnode to the result. More...
 
status_t xpath1_res_flatten_result (xpath_pcb_t *pcb, xpath_result_t *result)
 Convert any vahdr resnodes to valptr resnodes for simplified processing. More...
 
xpath_resnode_txpath1_res_find_resnode (xpath_pcb_t *pcb, dlq_hdr_t *resultQ, const void *ptr)
 Check if the specified resnode ptr is already in the Q. More...
 
xpath_resnode_txpath1_res_find_get2_resnode (xpath_pcb_t *pcb, dlq_hdr_t *resultQ, xpath_get2_node_t *get2node)
 Check if the specified resnode ptr is already in the Q (GET2) More...
 
xpath_resnode_txpath1_res_match_resnode (dlq_hdr_t *resultQ, xpath_resnode_t *findnode, boolean match_exact)
 Match the specified result node. More...
 
void xpath1_res_copy_resnode (xpath_resnode_t *srcnode, xpath_resnode_t *dstnode)
 Copy a resnode struct. More...
 
const xmlChar * xpath1_res_get_cxt_name (const xpath_pcb_t *pcb)
 Get the local-name of the context node. More...
 
const xmlChar * xpath1_res_get_resnode_name (const xpath_resnode_t *resnode)
 Get the local-name of the resnode node. More...
 
boolean xpath1_res_match_get2node (xpath_get2_cb_t *cb1, xpath_get2_cb_t *cb2)
 Compare two GET2 CBs. More...
 

Detailed Description

XPath 1.0 Expression Result Data Structure Support.

Function Documentation

void xpath1_res_add_resnode ( xpath_resnode_t resnode,
xpath_result_t result 
)

Add the specified resnode to the result.

Parameters
resnoderesnode to add to result
resultresult to receive the resnode

Here is the call graph for this function:

Here is the caller graph for this function:

void xpath1_res_copy_resnode ( xpath_resnode_t srcnode,
xpath_resnode_t dstnode 
)

Copy a resnode struct.

Parameters
srcnodesource resnode
dstnodedestination node

Here is the caller graph for this function:

val_value_t* xpath1_res_find_entry ( xpath_result_t result,
int64  position 
)

Find the Nth entry in the node-set result for the position() function.

Parameters
resultnode-set result to check
positionvalue of the position function
Returns
pointer to the valptr in the resnode that is the Nth value.
NULL if not a node-set of not enough values

Here is the call graph for this function:

xpath_resnode_t* xpath1_res_find_get2_resnode ( xpath_pcb_t pcb,
dlq_hdr_t *  resultQ,
xpath_get2_node_t get2node 
)

Check if the specified resnode ptr is already in the Q (GET2)

Parameters
pcbparser control block to use
resultQQ of xpath_resnode_t structs to check
DOES NOT HAVE TO BE WITHIN A RESULT NODE Q
get2nodeget2 node struct to find
Returns
found resnode or NULL if not found

Here is the call graph for this function:

xpath_resnode_t* xpath1_res_find_resnode ( xpath_pcb_t pcb,
dlq_hdr_t *  resultQ,
const void *  ptr 
)

Check if the specified resnode ptr is already in the Q.

Parameters
pcbparser control block to use
resultQQ of xpath_resnode_t structs to check
DOES NOT HAVE TO BE WITHIN A RESULT NODE Q
ptrpointer value to find
Returns
found resnode or NULL if not found

Here is the caller graph for this function:

status_t xpath1_res_flatten_result ( xpath_pcb_t pcb,
xpath_result_t result 
)

Convert any vahdr resnodes to valptr resnodes for simplified processing.

Parameters
pcbXPath parser control block
resultnode-set result to flatten
Returns
status

Here is the call graph for this function:

void xpath1_res_free_resnode ( xpath_pcb_t pcb,
xpath_resnode_t resnode 
)

Free a result node struct: put in cache or free if cache maxed out.

Parameters
pcbparser control block to use (may be NULL)
resnoderesult node struct to free

Here is the call graph for this function:

Here is the caller graph for this function:

void xpath1_res_free_result ( xpath_pcb_t pcb,
xpath_result_t result 
)

Free a result struct: put in cache or free if cache maxed out.

Parameters
pcbparser control block to use (may be NULL)
resultresult struct to free

Here is the call graph for this function:

Here is the caller graph for this function:

int64 xpath1_res_get_count ( xpath_result_t result)

Get the number of entries in the node-set result to support the count() function.

Parameters
resultnode-set result to check
Returns
count of valnodes in the result

Here is the caller graph for this function:

const xmlChar* xpath1_res_get_cxt_name ( const xpath_pcb_t pcb)

Get the local-name of the context node.

Parameters
pcbparser control block to use
Returns
const pointer to context node name

Here is the call graph for this function:

int64 xpath1_res_get_position ( xpath_result_t result,
val_value_t valptr 
)

Find the position of the specified entry.

This does not really work if GET2 nodes are being used The position() function is not required in NETCONF or YANG

Parameters
resultnode-set result to check
valptrentry to find
Returns
position value or zero if not found

Here is the call graph for this function:

const xmlChar* xpath1_res_get_resnode_name ( const xpath_resnode_t resnode)

Get the local-name of the resnode node.

Parameters
resnoderesnode to check
Returns
const pointer to the node name

Here is the call graph for this function:

Here is the caller graph for this function:

void xpath1_res_malloc_failed_error ( xpath_pcb_t pcb)

Generate a malloc failed error if OK.

Parameters
pcbparser control block to use

Here is the call graph for this function:

Here is the caller graph for this function:

boolean xpath1_res_match_get2node ( xpath_get2_cb_t cb1,
xpath_get2_cb_t cb2 
)

Compare two GET2 CBs.

Match if same CB or same object for list, the return keys have to match

Parameters
cb1GET2 control block 1 to compare
cb2GET2 control block 2 to compare
Returns
TRUE if the control blocks match

Here is the call graph for this function:

Here is the caller graph for this function:

xpath_resnode_t* xpath1_res_match_resnode ( dlq_hdr_t *  resultQ,
xpath_resnode_t findnode,
boolean  match_exact 
)

Match the specified result node.

THIS IS THE CURRENT FUNCTION; USE INSTEAD OF: xpath1_res_find_resnode

Check if the specified resnode ptr is already in the Q

Parameters
resultQQ of xpath_resnode_t structs to check
DOES NOT HAVE TO BE WITHIN A RESULT NODE Q
findnodethe resnode to find
match_exactTRUE to match only the exact same CB
== FALSE to match same object, same keystack
Returns
found resnode or NULL if not found

Here is the call graph for this function:

Here is the caller graph for this function:

xpath_result_t* xpath1_res_new_cxt_nodeset ( xpath_pcb_t pcb,
boolean  dblslash 
)

Start a nodeset result with the current context node.

Parameters
pcbparser control block to use
dblslashTRUE if unprocessed dblslash in effect
FALSE if not
Returns
malloced data structure or NULL if out-of-memory error

Here is the call graph for this function:

xpath_resnode_t* xpath1_res_new_get2_resnode ( xpath_pcb_t pcb,
boolean  dblslash,
val_value_t nodeptr_val,
xpath_get2_cb_t nodeptr_cb,
xpath_get2_form_t  get2_form 
)

Get a new result node from the cache or malloc if none available.

INPUTS:

Parameters
pcb== parser control block to use
if pcb->val set then node.valptr will be used else node.objptr will be used instead
dblslashTRUE if // present on this result node and has not been converted to separate nodes for all descendants instead
== FALSE if '//' is not in effect for the current step
nodeptr_valxpath_get2_node_t val field pointer
nodeptr_cbxpath_get2_node_t cb field pointer
get2_formform enum for this entry
Returns
result from the cache or malloced; NULL if malloc fails

Here is the call graph for this function:

Here is the caller graph for this function:

xpath_result_t* xpath1_res_new_nodeset ( xpath_pcb_t pcb,
obj_template_t obj,
val_value_t val,
boolean  dblslash 
)

Create a new nodeset.

Start a nodeset result with a specified object or value ptr Only one of obj or val will really be stored, depending on the current parsing mode

This is the old API before GET2 was added

Parameters
pcbparser control block to use
objobject ptr to store as the first resnode
valvalue ptr to store as the first resnode
dblslashTRUE if unprocessed dblslash in effect
FALSE if not
Returns
malloced data structure or NULL if out-of-memory error

Here is the call graph for this function:

xpath_resnode_t* xpath1_res_new_obj_resnode ( xpath_pcb_t pcb,
boolean  dblslash,
obj_template_t objptr 
)

Get a new result node from the cache or malloc if none available.

Parameters
pcbparser control block to use
if pcb->val set then node.valptr will be used else node.objptr will be used instead
dblslashTRUE if // present on this result node and has not been converted to separate nodes for all descendants instead
== FALSE if '//' is not in effect for the current step
objptrobject pointer value to use
Returns
result from the cache or malloced; NULL if malloc fails

Here is the call graph for this function:

Here is the caller graph for this function:

xpath_result_t* xpath1_res_new_origcxt_nodeset ( xpath_pcb_t pcb,
boolean  dblslash 
)

Start a nodeset result with the original context node.

Parameters
pcbparser control block to use
dblslashTRUE if unprocessed dblslash in effect
FALSE if not
Returns
malloced data structure or NULL if out-of-memory error

Here is the call graph for this function:

xpath_result_t* xpath1_res_new_result ( xpath_pcb_t pcb,
xpath_restype_t  restype 
)

Get a new result from the cache or malloc if none available.

Parameters
pcbparser control block to use
restypedesired result type
Returns
result from the cache or malloced; NULL if malloc fails

Here is the call graph for this function:

Here is the caller graph for this function:

xpath_resnode_t* xpath1_res_new_val_resnode ( xpath_pcb_t pcb,
boolean  dblslash,
val_value_t valptr 
)

Get a new result node from the cache or malloc if none available.

Parameters
pcb== parser control block to use
if pcb->val set then node.valptr will be used else node.objptr will be used instead
dblslashTRUE if // present on this result node and has not been converted to separate nodes for all descendants instead
== FALSE if '//' is not in effect for the current step
valptrvariable pointer value to use
Returns
result from the cache or malloced; NULL if malloc fails

Here is the call graph for this function:

Here is the caller graph for this function:

xpath_resnode_t* xpath1_res_new_valhdr_resnode ( xpath_pcb_t pcb,
boolean  dblslash,
val_child_hdr_t valhdr 
)

Get a new result node from the cache or malloc if none available.

Parameters
pcb== parser control block to use
if pcb->val set then node.valptr will be used else node.objptr will be used instead
dblslashTRUE if // present on this result node and has not been converted to separate nodes for all descendants instead
== FALSE if '//' is not in effect for the current step
valhdrvariable header pointer to use
Returns
result from the cache or malloced; NULL if malloc fails

Here is the call graph for this function:

Here is the caller graph for this function: