yumapro  20.10-12
YumaPro SDK
yinyang.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_yinyang
13 #define _H_yinyang
14 
15 /* FILE: yinyang.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 12-dec-09 abb Begun;
36 
37 */
38 
39 #include <xmlstring.h>
40 
41 #ifndef _H_status
42 #include "status.h"
43 #endif
44 
45 #ifndef _H_tk
46 #include "tk.h"
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 /********************************************************************
54 * *
55 * T Y P E S *
56 * *
57 *********************************************************************/
58 
59 
60 /********************************************************************
61 * *
62 * F U N C T I O N S *
63 * *
64 *********************************************************************/
65 
66 /* Group defined in yin.h */
67 
87 extern tk_chain_t *
88  yinyang_convert_token_chain (const xmlChar *sourcespec,
89  status_t *res);
90 
94 #ifdef __cplusplus
95 } /* end extern 'C' */
96 #endif
97 
98 #endif /* _H_yinyang */
ses.h
NETCONF Session Common definitions module.
tk_add_semicol_token
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
ERR_NCX_WRONG_NODETYP
@ ERR_NCX_WRONG_NODETYP
282
Definition: status_enum.h:325
tk_new_chain
tk_chain_t * tk_new_chain(void)
Allocatate a new token parse chain.
Definition: tk.c:2919
tk_add_rbrace_token
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
xml_clean_node
void xml_clean_node(xml_node_t *node)
Clean an xml_node_t struct.
Definition: xml_util.c:266
ses_new_dummy_scb
ses_cb_t * ses_new_dummy_scb(void)
Create a new dummy session control block.
Definition: ses.c:2100
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
xml_util.h
XML Utilities.
tk_add_string_token
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_free_chain
void tk_free_chain(tk_chain_t *tkc)
Cleanup and deallocate a tk_chain_t.
Definition: tk.c:3205
tk.h
NCX Syntax Token Handler.
tk_dump_chain
void tk_dump_chain(const tk_chain_t *tkc)
Debug printf the token chain !!! Very verbose !!!
Definition: tk.c:3532
XML_NT_END
@ XML_NT_END
end-tag of an element
Definition: xml_util.h:193
yinyang.h
Convert YIN format to YANG format for input.
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
xml_get_reader_from_filespec
status_t xml_get_reader_from_filespec(const char *filespec, xmlTextReaderPtr *reader)
Get a new xmlTextReader for parsing a debug test file.
Definition: xml_util.c:341
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
tk_setup_chain_yin
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
XML_NT_STRING
@ XML_NT_STRING
string content node
Definition: xml_util.h:194
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
xml_next_attr
xml_attr_t * xml_next_attr(xml_attr_t *attr)
get the next attribute in the list
Definition: xml_util.c:1218
yangconst.h
Contains YANG constants separated to prevent H file include loops.
tk_add_id_token
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
yin.h
YIN Language Format.
yinyang_convert_token_chain
tk_chain_t * yinyang_convert_token_chain(const xmlChar *sourcespec, status_t *res)
Try to open a file as a YIN formatted XML file and convert it to a token chain for processing by yang...
Definition: yinyang.c:387
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
log.h
NCX System Logging Manager.
xmlns_yin_id
xmlns_id_t xmlns_yin_id(void)
Get the ID for the YIN namespace or 0 if it doesn't exist.
Definition: xmlns.c:1035
xml_find_attr
xml_attr_t * xml_find_attr(xml_node_t *node, xmlns_id_t nsid, const xmlChar *attrname)
Find an attribute.
Definition: xml_util.c:1295
yin_find_mapping
const yin_mapping_t * yin_find_mapping(const xmlChar *name)
Find a static yin mapping entry.
Definition: yin.c:141
XML_NT_START
@ XML_NT_START
start-tag of an element
Definition: xml_util.h:192
tk_add_lbrace_token
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
ERR_NCX_MISSING_ELEMENT
@ ERR_NCX_MISSING_ELEMENT
263
Definition: status_enum.h:304
xml_get_first_attr
xml_attr_t * xml_get_first_attr(const xml_node_t *node)
get the first attribute in the attrs list, from an xml_node_t param
Definition: xml_util.c:1192
ses_free_scb
void ses_free_scb(ses_cb_t *scb)
Free a session control block.
Definition: ses.c:2221
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
XML_NT_EMPTY
@ XML_NT_EMPTY
standalone empty node
Definition: xml_util.h:191
xml_init_node
void xml_init_node(xml_node_t *node)
Init an xml_node_t struct.
Definition: xml_util.c:229
ERR_NCX_WRONG_NODETYP_CPX
@ ERR_NCX_WRONG_NODETYP_CPX
284
Definition: status_enum.h:327
xml_endnode_match
status_t xml_endnode_match(const xml_node_t *startnode, const xml_node_t *endnode)
check if a specific node is the proper endnode match for a given startnode
Definition: xml_util.c:592
status.h
Global error messages for status code enumerations.
xml_node_match
status_t xml_node_match(const xml_node_t *node, xmlns_id_t nsid, const xmlChar *elname, xml_nodetyp_t nodetyp)
check if a specific node is the proper owner, name, and type
Definition: xml_util.c:545
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
tk_add_pid_token
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