yumapro  23.10T-8
YumaPro SDK
Loading...
Searching...
No Matches
val_child.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_val_child
13#define _H_val_child
14
15/* FILE: val_child.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
29/*********************************************************************
30* *
31* C H A N G E H I S T O R Y *
32* *
33*********************************************************************
34
35date init comment
36----------------------------------------------------------------------
3719-mar-16 abb Begun; split from val.c
38
39*/
40
41
42#ifndef _H_val
43#include "val.h"
44#endif
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/********************************************************************
51* *
52* C O N S T A N T S *
53* *
54*********************************************************************/
55
56
69/********************************************************************
70* *
71* T Y P E S *
72* *
73*********************************************************************/
75typedef enum val_child_op_t_ {
81
82
83/********************************************************************
84* *
85* F U N C T I O N S *
86* *
87*********************************************************************/
88
98extern status_t
100 val_value_t *parent);
101
102
113extern status_t
115 val_value_t *parent);
116
117
126extern status_t
128 val_value_t *parent);
129
130
139extern status_t
141 val_value_t *parent);
142
143
152extern val_value_t *
153 val_child_find (const val_value_t *parent,
154 const xmlChar *child_modname,
155 const xmlChar *child_name);
156
157
170extern val_value_t *
171 val_child_find_next (const val_value_t *parent,
172 const xmlChar *child_modname,
173 const xmlChar *child_name,
174 const val_value_t *lastmatch);
175
176
185extern val_value_t *
186 val_child_find_nsid (const val_value_t *parent,
187 xmlns_id_t child_nsid,
188 const xmlChar *child_name);
189
190
201extern val_value_t *
203 xmlns_id_t child_nsid,
204 const xmlChar *child_name,
205 val_value_t *curchild,
206 val_child_op_t child_op);
207
208
216extern val_value_t *
217 val_child_find_obj (const val_value_t *parent,
218 const obj_template_t *child_obj);
219
220
230extern val_value_t *
231 val_child_find_same (const val_value_t *child,
232 const val_value_t *parent,
233 val_child_op_t child_op);
234
235
245extern val_value_t *
247 const val_value_t *parent,
248 val_value_t *lastmatch,
249 val_child_op_t child_op);
250
251
263extern val_value_t *
264 val_child_find_count (const val_value_t *parent,
265 const xmlChar *child_modname,
266 const xmlChar *child_name,
267 uint32 *matchcount);
268
269
277extern val_child_hdr_t *
279 val_value_t *parent);
280
281
294extern val_child_hdr_t *
296 val_value_t *parent,
297 val_value_t *lastmatch);
298
299
310extern status_t
312 val_value_t *current,
313 val_value_t *parent,
314 op_insertop_t insert_op);
315
316
322extern void
324
325
333extern void
335
336
344extern void
346
347
355extern status_t
356 val_child_swap (val_value_t *newchild,
357 val_value_t *curchild);
358
359
366extern val_value_t *
367 val_child_first (const val_value_t *parent);
368
369
377extern val_value_t *
378 val_child_next (const val_value_t *curchild);
379
380
387extern val_value_t *
389
390
397extern val_value_t *
399
400
407extern val_value_t *
409
410
418extern val_value_t *
419 val_child_next_terminal (const val_value_t *curchild);
420
421
428extern uint32
430
431
443extern uint32
445 xmlns_id_t nsid,
446 const xmlChar *name,
447 val_value_t **firstval);
448
449
455extern void
456 val_child_clean_hdrQ (dlq_hdr_t *child_hdrQ);
457
458
459
488extern boolean
490 void *cookie1,
491 void *cookie2,
492 val_value_t *startnode,
493 xmlns_id_t mod_nsid,
494 const xmlChar *name,
495 boolean configonly,
496 boolean textmode);
497
498
530extern boolean
532 void *cookie1,
533 void *cookie2,
534 val_value_t *startnode,
535 xmlns_id_t mod_nsid,
536 const xmlChar *name,
537 boolean configonly,
538 boolean textmode,
539 boolean orself);
540
541
577extern boolean
579 void *cookie1,
580 void *cookie2,
581 val_value_t *startnode,
582 xmlns_id_t mod_nsid,
583 const xmlChar *name,
584 boolean configonly,
585 boolean textmode,
586 boolean orself,
587 boolean forceall);
588
589
590
626extern boolean
628 void *cookie1,
629 void *cookie2,
630 val_value_t *startnode,
631 xmlns_id_t mod_nsid,
632 const xmlChar *name,
633 boolean configonly,
634 boolean textmode,
635 boolean orself,
636 boolean forceall);
637
638
678extern boolean
680 void *cookie1,
681 void *cookie2,
682 val_value_t *startnode,
683 xmlns_id_t mod_nsid,
684 const xmlChar *name,
685 boolean configonly,
686 boolean dblslash,
687 boolean textmode,
688 ncx_xpath_axis_t axis);
689
690
730extern boolean
732 void *cookie1,
733 void *cookie2,
734 val_value_t *startnode,
735 xmlns_id_t mod_nsid,
736 const xmlChar *name,
737 boolean configonly,
738 boolean dblslash,
739 boolean textmode,
740 ncx_xpath_axis_t axis);
741
742
750extern void
752 val_value_t *destval);
753
754
781extern status_t
783 val_value_t *child,
784 val_value_t *parent,
785 dlq_hdr_t *cleanQ);
786
787
816extern status_t
818 val_value_t *child,
819 val_value_t *parent,
820 dlq_hdr_t *cleanQ,
821 boolean check_exists);
822
823
842extern status_t
844 val_value_t *parent,
845 dlq_hdr_t *cleanQ);
846
847
848
875extern status_t
877 val_value_t *child,
878 val_value_t *parent,
879 boolean check_exists);
880
881
882
888extern void
890
891
897extern void
899
900
906extern void
908
909
924extern val_value_t *
926 val_hdr_test_fn_t hdr_test_fn,
927 val_test2_fn_t test_fn,
928 void *cookie);
929
930
945extern val_value_t *
947 val_hdr_test_fn_t hdr_test_fn,
948 val_test2_fn_t test_fn,
949 void *cookie);
950
951
958extern val_value_t *
960
961
968extern val_value_t *
970
971
979extern val_value_t *
981 const val_value_t *curval);
982
983
991extern val_value_t *
993 const val_value_t *curval);
994
995
1003extern val_value_t *
1005 const val_value_t *findval);
1006
1007
1008
1019extern boolean
1020 val_child_find_deleted (const val_value_t *startnode,
1021 const val_value_t *delnode);
1022
1023
1027#ifdef __cplusplus
1028} /* end extern 'C' */
1029#endif
1030
1031#endif /* _H_val_child */
op_insertop_t
YANG insert operation types.
Definition: op.h:137
boolean val_child_find_all_pfaxis(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean dblslash, boolean textmode, ncx_xpath_axis_t axis)
Find all occurances of the specified node for the specified preceding or following axis.
Definition: val_child.c:3258
val_value_t * val_child_prev_same(val_value_t *curnode)
Get the previous node of the same type.
Definition: val_child.c:2561
status_t val_child_insert(val_value_t *child, val_value_t *current, val_value_t *parent, op_insertop_t insert_op)
Insert a child value node into a parent value node before or after the specified node.
Definition: val_child.c:2232
val_value_t * val_child_next_same(val_value_t *curnode)
Get the next node of the same type.
Definition: val_child.c:2534
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:4169
val_value_t * val_child_find_same_nsid(const val_value_t *parent, xmlns_id_t child_nsid, const xmlChar *child_name, val_value_t *curchild, val_child_op_t child_op)
Find the child node for the specified child name and modname.
Definition: val_child.c:1979
void val_child_mark_undeleted(val_value_t *child)
Re-Add a previously deleted child value node (unmark deleted)
Definition: val_child.c:2384
status_t val_child_add_clean(val_editvars_t *editvars, val_value_t *child, val_value_t *parent, dlq_hdr_t *cleanQ)
Add a child value node to a parent value node This is only called by the agent when adding nodes to a...
Definition: val_child.c:3705
val_value_t * val_child_hdr_previous(const val_child_hdr_t *hdr, const val_value_t *curval)
Get the previous entry in the child header.
Definition: val_child.c:4230
boolean val_child_find_all_children(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean textmode)
Find all children instances of the specified node(s) The walker fn will be called for each match.
Definition: val_child.c:2783
void val_child_move_children(val_value_t *srcval, val_value_t *destval)
Move all the child nodes from src to dest Source and dest must both be containers!
Definition: val_child.c:3477
boolean val_child_find_all_descendants(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean textmode, boolean orself, boolean forceall)
Find all occurances of the specified node within the current subtree.
Definition: val_child.c:2978
uint32 val_child_count_nsid(val_value_t *parent, xmlns_id_t nsid, const xmlChar *name, val_value_t **firstval)
Get the number of non-deleted children matching the NSID and namestring in this parent.
Definition: val_child.c:2701
val_value_t * val_child_first_terminal(const val_value_t *parent)
Get the first terminal node child present for this parent.
Definition: val_child.c:2589
status_t val_child_add_clean2(val_editvars_t *editvars, val_value_t *child, val_value_t *parent, dlq_hdr_t *cleanQ, boolean check_exists)
Add a child value node to a parent value node.
Definition: val_child.c:3755
val_child_hdr_t * val_child_find_hdr_lastmatch(val_value_t *child, val_value_t *parent, val_value_t *lastmatch)
Find the child header for the specified child based on the last match.
Definition: val_child.c:2199
void val_child_mark_default_undeleted(val_value_t *val)
Mark all the leaf-list nodes that are defaults as deleted.
Definition: val_child.c:3938
void val_child_clean_hdrQ(dlq_hdr_t *child_hdrQ)
Empty and clean a Q of child headers.
Definition: val_child.c:2735
void val_child_mark_default_deleted(val_value_t *val)
Mark all the leaf-list nodes that are defaults as deleted.
Definition: val_child.c:3857
val_value_t * val_child_next_terminal(const val_value_t *curchild)
Get the next terminal node child present for the current node Parent must be set.
Definition: val_child.c:2626
void val_child_finish_default_deleted(val_value_t *val)
Delete all the marked default leaf-list nodes.
Definition: val_child.c:3896
status_t val_child_add_clean3(val_editvars_t *editvars, val_value_t *child, val_value_t *parent, boolean check_exists)
Add a child value node to a parent value node.
Definition: val_child.c:3831
val_value_t * val_child_find_obj(const val_value_t *parent, const obj_template_t *child_obj)
Find the child node for the specified child object header.
Definition: val_child.c:2028
val_child_hdr_t * val_child_find_hdr(val_value_t *child, val_value_t *parent)
Find the child header for the specified child.
Definition: val_child.c:2173
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:4210
val_value_t * val_child_find_same_lastmatch(const val_value_t *child, const val_value_t *parent, val_value_t *lastmatch, val_child_op_t child_op)
Find the child header for the specified child.
Definition: val_child.c:2092
status_t val_child_add_last(val_value_t *child, val_value_t *parent)
Add a child value node as last node to a parent value node.
Definition: val_child.c:1746
boolean val_child_find_all_descendants_old(val_walker_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean textmode, boolean orself, boolean forceall)
Find all occurances of the specified node within the current subtree.
Definition: val_child.c:3118
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:4250
status_t val_child_add_force(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node Force add even if Tree Insersion fails.
Definition: val_child.c:1789
boolean val_child_find_all_pfsibling_axis(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean dblslash, boolean textmode, ncx_xpath_axis_t axis)
Find all occurances of the specified node for the specified axis.
Definition: val_child.c:3391
val_value_t * val_child_find(const val_value_t *parent, const xmlChar *child_modname, const xmlChar *child_name)
Find the child node for the specified child name and modname.
Definition: val_child.c:1876
val_value_t * val_child_next_test(val_value_t *curchild, val_hdr_test_fn_t hdr_test_fn, val_test2_fn_t test_fn, void *cookie)
Get the next child present for this parent that passes the callback tests.
Definition: val_child.c:4068
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:1703
val_value_t * val_child_next(const val_value_t *curchild)
Get the next child present for the current node Parent must be set.
Definition: val_child.c:2495
status_t val_child_add_clean_test(val_value_t *child, val_value_t *parent, dlq_hdr_t *cleanQ)
Test the add_child_clean.
Definition: val_child.c:3795
val_child_op_t
modify the procedure call to get the previous, same or next entry
Definition: val_child.h:75
status_t val_child_add_force_last(val_value_t *child, val_value_t *parent)
Add a child value node as last node to a parent value node Force if tree insertion fails.
Definition: val_child.c:1832
void val_child_remove(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val_child.c:2299
boolean val_child_find_deleted(const val_value_t *startnode, const val_value_t *delnode)
Find the deleted node within the startnode.
Definition: val_child.c:4275
uint32 val_child_count(val_value_t *parent)
Get the number of non-deleted children in this parent.
Definition: val_child.c:2667
status_t val_child_swap(val_value_t *newchild, val_value_t *curchild)
Swap a child value node with a current value node.
Definition: val_child.c:2420
boolean val_child_find_all_ancestors(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean textmode, boolean orself)
Find all the ancestor instances of the specified node within the path to root from the current node; ...
Definition: val_child.c:2895
val_value_t * val_child_find_next(const val_value_t *parent, const xmlChar *child_modname, const xmlChar *child_name, const val_value_t *lastmatch)
Find the next child header for the specified child.
Definition: val_child.c:1909
void val_child_mark_deleted(val_value_t *child)
Remove a deleted child value node (mark deleted only)
Definition: val_child.c:2349
val_value_t * val_child_find_count(const val_value_t *parent, const xmlChar *child_modname, const xmlChar *child_name, uint32 *matchcount)
Find the child node for the specified child name and modname Get the first instance and also return t...
Definition: val_child.c:2134
val_value_t * val_child_find_nsid(const val_value_t *parent, xmlns_id_t child_nsid, const xmlChar *child_name)
Find the child node for the specified child name and namespace ID.
Definition: val_child.c:1946
val_value_t * val_child_first(const val_value_t *parent)
Get the first child present for this parent.
Definition: val_child.c:2461
val_value_t * val_child_first_test(val_value_t *parent, val_hdr_test_fn_t hdr_test_fn, val_test2_fn_t test_fn, void *cookie)
Get the first child present for this parent that passes the callback tests.
Definition: val_child.c:3984
val_value_t * val_child_hdr_last(const val_child_hdr_t *hdr)
Get the last entry in the child header.
Definition: val_child.c:4191
val_value_t * val_child_find_same(const val_value_t *child, const val_value_t *parent, val_child_op_t child_op)
Find the child header for the specified child, which is a different root; e.g., trying to match candi...
Definition: val_child.c:2058
@ VAL_CHILD_OP_SAME
get-exact
Definition: val_child.h:78
@ VAL_CHILD_OP_NONE
not set
Definition: val_child.h:76
@ VAL_CHILD_OP_PREV
get-previous
Definition: val_child.h:77
@ VAL_CHILD_OP_NEXT
get-next
Definition: val_child.h:79
boolean(* val_test2_fn_t)(val_value_t *val, void *cookie)
get first or next child test function value test function
Definition: val.h:1193
boolean(* val_walker2_fn_t)(val_child_hdr_t *valhdr, void *cookie1, void *cookie2)
child or descendant node search walker function - GEN2
Definition: val.h:1163
boolean(* val_walker_fn_t)(val_value_t *val, void *cookie1, void *cookie2)
child or descendant node search walker function
Definition: val.h:1147
boolean(* val_hdr_test_fn_t)(val_child_hdr_t *hdr, void *cookie)
get first or next child test function header test function
Definition: val.h:1179
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_xpath_axis_t
XPath expression axis types.
Definition: ncxtypes.h:662
One YANG data-def-stmt.
Definition: obj.h:1220
this struct is inserted in the val->v.child_hdrQ for container and list value nodes
Definition: val.h:1073
one set of edit-in-progress variables for one value node
Definition: val.h:823
one value to match one type
Definition: val.h:911
Value Node Basic Support.