yumapro  21.10T-8
YumaPro SDK
yang.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_yang
13 #define _H_yang
14 
15 /* FILE: yang.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 15-nov-07 abb Begun; start from yang_parse.c
36 
37 */
38 
39 #include <xmlstring.h>
40 
41 #ifndef _H_dlq
42 #include "dlq.h"
43 #endif
44 
45 #ifndef _H_ext
46 #include "ext.h"
47 #endif
48 
49 #ifndef _H_grp
50 #include "grp.h"
51 #endif
52 
53 #ifndef _H_ncxtypes
54 #include "ncxtypes.h"
55 #endif
56 
57 #ifndef _H_obj
58 #include "obj.h"
59 #endif
60 
61 #ifndef _H_status
62 #include "status.h"
63 #endif
64 
65 #ifndef _H_tk
66 #include "tk.h"
67 #endif
68 
69 #ifndef _H_typ
70 #include "typ.h"
71 #endif
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
77 /********************************************************************
78 * *
79 * T Y P E S *
80 * *
81 *********************************************************************/
82 
83 /* Group yangcomp defined in ncx.h */
84 
85  // BEGIN ncxlib/yang/yangcomp/yangcomp-parse
92 
93  // BEGIN ncxlib/yang/yangcomp/yangcompparse
101 
102 
104 typedef enum yang_parsetype_t_ {
110 
111 
112 /* YANG statement types for yang_stmt_t order struct */
113 typedef enum yang_stmttype_t_ {
114  YANG_ST_NONE,
115  YANG_ST_TYPEDEF, /* node is typ_template_t */
116  YANG_ST_GROUPING, /* node is grp_template_t */
117  YANG_ST_EXTENSION, /* node is ext_template_t */
118  YANG_ST_OBJECT, /* node is obj_template_t */
119  YANG_ST_IDENTITY, /* node is ncx_identity_t */
120  YANG_ST_FEATURE, /* node is ncx_feature_t */
121  YANG_ST_DEVIATION /* node is ncx_deviation_t */
122 } yang_stmttype_t;
123 
124 
126 typedef struct yang_stmt_t_ {
128  dlq_hdr_t qhdr;
129 
131  yang_stmttype_t stmttype;
132 
134  union s_ {
142  } s;
143 } yang_stmt_t;
144 
145 
147 typedef struct yang_node_t_ {
148  dlq_hdr_t qhdr;
149  const xmlChar *name;
150  const xmlChar *revision;
153  xmlChar *failed;
154  xmlChar *failedrev;
157 } yang_node_t;
158 
159 
161 typedef struct yang_import_ptr_t_ {
162  dlq_hdr_t qhdr;
163  xmlChar *modname;
164  xmlChar *modprefix;
165  xmlChar *revision;
166  xmlChar *descr;
167  xmlChar *ref;
169 
170 
174 typedef struct failed_ptr_t_ {
175  dlq_hdr_t qhdr;
176  xmlChar *modname;
177  xmlChar *revision;
179 } failed_ptr_t;
180 
181 
204 typedef struct yang_pcb_t_ {
205  struct ncx_module_t_ *top;
206  struct ncx_module_t_ *retmod;
207  struct ncx_module_t_ *parentparm;
208  const xmlChar *revision;
209  boolean with_submods;
210  boolean stmtmode;
211  boolean diffmode;
212  boolean deviationmode;
213  boolean annotation;
214  boolean searchmode;
215  boolean parsemode;
216  boolean keepmode;
217  boolean topfound;
218  boolean topadded;
219  boolean savetkc;
220  boolean docmode;
221  boolean trackmode;
222  boolean reparse;
223  boolean set_supported;
224  boolean res_dev;
225  boolean autoloadmode;
226  boolean in_grouping;
227  boolean in_yangdata;
228  boolean retmod_malloced;
229  boolean swaptop;
230  boolean freetop;
231  dlq_hdr_t allimpQ;
233  dlq_hdr_t *topfailedQ;
234  dlq_hdr_t *savedevQ;
235  dlq_hdr_t *savemodQ;
239  dlq_hdr_t impchainQ;
240  dlq_hdr_t failedQ;
242 } yang_pcb_t;
243 
244 
245 /********************************************************************
246 * *
247 * F U N C T I O N S *
248 * *
249 *********************************************************************/
250 
251 
268 extern status_t
270  ncx_module_t *mod,
271  dlq_hdr_t *appinfoQ);
272 
273 
289 extern status_t
291  ncx_module_t *mod,
292  xmlChar **field);
293 
294 
311 extern status_t
313  ncx_module_t *mod,
314  xmlChar **prefix,
315  xmlChar **field);
316 
317 
335 extern status_t
337  ncx_module_t *mod,
338  xmlChar **field);
339 
340 
358 extern status_t
360  ncx_module_t *mod,
361  xmlChar **field);
362 
363 
384 extern status_t
386  ncx_module_t *mod,
387  xmlChar **prefix,
388  xmlChar **field);
389 
390 
415 extern status_t
417  ncx_module_t *mod,
418  ncx_errinfo_t *errinfo,
419  dlq_hdr_t *appinfoQ,
420  boolean allow_modifier,
421  boolean *gotinverted);
422 
423 
444 extern status_t
446  ncx_module_t *mod,
447  xmlChar **str,
448  boolean *dupflag,
449  dlq_hdr_t *appinfoQ);
450 
451 
478 extern status_t
480  ncx_module_t *mod,
481  xmlChar **prefixstr,
482  xmlChar **str,
483  boolean *dupflag,
484  dlq_hdr_t *appinfoQ);
485 
486 
487 
508 extern status_t
510  ncx_module_t *mod,
511  xmlChar **str,
512  boolean *dupflag,
513  dlq_hdr_t *appinfoQ);
514 
515 
536 extern status_t
538  ncx_module_t *mod,
539  ncx_status_t *status,
540  boolean *dupflag,
541  dlq_hdr_t *appinfoQ);
542 
543 
564 extern status_t
566  ncx_module_t *mod,
567  boolean *ordsys,
568  boolean *dupflag,
569  dlq_hdr_t *appinfoQ);
570 
571 
592 extern status_t
594  ncx_module_t *mod,
595  uint32 *maxelems,
596  boolean *dupflag,
597  dlq_hdr_t *appinfoQ);
598 
599 
620 extern status_t
622  ncx_module_t *mod,
623  dlq_hdr_t *mustQ,
624  dlq_hdr_t *appinfoQ,
625  boolean do_parse);
626 
627 
649 extern status_t
651  ncx_module_t *mod,
652  obj_template_t *obj,
653  boolean *whenflag);
654 
655 
656 
676 extern status_t
678  ncx_module_t *mod,
679  boolean *boolval,
680  boolean *dupflag,
681  dlq_hdr_t *appinfoQ);
682 
683 
703 extern status_t
705  ncx_module_t *mod,
706  int32 *num,
707  boolean *dupflag,
708  dlq_hdr_t *appinfoQ);
709 
710 
731 extern status_t
733  ncx_module_t *mod,
734  uint32 *num,
735  boolean *dupflag,
736  dlq_hdr_t *appinfoQ);
737 
738 
759 extern status_t
761  ncx_module_t *mod,
762  boolean *dupflag,
763  dlq_hdr_t *appinfoQ);
764 
765 
782 extern status_t
784  tk_chain_t *tkc,
785  ncx_module_t *mod,
786  const xmlChar *prefix,
787  const xmlChar *name,
788  ncx_error_t *tkerr,
789  typ_template_t **typ);
790 
791 
808 extern status_t
810  tk_chain_t *tkc,
811  ncx_module_t *mod,
812  const xmlChar *prefix,
813  const xmlChar *name,
814  ncx_error_t *tkerr,
815  grp_template_t **grp);
816 
817 
834 extern status_t
836  tk_chain_t *tkc,
837  ncx_module_t *mod,
838  const xmlChar *prefix,
839  const xmlChar *name,
840  ncx_error_t *tkerr,
841  ext_template_t **ext);
842 
843 
860 extern status_t
862  tk_chain_t *tkc,
863  ncx_module_t *mod,
864  const xmlChar *prefix,
865  const xmlChar *name,
866  ncx_error_t *tkerr,
867  ncx_feature_t **feature);
868 
869 
886 extern status_t
888  tk_chain_t *tkc,
889  ncx_module_t *mod,
890  const xmlChar *prefix,
891  const xmlChar *name,
892  ncx_error_t *tkerr,
893  ncx_identity_t **identity);
894 
895 
910 extern void
912  ncx_module_t *mod,
913  dlq_hdr_t *typeQ,
914  dlq_hdr_t *grpQ);
915 
916 
930 extern void
932  ncx_module_t *mod);
933 
934 
940 extern yang_node_t *
941  yang_new_node (void);
942 
943 
949 extern void
950  yang_free_node (yang_node_t *node);
951 
952 
958 extern void
959  yang_clean_nodeQ (dlq_hdr_t *que);
960 
961 
970 extern yang_node_t *
971  yang_find_node (const dlq_hdr_t *que,
972  const xmlChar *name,
973  const xmlChar *revision);
974 
975 
982 extern void
983  yang_dump_nodeQ (dlq_hdr_t *que,
984  const char *name);
985 
986 
992 extern yang_pcb_t *
993  yang_new_pcb (void);
994 
995 
1001 extern void
1002  yang_free_pcb (yang_pcb_t *pcb);
1003 
1004 
1011 extern yang_stmt_t *
1013 
1014 
1021 extern yang_stmt_t *
1023 
1024 
1025 
1032 extern yang_stmt_t *
1034 
1035 
1042 extern yang_stmt_t *
1044 
1045 
1052 extern yang_stmt_t *
1053  yang_new_id_stmt (ncx_identity_t *identity);
1054 
1055 
1062 extern yang_stmt_t *
1064 
1065 
1072 extern yang_stmt_t *
1074 
1075 
1081 extern void
1082  yang_free_stmt (yang_stmt_t *stmt);
1083 
1084 
1090 extern void
1091  yang_clean_stmtQ (dlq_hdr_t *que);
1092 
1093 
1112 extern status_t
1114  ncx_module_t *mod,
1115  ncx_error_t *tkerr,
1116  const xmlChar *datestr);
1117 
1118 
1126 extern void
1128  ncx_module_t *mod);
1129 
1130 
1137 extern boolean
1138  yang_top_keyword (const xmlChar *keyword);
1139 
1140 
1151 extern yang_import_ptr_t *
1152  yang_new_import_ptr (const xmlChar *modname,
1153  const xmlChar *modprefix,
1154  const xmlChar *revision,
1155  const xmlChar *descr,
1156  const xmlChar *ref);
1157 
1158 
1164 extern void
1166 
1167 
1173 extern void
1174  yang_clean_import_ptrQ (dlq_hdr_t *que);
1175 
1176 
1184 extern yang_import_ptr_t *
1185  yang_find_import_ptr (dlq_hdr_t *que,
1186  const xmlChar *name);
1187 
1188 
1201 extern int32
1202  yang_compare_revision_dates (const xmlChar *revstring1,
1203  const xmlChar *revstring2);
1204 
1205 
1216 extern xmlChar *
1217  yang_make_filename (const xmlChar *modname,
1218  const xmlChar *revision,
1219  boolean isyang);
1220 
1221 
1234 extern status_t
1235  yang_copy_filename (const xmlChar *modname,
1236  const xmlChar *revision,
1237  xmlChar *buffer,
1238  uint32 bufflen,
1239  boolean isyang);
1240 
1241 
1252 extern boolean
1253  yang_split_filename (const xmlChar *filename,
1254  uint32 *modnamelen);
1255 
1256 
1264 extern boolean
1265  yang_fileext_is_yang (const xmlChar *filename);
1266 
1267 
1275 extern boolean
1276  yang_fileext_is_yin (const xmlChar *filename);
1277 
1278 
1286 extern boolean
1287  yang_fileext_is_xml (const xmlChar *filename);
1288 
1289 
1294 extern void
1295  yang_final_memcheck (void);
1296 
1297 
1304 extern void
1305  yang_set_in_yangdata (yang_pcb_t *pcb, boolean val);
1306 
1307 
1314 extern boolean
1315  yang_is_in_yangdata (const yang_pcb_t *pcb);
1316 
1317 
1330 extern status_t
1331  yang_extract_filespec_info (const char *filespec,
1332  xmlChar **modname,
1333  xmlChar **revision,
1334  boolean *isyang);
1335 
1336 
1343 extern void
1345 
1346 
1351 #ifdef __cplusplus
1352 } /* end extern 'C' */
1353 #endif
1354 
1355 #endif /* _H_yang */
ncx_feature_t * feature
feature-stmt
Definition: yang.h:140
boolean yang_top_keyword(const xmlChar *keyword)
Check if the string is a top-level YANG keyword.
Definition: yang.c:3464
status_t yang_consume_int32(tk_chain_t *tkc, ncx_module_t *mod, int32 *num, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one int32 clause Parse the int32 based parameter statement
Definition: yang.c:1833
xmlChar * ref
import reference
Definition: yang.h:167
status_t yang_consume_when(tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj, boolean *whenflag)
consume one when-stmt into obj->when
Definition: yang.c:1557
struct ncx_module_t_ * parentparm
parent passed for submodule
Definition: yang.h:207
void yang_free_import_ptr(yang_import_ptr_t *impptr)
Delete a YANG import pointer node.
Definition: yang.c:3578
boolean yang_fileext_is_yang(const xmlChar *filename)
Check if the filespec ends with the .yang extension.
Definition: yang.c:3920
boolean yang_split_filename(const xmlChar *filename, uint32 *modnamelen)
Split a module parameter into its filename components.
Definition: yang.c:3848
void yang_free_pcb(yang_pcb_t *pcb)
Delete a YANG parser control block.
Definition: yang.c:2896
Data Object Support.
dlq provides general double-linked list and queue support:
boolean set_supported
TRUE: load, FALSE: import only.
Definition: yang.h:223
void yang_skip_statement(tk_chain_t *tkc, ncx_module_t *mod)
Skip past the current invalid statement, starting at an invalid keyword.
Definition: yang.c:3406
YANG Extension Handler.
status_t yang_consume_status(tk_chain_t *tkc, ncx_module_t *mod, ncx_status_t *status, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one status clause
Definition: yang.c:1114
status_t yang_consume_nowsp_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume 1 string without any whitespace
Definition: yang.c:432
const xmlChar * revision
back-ptr to rev to match
Definition: yang.h:208
xmlChar * failedrev
saved revision for failed entries
Definition: yang.h:154
struct ncx_module_t_ * top
top-level file
Definition: yang.h:205
void yang_free_stmt(yang_stmt_t *stmt)
Delete a YANG statement node.
Definition: yang.c:3184
typ_template_t * typ
typdef-stmt
Definition: yang.h:135
boolean diffmode
TRUE = yangdiff old ver.
Definition: yang.h:211
xmlChar * failed
saved name for failed entries
Definition: yang.h:153
status_t yang_consume_strclause(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **str, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one normative string clause
Definition: yang.c:1046
boolean parsemode
TRUE if full parse but no reg-load.
Definition: yang.h:215
xmlChar * modname
import module name
Definition: yang.h:163
yang_node_t * yang_new_node(void)
Create a new YANG parser node.
Definition: yang.c:2658
One YANG data-def-stmt.
Definition: obj.h:1140
void yang_clean_pcb_top(yang_pcb_t *pcb)
Make sure pcb->top is freed before the pcb is reused after the bestmatch failed and NULL revision is ...
Definition: yang.c:4175
boolean topfound
TRUE if top found, not added.
Definition: yang.h:217
status_t res
saved result for &#39;failed&#39;
Definition: yang.h:155
status_t yang_validate_date_string(tk_chain_t *tkc, ncx_module_t *mod, ncx_error_t *tkerr, const xmlChar *datestr)
Validate a YANG date string for a revision entry.
Definition: yang.c:3247
status_t yang_consume_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume 1 string token
Definition: yang.c:227
tk_chain_t * tkc
live or NULL parse chain
Definition: yang.h:236
xmlChar * descr
import module revision date
Definition: yang.h:166
status_t yang_find_imp_extension(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, ext_template_t **ext)
Find the specified imported extension.
Definition: yang.c:2233
boolean deviationmode
TRUE if keeping deviations only.
Definition: yang.h:212
yang_stmt_t * yang_new_ext_stmt(ext_template_t *ext)
Create a new YANG stmt node for an extension.
Definition: yang.c:3011
boolean annotation
TRUE if deviation really annotation.
Definition: yang.h:213
boolean yang_is_in_yangdata(const yang_pcb_t *pcb)
Get the in_yangdata mode.
Definition: yang.c:4059
ncx_module_t * submod
submod for allincQ
Definition: yang.h:152
yang_stmt_t * yang_new_feature_stmt(ncx_feature_t *feature)
Create a new YANG stmt node for a feature definition.
Definition: yang.c:3116
struct ncx_module_t_ * retmod
nested [sub]mod being returned
Definition: yang.h:206
const xmlChar * name
module name in imp/inc/failed
Definition: yang.h:149
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1052
yang_node_t * yang_find_node(const dlq_hdr_t *que, const xmlChar *name, const xmlChar *revision)
Find a YANG parser node in the specified Q.
Definition: yang.c:2763
void yang_set_in_yangdata(yang_pcb_t *pcb, boolean val)
Set the in_yangdata mode.
Definition: yang.c:4046
boolean yang_fileext_is_yin(const xmlChar *filename)
Check if the filespec ends with the .yin extension.
Definition: yang.c:3958
status_t yang_find_imp_typedef(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, typ_template_t **typ)
Find the specified imported typedef.
Definition: yang.c:2075
YANG deviation statement struct.
Definition: obj.h:1345
pointer to failed modules to track all of them Prevents loading a broken module multiple times ...
Definition: yang.h:174
boolean with_submods
include submodules
Definition: yang.h:209
grp_template_t * grp
grouping-stmt
Definition: yang.h:136
status_t status
reason for failure
Definition: yang.h:178
void yang_clean_import_ptrQ(dlq_hdr_t *que)
Delete all the node entries in a YANG import pointer node Q.
Definition: yang.c:3618
yang_stmttype_t stmttype
statement type
Definition: yang.h:131
called from top level [sub]module
Definition: yang.h:106
status_t yang_find_imp_identity(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, ncx_identity_t **identity)
Find the specified imported identity.
Definition: yang.c:2400
yang_parsetype_t
YANG parser mode entry types.
Definition: yang.h:104
boolean searchmode
TRUE if just getting ns & version.
Definition: yang.h:214
YANG module data structures Many internal representations of YANG module constructs.
boolean in_grouping
T: resolving datadefs in a grouping.
Definition: yang.h:226
xmlChar * yang_make_filename(const xmlChar *modname, const xmlChar *revision, boolean isyang)
Malloc and construct a YANG filename.
Definition: yang.c:3722
struct to remember error info tkc->cur_err will be checked before tkc->cur for error information ...
Definition: ncxtypes.h:812
boolean keepmode
TRUE to keep new mod even if loaded.
Definition: yang.h:216
status_t yang_find_imp_feature(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, ncx_feature_t **feature)
Find the specified imported feature.
Definition: yang.c:2315
token parsing chain (main parser control block)
Definition: tk.h:415
yang_import_ptr_t * yang_new_import_ptr(const xmlChar *modname, const xmlChar *modprefix, const xmlChar *revision, const xmlChar *descr, const xmlChar *ref)
Create a new YANG import pointer node.
Definition: yang.c:3509
called from module import-stmt
Definition: yang.h:108
yang_stmt_t * yang_new_obj_stmt(obj_template_t *obj)
Create a new YANG stmt node for an object.
Definition: yang.c:3046
YANG feature entry.
Definition: ncxtypes.h:953
status_t yang_consume_descr(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **str, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one descriptive string clause
Definition: yang.c:887
boolean freetop
T: keeptop=T and wasadd=F and top=live mem.
Definition: yang.h:230
boolean in_yangdata
T: resolving datadefs in rc:yang-data.
Definition: yang.h:227
status_t yang_consume_boolean(tk_chain_t *tkc, ncx_module_t *mod, boolean *boolval, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one boolean clause Parse the boolean parameter based statement
Definition: yang.c:1741
ncx_module_t * mod
back-ptr to module w/ imp/inc
Definition: yang.h:151
yang_import_ptr_t * yang_find_import_ptr(dlq_hdr_t *que, const xmlChar *name)
Find a YANG import pointer node in the specified Q.
Definition: yang.c:3650
const xmlChar * revision
revision date in imp/inc/failed
Definition: yang.h:150
yang_stmt_t * yang_new_deviation_stmt(obj_deviation_t *deviation)
Create a new YANG stmt node for a deviation definition.
Definition: yang.c:3151
xmlChar * revision
module revision
Definition: yang.h:177
boolean reparse
TRUE if trackmode + mod already parsed.
Definition: yang.h:222
ncx_identity_t * identity
identity-stmt
Definition: yang.h:139
One YANG &#39;grouping&#39; definition – sibling set template.
Definition: grp.h:87
status_t yang_copy_filename(const xmlChar *modname, const xmlChar *revision, xmlChar *buffer, uint32 bufflen, boolean isyang)
Construct a YANG filename into a provided buffer.
Definition: yang.c:3786
boolean topadded
TRUE if top in registry; F: need free.
Definition: yang.h:218
status_t yang_consume_modifier(tk_chain_t *tkc, ncx_module_t *mod, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one modifier-stmt
Definition: yang.c:1998
status_t
global error return code
Definition: status_enum.h:186
status_t yang_consume_max_elements(tk_chain_t *tkc, ncx_module_t *mod, uint32 *maxelems, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one max-elements clause
Definition: yang.c:1290
status_t yang_consume_uint32(tk_chain_t *tkc, ncx_module_t *mod, uint32 *num, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one uint32 clause
Definition: yang.c:1916
void yang_clean_nodeQ(dlq_hdr_t *que)
Delete all the node entries in a YANG parser node Q.
Definition: yang.c:2730
status_t yang_consume_ordered_by(tk_chain_t *tkc, ncx_module_t *mod, boolean *ordsys, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one ordered-by clause
Definition: yang.c:1201
these node pointers are back-pointers and not malloced here
Definition: yang.h:134
xmlChar * modprefix
import module prefix
Definition: yang.h:164
status_t yang_consume_pid_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **prefix, xmlChar **field)
consume an identifier-ref-str token
Definition: yang.c:580
xmlChar * modname
module name
Definition: yang.h:176
status_t yang_consume_error_stmts(tk_chain_t *tkc, ncx_module_t *mod, ncx_errinfo_t *errinfo, dlq_hdr_t *appinfoQ, boolean allow_modifier, boolean *gotinverted)
consume the range.
Definition: yang.c:751
void yang_final_memcheck(void)
Check the node malloc and free counts.
Definition: yang.c:4027
status_t yang_find_imp_grouping(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, const xmlChar *prefix, const xmlChar *name, ncx_error_t *tkerr, grp_template_t **grp)
Find the specified imported grouping.
Definition: yang.c:2154
YANG node entry to track if a module has been used already.
Definition: yang.h:147
yang_stmt_t * yang_new_grp_stmt(grp_template_t *grp)
Create a new YANG stmt node for a grouping.
Definition: yang.c:2976
int32 yang_compare_revision_dates(const xmlChar *revstring1, const xmlChar *revstring2)
Compare 2 revision strings, which either may be NULL.
Definition: yang.c:3690
NCX Syntax Token Handler.
Global error messages for status code enumerations.
yang_pcb_t * yang_new_pcb(void)
Create a new YANG parser control block.
Definition: yang.c:2861
Parameter Type Handler.
yang_stmt_t * yang_new_id_stmt(ncx_identity_t *identity)
Create a new YANG stmt node for an identity.
Definition: yang.c:3081
not set
Definition: yang.h:105
void yang_free_node(yang_node_t *node)
Clean and delete the memory for a YANG parser node.
Definition: yang.c:2690
boolean autoloadmode
TRUE if yangcli autoload.
Definition: yang.h:225
One YANG &#39;typedef&#39; definition – top-level type template.
Definition: typ.h:477
status_t yang_consume_pid(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **prefixstr, xmlChar **str, boolean *dupflag, dlq_hdr_t *appinfoQ)
consume one [prefix:]name clause
Definition: yang.c:966
status_t yang_consume_must(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *mustQ, dlq_hdr_t *appinfoQ, boolean do_parse)
consume one must-stmt into mustQ
Definition: yang.c:1360
boolean savetkc
TRUE if tkc should be kept in tkc.
Definition: yang.h:219
void yang_check_imports_used(tk_chain_t *tkc, ncx_module_t *mod)
generate warnings if imports not used
Definition: yang.c:2572
YANG error info statement struct used to override default error handling in the server.
Definition: ncxtypes.h:1250
boolean swaptop
T: keepmode found top already so swap.
Definition: yang.h:229
ext_template_t * ext
extension-stmt
Definition: yang.h:137
YANG import pointer node to track all imports used.
Definition: yang.h:161
boolean docmode
TRUE if saving strings in origtkQ.
Definition: yang.h:220
called from module include-stmt
Definition: yang.h:107
YANG identity entry.
Definition: ncxtypes.h:1025
status_t yang_consume_semiapp(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ)
consume a stmtsep clause
Definition: yang.c:145
ncx_error_t tkerr
file and line infor for compiler
Definition: yang.h:156
obj_template_t * obj
data-def-stmt
Definition: yang.h:138
boolean stmtmode
save top-level stmt order
Definition: yang.h:210
boolean trackmode
TRUE if yangdump to track re-parse.
Definition: yang.h:221
One YANG &#39;extension&#39; definition – language extension template.
Definition: ext.h:130
void yang_check_obj_used(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *typeQ, dlq_hdr_t *grpQ)
generate warnings if local typedefs/groupings not used
Definition: yang.c:2503
YANG Grouping Statement Handler.
YANG statement node to track top-level statement order for doc output.
Definition: yang.h:126
boolean yang_fileext_is_xml(const xmlChar *filename)
Check if the filespec ends with the .xml extension.
Definition: yang.c:3996
ncx_status_t
enumeration for different YANG data-def status values
Definition: ncxtypes.h:570
obj_deviation_t * deviation
deviation-stmt
Definition: yang.h:141
void yang_dump_nodeQ(dlq_hdr_t *que, const char *name)
log_debug output for contents of the specified nodeQ
Definition: yang.c:2805
YANG parser control block.
Definition: yang.h:204
void yang_clean_stmtQ(dlq_hdr_t *que)
Delete a Q of YANG statement node.
Definition: yang.c:3208
boolean res_dev
TRUE: currently resolving a deviation.
Definition: yang.h:224
status_t yang_consume_keyword(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **prefix, xmlChar **field)
consume 1 YANG keyword or vendor extension keyword
Definition: yang.c:336
boolean retmod_malloced
T: if retmod live ncx_new_module.
Definition: yang.h:228
status_t yang_extract_filespec_info(const char *filespec, xmlChar **modname, xmlChar **revision, boolean *isyang)
Split a filespec into its filename components.
Definition: yang.c:4084
yang_stmt_t * yang_new_typ_stmt(typ_template_t *typ)
Create a new YANG stmt node for a typedef.
Definition: yang.c:2941
status_t yang_consume_id_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume an identifier-str token
Definition: yang.c:509