yumapro  20.10-12
YumaPro SDK
xpath1_fn.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_fn
13 #define _H_xpath1_fn
14 
15 /* FILE: xpath1_fn.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 27-aug-16 abb Begun; split from xpath1.h
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 /* Group defiied in xpath1.h */
66 
81 extern const xpath_fncb_t *
83 
84 
88 #ifdef __cplusplus
89 } /* end extern 'C' */
90 #endif
91 
92 
93 #endif /* _H_xpath1_fn */
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
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
VAL_ENUM
#define VAL_ENUM(V)
Access the enum value in the value ONLY if BCX_NT_ENUM.
Definition: val.h:429
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
xml_strncpy
uint32 xml_strncpy(xmlChar *copyTo, const xmlChar *copyFrom, uint32 maxlen)
String copy for xmlChar – checks for buffer overflow.
Definition: xml_util.c:1518
XP_RT_NUMBER
@ XP_RT_NUMBER
number result
Definition: xpath.h:348
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_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
xpath_next_resnode_valptr
val_value_t * xpath_next_resnode_valptr(xpath_resnode_t *resnode, val_value_t *valptr)
Get the next node val pointer from a result node struct.
Definition: xpath.c:4017
ncx_valid_name2
boolean ncx_valid_name2(const xmlChar *str)
Check if an xmlChar string is a valid NCX name.
Definition: ncx.c:7637
VAL_XPATHPCB
#define VAL_XPATHPCB(V)
Access the Xpath parser control block.
Definition: val.h:651
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
val.h
Value Node Basic Support.
NCX_BT_INSTANCE_ID
@ NCX_BT_INSTANCE_ID
instance-identifier
Definition: ncxtypes.h:219
ncx_set_num_nan
void ncx_set_num_nan(ncx_num_t *num, ncx_btype_t btyp)
Set a FP number to the Not a Number value.
Definition: ncx_num.c:592
NCX_BT_IDREF
@ NCX_BT_IDREF
identityref
Definition: ncxtypes.h:222
xpath_cvt_boolean
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
typ_is_number
boolean typ_is_number(ncx_btype_t btyp)
Check if the base type is numeric.
Definition: typ.c:4063
NCX_BT_LEAFREF
@ NCX_BT_LEAFREF
leafref (needs special processing)
Definition: ncxtypes.h:221
tk.h
NCX Syntax Token Handler.
ncx_num.h
NCX Module Library Number Utility Functions.
val_pattern_match
boolean val_pattern_match(const xmlRegexpPtr pattern, const xmlChar *strval)
Check the specified string against the specified pattern.
Definition: val.c:14118
val_find_bit
boolean val_find_bit(val_value_t *val, const xmlChar *bitname)
Find the specified bit name in the NCX_BT_BITS value.
Definition: val.c:13690
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
ncxconst.h
Contains NCX constants.
xml_isspace
boolean xml_isspace(uint32 ch)
Check if an xmlChar is a space char.
Definition: xml_util.c:1901
XP_RT_STRING
@ XP_RT_STRING
string result
Definition: xpath.h:349
ncx_print_errormsg
void ncx_print_errormsg(tk_chain_t *tkc, ncx_module_t *mod, status_t res)
Print an parse error message to STDOUT.
Definition: ncx.c:7048
VAL_TYPDEF
#define VAL_TYPDEF(V)
Access the typedef (simple types only)
Definition: val.h:393
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
xpath1_res_new_origcxt_nodeset
xpath_result_t * xpath1_res_new_origcxt_nodeset(xpath_pcb_t *pcb, boolean dblslash)
Start a nodeset result with the original context node.
Definition: xpath1_res.c:670
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
xpath1.h
XPath 1.0 expression support.
obj_is_leafy
boolean obj_is_leafy(const obj_template_t *obj)
Check if object is a proper leaf or leaflist.
Definition: obj.c:13478
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.
xpath_aio_cb_t_::obj
obj_template_t * obj
object for this subtree
Definition: xpath.h:1035
NCX_BT_ENUM
@ NCX_BT_ENUM
enumeration
Definition: ncxtypes.h:204
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
xpath1_fn_get_functions_ptr
const xpath_fncb_t * xpath1_fn_get_functions_ptr(void)
Get the start of the function array for XPath 1.0 plus the current() function.
Definition: xpath1_fn.c:3474
xml_strndup
xmlChar * xml_strndup(const xmlChar *copyFrom, uint32 maxlen)
String duplicate for max N xmlChars.
Definition: xml_util.c:1663
xpath_get_cxt_obj
obj_template_t * xpath_get_cxt_obj(xpath_pcb_t *pcb)
Get the object pointer for the context node.
Definition: xpath.c:4096
xpath_cvt_number
void xpath_cvt_number(const xpath_result_t *result, ncx_num_t *num)
Convert an XPath result to a number answer.
Definition: xpath.c:3690
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
ncx_round_num
status_t ncx_round_num(const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
Get the rounded value of a number.
Definition: ncx_num.c:1963
NCX_BT_INT64
@ NCX_BT_INT64
int64
Definition: ncxtypes.h:210
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
ncx_set_num_zero
void ncx_set_num_zero(ncx_num_t *num, ncx_btype_t btyp)
Set a number to zero.
Definition: ncx_num.c:542
XPATH_ANY_CXT
#define XPATH_ANY_CXT(P)
test if context node is a value or get2 in xpath_pcb_t * (P)
Definition: xpath.h:313
XP_RT_NONE
@ XP_RT_NONE
not set
Definition: xpath.h:346
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
xml_strncmp
int xml_strncmp(const xmlChar *s1, const xmlChar *s2, uint32 maxlen)
String compare for xmlChar for at most 'maxlen' xmlChars.
Definition: xml_util.c:1824
val_child.h
Value Node Child Access Support.
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
typ.h
Parameter Type Handler.
xmlns_get_ns_prefix
const xmlChar * xmlns_get_ns_prefix(xmlns_id_t ns_id)
Get the prefix for the specified namespace.
Definition: xmlns.c:669
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
val_get_first_leaf
val_value_t * val_get_first_leaf(val_value_t *val)
Get the first leaf or leaflist node in the specified value tree.
Definition: val.c:12185
yangconst.h
Contains YANG constants separated to prevent H file include loops.
ncx_find_feature
ncx_feature_t * ncx_find_feature(ncx_module_t *mod, const xmlChar *name)
Find a ncx_feature_t struct in the module and perhaps any of its submodules.
Definition: ncx_feature.c:855
ncx_num_ceiling
status_t ncx_num_ceiling(const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
Get the ceiling value of a number.
Definition: ncx_num.c:1884
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
xpath1_res_get_position
int64 xpath1_res_get_position(xpath_result_t *result, val_value_t *valptr)
Find the position of the specified entry.
Definition: xpath1_res.c:851
xpath1_fn.h
XPath 1.0 expression support; Function library.
ncx_num_floor
status_t ncx_num_floor(const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
Get the floor value of a number.
Definition: ncx_num.c:1806
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
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
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
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_get_count
int64 xpath1_res_get_count(xpath_result_t *result)
Get the number of entries in the node-set result to support the count() function.
Definition: xpath1_res.c:814
val_idref_derived_from
boolean val_idref_derived_from(ncx_module_t *impmod, val_value_t *testval, const xmlChar *qname, boolean or_self)
Check the specified valnode is derived from the specified identity.
Definition: val.c:14201
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
ncx_feature_enabled
boolean ncx_feature_enabled(ncx_feature_t *feature)
Check if the specified feature and any referenced if-features are enabled.
Definition: ncx_feature.c:1181
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
xpath_clone_pcb
xpath_pcb_t * xpath_clone_pcb(const xpath_pcb_t *srcpcb)
Clone an XPath PCB.
Definition: xpath.c:2822
NCX_BT_BITS
@ NCX_BT_BITS
bits
Definition: ncxtypes.h:203
NCX_BT_FLOAT64
@ NCX_BT_FLOAT64
hidden: just for XPath
Definition: ncxtypes.h:216
NCX_BT_UINT32
@ NCX_BT_UINT32
uint32
Definition: ncxtypes.h:213
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
ncx_cast_num
status_t ncx_cast_num(const ncx_num_t *num1, ncx_btype_t btyp1, ncx_num_t *num2, ncx_btype_t btyp2)
Cast a number as another number type.
Definition: ncx_num.c:1516
xpath_resnode_count
uint32 xpath_resnode_count(xpath_result_t *result)
Get the number of resnodes in the node-set.
Definition: xpath.c:4594
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
obj_get_basetype
ncx_btype_t obj_get_basetype(const obj_template_t *obj)
Get the NCX base type enum for the object type.
Definition: obj.c:12077
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
xpath1_res_new_result
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.
Definition: xpath1_res.c:157
obj.h
Data Object Support.
grp.h
YANG Grouping Statement Handler.
xmlns_get_ns_name
const xmlChar * xmlns_get_ns_name(xmlns_id_t ns_id)
Get the name for the specified namespace.
Definition: xmlns.c:690
xpath1_eval_xmlexpr
xpath_result_t * xpath1_eval_xmlexpr(xmlTextReaderPtr reader, xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, status_t *res)
Evaluate an XML document expression.
Definition: xpath1.c:5643
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.
XP_RT_BOOLEAN
@ XP_RT_BOOLEAN
boolean result
Definition: xpath.h:350
typ_get_leafref_pcb
struct xpath_pcb_t_ * typ_get_leafref_pcb(typ_def_t *typdef)
Get the XPath parser control block for the leafref data type returns xpath_pcb_t but cannot import du...
Definition: typ.c:4795
xpath1_res_new_cxt_nodeset
xpath_result_t * xpath1_res_new_cxt_nodeset(xpath_pcb_t *pcb, boolean dblslash)
Start a nodeset result with the current context node.
Definition: xpath1_res.c:595
ncx_find_module
ncx_module_t * ncx_find_module(const xmlChar *modname, const xmlChar *revision)
Find a ncx_module_t in the ncx_sesmodQ.
Definition: ncx.c:3227
xpath1_res_get_resnode_name
const xmlChar * xpath1_res_get_resnode_name(const xpath_resnode_t *resnode)
Get the local-name of the resnode node.
Definition: xpath1_res.c:1305
ERR_NCX_EXTRA_PARM
@ ERR_NCX_EXTRA_PARM
234
Definition: status_enum.h:273
ncx_check_yang_identity
status_t ncx_check_yang_identity(ncx_module_t *impmod, const xmlChar *idstr)
Check if an identity string is available in the module.
Definition: ncx.c:13765
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
XP_RT_NODESET
@ XP_RT_NODESET
node-set result
Definition: xpath.h:347
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
dlq.h
dlq provides general double-linked list and queue support:
xpath1_res_get_cxt_name
const xmlChar * xpath1_res_get_cxt_name(const xpath_pcb_t *pcb)
Get the local-name of the context node.
Definition: xpath1_res.c:1286