yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
xpath1.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
13#define _H_xpath1
14
15/* FILE: xpath1.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
33date init comment
34----------------------------------------------------------------------
3513-nov-08 abb Begun
36
37*/
38
39#ifndef _H_dlq
40#include "dlq.h"
41#endif
42
43#ifndef _H_getcb
44#include "getcb.h"
45#endif
46
47#ifndef _H_ncxtypes
48#include "ncxtypes.h"
49#endif
50
51#ifndef _H_obj
52#include "obj.h"
53#endif
54
55#ifndef _H_status_enum
56#include "status_enum.h"
57#endif
58
59#ifndef _H_tk
60#include "tk.h"
61#endif
62
63#ifndef _H_val
64#include "val.h"
65#endif
66
67#ifndef _H_xpath
68#include "xpath.h"
69#endif
70
71#ifdef __cplusplus
72extern "C" {
73#endif
74
75/********************************************************************
76* *
77* C O N S T A N T S *
78* *
79*********************************************************************/
80
81
96#define SET_SKIP_MODE(pcb) (pcb)->flags |= XP_FL_SKIP_MODE
97
99#define CLEAR_SKIP_MODE(pcb) (pcb)->flags &= ~XP_FL_SKIP_MODE
100
102#define IS_SKIP_MODE(pcb) ((pcb)->flags & XP_FL_SKIP_MODE)
103
104
105/********************************************************************
106* *
107* T Y P E S *
108* *
109*********************************************************************/
110
111/********************************************************************
112* *
113* F U N C T I O N S *
114* *
115*********************************************************************/
116
117
154extern status_t
156 ncx_module_t *mod,
157 xpath_pcb_t *pcb,
158 xpath_source_t source);
159
160
186extern status_t
188 obj_template_t *obj,
189 xpath_pcb_t *pcb);
190
191
225extern status_t
227 obj_template_t *obj,
228 xpath_pcb_t *pcb,
229 boolean missing_is_error,
230 boolean set_backptrs,
231 ncx_xpath_type_t backptr_type);
232
233
234
246extern status_t
248
249
278extern xpath_result_t *
280 val_value_t *val,
281 val_value_t *docroot,
282 boolean logerrors,
283 boolean configonly,
284 status_t *res);
285
286
316extern xpath_result_t *
318 val_value_t *val,
319 val_value_t *docroot,
320 boolean logerrors,
321 boolean configonly,
322 boolean force_only,
323 status_t *res);
324
325
359extern xpath_result_t *
361 val_value_t *val,
362 val_value_t *docroot,
363 boolean logerrors,
364 boolean configonly,
365 boolean force_only,
366 xml_msg_hdr_t *get2_mhdr,
367 boolean get_when,
368 xpath_get2_node_t *val_get2,
369 status_t *res);
370
371
385extern status_t
387 getcb_get2_t *get2cb,
388 boolean *testres);
389
390
422extern xpath_result_t *
423 xpath1_eval_xmlexpr (xmlTextReaderPtr reader,
424 xpath_pcb_t *pcb,
425 val_value_t *val,
426 val_value_t *docroot,
427 boolean logerrors,
428 boolean configonly,
429 status_t *res);
430
431
443extern void
445 xpath_result_t *result);
446
447
464extern boolean
466 dlq_hdr_t *resultQ,
467 const val_value_t *val);
468
469
487extern boolean
489 dlq_hdr_t *resultQ,
490 const val_value_t *val);
491
492
509extern boolean
511 dlq_hdr_t *resultQ,
512 xpath_resnode_t *resnode);
513
514
528extern status_t
530 const xpath_result_t *result,
531 xmlChar **str);
532
533
545extern status_t
547 val_value_t *val,
548 xmlChar **str);
549
550
563extern boolean
565 xpath_result_t *result,
566 xmlChar *strval,
567 status_t *res);
568
569
583extern boolean
585 xpath_result_t *result,
586 ncx_num_t *numval,
587 status_t *res);
588
589
603extern boolean
605 xpath_result_t *result1,
606 xpath_result_t *result2,
607 status_t *res);
608
609
617extern boolean
619 const xmlChar *valstr);
620
621
632extern boolean
634 val_value_t *testval);
635
636
652extern xpath_result_t *
654 status_t *res);
655
656
667extern xpath_result_t *
669 status_t *res);
670
684extern boolean
686 boolean textmode,
687 xmlns_id_t nsid,
688 const xmlChar *name);
689
690
701extern void
703 xpath_pcb_t *pcb,
704 xpath_result_t *result,
705 const char *banner);
706
707
708
718extern void
720 xpath_resnode_t *resnode,
721 const char *banner);
722
726#ifdef __cplusplus
727} /* end extern 'C' */
728#endif
729
730
731#endif /* _H_xpath1 */
dlq provides general double-linked list and queue support:
GET1 and GET2 Callback Support.
log_debug_t
The debug level enumerations used in util/log.c.
Definition: log.h:343
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
xpath_source_t
XPath expression source type.
Definition: xpath.h:410
boolean xpath1_compare_result_to_number(xpath_pcb_t *pcb, xpath_result_t *result, ncx_num_t *numval, status_t *res)
Compare an XPath result to the specified number.
Definition: xpath1.c:6692
status_t xpath1_validate_expr(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb)
Validate the previously parsed expression string.
Definition: xpath1.c:5413
xpath_result_t * xpath1_eval_expr(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, status_t *res)
Evaluate an XPath expression use if the prefixes are YANG: must/when.
Definition: xpath1.c:5538
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:6962
boolean xpath1_find_val_in_nodeset(xpath_result_t *result, const xmlChar *valstr)
Check a nodeset result and find the same value in one of the nodes.
Definition: xpath1.c:6777
boolean xpath1_check_node_exists_slow(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, const val_value_t *val)
Check if any ancestor-ot-self node is already in the specified Q Slow version.
Definition: xpath1.c:6233
xpath_result_t * xpath1_eval_expr2(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, boolean force_only, status_t *res)
Evaluate an XPath expression (alt)
Definition: xpath1.c:5592
status_t xpath1_eval_obj_expr(xpath_pcb_t *pcb)
Evaluate an OBJECT expression.
Definition: xpath1.c:5442
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:5937
status_t xpath1_stringify_node(xpath_pcb_t *pcb, val_value_t *val, xmlChar **str)
Convert a value node to a string node.
Definition: xpath1.c:6511
status_t xpath1_stringify_nodeset(xpath_pcb_t *pcb, const xpath_result_t *result, xmlChar **str)
Convert a value node pointer to a string node.
Definition: xpath1.c:6394
boolean xpath1_check_resnode_exists(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, xpath_resnode_t *resnode)
Check if any ancestor-ot-self node is already in the specified Q.
Definition: xpath1.c:6296
boolean xpath1_check_node_exists(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, const val_value_t *val)
Check if any ancestor-ot-self node is already in the specified Q.
Definition: xpath1.c:6172
status_t xpath1_validate_expr_ex(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean missing_is_error, boolean set_backptrs, ncx_xpath_type_t backptr_type)
Validate the previously parsed expression string.
Definition: xpath1.c:5124
void xpath1_prune_nodeset(xpath_pcb_t *pcb, xpath_result_t *result)
Check the current result nodeset and remove any redundant nodes from a NETCONF POV.
Definition: xpath1.c:6070
boolean xpath1_find_val_in_nodeset_ex(xpath_result_t *result, val_value_t *testval)
Check a nodeset result and find the same value in one of the nodes.
Definition: xpath1.c:6832
boolean xpath1_compare_result_to_string(xpath_pcb_t *pcb, xpath_result_t *result, xmlChar *strval, status_t *res)
Compare an XPath result to the specified string.
Definition: xpath1.c:6640
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:7055
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:6989
void xpath1_dump_resnode(log_debug_t lvl, xpath_resnode_t *resnode, const char *banner)
Generate log output displaying the contents of an XPath resnode.
Definition: xpath1.c:7153
xpath_result_t * xpath1_eval_expr3(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, boolean force_only, xml_msg_hdr_t *get2_mhdr, boolean get_when, xpath_get2_node_t *val_get2, status_t *res)
Evaluate an XPath expression (alt3)
Definition: xpath1.c:5651
boolean xpath1_compare_nodeset_results(xpath_pcb_t *pcb, xpath_result_t *result1, xpath_result_t *result2, status_t *res)
Compare an XPath result to another result.
Definition: xpath1.c:6743
status_t xpath1_test_data_rule(xpath_pcb_t *pcb, getcb_get2_t *get2cb, boolean *testres)
Test a NACM data rule expression against a GET2 control block.
Definition: xpath1.c:5836
boolean xpath1_keep_object(obj_template_t *testobj, boolean textmode, xmlns_id_t nsid, const xmlChar *name)
Test if an object should be kept in a resnode node-test.
Definition: xpath1.c:7012
status_t xpath1_parse_expr(tk_chain_t *tkc, ncx_module_t *mod, xpath_pcb_t *pcb, xpath_source_t source)
Parse the XPATH 1.0 expression string.
Definition: xpath1.c:4956
ncx_xpath_type_t
enumeration for different XPath back pointer types
Definition: ncxtypes.h:1283
YANG module data structures Many internal representations of YANG module constructs.
Data Object Support.
global error status code enumerations
GET2 control block.
Definition: getcb.h:355
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1134
One YANG data-def-stmt.
Definition: obj.h:1209
token parsing chain (main parser control block)
Definition: tk.h:415
one value to match one type
Definition: val.h:911
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:397
Special XPath GET2 resnode.
Definition: xpath.h:608
XPath parser control block.
Definition: xpath.h:752
XPath result node struct.
Definition: xpath.h:664
XPath expression result.
Definition: xpath.h:703
NCX Syntax Token Handler.
union of all the basic number types if float not supported, then it is stored as an int64
Definition: ncxtypes.h:780
Value Node Basic Support.
Schema and data model Xpath search support.