yumapro  24.10-11
YumaPro SDK
Loading...
Searching...
No Matches
ncx_list.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_ncx_list
13#define _H_ncx_list
14
15/* FILE: ncx_list.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
28/*********************************************************************
29* *
30* C H A N G E H I S T O R Y *
31* *
32*********************************************************************
33
34date init comment
35----------------------------------------------------------------------
3617-feb-10 abb Begun; split out from ncx.c
37*/
38
39#include <xmlstring.h>
40
41#ifndef _H_dlq
42#include "dlq.h"
43#endif
44
45#ifndef _H_ncxtypes
46#include "ncxtypes.h"
47#endif
48
49#ifndef _H_tk
50#include "tk.h"
51#endif
52
53#ifndef _H_typ
54#include "typ.h"
55#endif
56
57#ifndef _H_val
58#include "val.h"
59#endif
60
61#ifndef _H_xmlns
62#include "xmlns.h"
63#endif
64
65#ifndef _H_yang
66#include "yang.h"
67#endif
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
73/********************************************************************
74* *
75* F U N C T I O N S *
76* *
77*********************************************************************/
78
96extern ncx_list_t *
98
99
111extern void
112 ncx_init_list (ncx_list_t *list,
113 ncx_btype_t btyp);
114
115
124extern void
125 ncx_clean_list (ncx_list_t *list);
126
127
133extern void
135
136
143extern uint32
144 ncx_list_cnt (const ncx_list_t *list);
145
146
154extern uint32
155 ncx_list_linelen (const ncx_list_t *list);
156
157
167extern boolean
168 ncx_list_empty (const ncx_list_t *list);
169
170
182extern boolean
183 ncx_string_in_list (const xmlChar *str,
184 const ncx_list_t *list);
185
200extern int32
201 ncx_compare_lists (const ncx_list_t *list1,
202 const ncx_list_t *list2);
203
204
216extern status_t
217 ncx_copy_list (const ncx_list_t *list1,
218 ncx_list_t *list2);
219
220
240extern void
242 ncx_list_t *dest,
243 ncx_merge_t mergetyp,
244 boolean allow_dups);
245
246
257extern status_t
258 ncx_replace_list (const ncx_list_t *src,
259 ncx_list_t *dest);
260
261
274extern status_t
275 ncx_set_strlist (const xmlChar *liststr,
276 ncx_list_t *list);
277
278
297extern status_t
299 const xmlChar *strval,
300 ncx_list_t *list);
301
302
323extern status_t
324 ncx_finish_list (typ_def_t *typdef,
325 ncx_list_t *list);
326
327
336extern ncx_lmem_t *
337 ncx_new_lmem (void);
338
339
346extern void
348 ncx_btype_t btyp);
349
350
357extern void
359 ncx_btype_t btyp);
360
361
369extern ncx_lmem_t *
371 const ncx_lmem_t *memval);
372
373
384extern void
385 ncx_insert_lmem (ncx_list_t *list,
386 ncx_lmem_t *memval,
387 ncx_merge_t mergetyp);
388
389
396extern uint32
398
399
407extern ncx_lmem_t *
409
410
418extern ncx_lmem_t *
420
421
435extern status_t
436 ncx_add_strlist (const xmlChar *liststr,
437 uint32 liststrlen,
438 ncx_list_t *list);
439
440
448extern const xmlChar *
449 ncx_get_lmem_strval (const ncx_lmem_t *lmem);
450
451
458extern xmlChar *
459 ncx_list_to_string (const ncx_list_t *list);
460
461
462
475extern status_t
477 uint32 bitpos,
478 const xmlChar *bitname);
479
480
484#ifdef __cplusplus
485} /* end extern 'C' */
486#endif
487
488#endif /* _H_ncx_list */
dlq provides general double-linked list and queue support:
status_t
global error return code
Definition: status_enum.h:219
ncx_btype_t
enumeration of the built-in NCX types These types cannot be overridden and cannot be imported
Definition: ncxtypes.h:213
ncx_merge_t
The merge type for the NETCONF merge operation.
Definition: ncxtypes.h:469
uint32 ncx_list_cnt(const ncx_list_t *list)
Get the number of entries in the list.
Definition: ncx_list.c:190
ncx_lmem_t * ncx_next_lmem(ncx_lmem_t *cur)
Return the next list member.
Definition: ncx_list.c:1242
ncx_lmem_t * ncx_new_lmem(void)
Malloc and fill in a new ncx_lmem_t struct.
Definition: ncx_list.c:932
ncx_list_t * ncx_new_list(ncx_btype_t btyp)
Malloc Initialize an allocated ncx_list_t.
Definition: ncx_list.c:90
const xmlChar * ncx_get_lmem_strval(const ncx_lmem_t *lmem)
Get the string value from an lmem must be type NCX_BT_STRING.
Definition: ncx_list.c:1319
status_t ncx_copy_list(const ncx_list_t *list1, ncx_list_t *list2)
Copy the contents of list1 to list2 Supports base type NCX_BT_SLIST.
Definition: ncx_list.c:487
void ncx_free_lmem(ncx_lmem_t *lmem, ncx_btype_t btyp)
Free all the memory in a ncx_lmem_t struct.
Definition: ncx_list.c:994
int32 ncx_compare_lists(const ncx_list_t *list1, const ncx_list_t *list2)
Compare 2 ncx_list_t struct contents.
Definition: ncx_list.c:397
ncx_lmem_t * ncx_find_lmem(ncx_list_t *list, const ncx_lmem_t *memval)
Find a the first matching list member with the specified value.
Definition: ncx_list.c:1020
status_t ncx_set_strlist(const xmlChar *liststr, ncx_list_t *list)
Consume a generic string list with no type checking.
Definition: ncx_list.c:694
status_t ncx_finish_list(typ_def_t *typdef, ncx_list_t *list)
2nd pass of parsing a ncx_list_t Finish converting the list members to the proper format
Definition: ncx_list.c:843
xmlChar * ncx_list_to_string(const ncx_list_t *list)
Convert a list into a string with spaces between the entries.
Definition: ncx_list.c:1337
void ncx_merge_list(ncx_list_t *src, ncx_list_t *dest, ncx_merge_t mergetyp, boolean allow_dups)
The merge function is handled specially for lists.
Definition: ncx_list.c:587
uint32 ncx_list_linelen(const ncx_list_t *list)
Get the length of the string if the list was printed in 1 line with spaces between the entries.
Definition: ncx_list.c:223
status_t ncx_add_bit_to_list(ncx_list_t *list, uint32 bitpos, const xmlChar *bitname)
Add a lmem struct for a bits list.
Definition: ncx_list.c:1442
ncx_lmem_t * ncx_first_lmem(ncx_list_t *list)
Return the first list member.
Definition: ncx_list.c:1218
void ncx_free_list(ncx_list_t *list)
Clean and free an allocated ncx_list_t.
Definition: ncx_list.c:167
void ncx_clean_lmem(ncx_lmem_t *lmem, ncx_btype_t btyp)
Scrub the memory of a ncx_lmem_t but do not delete it.
Definition: ncx_list.c:954
status_t ncx_set_list(ncx_btype_t btyp, const xmlChar *strval, ncx_list_t *list)
consume a generic string list with base type checking Parse the XML input as an NCX_BT_SLIST
Definition: ncx_list.c:732
uint32 ncx_lmem_count(ncx_list_t *list)
Return the number of list members.
Definition: ncx_list.c:1194
status_t ncx_replace_list(const ncx_list_t *src, ncx_list_t *dest)
The replace function is handled specially for lists.
Definition: ncx_list.c:664
YANG module data structures Many internal representations of YANG module constructs.
header for a NCX List
Definition: ncxtypes.h:859
NCX list member: list of string or number Usually used within a val_value_t structure.
Definition: ncxtypes.h:829
Discriminated union for all data typedefs.
Definition: typ.h:458
NCX Syntax Token Handler.
Parameter Type Handler.
Value Node Basic Support.
XML namespace support.
YANG Module parser utilities.