yumapro  24.10-3
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 - 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_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
108extern void
110 ncx_btype_t btyp);
111
112
118extern void
120
121
127extern void
129
130
137extern uint32
138 ncx_list_cnt (const ncx_list_t *list);
139
140
148extern uint32
149 ncx_list_linelen (const ncx_list_t *list);
150
151
158extern boolean
159 ncx_list_empty (const ncx_list_t *list);
160
161
170extern boolean
171 ncx_string_in_list (const xmlChar *str,
172 const ncx_list_t *list);
173
188extern int32
189 ncx_compare_lists (const ncx_list_t *list1,
190 const ncx_list_t *list2);
191
192
204extern status_t
205 ncx_copy_list (const ncx_list_t *list1,
206 ncx_list_t *list2);
207
208
228extern void
230 ncx_list_t *dest,
231 ncx_merge_t mergetyp,
232 boolean allow_dups);
233
234
245extern status_t
246 ncx_replace_list (const ncx_list_t *src,
247 ncx_list_t *dest);
248
249
262extern status_t
263 ncx_set_strlist (const xmlChar *liststr,
264 ncx_list_t *list);
265
266
285extern status_t
287 const xmlChar *strval,
288 ncx_list_t *list);
289
290
311extern status_t
312 ncx_finish_list (typ_def_t *typdef,
313 ncx_list_t *list);
314
315
324extern ncx_lmem_t *
325 ncx_new_lmem (void);
326
327
334extern void
336 ncx_btype_t btyp);
337
338
345extern void
347 ncx_btype_t btyp);
348
349
357extern ncx_lmem_t *
359 const ncx_lmem_t *memval);
360
361
369extern void
371 ncx_lmem_t *memval,
372 ncx_merge_t mergetyp);
373
374
381extern uint32
383
384
392extern ncx_lmem_t *
394
395
403extern ncx_lmem_t *
405
406
417extern status_t
418 ncx_add_strlist (const xmlChar *liststr,
419 uint32 liststrlen,
420 ncx_list_t *list);
421
422
430extern const xmlChar *
431 ncx_get_lmem_strval (const ncx_lmem_t *lmem);
432
433
440extern xmlChar *
441 ncx_list_to_string (const ncx_list_t *list);
442
443
444
457extern status_t
459 uint32 bitpos,
460 const xmlChar *bitname);
461
462
466#ifdef __cplusplus
467} /* end extern 'C' */
468#endif
469
470#endif /* _H_ncx_list */
dlq provides general double-linked list and queue support:
status_t
global error return code
Definition: status_enum.h:210
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
boolean ncx_string_in_list(const xmlChar *str, const ncx_list_t *list)
Check if the string value is in the list List type must be string based, or an enum.
Definition: ncx_list.c:331
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
void ncx_insert_lmem(ncx_list_t *list, ncx_lmem_t *memval, ncx_merge_t mergetyp)
Insert a list entry into the specified list.
Definition: ncx_list.c:1095
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_init_list(ncx_list_t *list, ncx_btype_t btyp)
Initialize an allocated ncx_list_t.
Definition: ncx_list.c:113
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
status_t ncx_add_strlist(const xmlChar *liststr, uint32 liststrlen, ncx_list_t *list)
add a string as a complete list member to an initialized list must be type NCX_BT_STRING
Definition: ncx_list.c:1270
boolean ncx_list_empty(const ncx_list_t *list)
Check if the list is empty or not.
Definition: ncx_list.c:305
ncx_lmem_t * ncx_first_lmem(ncx_list_t *list)
Return the first list member.
Definition: ncx_list.c:1218
void ncx_clean_list(ncx_list_t *list)
Scrub the memory of a ncx_list_t but do not delete it.
Definition: ncx_list.c:136
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.