yumapro  20.10-12
YumaPro SDK
yang_ext.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_ext
13 #define _H_yang_ext
14 
15 /* FILE: yang_ext.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 05-jan-08 abb Begun; start from yang_grp.h
36 
37 */
38 
39 #ifndef _H_ncxtypes
40 #include "ncxtypes.h"
41 #endif
42 
43 #ifndef _H_status
44 #include "status.h"
45 #endif
46 
47 #ifndef _H_tk
48 #include "tk.h"
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /********************************************************************
56 * *
57 * T Y P E S *
58 * *
59 *********************************************************************/
60 
61 
62 /********************************************************************
63 * *
64 * F U N C T I O N S *
65 * *
66 *********************************************************************/
67 
68 
69 /* Group definied in ext.h */
70 
71 
95 extern status_t
96  yang_ext_consume_extension (tk_chain_t *tkc,
97  ncx_module_t *mod);
98 
99 
103 #ifdef __cplusplus
104 } /* end extern 'C' */
105 #endif
106 
107 #endif /* _H_yang_ext */
TK_TT_TSTRING
@ TK_TT_TSTRING
token string
Definition: tk.h:319
ncx_consume_appinfo
status_t ncx_consume_appinfo(tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ)
Check if an appinfo clause is present.
Definition: ncx_appinfo.c:761
ncx_appinfo.h
NCX Module Library Extension (Application Info) Utility Functions.
ERR_NCX_WRONG_TKVAL
@ ERR_NCX_WRONG_TKVAL
246
Definition: status_enum.h:285
ncx_valid_name2
boolean ncx_valid_name2(const xmlChar *str)
Check if an xmlChar string is a valid NCX name.
Definition: ncx.c:7637
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
ncx_get_modname
const xmlChar * ncx_get_modname(const ncx_module_t *mod)
Get the main module name.
Definition: ncx.c:4834
xml_util.h
XML Utilities.
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_CUR_LNUM
#define TK_CUR_LNUM(T)
return the current line number
Definition: tk.h:179
tk.h
NCX Syntax Token Handler.
ext_find_cbfn
void ext_find_cbfn(const xmlChar *modname, const xmlChar *extname, ext_template_t *ext)
Find the registered callback for the specified extension Set the callback handler if found.
Definition: ext.c:517
yang_new_ext_stmt
yang_stmt_t * yang_new_ext_stmt(ext_template_t *ext)
Create a new YANG stmt node for an extension.
Definition: yang.c:3026
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
ncxconst.h
Contains NCX constants.
TK_ADV
#define TK_ADV(T)
advance the current token pointer
Definition: tk.h:107
ncx_print_errormsg
void ncx_print_errormsg(tk_chain_t *tkc, ncx_module_t *mod, status_t res)
Print an parse error message to STDOUT.
Definition: ncx.c:7048
TK_CUR_VAL
#define TK_CUR_VAL(T)
return the current token value
Definition: tk.h:128
TK_CUR_LPOS
#define TK_CUR_LPOS(T)
return the current line position
Definition: tk.h:182
ERR_NCX_ENTRY_EXISTS
@ ERR_NCX_ENTRY_EXISTS
223
Definition: status_enum.h:262
def_reg.h
Definition Registry module.
yang_ext_consume_extension
status_t yang_ext_consume_extension(tk_chain_t *tkc, ncx_module_t *mod)
Parse the next N tokens as an extension-stmt.
Definition: yang_ext.c:267
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
TK_TT_RBRACE
@ TK_TT_RBRACE
right brace '}'
Definition: tk.h:287
ERR_NCX_WRONG_TKTYPE
@ ERR_NCX_WRONG_TKTYPE
245
Definition: status_enum.h:284
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
ext_new_template
ext_template_t * ext_new_template(void)
Malloc and initialize the fields in a ext_template_t.
Definition: ext.c:134
yang_consume_boolean
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:1756
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
yang.h
YANG Module parser utilities.
typ.h
Parameter Type Handler.
yangconst.h
Contains YANG constants separated to prevent H file include loops.
yang_consume_descr
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:888
ERR_NCX_EOF
@ ERR_NCX_EOF
244
Definition: status_enum.h:283
TK_TT_SEMICOL
@ TK_TT_SEMICOL
semi-colon ';'
Definition: tk.h:288
ncx_set_error
void ncx_set_error(ncx_error_t *tkerr, ncx_module_t *mod, uint32 linenum, uint32 linepos)
Set the fields in an ncx_error_t struct.
Definition: ncx.c:9746
yang_ext.h
YANG Module parser extension statement support.
ncx_module_t_::ref
xmlChar * ref
reference-stmt (not saved on server)
Definition: ncxtypes.h:921
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
TK_TT_LBRACE
@ TK_TT_LBRACE
left brace '{'
Definition: tk.h:286
log.h
NCX System Logging Manager.
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
ext_find_extension_all
ext_template_t * ext_find_extension_all(ncx_module_t *mod, const xmlChar *name)
Search a module of ext_template_t structs for a given name Check all submodules as well.
Definition: ext.c:370
yang_consume_id_string
status_t yang_consume_id_string(tk_chain_t *tkc, ncx_module_t *mod, xmlChar **field)
consume an identifier-str token
Definition: yang.c:510
ncx_mod_exp_err
void ncx_mod_exp_err(tk_chain_t *tkc, ncx_module_t *mod, status_t result, const char *expstr)
Print an error for wrong token, expected a different token.
Definition: ncx.c:7220
ncx.h
YANG module utility functions.
TK_CUR_TYP
#define TK_CUR_TYP(T)
return the current token type
Definition: tk.h:125
ext_free_template
void ext_free_template(ext_template_t *ext)
Scrub the memory in a ext_template_t by freeing all the sub-fields and then freeing the entire struct...
Definition: ext.c:162
CHK_EXIT
#define CHK_EXIT(res, retres)
used in parser routines to decide if processing can continue will exit the function if critical error...
Definition: yangconst.h:221
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
yang_consume_status
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:1115
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
TK_TT_MSTRING
@ TK_TT_MSTRING
module-qualified token string
Definition: tk.h:320
status.h
Global error messages for status code enumerations.
dlq.h
dlq provides general double-linked list and queue support:
ext.h
YANG Extension Handler.