yumapro  24.10-11
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 - 2025, 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
129extern status_t
130 val_child_add_force (val_value_t *child,
131 val_value_t *parent);
132
133
142extern status_t
144 val_value_t *parent);
145
146
155extern val_value_t *
156 val_child_find (const val_value_t *parent,
157 const xmlChar *child_modname,
158 const xmlChar *child_name);
159
160
173extern val_value_t *
174 val_child_find_next (const val_value_t *parent,
175 const xmlChar *child_modname,
176 const xmlChar *child_name,
177 const val_value_t *lastmatch);
178
179
188extern val_value_t *
189 val_child_find_nsid (const val_value_t *parent,
190 xmlns_id_t child_nsid,
191 const xmlChar *child_name);
192
193
204extern val_value_t *
206 xmlns_id_t child_nsid,
207 const xmlChar *child_name,
208 val_value_t *curchild,
209 val_child_op_t child_op);
210
211
219extern val_value_t *
220 val_child_find_obj (const val_value_t *parent,
221 const obj_template_t *child_obj);
222
223
233extern val_value_t *
234 val_child_find_same (const val_value_t *child,
235 const val_value_t *parent,
236 val_child_op_t child_op);
237
238
248extern val_value_t *
250 const val_value_t *parent,
251 val_value_t *lastmatch,
252 val_child_op_t child_op);
253
254
266extern val_value_t *
267 val_child_find_count (const val_value_t *parent,
268 const xmlChar *child_modname,
269 const xmlChar *child_name,
270 uint32 *matchcount);
271
272
280extern val_child_hdr_t *
282 val_value_t *parent);
283
284
297extern val_child_hdr_t *
299 val_value_t *parent,
300 val_value_t *lastmatch);
301
302
313extern status_t
315 val_value_t *current,
316 val_value_t *parent,
317 op_insertop_t insert_op);
318
319
325extern void
327
328
336extern void
338
339
347extern void
349
350
358extern status_t
359 val_child_swap (val_value_t *newchild,
360 val_value_t *curchild);
361
362
369extern val_value_t *
370 val_child_first (const val_value_t *parent);
371
372
380extern val_value_t *
381 val_child_next (const val_value_t *curchild);
382
383
390extern val_value_t *
392
393
400extern val_value_t *
402
403
410extern val_value_t *
412
413
421extern val_value_t *
422 val_child_next_terminal (const val_value_t *curchild);
423
424
431extern uint32
433
434
446extern uint32
448 xmlns_id_t nsid,
449 const xmlChar *name,
450 val_value_t **firstval);
451
452
458extern void
459 val_child_clean_hdrQ (dlq_hdr_t *child_hdrQ);
460
461
462
491extern boolean
493 void *cookie1,
494 void *cookie2,
495 val_value_t *startnode,
496 xmlns_id_t mod_nsid,
497 const xmlChar *name,
498 boolean configonly,
499 boolean textmode);
500
501
533extern boolean
535 void *cookie1,
536 void *cookie2,
537 val_value_t *startnode,
538 xmlns_id_t mod_nsid,
539 const xmlChar *name,
540 boolean configonly,
541 boolean textmode,
542 boolean orself);
543
544
580extern boolean
582 void *cookie1,
583 void *cookie2,
584 val_value_t *startnode,
585 xmlns_id_t mod_nsid,
586 const xmlChar *name,
587 boolean configonly,
588 boolean textmode,
589 boolean orself,
590 boolean forceall);
591
592
593
629extern boolean
631 void *cookie1,
632 void *cookie2,
633 val_value_t *startnode,
634 xmlns_id_t mod_nsid,
635 const xmlChar *name,
636 boolean configonly,
637 boolean textmode,
638 boolean orself,
639 boolean forceall);
640
641
681extern boolean
683 void *cookie1,
684 void *cookie2,
685 val_value_t *startnode,
686 xmlns_id_t mod_nsid,
687 const xmlChar *name,
688 boolean configonly,
689 boolean dblslash,
690 boolean textmode,
691 ncx_xpath_axis_t axis);
692
693
733extern boolean
735 void *cookie1,
736 void *cookie2,
737 val_value_t *startnode,
738 xmlns_id_t mod_nsid,
739 const xmlChar *name,
740 boolean configonly,
741 boolean dblslash,
742 boolean textmode,
743 ncx_xpath_axis_t axis);
744
745
753extern void
755 val_value_t *destval);
756
757
784extern status_t
786 val_value_t *child,
787 val_value_t *parent,
788 dlq_hdr_t *cleanQ);
789
790
819extern status_t
821 val_value_t *child,
822 val_value_t *parent,
823 dlq_hdr_t *cleanQ,
824 boolean check_exists);
825
826
845extern status_t
847 val_value_t *parent,
848 dlq_hdr_t *cleanQ);
849
850
851
878extern status_t
880 val_value_t *child,
881 val_value_t *parent,
882 boolean check_exists);
883
884
885
891extern void
893
894
900extern void
902
903
909extern void
911
912
927extern val_value_t *
929 val_hdr_test_fn_t hdr_test_fn,
930 val_test2_fn_t test_fn,
931 void *cookie);
932
933
948extern val_value_t *
950 val_hdr_test_fn_t hdr_test_fn,
951 val_test2_fn_t test_fn,
952 void *cookie);
953
954
961extern val_value_t *
963
964
971extern val_value_t *
973
974
982extern val_value_t *
984 const val_value_t *curval);
985
986
994extern val_value_t *
996 const val_value_t *curval);
997
998
1006extern val_value_t *
1008 const val_value_t *findval);
1009
1010
1011
1022extern boolean
1023 val_child_find_deleted (const val_value_t *startnode,
1024 const val_value_t *delnode);
1025
1026
1030#ifdef __cplusplus
1031} /* end extern 'C' */
1032#endif
1033
1034#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:3270
val_value_t * val_child_prev_same(val_value_t *curnode)
Get the previous node of the same type.
Definition: val_child.c:2573
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:2546
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:4181
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:2390
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:3717
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:4242
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:2795
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:3489
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:2990
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:2713
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:2601
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:3767
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:3950
void val_child_clean_hdrQ(dlq_hdr_t *child_hdrQ)
Empty and clean a Q of child headers.
Definition: val_child.c:2747
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:3869
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:2638
void val_child_finish_default_deleted(val_value_t *val)
Delete all the marked default leaf-list nodes.
Definition: val_child.c:3908
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:3843
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:4222
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:3130
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:4262
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:3403
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:4080
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:2507
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:3807
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:4287
uint32 val_child_count(val_value_t *parent)
Get the number of non-deleted children in this parent.
Definition: val_child.c:2679
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:2432
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:2907
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:2473
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:3996
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:4203
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:1187
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:1157
boolean(* val_walker_fn_t)(val_value_t *val, void *cookie1, void *cookie2)
child or descendant node search walker function
Definition: val.h:1141
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:1173
status_t
global error return code
Definition: status_enum.h:219
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:1232
this struct is inserted in the val->v.child_hdrQ for container and list value nodes
Definition: val.h:1074
one set of edit-in-progress variables for one value node
Definition: val.h:823
one value to match one type
Definition: val.h:912
Value Node Basic Support.