yumapro  21.10-3
YumaPro SDK
tk.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2020, 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_tk
13 #define _H_tk
14 
15 /* FILE: tk.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 
34 date init comment
35 ----------------------------------------------------------------------
36 12-nov-05 abb Begun
37 
38 */
39 
40 #include <xmlstring.h>
41 
42 #ifndef _H_dlq
43 #include "dlq.h"
44 #endif
45 
46 #ifndef _H_ncxtypes
47 #include "ncxtypes.h"
48 #endif
49 
50 #ifndef _H_xmlns
51 #include "xmlns.h"
52 #endif
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 /********************************************************************
59 * *
60 * C O N S T A N T S *
61 * *
62 *********************************************************************/
63 
76 #define TK_BUFF_SIZE 0xffff
77 
78 
79 
80  /******************** tk_token_t macros ******************/
81 
82 /* macros for quick processing of token chains
83  * All these macros take 1 parameter
84  * INPUTS:
85  * T == pointer to the tk_chain_t in progress
86  */
87 
89 #define TK_NEXT(T) ((tk_token_t *)dlq_nextEntry(T))
90 
92 #define TK_TYP(T) ((T)->typ)
93 
95 #define TK_ID(T) ((T)->typ==TK_TT_TSTRING || (T)->typ==TK_TT_MSTRING)
96 
98 #define TK_VAL(T) (T)->val
99 
101 #define TK_NSID(T) (T)->nsid
102 
104 #define TK_MOD(T) (T)->mod
105 
107 #define TK_ADV(T) \
108  ((T)->cur ? (((T)->cur = (tk_token_t *)dlq_nextEntry((T)->cur)) \
109  ? NO_ERR : ERR_NCX_EOF) : ERR_NCX_EOF)
110 
112 #define TK_BKUP(T) \
113  if (! ((T)->cur = (tk_token_t *)dlq_prevEntry((T)->cur))) \
114  (T)->cur = (tk_token_t *)&((T)->tkQ)
115 
116 
117 
118  /******************** tk_chain_t macros ******************/
119 
120 
122 #define TK_CUR(T) ((T)->cur)
123 
125 #define TK_CUR_TYP(T) ((T)->cur->typ)
126 
128 #define TK_CUR_VAL(T) ((T)->cur->val)
129 
131 #define TK_CUR_LEN(T) ((T)->cur->len)
132 
134 #define TK_CUR_MOD(T) (T)->cur->mod
135 
137 #define TK_CUR_MODLEN(T) ((T)->cur->modlen)
138 
140 #define TK_CUR_STR(T) ((T)->cur->typ >= TK_TT_STRING && \
141  (T)->cur->typ <= TK_TT_SQSTRING)
142 
144 #define TK_TYP_STR(T) ((T) >= TK_TT_STRING && (T) <= TK_TT_SQSTRING)
145 
147 #define TK_CUR_NOWSTR(T) ((T)->cur->typ >= TK_TT_STRING && \
148  (T)->cur->typ <= TK_TT_SQSTRING)
149 
151 #define TK_CUR_NUM(T) ((T)->cur->typ==TK_TT_DNUM || \
152  (T)->cur->typ==TK_TT_HNUM || \
153  (T)->cur->typ==TK_TT_RNUM)
154 
155 
157 #define TK_TYP_NUM(T) (((T) >= TK_TT_DNUM) && ((T) <= TK_TT_RNUM))
158 
159 
161 #define TK_CUR_INUM(T) ((T)->cur->typ==TK_TT_DNUM || \
162  (T)->cur->typ==TK_TT_HNUM)
163 
165 #define TK_CUR_IQUAL(T) ((T)->cur->typ==TK_TT_QMARK || \
166  (T)->cur->typ==TK_TT_STAR || \
167  (T)->cur->typ==TK_TT_PLUS)
168 
169 
171 #define TK_CUR_ID(T) ((T)->cur->typ==TK_TT_TSTRING || \
172  (T)->cur->typ==TK_TT_MSTRING)
173 
175 #define TK_CUR_SID(T) ((T)->cur->typ==TK_TT_SSTRING || \
176  (T)->cur->typ==TK_TT_MSSTRING)
177 
179 #define TK_CUR_LNUM(T) ((T)->cur->linenum)
180 
182 #define TK_CUR_LPOS(T) ((T)->cur->linepos)
183 
188 #define TK_CUR_TEXT(T) (((T)->cur->typ == TK_TT_STRING) || \
189  ((T)->cur->typ >= TK_TT_SSTRING && \
190  (T)->cur->typ <= TK_TT_RNUM))
191 
192 
194 #define TK_CUR_NSID(T) (T)->cur->nsid
195 
197 #define TK_DOCMODE(TKC) ((TKC)->flags & TK_FL_DOCMODE)
198 
200 #define TK_HAS_ORIGTK(TK) (((TK)->typ == TK_TT_QSTRING || \
201  (TK)->typ == TK_TT_SQSTRING) && \
202  (TK)->origval != NULL)
203 
205 #define TK_SET_ESCERR(TK) (TK)->flags |= TK_FL_ESCSTR_ERR
206 
208 #define TK_GET_ESCERR(TK) ((TK)->flags & TK_FL_ESCSTR_ERR)
209 
210 
217 #define TK_FL_REDO bit0
218 
225 #define TK_FL_MALLOC bit1
226 
233 #define TK_FL_DOCMODE bit2
234 
235 
242 #define TK_FL_BINARYMODE bit3
243 
244 
250 #define TK_FL_ESCSTR_ERR bit4
251 
252 
253 
259 #define TK_FL_VAL_MALLOC bit0
260 
261 
266 #define TK_FL_ORIGVAL_MALLOC bit1
267 
268 
269 #define TK_VALBUFF_LEN 8
270 
271 
272 /********************************************************************
273 * *
274 * T Y P E S *
275 * *
276 *********************************************************************/
277 
279 typedef enum tk_type_t_ {
280  TK_TT_NONE,
281  /* PUT ALL 1-CHAR TOKENS FIRST */
302  /* PUT ALL 2-CHAR TOKENS SECOND */
311  /* PUT ALL STRING CLASSIFICATION TOKENS THIRD */
326  /* PUT ALL NUMBER CLASSIFICATION TOKENS FOURTH */
331  /* PUT ALL SPECIAL CASE TOKENS LAST */
333 } tk_type_t;
334 
335 
337 typedef enum tk_source_t_ {
345  TK_SOURCE_CLI
346 } tk_source_t;
347 
348 
350 typedef enum tk_origstr_typ_t_ {
351  TK_ORIGSTR_NONE,
357 
358 
363 typedef struct tk_origstr_t_ {
364  dlq_hdr_t qhdr;
365  tk_origstr_typ_t origtyp;
366  xmlChar *str;
367 } tk_origstr_t;
368 
369 
371 typedef struct tk_token_t_ {
372  dlq_hdr_t qhdr;
373  tk_type_t typ;
374  xmlChar *mod;
375  uint32 modlen;
376  xmlChar *val;
377  xmlChar *origval;
378  uint32 len;
379  uint32 linenum;
380  uint32 linepos;
382  dlq_hdr_t origstrQ;
383  xmlChar valbuff[TK_VALBUFF_LEN];
384  uint8 flags;
385 } tk_token_t;
386 
387 
391 typedef struct tk_token_ptr_t_ {
392  dlq_hdr_t qhdr;
394  const void *field;
396 
397 
407 typedef status_t
408  (*tk_getline_fn_t) (xmlChar *fillbuff,
409  uint32 fillbuffsize,
410  void *cookie);
411 
412 
413 
415 typedef struct tk_chain_t_ {
416  dlq_hdr_t qhdr;
417  dlq_hdr_t tkQ;
418  dlq_hdr_t tkptrQ;
422  const xmlChar *filename;
423  FILE *fp;
424  xmlChar *buff;
425  xmlChar *bptr;
426  uint32 linenum;
427  uint32 linepos;
428  uint32 flags;
429  tk_source_t source;
431  void *cookie;
432  xmlChar escerr_ch;
433 } tk_chain_t;
434 
435 
436 /********************************************************************
437 * *
438 * F U N C T I O N S *
439 * *
440 *********************************************************************/
441 
442 
448 extern tk_chain_t *
449  tk_new_chain (void);
450 
451 
459 extern void
461  FILE *fp,
462  const xmlChar *filename);
463 
464 
472 extern void
474  xmlChar *line);
475 
476 
486 extern void
488  xmlChar *str);
489 
496 extern void
498  xmlChar *str);
499 
500 
508 extern void
510  FILE *fp,
511  const xmlChar *filename);
512 
513 
520 extern void
522  const xmlChar *filename);
523 
524 
532 extern void
534  FILE *fp,
535  const xmlChar *filename);
536 
537 
544 extern void
546  xmlChar *buff);
547 
548 
556 extern void
558  tk_getline_fn_t getline_fn,
559  void *cookie);
560 
561 
567 extern void
569 
570 
577 extern void
579  xmlChar *str);
580 
581 
587 extern void
588  tk_free_chain (tk_chain_t *tkc);
589 
590 
599 extern ncx_btype_t
600  tk_get_yang_btype_id (const xmlChar *buff,
601  uint32 len);
602 
603 
610 extern const char *
611  tk_get_token_name (tk_type_t ttyp);
612 
613 
620 extern const char *
621  tk_get_token_sym (tk_type_t ttyp);
622 
623 
630 extern const char *
632 
633 
640 extern tk_type_t
641  tk_next_typ (tk_chain_t *tkc);
642 
643 
650 extern tk_type_t
651  tk_next_typ2 (tk_chain_t *tkc);
652 
653 
660 extern boolean
662 
663 
670 extern const xmlChar *
671  tk_next_val (tk_chain_t *tkc);
672 
673 
680 extern void
681  tk_dump_token (const tk_token_t *tk);
682 
683 
690 extern void
691  tk_dump_chain (const tk_chain_t *tkc);
692 
693 
701 extern boolean
702  tk_is_wsp_string (const tk_token_t *tk);
703 
704 
734 extern status_t
736  ncx_module_t *mod);
737 
738 
749 extern status_t
751  ncx_module_t *mod);
752 
753 
765 extern tk_chain_t *
767  xmlChar *str,
768  status_t *res);
769 
770 
783 extern tk_chain_t *
785  xmlChar *str,
786  uint32 curlinenum,
787  uint32 curlinepos,
788  status_t *res);
789 
790 
797 extern uint32
798  tk_token_count (const tk_chain_t *tkc);
799 
800 
806 extern void
807  tk_reset_chain (tk_chain_t *tkc);
808 
809 
818 extern tk_chain_t *
819  tk_clone_chain (tk_chain_t *oldtkc);
820 
821 
829 extern status_t
831  const xmlChar *valstr);
832 
833 
844 extern status_t
846  const xmlChar *prefix,
847  uint32 prefixlen,
848  const xmlChar *valstr);
849 
850 
858 extern status_t
860  const xmlChar *valstr);
861 
862 
869 extern status_t
871 
872 
879 extern status_t
881 
882 
889 extern status_t
891 
892 
902 extern status_t
904  tk_token_t *tk,
905  const void *field);
906 
907 
923 extern const xmlChar *
924  tk_get_first_origstr (const tk_token_ptr_t *tkptr,
925  boolean *dquote,
926  boolean *morestr);
927 
928 
935 extern const tk_origstr_t *
936  tk_first_origstr_rec (const tk_token_ptr_t *tkptr);
937 
938 
945 extern const tk_origstr_t *
946  tk_next_origstr_rec (const tk_origstr_t *origstr);
947 
948 
964 extern const xmlChar *
965  tk_get_origstr_parts (const tk_origstr_t *origstr,
966  boolean *dquote,
967  boolean *newline);
968 
969 
977 extern const tk_token_ptr_t *
978  tk_find_tkptr (const tk_chain_t *tkc,
979  const void *field);
980 
981 
989 extern uint32
990  tk_tkptr_quotes (const tk_token_ptr_t *tkptr);
991 
992 
999 extern boolean
1000  tk_cur_is_first (const tk_chain_t *tkc);
1001 
1002 
1006 #ifdef __cplusplus
1007 } /* end extern 'C' */
1008 #endif
1009 
1010 #endif /* _H_tk */
uint32 tk_tkptr_quotes(const tk_token_ptr_t *tkptr)
Get the specified token pointer record token ID type Use the first string or only string...
Definition: tk.c:4567
minus char &#39;-&#39;
Definition: tk.h:298
status_t tk_add_semicol_token(tk_chain_t *tkc)
Allocatate a new semi-colon token and add it to the parse chain.
Definition: tk.c:4332
each entry in the origstrQ is the 2nd through Nth string to be concated.
Definition: tk.h:363
dlq provides general double-linked list and queue support:
double quoted string
Definition: tk.h:318
XPath varbind &#39;$NCName&#39;.
Definition: tk.h:321
tk_chain_t * tk_clone_chain(tk_chain_t *oldtkc)
Allocatate and a new token parse chain and fill it with the specified token chain contents...
Definition: tk.c:4068
status_t tk_add_string_token(tk_chain_t *tkc, const xmlChar *valstr)
Allocatate a new string token and add it to the parse chain.
Definition: tk.c:4216
tk_chain_t * tk_tokenize_xpath_string(ncx_module_t *mod, xmlChar *str, uint32 curlinenum, uint32 curlinepos, status_t *res)
The specified XPath string is parsed into tokens.
Definition: tk.c:3980
void * cookie
getline callback cookie
Definition: tk.h:431
uint32 linepos
current line position
Definition: tk.h:427
XPath varbind &#39;$prefix:NCName&#39;.
Definition: tk.h:322
module-qualified scoped string
Definition: tk.h:317
const tk_origstr_t * tk_next_origstr_rec(const tk_origstr_t *origstr)
Get the next tk_origstr_t struct (if any)
Definition: tk.c:4472
uint32 tk_token_count(const tk_chain_t *tkc)
Get the number of tokens in the queue.
Definition: tk.c:4017
void tk_setup_chain_json_buffs(tk_chain_t *tkc, tk_getline_fn_t getline_fn, void *cookie)
Setup a previously allocated chain for a JSON buffer chain.
Definition: tk.c:3139
double quote
Definition: tk.h:352
tk_chain_t * tk_new_chain(void)
Allocatate a new token parse chain.
Definition: tk.c:2919
plus mark &#39;+&#39;
Definition: tk.h:294
YANG.
Definition: tk.h:339
status_t tk_check_save_origstr(tk_chain_t *tkc, tk_token_t *tk, const void *field)
Check the docmode and the specified token; Save a tk_origptr_t if needed with the field address...
Definition: tk.c:4368
xmlChar * mod
only used if prefix found
Definition: tk.h:374
xmlChar * buff
buffer when source is buffer
Definition: tk.h:424
const xmlChar * tk_get_origstr_parts(const tk_origstr_t *origstr, boolean *dquote, boolean *newline)
Get the fields from the original string record.
Definition: tk.c:4500
uint32 modlen
length of &#39;mod&#39;; not Z-string!
Definition: tk.h:375
period char &#39;.
Definition: tk.h:296
status_t tk_add_pid_token(tk_chain_t *tkc, const xmlChar *prefix, uint32 prefixlen, const xmlChar *valstr)
Allocatate a new prefixed ID token and add it to the parse chain.
Definition: tk.c:4175
bar &#39;|&#39;
Definition: tk.h:291
raw command line
Definition: tk.h:313
comma &#39;,&#39;
Definition: tk.h:289
uint32 linenum
current line number
Definition: tk.h:426
uint32 linepos
token source line osition
Definition: tk.h:380
const xmlChar * tk_next_val(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3464
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
token backptr to get at original token chain for strings used only by yangdump –format=yang|html ...
Definition: tk.h:391
greater than or equal &#39;>=&#39;
Definition: tk.h:308
tk_type_t
different types of tokens parsed during 1st pass
Definition: tk.h:279
scoped token string
Definition: tk.h:314
is significant in conf files
Definition: tk.h:332
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:900
2 colon chars &#39;::&#39;
Definition: tk.h:304
right paren &#39;)&#39;
Definition: tk.h:286
const char * tk_get_token_name(tk_type_t ttyp)
Get the symbolic token name.
Definition: tk.c:3280
void tk_dump_chain(const tk_chain_t *tkc)
Debug printf the token chain !!! Very verbose !!!
Definition: tk.c:3532
hex number
Definition: tk.h:328
RESTCONF fields parameter.
Definition: tk.h:343
tk_origstr_typ_t
preserve the original string type
Definition: tk.h:350
decimal number
Definition: tk.h:327
tk_token_t * tk
token
Definition: tk.h:393
colon char &#39;:&#39;
Definition: tk.h:295
boolean tk_is_wsp_string(const tk_token_t *tk)
Check if the current token is a string with whitespace in it.
Definition: tk.c:3582
uint8 flags
parsing state flags
Definition: tk.h:384
status_t tk_retokenize_cur_string(tk_chain_t *tkc, ncx_module_t *mod)
The current token is some sort of a string Reparse it according to the full YANG token list...
Definition: tk.c:3865
tk_getline_fn_t getline_fn
getline callback
Definition: tk.h:430
void tk_setup_chain_conf(tk_chain_t *tkc, FILE *fp, const xmlChar *filename)
Setup a previously allocated chain for a text config file.
Definition: tk.c:2945
star &#39;*&#39;
Definition: tk.h:292
status_t tk_add_id_token(tk_chain_t *tkc, const xmlChar *valstr)
Allocatate a new ID token and add it to the parse chain.
Definition: tk.c:4131
YANG module data structures Many internal representations of YANG module constructs.
JSON.
Definition: tk.h:342
struct to remember error info tkc->cur_err will be checked before tkc->cur for error information ...
Definition: ncxtypes.h:660
token parsing chain (main parser control block)
Definition: tk.h:415
xmlChar * bptr
current read buffer pointer
Definition: tk.h:425
xmlChar * val
value string for token if buffer too snall
Definition: tk.h:376
greater than char &#39;>&#39;
Definition: tk.h:300
tk_token_t * escerr_tk
backptr into tkQ
Definition: tk.h:420
void tk_setup_chain_fields(tk_chain_t *tkc, xmlChar *str)
Setup a previously allocated chain for &#39;fields&#39; RESTCONF query parameter str value.
Definition: tk.c:2997
tk_source_t
token source context
Definition: tk.h:337
left brace &#39;{&#39;
Definition: tk.h:282
const tk_token_ptr_t * tk_find_tkptr(const tk_chain_t *tkc, const void *field)
Find the specified token pointer record.
Definition: tk.c:4531
const xmlChar * filename
filename when source is file
Definition: tk.h:422
void tk_setup_chain_yin(tk_chain_t *tkc, const xmlChar *filename)
Setup a previously allocated chain for a YIN file.
Definition: tk.c:3069
void tk_setup_chain_feature(tk_chain_t *tkc, xmlChar *str)
Setup a previously allocated chain for &#39;if-feature&#39; YANG 1.1.
Definition: tk.c:3021
void tk_setup_chain_docmode(tk_chain_t *tkc)
Setup a previously allocated chain for a yangdump docmode output.
Definition: tk.c:3163
equal sign &#39;=&#39;
Definition: tk.h:290
tk_chain_t * tk_tokenize_metadata_string(ncx_module_t *mod, xmlChar *str, status_t *res)
The specified ncx:metadata string is parsed into tokens convert the ncx:metadata content to 1 or 2 to...
Definition: tk.c:3938
boolean tk_cur_is_first(const tk_chain_t *tkc)
Check if the current token is the first token.
Definition: tk.c:4596
boolean tk_next_is_null(tk_chain_t *tkc)
Get the special sequence [null] is next.
Definition: tk.c:3411
uint32 linenum
token source line number
Definition: tk.h:379
status_t(* tk_getline_fn_t)(xmlChar *fillbuff, uint32 fillbuffsize, void *cookie)
callback function to read a line into a buffer
Definition: tk.h:408
YANG 1.1 feature expr.
Definition: tk.h:344
void tk_setup_chain_cli(tk_chain_t *tkc, xmlChar *line)
Setup a previously allocated chain for a CLI command line.
Definition: tk.c:2970
uint32 flags
parser state flags
Definition: tk.h:428
config file
Definition: tk.h:338
const xmlChar * tk_get_first_origstr(const tk_token_ptr_t *tkptr, boolean *dquote, boolean *morestr)
Get the first original string to use.
Definition: tk.c:4417
tk_type_t tk_next_typ2(tk_chain_t *tkc)
Get the token type of the token after the next token.
Definition: tk.c:3374
xmlns_id_t nsid
only used for TK_TT_MSTRING tokens
Definition: tk.h:381
xmlChar escerr_ch
first bad escaped char if escerr
Definition: tk.h:432
status_t
global error return code
Definition: status_enum.h:186
const char * tk_get_btype_sym(ncx_btype_t btyp)
Get the symbolic token symbol for one of the base types.
Definition: tk.c:3324
void tk_setup_chain_json_buffer(tk_chain_t *tkc, xmlChar *buff)
Setup a previously allocated chain for a JSON buffer.
Definition: tk.c:3116
void tk_reset_chain(tk_chain_t *tkc)
Reset the token chain current pointer to the start.
Definition: tk.c:4042
single quoted string
Definition: tk.h:319
at sign &#39;@&#39;
Definition: tk.h:293
left bracket &#39;[&#39;
Definition: tk.h:287
right bracket &#39;]&#39;
Definition: tk.h:288
single quote
Definition: tk.h:354
2 fwd slashes &#39;//&#39;
Definition: tk.h:305
const void * field
saved cookie
Definition: tk.h:394
void tk_dump_token(const tk_token_t *tk)
Debug printf the specified token !!! Very verbose !!!
Definition: tk.c:3492
const char * tk_get_token_sym(tk_type_t ttyp)
Get the symbolic token symbol.
Definition: tk.c:3302
status_t tk_tokenize_input(tk_chain_t *tkc, ncx_module_t *mod)
Parse the input (FILE or buffer) into tk_token_t structs.
Definition: tk.c:3641
ncx_error_t * curerr
error token pointer
Definition: tk.h:421
XPath NCName:* sequence.
Definition: tk.h:324
forward slash char &#39;/&#39;
Definition: tk.h:297
tk_token_t * cur
current token pointer
Definition: tk.h:419
single YANG language token type
Definition: tk.h:371
const tk_origstr_t * tk_first_origstr_rec(const tk_token_ptr_t *tkptr)
Get the first tk_origstr_t struct (if any)
Definition: tk.c:4450
tk_origstr_typ_t origtyp
original source type
Definition: tk.h:365
range sep, parent node &#39;..&#39;
Definition: tk.h:303
not equal &#39;!=&#39;
Definition: tk.h:306
status_t tk_add_lbrace_token(tk_chain_t *tkc)
Allocatate a new left brace token and add it to the parse chain.
Definition: tk.c:4266
void tk_setup_chain_cli_line(tk_chain_t *tkc, xmlChar *str)
Setup a previously allocated chain for yangcli CLI line of input.
Definition: tk.c:3181
left paren &#39;(&#39;
Definition: tk.h:285
xmlChar * origval
used in DOCMODE for yangdump
Definition: tk.h:377
unquoted string
Definition: tk.h:312
tk_type_t tk_next_typ(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3349
single quote + newline
Definition: tk.h:355
uint32 len
length of value
Definition: tk.h:378
token string
Definition: tk.h:315
right brace &#39;}&#39;
Definition: tk.h:283
less than or equal &#39;<=&#39;
Definition: tk.h:307
status_t tk_add_rbrace_token(tk_chain_t *tkc)
Allocatate a new right brace token and add it to the parse chain.
Definition: tk.c:4299
semi-colon &#39;;&#39;
Definition: tk.h:284
less than char &#39;<&#39;
Definition: tk.h:299
souble quote + newline
Definition: tk.h:353
XPath.
Definition: tk.h:340
XML namespace support.
void tk_setup_chain_yang(tk_chain_t *tkc, FILE *fp, const xmlChar *filename)
Setup a previously allocated chain for a YANG file.
Definition: tk.c:3046
tk_type_t typ
token type
Definition: tk.h:373
void tk_free_chain(tk_chain_t *tkc)
Cleanup and deallocate a tk_chain_t.
Definition: tk.c:3205
xmlChar * str
original string
Definition: tk.h:366
real number
Definition: tk.h:329
void tk_setup_chain_json_file(tk_chain_t *tkc, FILE *fp, const xmlChar *filename)
Setup a previously allocated chain for a JSON input stream.
Definition: tk.c:3091
redo internal mode
Definition: tk.h:341
module-qualified token string
Definition: tk.h:316
ncx_btype_t
enumeration of the built-in NCX types These types cannot be overridden and cannot be imported ...
Definition: ncxtypes.h:200
ncx_btype_t tk_get_yang_btype_id(const xmlChar *buff, uint32 len)
Check if the specified string is a YANG builtin type name checks for valid YANG data type name...
Definition: tk.c:3241
tk_source_t source
source context
Definition: tk.h:429
FILE * fp
file when source is file
Definition: tk.h:423