yumapro  20.10-12
YumaPro SDK
grp.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_grp
13 #define _H_grp
14 
15 /* FILE: grp.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 09-dec-07 abb Begun
36 
37 */
38 
39 #include <xmlstring.h>
40 #include <xmlregexp.h>
41 
42 #ifndef _H_ncxconst
43 #include "ncxconst.h"
44 #endif
45 
46 #ifndef _H_ncxtypes
47 #include "ncxtypes.h"
48 #endif
49 
50 #ifndef _H_status
51 #include "status.h"
52 #endif
53 
54 #ifndef _H_tk
55 #include "tk.h"
56 #endif
57 
58 #ifndef _H_xmlns
59 #include "xmlns.h"
60 #endif
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 /********************************************************************
67 * *
68 * C O N S T A N T S *
69 * *
70 *********************************************************************/
71 
72 
73 /********************************************************************
74 * *
75 * T Y P E S *
76 * *
77 *********************************************************************/
78 
87 typedef struct grp_template_t_ {
88  dlq_hdr_t qhdr;
89  xmlChar *name;
90  xmlChar *descr;
91  xmlChar *ref;
92  ncx_error_t tkerr;
93  void *parent;
96  boolean used;
97  boolean istop;
98  boolean expand_done;
99  boolean loop_detected;
100  ncx_status_t status;
101  uint32 grpindex;
102  dlq_hdr_t typedefQ;
103  dlq_hdr_t groupingQ;
104  dlq_hdr_t datadefQ;
105  dlq_hdr_t appinfoQ;
107 } grp_template_t;
108 
109 
110 
111 /********************************************************************
112 * *
113 * F U N C T I O N S *
114 * *
115 *********************************************************************/
116 
117 
123 extern grp_template_t *
124  grp_new_template (void);
125 
126 
136 extern void
137  grp_free_template (grp_template_t *grp);
138 
139 
145 extern void
146  grp_clean_groupingQ (dlq_hdr_t *que);
147 
148 
156 extern boolean
157  grp_has_typedefs (const grp_template_t *grp);
158 
159 
166 extern const xmlChar *
167  grp_get_mod_name (const grp_template_t *grp);
168 
169 
172 #ifdef __cplusplus
173 } /* end extern 'C' */
174 #endif
175 
176 #endif /* _H_grp */
grp_template_t_::expand_done
boolean expand_done
T: expand already done.
Definition: grp.h:98
grp_new_template
grp_template_t * grp_new_template(void)
Malloc and initialize the fields in a grp_template_t.
Definition: grp.c:100
ncx_appinfo.h
NCX Module Library Extension (Application Info) Utility Functions.
grp_template_t_::parentgrp
struct grp_template_t_ * parentgrp
direct parent is grp
Definition: grp.h:94
grp_template_t_::nsid
xmlns_id_t nsid
namespace ID of module defining grp
Definition: grp.h:95
grp_template_t_::groupingQ
dlq_hdr_t groupingQ
Q of grp_template_t.
Definition: grp.h:103
ncx_clean_appinfoQ
void ncx_clean_appinfoQ(dlq_hdr_t *appinfoQ)
Check an initialized appinfoQ for any entries Remove them from the queue and delete them.
Definition: ncx_appinfo.c:723
tk.h
NCX Syntax Token Handler.
grp_get_mod_name
const xmlChar * grp_get_mod_name(const grp_template_t *grp)
Get the module name for a grouping.
Definition: grp.c:231
grp_template_t_::loop_detected
boolean loop_detected
T: loop detected by compiler.
Definition: grp.h:99
grp_template_t_::used
boolean used
used flag for yangdiff use
Definition: grp.h:96
ncxconst.h
Contains NCX constants.
grp_clean_groupingQ
void grp_clean_groupingQ(dlq_hdr_t *que)
Clean a queue of grp_template_t structs.
Definition: grp.c:164
grp_template_t_::tkerr
ncx_error_t tkerr
file and line info for compiler
Definition: grp.h:92
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
def_reg.h
Definition Registry module.
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
grp_template_t_::grpindex
uint32 grpindex
used for XSD generation
Definition: grp.h:101
grp_template_t_::status
ncx_status_t status
parse status
Definition: grp.h:100
grp_template_t_::ref
xmlChar * ref
reference-stmt (not on server)
Definition: grp.h:91
grp_template_t_::name
xmlChar * name
name of the grouping
Definition: grp.h:89
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
typ.h
Parameter Type Handler.
NCX_STATUS_CURRENT
@ NCX_STATUS_CURRENT
current (default)
Definition: ncxtypes.h:420
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
obj_clean_datadefQ
void obj_clean_datadefQ(dlq_hdr_t *que)
Clean and free all the obj_template_t structs in the specified Q.
Definition: obj.c:8148
grp_template_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: grp.h:88
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
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
grp_template_t_::datadefQ
dlq_hdr_t datadefQ
Q of obj_template_t.
Definition: grp.h:104
grp_template_t_::typedefQ
dlq_hdr_t typedefQ
Q of typ_template_t.
Definition: grp.h:102
grp_free_template
void grp_free_template(grp_template_t *grp)
Scrub the memory in a grp_template_t by freeing all the sub-fields and then freeing the entire struct...
Definition: grp.c:131
grp_template_t_::istop
boolean istop
T: top-level grouping.
Definition: grp.h:97
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
grp.h
YANG Grouping Statement Handler.
typ_clean_typeQ
void typ_clean_typeQ(dlq_hdr_t *que)
Clean a queue of typ_template_t structs.
Definition: typ.c:4477
grp_has_typedefs
boolean grp_has_typedefs(const grp_template_t *grp)
Check if the grouping contains any typedefs.
Definition: grp.c:190
grp_template_t_::appinfoQ
dlq_hdr_t appinfoQ
Q of ncx_appinfo_t.
Definition: grp.h:105
grp_template_t_
One YANG 'grouping' definition – sibling set template.
Definition: grp.h:87
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
grp_template_t_::parent
void * parent
const back-ptr to parent obj
Definition: grp.h:93
xmlns.h
XML namespace support.
status.h
Global error messages for status code enumerations.
dlq.h
dlq provides general double-linked list and queue support:
grp_template_t_::descr
xmlChar * descr
description-stmt (not on server)
Definition: grp.h:90