yumapro
24.10-1
YumaPro SDK
|
XPath 1.0 Expression Result Data Structure Support. More...
Functions | |
void | xpath1_res_malloc_failed_error (xpath_pcb_t *pcb) |
Generate a malloc failed error if OK. More... | |
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. 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_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. More... | |
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. More... | |
xpath_resnode_t * | xpath1_res_new_aioval_resnode (xpath_pcb_t *pcb, boolean dblslash, val_value_t *valptr) |
Get a new AIO val result node from the cache or malloc if none available. More... | |
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. More... | |
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. 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_t * | xpath1_res_new_nodeset (xpath_pcb_t *pcb, obj_template_t *obj, val_value_t *val, boolean dblslash) |
Create a new nodeset. More... | |
xpath_result_t * | xpath1_res_new_cxt_nodeset (xpath_pcb_t *pcb, boolean dblslash) |
Start a nodeset result with the current context node. More... | |
xpath_result_t * | xpath1_res_new_origcxt_nodeset (xpath_pcb_t *pcb, boolean dblslash) |
Start a nodeset result with the original context node. More... | |
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. 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_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. More... | |
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) More... | |
xpath_resnode_t * | xpath1_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... | |
XPath 1.0 Expression Result Data Structure Support.
void xpath1_res_add_resnode | ( | xpath_resnode_t * | resnode, |
xpath_result_t * | result | ||
) |
Add the specified resnode to the result.
resnode | resnode to add to result |
result | result to receive the resnode |
void xpath1_res_copy_resnode | ( | xpath_resnode_t * | srcnode, |
xpath_resnode_t * | dstnode | ||
) |
Copy a resnode struct.
srcnode | source resnode |
dstnode | destination node |
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.
result | node-set result to check |
position | value of the position 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)
pcb | parser control block to use |
resultQ | Q of xpath_resnode_t structs to check DOES NOT HAVE TO BE WITHIN A RESULT NODE Q |
get2node | get2 node struct to find |
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.
pcb | parser control block to use |
resultQ | Q of xpath_resnode_t structs to check DOES NOT HAVE TO BE WITHIN A RESULT NODE Q |
ptr | pointer value to find |
status_t xpath1_res_flatten_result | ( | xpath_pcb_t * | pcb, |
xpath_result_t * | result | ||
) |
Convert any vahdr resnodes to valptr resnodes for simplified processing.
pcb | XPath parser control block |
result | node-set result to flatten |
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.
pcb | parser control block to use (may be NULL) |
resnode | result node struct to free |
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.
pcb | parser control block to use (may be NULL) |
result | result struct to free |
int64 xpath1_res_get_count | ( | xpath_result_t * | result | ) |
Get the number of entries in the node-set result to support the count() function.
result | node-set result to check |
const xmlChar * xpath1_res_get_cxt_name | ( | const xpath_pcb_t * | pcb | ) |
Get the local-name of the context node.
pcb | parser control block to use |
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
result | node-set result to check |
valptr | entry to find |
const xmlChar * xpath1_res_get_resnode_name | ( | const xpath_resnode_t * | resnode | ) |
Get the local-name of the resnode node.
resnode | resnode to check |
void xpath1_res_malloc_failed_error | ( | xpath_pcb_t * | pcb | ) |
Generate a malloc failed error if OK.
pcb | parser control block to use |
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
cb1 | GET2 control block 1 to compare |
cb2 | GET2 control block 2 to compare |
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
resultQ | Q of xpath_resnode_t structs to check DOES NOT HAVE TO BE WITHIN A RESULT NODE Q |
findnode | the resnode to find |
match_exact | TRUE to match only the exact same CB == FALSE to match same object, same keystack |
xpath_resnode_t * xpath1_res_new_aioval_resnode | ( | xpath_pcb_t * | pcb, |
boolean | dblslash, | ||
val_value_t * | valptr | ||
) |
Get a new AIO val result node from the cache or malloc if none available.
pcb | == parser control block to use if pcb->val set then node.valptr will be used else node.objptr will be used instead |
dblslash | TRUE 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 |
valptr | variable pointer value to use |
xpath_result_t * xpath1_res_new_cxt_nodeset | ( | xpath_pcb_t * | pcb, |
boolean | dblslash | ||
) |
Start a nodeset result with the current context node.
pcb | parser control block to use |
dblslash | TRUE if unprocessed dblslash in effect FALSE if not |
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:
pcb | == parser control block to use if pcb->val set then node.valptr will be used else node.objptr will be used instead |
dblslash | TRUE 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_val | xpath_get2_node_t val field pointer |
nodeptr_cb | xpath_get2_node_t cb field pointer |
get2_form | form enum for this entry |
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
pcb | parser control block to use |
obj | object ptr to store as the first resnode |
val | value ptr to store as the first resnode |
dblslash | TRUE if unprocessed dblslash in effect FALSE if not |
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.
pcb | parser control block to use if pcb->val set then node.valptr will be used else node.objptr will be used instead |
dblslash | TRUE 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 |
objptr | object pointer value to use |
xpath_result_t * xpath1_res_new_origcxt_nodeset | ( | xpath_pcb_t * | pcb, |
boolean | dblslash | ||
) |
Start a nodeset result with the original context node.
pcb | parser control block to use |
dblslash | TRUE if unprocessed dblslash in effect FALSE if not |
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.
pcb | parser control block to use |
restype | desired result type |
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.
pcb | == parser control block to use if pcb->val set then node.valptr will be used else node.objptr will be used instead |
dblslash | TRUE 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 |
valptr | variable pointer value to use |
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.
pcb | == parser control block to use if pcb->val set then node.valptr will be used else node.objptr will be used instead |
dblslash | TRUE 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 |
valhdr | variable header pointer to use |