yumapro  23.10T-9
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
80#define SET_FEAT(F) (F) |= NCX_FL_FEAT_SET
81#define CLR_FEAT(F) (F) &= ~NCX_FL_FEAT_SET
82#define IS_FEAT_SET(F) ((F) & NCX_FL_FEAT_SET)
83
84#define SET_FEAT_ENA(F) (F) |= NCX_FL_FEAT_ENABLED
85#define CLR_FEAT_ENA(F) (F) &= ~NCX_FL_FEAT_ENABLED
86#define IS_FEAT_ENA(F) ((F) & NCX_FL_FEAT_ENABLED)
87
88
89/********************************************************************
90* *
91* F U N C T I O N S *
92* *
93*********************************************************************/
94
95
96
107extern void
108 ncx_feature_init (void);
109
110
114extern void
115 ncx_feature_cleanup (void);
116
117
124extern ncx_iffeature_t *
125 ncx_new_iffeature (void);
126
127
132extern void
134
135
145extern ncx_iff_ref_t *
146 ncx_new_iff_ref (const xmlChar *prefix,
147 uint32 prefix_len,
148 const xmlChar *featname);
149
150
156extern void
158
159
170extern ncx_iff_ref_t *
171 ncx_find_iff_ref (dlq_hdr_t *iff_refQ,
172 const xmlChar *prefix,
173 uint32 prefix_len,
174 const xmlChar *featname);
175
176
184extern ncx_iffeature_t *
186
187
193extern void
194 ncx_clean_iffeatureQ (dlq_hdr_t *iffeatureQ);
195
196
206extern ncx_iffeature_t *
207 ncx_find_iffeature (dlq_hdr_t *iffeatureQ,
208 const xmlChar *prefix,
209 const xmlChar *name,
210 const xmlChar *modprefix);
211
212
219extern ncx_feature_t *
220 ncx_new_feature (void);
221
222
228extern void
230
231
240extern ncx_feature_t *
242 const xmlChar *name);
243
244
252extern ncx_feature_t *
253 ncx_find_feature_que (dlq_hdr_t *featureQ,
254 const xmlChar *name);
255
256
265extern ncx_feature_t *
267 const xmlChar *name);
268
269
280extern void
283 void *cookie,
284 boolean enabledonly);
285
286
296extern uint32
298 boolean enabledonly);
299
300
309extern boolean
311
312
321extern boolean
322 ncx_feature_enabled_str (const xmlChar *modname,
323 const xmlChar *revision,
324 const xmlChar *name);
325
326
334extern void
335 ncx_set_feature_enable_default (boolean flag);
336
337
347extern void
349
350
363extern status_t
364 ncx_set_feature_code_entry (const xmlChar *featstr,
365 ncx_feature_code_t featcode);
366
367
378extern status_t
379 ncx_set_feature_enable_entry (const xmlChar *featstr,
380 boolean flag);
381
382
394extern status_t
395 ncx_set_feature_enable (const xmlChar *modname,
396 const xmlChar *name,
397 boolean flag);
398
399
412extern status_t
413 ncx_set_feature_enable_ex (const xmlChar *modname,
414 const xmlChar *name,
415 boolean flag,
416 boolean force);
417
418
426extern void
428
429
437extern void
439
440
451extern ncx_feature_t *
453
454
463extern const xmlChar *
465
466
470#ifdef __cplusplus
471} /* end extern 'C' */
472#endif
473
474#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:989
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:1482
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:1560
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:1357
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:1608
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:1636
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:1314
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:1333
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:1499
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:1282
const xmlChar * ncx_get_feature_modname(ncx_feature_t *feat)
Get the module name string for the feature.
Definition: ncx_feature.c:1667
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:1418
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:1470
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:1017
YANG 1.1 identifier-ref-arg that within an if-feature expression.
Definition: ncxtypes.h:933
YANG if-feature entry.
Definition: ncxtypes.h:949
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1134
NCX Syntax Token Handler.
Parameter Type Handler.
Value Node Basic Support.
XML namespace support.
YANG Module parser utilities.