yumapro  20.10-12
YumaPro SDK
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 
35 date init comment
36 ----------------------------------------------------------------------
37 19-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
47 extern "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 *********************************************************************/
75 typedef enum val_child_op_t_ {
80 } val_child_op_t;
81 
82 
83 /********************************************************************
84 * *
85 * F U N C T I O N S *
86 * *
87 *********************************************************************/
88 
98 extern status_t
99  val_child_add (val_value_t *child,
100  val_value_t *parent);
101 
102 
113 extern status_t
114  val_child_add_last (val_value_t *child,
115  val_value_t *parent);
116 
117 
126 extern status_t
127  val_child_add_force (val_value_t *child,
128  val_value_t *parent);
129 
130 
139 extern status_t
140  val_child_add_force_last (val_value_t *child,
141  val_value_t *parent);
142 
143 
152 extern val_value_t *
153  val_child_find (const val_value_t *parent,
154  const xmlChar *child_modname,
155  const xmlChar *child_name);
156 
157 
170 extern 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 
185 extern 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 
201 extern val_value_t *
202  val_child_find_same_nsid (const val_value_t *parent,
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 
216 extern val_value_t *
217  val_child_find_obj (const val_value_t *parent,
218  const obj_template_t *child_obj);
219 
220 
230 extern 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 
245 extern val_value_t *
246  val_child_find_same_lastmatch (const val_value_t *child,
247  const val_value_t *parent,
248  val_value_t *lastmatch,
249  val_child_op_t child_op);
250 
251 
263 extern 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 
277 extern val_child_hdr_t *
278  val_child_find_hdr (val_value_t *child,
279  val_value_t *parent);
280 
281 
294 extern val_child_hdr_t *
295  val_child_find_hdr_lastmatch (val_value_t *child,
296  val_value_t *parent,
297  val_value_t *lastmatch);
298 
299 
310 extern status_t
311  val_child_insert (val_value_t *child,
312  val_value_t *current,
313  val_value_t *parent,
314  op_insertop_t insert_op);
315 
316 
322 extern void
323  val_child_remove (val_value_t *child);
324 
325 
333 extern void
334  val_child_mark_deleted (val_value_t *child);
335 
336 
344 extern void
345  val_child_mark_undeleted (val_value_t *child);
346 
347 
355 extern status_t
356  val_child_swap (val_value_t *newchild,
357  val_value_t *curchild);
358 
359 
366 extern val_value_t *
367  val_child_first (const val_value_t *parent);
368 
369 
377 extern val_value_t *
378  val_child_next (const val_value_t *curchild);
379 
380 
387 extern val_value_t *
388  val_child_next_same (val_value_t *curnode);
389 
390 
397 extern val_value_t *
398  val_child_prev_same (val_value_t *curnode);
399 
400 
407 extern val_value_t *
408  val_child_first_terminal (const val_value_t *parent);
409 
410 
418 extern val_value_t *
419  val_child_next_terminal (const val_value_t *curchild);
420 
421 
428 extern uint32
429  val_child_count (val_value_t *parent);
430 
431 
443 extern uint32
444  val_child_count_nsid (val_value_t *parent,
445  xmlns_id_t nsid,
446  const xmlChar *name,
447  val_value_t **firstval);
448 
449 
455 extern void
456  val_child_clean_hdrQ (dlq_hdr_t *child_hdrQ);
457 
458 
459 
488 extern 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 
530 extern 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 
577 extern 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 
626 extern 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 
678 extern 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 
730 extern 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 
750 extern void
751  val_child_move_children (val_value_t *srcval,
752  val_value_t *destval);
753 
754 
781 extern status_t
782  val_child_add_clean (val_editvars_t *editvars,
783  val_value_t *child,
784  val_value_t *parent,
785  dlq_hdr_t *cleanQ);
786 
787 
816 extern status_t
817  val_child_add_clean2 (val_editvars_t *editvars,
818  val_value_t *child,
819  val_value_t *parent,
820  dlq_hdr_t *cleanQ,
821  boolean check_exists);
822 
823 
829 extern void
830  val_child_mark_default_deleted (val_value_t *val);
831 
832 
838 extern void
839  val_child_finish_default_deleted (val_value_t *val);
840 
841 
847 extern void
848  val_child_mark_default_undeleted (val_value_t *val);
849 
850 
865 extern val_value_t *
866  val_child_first_test (val_value_t *parent,
867  val_hdr_test_fn_t hdr_test_fn,
868  val_test2_fn_t test_fn,
869  void *cookie);
870 
871 
886 extern val_value_t *
887  val_child_next_test (val_value_t *curchild,
888  val_hdr_test_fn_t hdr_test_fn,
889  val_test2_fn_t test_fn,
890  void *cookie);
891 
892 
899 extern val_value_t *
900  val_child_hdr_first (const val_child_hdr_t *hdr);
901 
902 
909 extern val_value_t *
910  val_child_hdr_last (const val_child_hdr_t *hdr);
911 
912 
920 extern val_value_t *
921  val_child_hdr_next (const val_child_hdr_t *hdr,
922  const val_value_t *curval);
923 
924 
932 extern val_value_t *
933  val_child_hdr_previous (const val_child_hdr_t *hdr,
934  const val_value_t *curval);
935 
936 
944 extern val_value_t *
945  val_child_hdr_find_match (val_child_hdr_t *hdr,
946  const val_value_t *findval);
947 
948 
952 #ifdef __cplusplus
953 } /* end extern 'C' */
954 #endif
955 
956 #endif /* _H_val_child */
VAL_FL_USE_QUE
#define VAL_FL_USE_QUE
the child_hdr->que is being used for multi-nodes
Definition: val.h:353
ncx_str.h
NCX Module Library String Utility Functions.
val_tree.h
AVL Tree storage of YANG List Data.
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
val_child_next_test
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:3695
val_child_find_same_nsid
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:1808
val_child_add_last
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:1583
val_child_find_all_pfaxis
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:3055
dlq_block_enque
void dlq_block_enque(dlq_hdrT *srcP, dlq_hdrT *dstP)
add all the queue entries in the srcP queue list to the end of the dstP queue list
Definition: dlq.c:731
VAL_FL_USE_TREE
#define VAL_FL_USE_TREE
the child_hdr->tree is being used
Definition: val.h:356
dlq_insertAfter
void dlq_insertAfter(void *newP, void *nodeP)
insert the new queue entry after the current entry
Definition: dlq.c:482
val_child_first_test
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:3613
val_child_mark_default_undeleted
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:3570
val_simple_anyxml
boolean val_simple_anyxml(const val_value_t *val)
Check if val_value node is a proper simple type ANYXML.
Definition: val_util.c:7480
val_child_remove
void val_child_remove(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val_child.c:2133
XP_AX_PRECEDING_SIBLING
@ XP_AX_PRECEDING_SIBLING
preceding-sibling axis (not allowed in YANG)
Definition: ncxtypes.h:513
OP_INSOP_AFTER
@ OP_INSOP_AFTER
insert after foo
Definition: op.h:142
obj_is_terminal
boolean obj_is_terminal(const obj_template_t *obj)
Check if object is a proper leaf or leaflist or anyxml.
Definition: obj.c:13493
VAL_NSID
#define VAL_NSID(V)
Access the namespace ID.
Definition: val.h:396
val_child_hdr_previous
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:3847
OP_INSOP_BEFORE
@ OP_INSOP_BEFORE
insert before foo
Definition: op.h:141
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
obj_is_leaf_list
boolean obj_is_leaf_list(const obj_template_t *obj)
Check if object is a proper leaf-list.
Definition: obj.c:13336
val.h
Value Node Basic Support.
val_child_find_all_children
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:2596
xml_util.h
XML Utilities.
val_child_find_all_descendants
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:2785
val_child_add_clean2
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:3379
XP_AX_FOLLOWING
@ XP_AX_FOLLOWING
following axis (not allowed in YANG)
Definition: ncxtypes.h:498
val_child_mark_default_deleted
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:3495
val_child_move_children
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:3270
val_tree_free
void val_tree_free(val_tree_t *val_tree)
Clean and free the specified val_tree.
Definition: val_tree.c:214
val_child_find
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:1707
obj_first_key
obj_key_t * obj_first_key(obj_template_t *obj)
Get the first key record.
Definition: obj.c:9472
val_child_find_obj
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:1858
val_child_find_same_lastmatch
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:1923
val_child_find_nsid
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:1775
val_tree_find
val_value_t * val_tree_find(const val_value_t *childval, val_tree_t *val_tree)
Find a value node from the specified val_tree.
Definition: val_tree.c:518
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.
val_get_casobj
obj_template_t * val_get_casobj(val_value_t *val)
Get the case object for the value node.
Definition: val_util.c:7993
ncx_num.h
NCX Module Library Number Utility Functions.
val_get_mod_name
const xmlChar * val_get_mod_name(const val_value_t *val)
Get the module name associated with this value node.
Definition: val.c:12223
OP_INSOP_FIRST
@ OP_INSOP_FIRST
insert first
Definition: op.h:139
val_tree_remove
boolean val_tree_remove(val_value_t *childval, val_tree_t *val_tree)
Remove a value node from the specified val_tree.
Definition: val_tree.c:333
val_tree_new
val_tree_t * val_tree_new(void)
Create a new empty val_tree.
Definition: val_tree.c:186
val_child_find_same
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:1888
val_tree_insert
status_t val_tree_insert(val_value_t *childval, val_tree_t *val_tree, boolean ignore_err, boolean *inserted)
Add a list entry to the val_tree.
Definition: val_tree.c:249
val_compare
int32 val_compare(const val_value_t *val1, const val_value_t *val2)
Compare 2 val_value_t struct value contents.
Definition: val.c:9456
VAL_CHILD_OP_NEXT
@ VAL_CHILD_OP_NEXT
get-next
Definition: val_child.h:83
NCX_BT_ANYDATA
@ NCX_BT_ANYDATA
YANG 1.1 anydata.
Definition: ncxtypes.h:229
dlq_lastEntry
#define dlq_lastEntry(listP)
get the last entry in the queue list
Definition: dlq.h:352
val_child_find_all_descendants_old
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:2920
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
val_child_op_t_
val_child_op_t_
modify the procedure call to get the previous, same or next entry
Definition: val_child.h:75
val_child_prev_same
val_value_t * val_child_prev_same(val_value_t *curnode)
Get the previous node of the same type.
Definition: val_child.c:2385
val_is_virtual
boolean val_is_virtual(const val_value_t *val)
Check if the specified value is a virtual value such that a 'get' callback function is required to ac...
Definition: val.c:11260
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
val_child_find_all_pfsibling_axis
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:3186
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
xmlns_get_module
const xmlChar * xmlns_get_module(xmlns_id_t nsid)
get the module name of the namespace ID
Definition: xmlns.c:1126
VAL_MARK_DELETED
#define VAL_MARK_DELETED(V)
Mark the value node as deleted.
Definition: val.h:536
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
dlq_swap
void dlq_swap(void *new_node, void *cur_node)
remove the cur_node queue entry from its queue list and replace it with the new_node
Definition: dlq.c:562
val_child_find_hdr
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:2005
val_child_find_count
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:1966
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
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
val_child_insert
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:2066
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
NCX_BT_LIST
@ NCX_BT_LIST
internal, YANG list
Definition: ncxtypes.h:228
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
VAL_FL_GENERIC
#define VAL_FL_GENERIC
Begin val_child_hdr->flags fields.
Definition: val.h:347
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
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_next
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:2326
dlq_remove
void dlq_remove(void *nodeP)
remove the queue entry from its queue list entry MUST have been enqueued somehow before this function...
Definition: dlq.c:519
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.
ERR_NCX_WRONG_TYPE
@ ERR_NCX_WRONG_TYPE
231
Definition: status_enum.h:270
val_index_match
boolean val_index_match(const val_value_t *val1, const val_value_t *val2)
Check 2 val_value structs for the same instance ID.
Definition: val.c:9032
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
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
VAL_UNMARK_DELETED
#define VAL_UNMARK_DELETED(V)
Unmark the value node as deleted.
Definition: val.h:539
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
obj_index_t
uint16 obj_index_t
object index only applies to child nodes; this is assigned at runtime and any augments loaded at run-...
Definition: obj.h:638
val_child.h
Value Node Child Access Support.
val_child_add_force_last
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:1665
OP_INSOP_NONE
@ OP_INSOP_NONE
not set
Definition: op.h:138
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
ncx_obj_is_generic
boolean ncx_obj_is_generic(const obj_template_t *obj)
Check if the object is 1 of the gen_foo object templates.
Definition: ncx.c:13013
ERR_NCX_INSERT_MISSING_INSTANCE
@ ERR_NCX_INSERT_MISSING_INSTANCE
341 - 13.8
Definition: status_enum.h:384
NCX_BT_CONTAINER
@ NCX_BT_CONTAINER
internal container
Definition: ncxtypes.h:225
val_child_mark_undeleted
void val_child_mark_undeleted(val_value_t *child)
Re-Add a previously deleted child value node (unmark deleted)
Definition: val_child.c:2218
XP_AX_NONE
@ XP_AX_NONE
not set
Definition: ncxtypes.h:489
typ.h
Parameter Type Handler.
val_child_clean_hdrQ
void val_child_clean_hdrQ(dlq_hdr_t *child_hdrQ)
Empty and clean a Q of child headers.
Definition: val_child.c:2548
obj_get_real_parent
obj_template_t * obj_get_real_parent(obj_template_t *obj)
Get the parent of the current object; skip OBJ_TYP_CHOICE and OBJ_TYP_CASE.
Definition: obj.c:12733
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
dlq_prevEntry
#define dlq_prevEntry(nodeP)
get the previous queue entry before the current entry
Definition: dlq.h:280
val_child_find_next
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:1740
val_get_virtual_value
val_value_t * val_get_virtual_value(ses_cb_t *scb, val_value_t *val, status_t *res)
Get the value of a virtual value node.
Definition: val.c:11310
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
VAL_FL_HDR_NOT_INSERTED
#define VAL_FL_HDR_NOT_INSERTED
the insertion into the AVL Tree failed due to sanity check error or due to some other reason.
Definition: val.h:372
OP_INSOP_LAST
@ OP_INSOP_LAST
insert last (default)
Definition: op.h:140
VAL_FL_ROOT
#define VAL_FL_ROOT
the value represents an ncx:root node
Definition: val.h:350
val_child_add_clean
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:3332
val_child_hdr_last
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:3808
val_child_mark_deleted
void val_child_mark_deleted(val_value_t *child)
Remove a deleted child value node (mark deleted only)
Definition: val_child.c:2185
XP_AX_PRECEDING
@ XP_AX_PRECEDING
preceding axis (not allowed in YANG)
Definition: ncxtypes.h:510
VAL_CHILD_OP_SAME
@ VAL_CHILD_OP_SAME
get-exact
Definition: val_child.h:82
val_child_find_hdr_lastmatch
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:2032
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
typ_is_simple
boolean typ_is_simple(ncx_btype_t btyp)
Check if this is a simple data type.
Definition: typ.c:3107
NCX_BT_ANY
@ NCX_BT_ANY
anyxml
Definition: ncxtypes.h:202
VAL_CHILD_OP_NONE
@ VAL_CHILD_OP_NONE
not set
Definition: val_child.h:80
ncx_netconfd_running
boolean ncx_netconfd_running(void)
Check if netconfd running.
Definition: ncx.c:11805
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
val_child_find_all_ancestors
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:2703
val_child_next_terminal
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:2447
val_set_by_default
boolean val_set_by_default(const val_value_t *val)
Check if the value was set by val_add_defaults.
Definition: val.c:12571
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
val_child_first
val_value_t * val_child_first(const val_value_t *parent)
Get the first child present for this parent.
Definition: val_child.c:2294
VAL_CHILD_OP_PREV
@ VAL_CHILD_OP_PREV
get-previous
Definition: val_child.h:81
ncx_list.h
NCX Module Library List Utility Functions.
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
val_child_swap
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:2253
XP_AX_FOLLOWING_SIBLING
@ XP_AX_FOLLOWING_SIBLING
following-sibling axis (not allowed in YANG)
Definition: ncxtypes.h:501
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
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
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
val_hdr_test_fn_t
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:1116
ncx.h
YANG module utility functions.
val_tree_remove_deleted
void val_tree_remove_deleted(val_value_t *childval, val_tree_t *val_tree)
A node is being removed from the tree but not the que because it is marked as VAL_FL_DELETED.
Definition: val_tree.c:443
obj.h
Data Object Support.
val_walker_fn_t
boolean(* val_walker_fn_t)(val_value_t *val, void *cookie1, void *cookie2)
child or descendant node search walker function
Definition: val.h:1084
xmlns_ids_equal
boolean xmlns_ids_equal(xmlns_id_t ns1, xmlns_id_t ns2)
compare 2 namespace IDs only if they are both non-zero and return TRUE if they are equal
Definition: xmlns.c:1363
val_test2_fn_t
boolean(* val_test2_fn_t)(val_value_t *val, void *cookie)
get first or next child test function value test function
Definition: val.h:1130
val_tree_add_undeleted
status_t val_tree_add_undeleted(val_value_t *childval, val_tree_t *val_tree)
A node is being added back to the the tree but not the que because it was marked as VAL_FL_DELETED.
Definition: val_tree.c:480
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
val_child_next_same
val_value_t * val_child_next_same(val_value_t *curnode)
Get the next node of the same type.
Definition: val_child.c:2359
val_first_child_match
val_value_t * val_first_child_match(const val_value_t *parent, const val_value_t *child)
Get the first instance of the corresponding child node.
Definition: val.c:8359
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
val_tree_swap
status_t val_tree_swap(val_value_t *newval, val_value_t *childval, val_tree_t *val_tree)
Change the node in the specified tree.
Definition: val_tree.c:386
val_walker2_fn_t
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:1100
VAL_HDR
#define VAL_HDR(V)
Access the header backptr.
Definition: val.h:390
val_child_add_force
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:1624
VAL_FL_DELETED
#define VAL_FL_DELETED
if set, value has been deleted or moved and awaiting commit or rollback
Definition: val.h:209
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
obj_is_root
boolean obj_is_root(const obj_template_t *obj)
Check if object is marked as a root object.
Definition: obj.c:14152
val_child_first_terminal
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:2412
val_child_count
uint32 val_child_count(val_value_t *parent)
Get the number of non-deleted children in this parent.
Definition: val_child.c:2483
VAL_IS_DELETED
#define VAL_IS_DELETED(V)
Access the deleted flag.
Definition: val.h:533
log_debug3_append
void void void void void void void void void void void void log_debug3_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG3 log entry.
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:
ncx_new_backptr
ncx_backptr_t * ncx_new_backptr(void *node)
Malloc and initialize a new ncx_backptr_t struct.
Definition: ncx.c:11412
typ_has_children
boolean typ_has_children(ncx_btype_t btyp)
Check if this is a data type that uses the val.v.childQ.
Definition: typ.c:3056
val_child_finish_default_deleted
void val_child_finish_default_deleted(val_value_t *val)
Delete all the marked default leaf-list nodes.
Definition: val_child.c:3531
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
val_child_count_nsid
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:2515