yumapro  24.10-4
YumaPro SDK
Loading...
Searching...
No Matches
ncx_feature.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_feature
13#define _H_ncx_feature
14
15/* FILE: ncx_feature.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* *
76* C O N S T A N T S *
77* *
78*********************************************************************/
79
86#define SET_FEAT(F) (F) |= NCX_FL_FEAT_SET
87#define CLR_FEAT(F) (F) &= ~NCX_FL_FEAT_SET
88#define IS_FEAT_SET(F) ((F) & NCX_FL_FEAT_SET)
89
90
98#define SET_FEAT_ENA(F) (F) |= NCX_FL_FEAT_ENABLED
99#define CLR_FEAT_ENA(F) (F) &= ~NCX_FL_FEAT_ENABLED
100#define IS_FEAT_ENA(F) ((F) & NCX_FL_FEAT_ENABLED)
101
102
107#define SET_FEAT_XFER(F) (F) |= NCX_FL_FEAT_XFER
108#define CLR_FEAT_XFER(F) (F) &= ~NCX_FL_FEAT_XFER
109#define IS_FEAT_XFER(F) ((F) & NCX_FL_FEAT_XFER)
110
111
112/********************************************************************
113* *
114* F U N C T I O N S *
115* *
116*********************************************************************/
117
118
119
130extern void
131 ncx_feature_init (void);
132
133
137extern void
138 ncx_feature_cleanup (void);
139
140
147extern ncx_iffeature_t *
148 ncx_new_iffeature (void);
149
150
155extern void
157
158
168extern ncx_iff_ref_t *
169 ncx_new_iff_ref (const xmlChar *prefix,
170 uint32 prefix_len,
171 const xmlChar *featname);
172
173
179extern void
181
182
193extern ncx_iff_ref_t *
194 ncx_find_iff_ref (dlq_hdr_t *iff_refQ,
195 const xmlChar *prefix,
196 uint32 prefix_len,
197 const xmlChar *featname);
198
199
207extern ncx_iffeature_t *
209
210
216extern void
217 ncx_clean_iffeatureQ (dlq_hdr_t *iffeatureQ);
218
219
229extern ncx_iffeature_t *
230 ncx_find_iffeature (dlq_hdr_t *iffeatureQ,
231 const xmlChar *prefix,
232 const xmlChar *name,
233 const xmlChar *modprefix);
234
235
242extern ncx_feature_t *
243 ncx_new_feature (void);
244
245
251extern void
253
254
263extern ncx_feature_t *
265 const xmlChar *name);
266
267
275extern ncx_feature_t *
276 ncx_find_feature_que (dlq_hdr_t *featureQ,
277 const xmlChar *name);
278
279
288extern ncx_feature_t *
290 const xmlChar *name);
291
292
303extern void
306 void *cookie,
307 boolean enabledonly);
308
309
319extern uint32
321 boolean enabledonly);
322
323
332extern boolean
334
335
344extern boolean
345 ncx_feature_enabled_str (const xmlChar *modname,
346 const xmlChar *revision,
347 const xmlChar *name);
348
349
357extern void
358 ncx_set_feature_enable_default (boolean flag);
359
360
370extern void
372
373
386extern status_t
387 ncx_set_feature_code_entry (const xmlChar *featstr,
388 ncx_feature_code_t featcode);
389
390
401extern status_t
402 ncx_set_feature_enable_entry (const xmlChar *featstr,
403 boolean flag);
404
405
417extern status_t
418 ncx_set_feature_enable (const xmlChar *modname,
419 const xmlChar *name,
420 boolean flag);
421
422
435extern status_t
436 ncx_set_feature_enable_ex (const xmlChar *modname,
437 const xmlChar *name,
438 boolean flag,
439 boolean force);
440
441
449extern void
451
452
460extern void
462
463
474extern ncx_feature_t *
476
477
486extern const xmlChar *
488
489
493#ifdef __cplusplus
494} /* end extern 'C' */
495#endif
496
497#endif /* _H_ncx_feature */
dlq provides general double-linked list and queue support:
status_t
global error return code
Definition: status_enum.h:210
ncx_feature_code_t
Feature code generation type (deprecated)
Definition: ncxtypes.h:993
boolean(* ncx_feature_cbfn_t)(const ncx_module_t *mod, ncx_feature_t *feature, void *cookie)
user function callback template to traverse all module features for a specified module
Definition: ncxtypes.h:1486
void ncx_set_feature_parms(ncx_feature_t *feature)
Check if any feature parameters were set for the specified feature struct.
Definition: ncx_feature.c:1578
status_t ncx_set_feature_code_entry(const xmlChar *featstr, ncx_feature_code_t featcode)
Create or set a feature_entry struct for the specified feature code parameter (deprecated)
Definition: ncx_feature.c:1358
ncx_feature_t * ncx_find_feature_all(ncx_module_t *mod, const xmlChar *name)
Find a ncx_feature_t struct in the module and perhaps any of its submodules.
Definition: ncx_feature.c:1000
void ncx_clean_iffeatureQ(dlq_hdr_t *iffeatureQ)
Clean a Q of malloced ncx_iffeature_t struct.
Definition: ncx_feature.c:723
ncx_iff_ref_t * ncx_find_iff_ref(dlq_hdr_t *iff_refQ, const xmlChar *prefix, uint32 prefix_len, const xmlChar *featname)
Find a ncx_iff_ref_t struct.
Definition: ncx_feature.c:562
ncx_iffeature_t * ncx_clone_iffeature(ncx_iffeature_t *srciff)
Clone a new ncx_iffeature_t struct.
Definition: ncx_feature.c:639
void ncx_free_iff_ref(ncx_iff_ref_t *iff_ref)
Free a malloced ncx_iff_ref_t struct.
Definition: ncx_feature.c:614
void ncx_set_features_for_mod(ncx_module_t *mod)
Check if any feature parameters were set for the specified feature struct for all features in a modul...
Definition: ncx_feature.c:1635
boolean ncx_feature_enabled(ncx_feature_t *feature)
Check if the specified feature and any referenced if-features are enabled.
Definition: ncx_feature.c:1205
ncx_feature_t * ncx_find_feature_que(dlq_hdr_t *featureQ, const xmlChar *name)
Find a ncx_feature_t struct in the specified Q.
Definition: ncx_feature.c:964
ncx_feature_t * ncx_first_feature_from_iff(ncx_iffeature_t *iff)
Get the feature in the first ncx_iff_ref_t struct.
Definition: ncx_feature.c:1663
ncx_iffeature_t * ncx_new_iffeature(void)
Get a new ncx_iffeature_t struct.
Definition: ncx_feature.c:455
void ncx_set_feature_enable_default(boolean flag)
Set the feature_enable_default flag.
Definition: ncx_feature.c:1315
void ncx_feature_init(void)
Init the ncx_feature module.
Definition: ncx_feature.c:399
ncx_feature_t * ncx_find_feature(ncx_module_t *mod, const xmlChar *name)
Find a ncx_feature_t struct in the module and perhaps any of its submodules.
Definition: ncx_feature.c:868
ncx_feature_t * ncx_new_feature(void)
Get a new ncx_feature_t struct.
Definition: ncx_feature.c:796
void ncx_set_feature_code_default(ncx_feature_code_t code)
Set the feature_code_default enumeration (deprecated)
Definition: ncx_feature.c:1334
status_t ncx_set_feature_enable_ex(const xmlChar *modname, const xmlChar *name, boolean flag, boolean force)
Create or set a feature_entry struct for the specified feature enabled parameter (extended)
Definition: ncx_feature.c:1500
ncx_iff_ref_t * ncx_new_iff_ref(const xmlChar *prefix, uint32 prefix_len, const xmlChar *featname)
Get a new ncx_iff_ref_t struct.
Definition: ncx_feature.c:515
boolean ncx_feature_enabled_str(const xmlChar *modname, const xmlChar *revision, const xmlChar *name)
Find a ncx_feature_t struct and check if it is enabled.
Definition: ncx_feature.c:1283
const xmlChar * ncx_get_feature_modname(ncx_feature_t *feat)
Get the module name string for the feature.
Definition: ncx_feature.c:1694
status_t ncx_set_feature_enable_entry(const xmlChar *featstr, boolean flag)
Create or set a feature_entry struct for the specified feature enabled parameter.
Definition: ncx_feature.c:1419
uint32 ncx_feature_count(const ncx_module_t *mod, boolean enabledonly)
Get the total feature count for this module and any submodules.
Definition: ncx_feature.c:1128
void ncx_for_all_features(const ncx_module_t *mod, ncx_feature_cbfn_t cbfn, void *cookie, boolean enabledonly)
Execute a callback function for all features in this module and any submodules.
Definition: ncx_feature.c:1049
status_t ncx_set_feature_enable(const xmlChar *modname, const xmlChar *name, boolean flag)
Create or set a feature_entry struct for the specified feature enabled parameter.
Definition: ncx_feature.c:1471
ncx_iffeature_t * ncx_find_iffeature(dlq_hdr_t *iffeatureQ, const xmlChar *prefix, const xmlChar *name, const xmlChar *modprefix)
Search a Q of ncx_iffeature_t structs for a match.
Definition: ncx_feature.c:750
void ncx_free_iffeature(ncx_iffeature_t *iff)
Free a malloced ncx_iffeature_t struct.
Definition: ncx_feature.c:479
void ncx_free_feature(ncx_feature_t *feature)
Free a malloced ncx_feature_t struct.
Definition: ncx_feature.c:830
void ncx_feature_cleanup(void)
Cleanup the ncx_feature module.
Definition: ncx_feature.c:425
YANG module data structures Many internal representations of YANG module constructs.
YANG feature entry.
Definition: ncxtypes.h:1021
YANG 1.1 identifier-ref-arg that within an if-feature expression.
Definition: ncxtypes.h:937
YANG if-feature entry.
Definition: ncxtypes.h:953
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
NCX Syntax Token Handler.
Parameter Type Handler.
Value Node Basic Support.
XML namespace support.
YANG Module parser utilities.