yumapro  20.10-12
YumaPro SDK
xpath1_pred.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_xpath1_pred
13 #define _H_xpath1_pred
14 
15 /* FILE: xpath1_pred.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 10-sep-16 abb Begun; split from xpath1.c
36 
37 */
38 
39 #ifndef _H_xpath
40 #include "xpath.h"
41 #endif
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /********************************************************************
48 * *
49 * C O N S T A N T S *
50 * *
51 *********************************************************************/
52 
53 /********************************************************************
54 * *
55 * T Y P E S *
56 * *
57 *********************************************************************/
58 
59 /********************************************************************
60 * *
61 * F U N C T I O N S *
62 * *
63 *********************************************************************/
64 
65 
66 /* Group defiied in xpath1.h */
67 
96 extern status_t
97  xpath1_pred_parse_predicate (xpath_pcb_t *pcb,
98  xpath_result_t **result);
99 
100 
104 #ifdef __cplusplus
105 } /* end extern 'C' */
106 #endif
107 
108 
109 #endif /* _H_xpath1_pred */
xpath1_get2.h
XPath 1.0 expression support for server GET2 callback functions.
TK_CUR
#define TK_CUR(T)
return the current token
Definition: tk.h:122
xpath_get_resnode_obj
obj_template_t * xpath_get_resnode_obj(xpath_resnode_t *resnode)
Get the resnode object pointer from a value resnode.
Definition: xpath.c:4050
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
TK_TT_RBRACK
@ TK_TT_RBRACK
right bracket ']'
Definition: tk.h:292
tk_next_typ
tk_type_t tk_next_typ(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3349
TK_TT_DNUM
@ TK_TT_DNUM
decimal number
Definition: tk.h:331
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
XP_RT_NUMBER
@ XP_RT_NUMBER
number result
Definition: xpath.h:348
xpath_clear_nodeset_result
void xpath_clear_nodeset_result(xpath_result_t *result)
Clear all the nodes from the node-set result.
Definition: xpath.c:4635
xpath_first_resnode_valptr
val_value_t * xpath_first_resnode_valptr(xpath_resnode_t *resnode)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3982
xml_msg_get_lookupQ
dlq_hdr_t * xml_msg_get_lookupQ(xml_msg_hdr_t *msg)
Get the GET2 lookup Queue.
Definition: xml_msg.c:1606
xpath_clean_result
void xpath_clean_result(xpath_result_t *result)
Clean an XPath result struct.
Definition: xpath.c:3135
ncx_decode_num
status_t ncx_decode_num(const xmlChar *numstr, ncx_btype_t btyp, ncx_num_t *retnum)
Handle some sort of number string.
Definition: ncx_num.c:1288
xpath1_dump_result
void xpath1_dump_result(log_debug_t lvl, xpath_pcb_t *pcb, xpath_result_t *result, const char *banner)
Generate log output displaying the contents of a result.
Definition: xpath1.c:6737
val.h
Value Node Basic Support.
val_make_simval_obj
val_value_t * val_make_simval_obj(obj_template_t *obj, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type from an object template instead of individual fields Ca...
Definition: val_util.c:4389
xpath1_res_new_val_resnode
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.
Definition: xpath1_res.c:325
xpath_new_pred_ent
xpath_pred_ent_t * xpath_new_pred_ent(obj_template_t *keyobj, const xmlChar *keyval)
Malloc and init an XPath predicate entry struct.
Definition: xpath.c:4949
xpath_cvt_boolean
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
xpath_parse_token
status_t xpath_parse_token(xpath_pcb_t *pcb, tk_type_t tktype)
Parse the XPath token sequence for a specific token type.
Definition: xpath.c:3579
tk.h
NCX Syntax Token Handler.
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
ncx_num.h
NCX Module Library Number Utility Functions.
TK_NEXT
#define TK_NEXT(T)
move through token chain without advancing the cur pointer
Definition: tk.h:89
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
XP_RNT_GET2
@ XP_RNT_GET2
get2ptr
Definition: xpath.h:426
xpath1_cmp.h
XPath 1.0 expression support; Compare utilities.
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
TK_CUR_VAL
#define TK_CUR_VAL(T)
return the current token value
Definition: tk.h:128
val_child_hdr_find_match
val_value_t * val_child_hdr_find_match(val_child_hdr_t *hdr, const val_value_t *findval)
Find the matching entry in the hdr.
Definition: val_child.c:3867
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
dlq_insertAhead
void dlq_insertAhead(void *newP, void *nodeP)
insert the new queue entry before the current entry
Definition: dlq.c:447
XP_FL_FOUND_PRED
#define XP_FL_FOUND_PRED
set if the parser found any predicates in the XPath expression
Definition: xpath.h:272
obj_get_key_by_name
obj_key_t * obj_get_key_by_name(obj_template_t *obj, const xmlChar *keyname)
Check the specified list to see if the string is a list key.
Definition: obj.c:17627
xpath1.h
XPath 1.0 expression support.
ncx_cvt_to_int64
int64 ncx_cvt_to_int64(const ncx_num_t *num, ncx_btype_t btyp)
Convert a number to an integer64; Use rounding for float64.
Definition: ncx_num.c:2103
def_reg.h
Definition Registry module.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
xpath_discard_resnode
void xpath_discard_resnode(xpath_resnode_t *resnode)
Discard a result node.
Definition: xpath.c:4616
getcb_new_get2_lookup
getcb_get2_lookup_t * getcb_new_get2_lookup(obj_template_t *obj, dlq_hdr_t *keyvalQ)
Create a new getcb_get2_lookup struct.
Definition: getcb.c:7865
log_debug4
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
xpath1_pred_parse_predicate
status_t xpath1_pred_parse_predicate(xpath_pcb_t *pcb, xpath_result_t **result)
Parse an XPath Predicate sequence It has already been tokenized.
Definition: xpath1_pred.c:1422
xpath_free_result
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
val_gen_index_chain
status_t val_gen_index_chain(const obj_template_t *obj, val_value_t *val)
Create an index chain for the just-parsed table or container struct.
Definition: val_util.c:2632
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
val_util.h
Value Node Utilities.
getcb_clean_get2_lookupQ
void getcb_clean_get2_lookupQ(dlq_hdr_t *lookupQ)
Clean a queue of getcb_get2_lookup_t.
Definition: getcb.c:7934
val_child_hdr_next
val_value_t * val_child_hdr_next(const val_child_hdr_t *hdr, const val_value_t *curval)
Get the next entry in the child header.
Definition: val_child.c:3827
NCX_BT_INT64
@ NCX_BT_INT64
int64
Definition: ncxtypes.h:210
XP_RT_NONE
@ XP_RT_NONE
not set
Definition: xpath.h:346
xpath1_parse_expr_int
xpath_result_t * xpath1_parse_expr_int(xpath_pcb_t *pcb, status_t *res)
Parse an XPath Expr sequence It has already been tokenized.
Definition: xpath1.c:6644
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
xpath_init_result
void xpath_init_result(xpath_result_t *result, xpath_restype_t restype)
Initialize an XPath result struct.
Definition: xpath.c:3066
IS_SKIP_MODE
#define IS_SKIP_MODE(pcb)
Check if skip mode is active.
Definition: xpath1.h:102
XP_RNT_OBJ
@ XP_RNT_OBJ
objnode
Definition: xpath.h:423
NCX_XPATH_TYPE_NACM
@ NCX_XPATH_TYPE_NACM
NACM data rule.
Definition: ncxtypes.h:1023
val_child.h
Value Node Child Access Support.
xpath1_get2_expand_result
status_t xpath1_get2_expand_result(xpath_pcb_t *pcb, xpath_result_t *result, boolean leaflist_only)
Check the result for GET2 nodes that need to be retrieved.
Definition: xpath1_get2.c:2105
typ.h
Parameter Type Handler.
dlq_count
unsigned int dlq_count(const dlq_hdrT *listP)
get the number of queue entries in the listP queue list
Definition: dlq.c:994
xpath1_res_add_resnode
void xpath1_res_add_resnode(xpath_resnode_t *resnode, xpath_result_t *result)
Add the specified resnode to the result.
Definition: xpath1_res.c:904
yangconst.h
Contains YANG constants separated to prevent H file include loops.
TK_TYP_NUM
#define TK_TYP_NUM(T)
return TRUE if the specified token type is a number
Definition: tk.h:157
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
xpath1_fn.h
XPath 1.0 expression support; Function library.
TK_TT_LBRACK
@ TK_TT_LBRACK
left bracket '['
Definition: tk.h:291
TK_ID
#define TK_ID(T)
return TRUE if the token type is an identifier
Definition: tk.h:95
XP_RNT_VAL
@ XP_RNT_VAL
valptr
Definition: xpath.h:424
ncx_num_is_integral
boolean ncx_num_is_integral(const ncx_num_t *num, ncx_btype_t btyp)
Check if the number is integral or if it has a fractional part.
Definition: ncx_num.c:2038
xpath1_parse_relational_expr_int
xpath_result_t * xpath1_parse_relational_expr_int(xpath_pcb_t *pcb, status_t *res)
Parse an XPath Relational Expr sequence It has already been tokenized.
Definition: xpath1.c:6671
xpath_get_next_resnode
xpath_resnode_t * xpath_get_next_resnode(xpath_resnode_t *resnode)
Get the next result in the renodeQ from a result struct.
Definition: xpath.c:3959
log_debug4_append
void void void void void void void void void void void void void void log_debug4_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG4 log entry.
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
ncx_clean_num
void ncx_clean_num(ncx_btype_t btyp, ncx_num_t *num)
Scrub the memory in a ncx_num_t by freeing all the sub-fields.
Definition: ncx_num.c:189
TK_TT_EQUAL
@ TK_TT_EQUAL
equal sign '='
Definition: tk.h:294
xpath_get_first_resnode
xpath_resnode_t * xpath_get_first_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3931
xpath1_res_find_entry
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.
Definition: xpath1_res.c:746
getcb_new_keyval3
getcb_keyval_t * getcb_new_keyval3(const xmlChar *keyval, obj_template_t *keyobj, boolean fixed_value)
Create a new Get2 keyval holder using value string.
Definition: getcb.c:7786
TK_VAL
#define TK_VAL(T)
return the token value
Definition: tk.h:98
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
tk_next_typ2
tk_type_t tk_next_typ2(tk_chain_t *tkc)
Get the token type of the token after the next token.
Definition: tk.c:3374
xpath_cvt_string
status_t xpath_cvt_string(xpath_pcb_t *pcb, const xpath_result_t *result, xmlChar **str)
Convert an XPath result to a string answer.
Definition: xpath.c:3821
NCX_BT_FLOAT64
@ NCX_BT_FLOAT64
hidden: just for XPath
Definition: ncxtypes.h:216
XP_RNT_VALHDR
@ XP_RNT_VALHDR
valhdr
Definition: xpath.h:425
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
getcb_clean_keyvalQ
void getcb_clean_keyvalQ(dlq_hdr_t *que)
Free all the Get2 keyvals from a dlq_hdr.
Definition: getcb.c:7843
val_child_hdr_first
val_value_t * val_child_hdr_first(const val_child_hdr_t *hdr)
Get the first entry in the child header.
Definition: val_child.c:3789
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
TK_TYP
#define TK_TYP(T)
return the token type
Definition: tk.h:92
grp.h
YANG Grouping Statement Handler.
XML_MSG_SET_LOOKUPQ
#define XML_MSG_SET_LOOKUPQ(M, Q)
Set GET2 lookup entry.
Definition: xml_msg.h:237
XPATH_VAL_CXT
#define XPATH_VAL_CXT(P)
test if context node is a value or get2 in xpath_pcb_t * (P)
Definition: xpath.h:310
xpath1_res.h
XPath 1.0 expression support; result support.
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
obj_key_count
uint32 obj_key_count(const obj_template_t *obj)
Get the number of keys for this object.
Definition: obj.c:9637
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
TK_TYP_STR
#define TK_TYP_STR(T)
return TRUE if the specified token type is a string
Definition: tk.h:144
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
xpath1_pred.h
XPath 1.0 expression support; predicate support.
xpath1_res_free_result
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.
Definition: xpath1_res.c:204
xpath1_res_copy_resnode
void xpath1_res_copy_resnode(xpath_resnode_t *srcnode, xpath_resnode_t *dstnode)
Copy a resnode struct.
Definition: xpath1_res.c:1245
XP_RT_NODESET
@ XP_RT_NODESET
node-set result
Definition: xpath.h:347
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
xpath_result_is_get2
boolean xpath_result_is_get2(xpath_result_t *result)
Check if the result is a node-set for GET2 nodes.
Definition: xpath.c:5144
xpath_get_first_real_resnode
xpath_resnode_t * xpath_get_first_real_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:5110
dlq.h
dlq provides general double-linked list and queue support:
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297