libyang 1.0.184
YANG data modeling language library
Loading...
Searching...
No Matches
libyang.h
Go to the documentation of this file.
1
14
15#ifndef LY_LIBYANG_H_
16#define LY_LIBYANG_H_
17
18#include <stdio.h>
19
23#define LY_ENABLED_CACHE
24
28#define LY_ENABLED_LATEST_REVISIONS
29
33#define LY_ENABLED_LYD_PRIV
34
38#define _PACKED __attribute__((__packed__))
39
40#include "tree_schema.h"
41#include "tree_data.h"
42#include "xml.h"
43#include "dict.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49#define LY_VERSION_MAJOR 1
50#define LY_VERSION_MINOR 9
51#define LY_VERSION_MICRO 2
52#define LY_VERSION "1.9.2"
53
99
111
217
242
282
325
354
532
625
673
710
765
833
889
926
1011
1043
1057
1104
1113
1118struct ly_ctx;
1119
1127
1128#define LY_CTX_ALLIMPLEMENTED 0x01
1129#define LY_CTX_TRUSTED 0x02
1132#define LY_CTX_NOYANGLIBRARY 0x04
1138#define LY_CTX_DISABLE_SEARCHDIRS 0x08
1142#define LY_CTX_DISABLE_SEARCHDIR_CWD 0x10
1145#define LY_CTX_PREFER_SEARCHDIRS 0x20
1147
1169struct ly_ctx *ly_ctx_new(const char *search_dir, int options);
1170
1197struct ly_ctx *ly_ctx_new_ylpath(const char *search_dir, const char *path, LYD_FORMAT format, int options);
1198
1225struct ly_ctx *ly_ctx_new_ylmem(const char *search_dir, const char *data, LYD_FORMAT format, int options);
1226
1232unsigned int ly_ctx_internal_modules_count(struct ly_ctx *ctx);
1233
1244int ly_ctx_set_searchdir(struct ly_ctx *ctx, const char *search_dir);
1245
1253void ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index);
1254
1261const char * const *ly_ctx_get_searchdirs(const struct ly_ctx *ctx);
1262
1270
1282
1289
1300
1307
1317
1324
1339
1346
1359void ly_ctx_set_trusted(struct ly_ctx *ctx);
1360
1367
1375uint16_t ly_ctx_get_module_set_id(const struct ly_ctx *ctx);
1376
1384struct lyd_node *ly_ctx_info(struct ly_ctx *ctx);
1385
1393const struct lys_module *ly_ctx_get_module_iter(const struct ly_ctx *ctx, uint32_t *idx);
1394
1402const struct lys_module *ly_ctx_get_disabled_module_iter(const struct ly_ctx *ctx, uint32_t *idx);
1403
1416const struct lys_module *ly_ctx_get_module(const struct ly_ctx *ctx, const char *name, const char *revision, int implemented);
1417
1435const struct lys_module *ly_ctx_get_module_older(const struct ly_ctx *ctx, const struct lys_module *module);
1436
1451const struct lys_module *ly_ctx_load_module(struct ly_ctx *ctx, const char *name, const char *revision);
1452
1469typedef const char *(*ly_module_imp_clb)(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev,
1470 void *user_data, LYS_INFORMAT *format, void (**free_module_data)(void *model_data, void *user_data));
1471
1481void ly_ctx_set_module_imp_clb(struct ly_ctx *ctx, ly_module_imp_clb clb, void *user_data);
1482
1491
1504typedef const struct lys_module *(*ly_module_data_clb)(struct ly_ctx *ctx, const char *name, const char *ns,
1505 int options, void *user_data);
1506
1507/* Module is in the context, but is not implemented, so to continue with the data operation, it must be implemented. */
1508#define LY_MODCLB_NOT_IMPLEMENTED 0x01
1509
1518void ly_ctx_set_module_data_clb(struct ly_ctx *ctx, ly_module_data_clb clb, void *user_data);
1519
1527ly_module_data_clb ly_ctx_get_module_data_clb(const struct ly_ctx *ctx, void **user_data);
1528
1529#ifdef LY_ENABLED_LYD_PRIV
1530
1531void ly_ctx_set_priv_dup_clb(struct ly_ctx *ctx, void *(*priv_dup_clb)(const void *priv));
1532
1533#endif
1534
1547const struct lys_module *ly_ctx_get_module_by_ns(const struct ly_ctx *ctx, const char *ns, const char *revision, int implemented);
1548
1563const struct lys_submodule *ly_ctx_get_submodule(const struct ly_ctx *ctx, const char *module, const char *revision,
1564 const char *submodule, const char *sub_revision);
1565
1576const struct lys_submodule *ly_ctx_get_submodule2(const struct lys_module *main_module, const char *submodule);
1577
1593const struct lys_node *ly_ctx_get_node(const struct ly_ctx *ctx, const struct lys_node *start, const char *data_path, int output);
1594
1606struct ly_set *ly_ctx_find_path(struct ly_ctx *ctx, const char *path);
1607
1621int ly_ctx_remove_module(const struct lys_module *module,
1622 void (*private_destructor)(const struct lys_node *node, void *priv));
1623
1632void ly_ctx_clean(struct ly_ctx *ctx, void (*private_destructor)(const struct lys_node *node, void *priv));
1633
1650void ly_ctx_destroy(struct ly_ctx *ctx, void (*private_destructor)(const struct lys_node *node, void *priv));
1651
1661char *ly_path_xml2json(struct ly_ctx *ctx, const char *xml_path, struct lyxml_elem *xml);
1662
1674char *ly_path_data2schema(struct ly_ctx *ctx, const char *data_path);
1675
1677
1686
1692 struct lys_node **s;
1693 struct lyd_node **d;
1694 void **g;
1695};
1696
1708struct ly_set {
1709 unsigned int size;
1710 unsigned int number;
1712};
1713
1718#define LY_SET_OPT_USEASLIST 0x01
1719
1725struct ly_set *ly_set_new(void);
1726
1733struct ly_set *ly_set_dup(const struct ly_set *set);
1734
1748int ly_set_add(struct ly_set *set, void *node, int options);
1749
1762int ly_set_merge(struct ly_set *trg, struct ly_set *src, int options);
1763
1770int ly_set_contains(const struct ly_set *set, void *node);
1771
1779
1790int ly_set_rm(struct ly_set *set, void *node);
1791
1802int ly_set_rm_index(struct ly_set *set, unsigned int index);
1803
1809void ly_set_free(struct ly_set *set);
1810
1812
1821#define LYP_WITHSIBLINGS 0x01
1822#define LYP_FORMAT 0x02
1823#define LYP_KEEPEMPTYCONT 0x04
1824#define LYP_WD_MASK 0xF0
1825#define LYP_WD_EXPLICIT 0x00
1827#define LYP_WD_TRIM 0x10
1828#define LYP_WD_ALL 0x20
1829#define LYP_WD_ALL_TAG 0x40
1834#define LYP_WD_IMPL_TAG 0x80
1838#define LYP_NETCONF 0x100
1843
1847
1855
1860typedef enum {
1866} LY_LOG_LEVEL;
1867
1874
1883#define LY_LOLOG 0x01
1885#define LY_LOSTORE 0x02
1887#define LY_LOSTORE_LAST 0x06
1889
1893
1900int ly_log_options(int opts);
1901
1902#ifndef NDEBUG
1903
1912
1913#define LY_LDGDICT 0x01
1914#define LY_LDGYANG 0x02
1915#define LY_LDGYIN 0x04
1916#define LY_LDGXPATH 0x08
1917#define LY_LDGDIFF 0x10
1918#define LY_LDGAPI 0x20
1919#define LY_LDGHASH 0x40
1920
1924
1929void ly_verb_dbg(int dbg_groups);
1930
1931#endif
1932
1947void ly_set_log_clb(void (*clb)(LY_LOG_LEVEL level, const char *msg, const char *path), int path);
1948
1953void (*ly_get_log_clb(void))(LY_LOG_LEVEL, const char *, const char *);
1954
1969
1976typedef enum {
1978
1982
1985 /* */
1991 /* */
2000 /* */
2001 /* */
2005 /* */
2006 /* */
2008 /* */
2023
2025 /* */
2028 /* */
2047
2051 /* */
2059
2070} LY_VECODE;
2071
2076LY_ERR *ly_errno_glob_address(void);
2077
2082#define ly_errno (*ly_errno_glob_address())
2083
2092LY_VECODE ly_vecode(const struct ly_ctx *ctx);
2093
2104const char *ly_errmsg(const struct ly_ctx *ctx);
2105
2119const char *ly_errpath(const struct ly_ctx *ctx);
2120
2131const char *ly_errapptag(const struct ly_ctx *ctx);
2132
2140 char *msg;
2141 char *path;
2142 char *apptag;
2144 struct ly_err_item *prev; /* first item's prev points to the last item */
2145};
2146
2153struct ly_err_item *ly_err_first(const struct ly_ctx *ctx);
2154
2160void ly_err_print(struct ly_err_item *eitem);
2161
2170void ly_err_clean(struct ly_ctx *ctx, struct ly_err_item *eitem);
2171
2175
2176#ifdef __cplusplus
2177}
2178#endif
2179
2180#endif /* LY_LIBYANG_H_ */
libyang dictionary
void ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index)
Clean the search path(s) from the libyang context.
const struct lys_node * ly_ctx_get_node(const struct ly_ctx *ctx, const struct lys_node *start, const char *data_path, int output)
Get schema node according to the given data path (JSON format, see XPath Addressing).
char * ly_path_xml2json(struct ly_ctx *ctx, const char *xml_path, struct lyxml_elem *xml)
Transform a data path in XML format (node prefixes are XML namespace prefixes of module namespaces) t...
ly_module_imp_clb ly_ctx_get_module_imp_clb(const struct ly_ctx *ctx, void **user_data)
Get the custom callback for missing import/include module retrieval.
void ly_ctx_set_allimplemented(struct ly_ctx *ctx)
Make context to set all the imported modules to be implemented. By default, if the imported module is...
uint16_t ly_ctx_get_module_set_id(const struct ly_ctx *ctx)
Get current ID of the modules set. The value is available also as module-set-id in ly_ctx_info() resu...
const struct lys_submodule * ly_ctx_get_submodule2(const struct lys_module *main_module, const char *submodule)
Get submodule of a main module.
void ly_ctx_set_module_imp_clb(struct ly_ctx *ctx, ly_module_imp_clb clb, void *user_data)
Set missing include or import module callback. It is meant to be used when the models are not locally...
void ly_ctx_unset_prefer_searchdirs(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_prefer_searchdirs().
void ly_ctx_set_trusted(struct ly_ctx *ctx)
Change the schema parser behavior when parsing new schemas forcing it to skip some of the schema vali...
const struct lys_module * ly_ctx_get_module_iter(const struct ly_ctx *ctx, uint32_t *idx)
Iterate over all (enabled) modules in a context.
int ly_ctx_remove_module(const struct lys_module *module, void(*private_destructor)(const struct lys_node *node, void *priv))
Remove the specified module from its context.
const char *const * ly_ctx_get_searchdirs(const struct ly_ctx *ctx)
Get the NULL-terminated list of the search paths in libyang context.
ly_module_data_clb ly_ctx_get_module_data_clb(const struct ly_ctx *ctx, void **user_data)
Get the missing data module calback.
struct ly_ctx * ly_ctx_new_ylpath(const char *search_dir, const char *path, LYD_FORMAT format, int options)
Create libyang context according to the content of the given yang-library data.
char * ly_path_data2schema(struct ly_ctx *ctx, const char *data_path)
Transform a data path into schema path (see XPath Addressing).
int ly_ctx_set_searchdir(struct ly_ctx *ctx, const char *search_dir)
Add the search path into libyang context.
struct ly_set * ly_ctx_find_path(struct ly_ctx *ctx, const char *path)
Get schema node according to the given schema path (see XPath Addressing).
void ly_ctx_destroy(struct ly_ctx *ctx, void(*private_destructor)(const struct lys_node *node, void *priv))
Free all internal structures of the specified context.
struct ly_ctx * ly_ctx_new(const char *search_dir, int options)
Create libyang context.
void ly_ctx_set_disable_searchdirs(struct ly_ctx *ctx)
Make context to stop searching for schemas (imported, included or requested via ly_ctx_load_module())...
const struct lys_module * ly_ctx_get_disabled_module_iter(const struct ly_ctx *ctx, uint32_t *idx)
Iterate over the disabled modules in a context.
void ly_ctx_set_prefer_searchdirs(struct ly_ctx *ctx)
Prefer context's searchdirs before the user callback (ly_module_imp_clb) provided via ly_ctx_set_modu...
unsigned int ly_ctx_internal_modules_count(struct ly_ctx *ctx)
Number of internal modules, which are in the context and cannot be removed nor disabled.
struct ly_ctx * ly_ctx_new_ylmem(const char *search_dir, const char *data, LYD_FORMAT format, int options)
Create libyang context according to the content of the given yang-library data.
void ly_ctx_unset_trusted(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_trusted().
void ly_ctx_unset_allimplemented(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_allimplemented().
const struct lys_module * ly_ctx_load_module(struct ly_ctx *ctx, const char *name, const char *revision)
Try to find the model in the searchpath of ctx and load it into it. If custom missing module callback...
void ly_ctx_set_module_data_clb(struct ly_ctx *ctx, ly_module_data_clb clb, void *user_data)
Set the missing data module callback. It will be called when some data is parsed or searched for and ...
const char *(* ly_module_imp_clb)(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev, void *user_data, LYS_INFORMAT *format, void(**free_module_data)(void *model_data, void *user_data))
Callback for retrieving missing included or imported models in a custom way.
Definition libyang.h:1469
const struct lys_submodule * ly_ctx_get_submodule(const struct ly_ctx *ctx, const char *module, const char *revision, const char *submodule, const char *sub_revision)
Get submodule of a main module.
const struct lys_module *(* ly_module_data_clb)(struct ly_ctx *ctx, const char *name, const char *ns, int options, void *user_data)
Callback for retrieving missing modules in the context, for which some data was found.
Definition libyang.h:1504
void ly_ctx_clean(struct ly_ctx *ctx, void(*private_destructor)(const struct lys_node *node, void *priv))
Remove all the modules from the context except the internal modules. Also the addition data in dictio...
void ly_ctx_set_disable_searchdir_cwd(struct ly_ctx *ctx)
Make context to stop implicitly searching for schemas (imported, included or requested via ly_ctx_loa...
void ly_ctx_unset_disable_searchdirs(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_disable_searchdirs().
const struct lys_module * ly_ctx_get_module_older(const struct ly_ctx *ctx, const struct lys_module *module)
Get pointer to the older schema tree to the specified one in the provided context.
void ly_ctx_set_priv_dup_clb(struct ly_ctx *ctx, void *(*priv_dup_clb)(const void *priv))
struct lyd_node * ly_ctx_info(struct ly_ctx *ctx)
Get data of an internal ietf-yang-library module.
int ly_ctx_get_options(struct ly_ctx *ctx)
Get the currently set context's options.
void ly_ctx_unset_disable_searchdir_cwd(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_disable_searchdir_cwd().
const struct lys_module * ly_ctx_get_module(const struct ly_ctx *ctx, const char *name, const char *revision, int implemented)
Get pointer to the schema tree of the module of the specified name.
const struct lys_module * ly_ctx_get_module_by_ns(const struct ly_ctx *ctx, const char *ns, const char *revision, int implemented)
Get pointer to the schema tree of the module of the specified namespace.
libyang context handler.
LYD_FORMAT
Data input/output formats supported by libyang parser and printer functions.
Definition tree_data.h:40
Generic structure for a data node, directly applicable to the data nodes defined as LYS_CONTAINER,...
Definition tree_data.h:176
LY_ERR no
Definition libyang.h:2138
struct ly_err_item * prev
Definition libyang.h:2144
LY_VECODE vecode
Definition libyang.h:2139
char * msg
Definition libyang.h:2140
char * apptag
Definition libyang.h:2142
char * path
Definition libyang.h:2141
struct ly_err_item * next
Definition libyang.h:2143
LY_LOG_LEVEL level
Definition libyang.h:2137
void ly_verb_dbg(int dbg_groups)
Enable specific debugging messages (independent of log level).
void ly_err_clean(struct ly_ctx *ctx, struct ly_err_item *eitem)
Free error structures from a context.
const char * ly_errapptag(const struct ly_ctx *ctx)
Get the last (thread, context-specific) error-app-tag if there was a specific one defined in the modu...
LY_VECODE
libyang's codes of validation error. Whenever ly_errno is set to LY_EVALID, the ly_vecode is also set...
Definition libyang.h:1976
const char * ly_errpath(const struct ly_ctx *ctx)
Get the last (thread, context-specific) path of the element where was an error.
const char * ly_errmsg(const struct ly_ctx *ctx)
Get the last (thread, context-specific) error message. If the corresponding module defined a specific...
LY_LOG_LEVEL ly_verb(LY_LOG_LEVEL level)
Set logger verbosity level.
void(*)(LY_LOG_LEVEL, const char *, const char *) ly_get_log_clb(void)
Get logger callback.
Definition libyang.h:1953
void ly_set_log_clb(void(*clb)(LY_LOG_LEVEL level, const char *msg, const char *path), int path)
Set logger callback.
LY_ERR
libyang's error codes available via ly_errno extern variable.
Definition libyang.h:1960
LY_LOG_LEVEL
Verbosity levels of the libyang logger.
Definition libyang.h:1860
void ly_err_print(struct ly_err_item *eitem)
Print the error structure as if just generated.
LY_VECODE ly_vecode(const struct ly_ctx *ctx)
Get the last (thread, context-specific) validation error code.
int ly_log_options(int opts)
Set additional logger options. Default is LY_LOLOG | LY_LOSTORE_LAST.
struct ly_err_item * ly_err_first(const struct ly_ctx *ctx)
Get the first (thread, context-specific) generated error structure.
@ LYVE_XPATH_NOEND
Definition libyang.h:2058
@ LYVE_PATH_INNODE
Definition libyang.h:2063
@ LYVE_NOWHEN
Definition libyang.h:2039
@ LYVE_PATH_INKEY
Definition libyang.h:2064
@ LYVE_INREGEX
Definition libyang.h:2014
@ LYVE_NOLEAFREF
Definition libyang.h:2045
@ LYVE_MISSELEM
Definition libyang.h:2029
@ LYVE_ENUM_INVAL
Definition libyang.h:1998
@ LYVE_INPRED
Definition libyang.h:2036
@ LYVE_XPATH_INARGCOUNT
Definition libyang.h:2055
@ LYVE_BITS_INNAME
Definition libyang.h:2004
@ LYVE_XPATH_INOP
Definition libyang.h:2050
@ LYVE_INVER
Definition libyang.h:2021
@ LYVE_INORDER
Definition libyang.h:2040
@ LYVE_XML_INVAL
Definition libyang.h:1980
@ LYVE_XPATH_INTOK
Definition libyang.h:2048
@ LYVE_PATH_MISSKEY
Definition libyang.h:2065
@ LYVE_DUPLEAFLIST
Definition libyang.h:1995
@ LYVE_XPATH_INCTX
Definition libyang.h:2052
@ LYVE_KEY_MISS
Definition libyang.h:2012
@ LYVE_BITS_INVAL
Definition libyang.h:2003
@ LYVE_CIRC_INCLUDES
Definition libyang.h:2020
@ LYVE_KEY_NLEAF
Definition libyang.h:2009
@ LYVE_INATTR
Definition libyang.h:2032
@ LYVE_NOREQINS
Definition libyang.h:2044
@ LYVE_INDATE
Definition libyang.h:1988
@ LYVE_SUBMODULE
Definition libyang.h:2022
@ LYVE_INARG
Definition libyang.h:1989
@ LYVE_XPATH_DUMMY
Definition libyang.h:2057
@ LYVE_MISSSTMT
Definition libyang.h:1990
@ LYVE_PATH_MISSPAR
Definition libyang.h:2068
@ LYVE_KEY_DUP
Definition libyang.h:2013
@ LYVE_INSTATUS
Definition libyang.h:2016
@ LYVE_XPATH_INARGTYPE
Definition libyang.h:2056
@ LYVE_XPATH_EOF
Definition libyang.h:2049
@ LYVE_NOMUST
Definition libyang.h:2038
@ LYVE_NORESOLV
Definition libyang.h:2026
@ LYVE_PATH_PREDTOOMANY
Definition libyang.h:2069
@ LYVE_KEY_TYPE
Definition libyang.h:2010
@ LYVE_PATH_INIDENTREF
Definition libyang.h:2066
@ LYVE_INRESOLV
Definition libyang.h:2015
@ LYVE_OBSDATA
Definition libyang.h:2024
@ LYVE_INCHAR
Definition libyang.h:2035
@ LYVE_TOOMANY
Definition libyang.h:1993
@ LYVE_NOCONSTR
Definition libyang.h:2034
@ LYVE_ENUM_WS
Definition libyang.h:2002
@ LYVE_INWHEN
Definition libyang.h:2041
@ LYVE_INELEM
Definition libyang.h:2027
@ LYVE_PATH_EXISTS
Definition libyang.h:2067
@ LYVE_INMETA
Definition libyang.h:2031
@ LYVE_MISSARG
Definition libyang.h:1992
@ LYVE_MISSATTR
Definition libyang.h:2033
@ LYVE_DUPLIST
Definition libyang.h:1996
@ LYVE_INSTMT
Definition libyang.h:1984
@ LYVE_NOUNIQ
Definition libyang.h:1997
@ LYVE_PATH_INCHAR
Definition libyang.h:2060
@ LYVE_INPAR
Definition libyang.h:1986
@ LYVE_ENUM_INNAME
Definition libyang.h:1999
@ LYVE_SUCCESS
Definition libyang.h:1977
@ LYVE_PATH_MISSMOD
Definition libyang.h:2062
@ LYVE_EOF
Definition libyang.h:1983
@ LYVE_PATH_INMOD
Definition libyang.h:2061
@ LYVE_DUPID
Definition libyang.h:1994
@ LYVE_XML_INCHAR
Definition libyang.h:1981
@ LYVE_XPATH_INFUNC
Definition libyang.h:2054
@ LYVE_CIRC_FEATURES
Definition libyang.h:2018
@ LYVE_XML_MISS
Definition libyang.h:1979
@ LYVE_NOMANDCHOICE
Definition libyang.h:2046
@ LYVE_KEY_CONFIG
Definition libyang.h:2011
@ LYVE_INMOD
Definition libyang.h:2007
@ LYVE_CIRC_LEAFREFS
Definition libyang.h:2017
@ LYVE_MCASEDATA
Definition libyang.h:2037
@ LYVE_INID
Definition libyang.h:1987
@ LYVE_NOMAX
Definition libyang.h:2043
@ LYVE_NOMIN
Definition libyang.h:2042
@ LYVE_CIRC_IMPORTS
Definition libyang.h:2019
@ LYVE_XPATH_INMOD
Definition libyang.h:2053
@ LYVE_INVAL
Definition libyang.h:2030
@ LY_EINVAL
Definition libyang.h:1964
@ LY_ESYS
Definition libyang.h:1963
@ LY_EMEM
Definition libyang.h:1962
@ LY_EVALID
Definition libyang.h:1966
@ LY_EINT
Definition libyang.h:1965
@ LY_SUCCESS
Definition libyang.h:1961
@ LY_EPLUGIN
Definition libyang.h:1967
@ LY_LLERR
Definition libyang.h:1861
@ LY_LLVRB
Definition libyang.h:1863
@ LY_LLWRN
Definition libyang.h:1862
@ LY_LLDBG
Definition libyang.h:1864
Libyang full error structure.
Definition libyang.h:2136
struct lyd_node ** d
Definition libyang.h:1693
void ** g
Definition libyang.h:1694
unsigned int size
Definition libyang.h:1709
union ly_set_set set
Definition libyang.h:1711
struct lys_node ** s
Definition libyang.h:1692
unsigned int number
Definition libyang.h:1710
int ly_set_rm_index(struct ly_set *set, unsigned int index)
Remove a lyd_node or lys_node object from the set index.
int ly_set_clean(struct ly_set *set)
Remove all objects from the set, but keep the set container for further use.
int ly_set_merge(struct ly_set *trg, struct ly_set *src, int options)
Add all objects from src to trg.
void ly_set_free(struct ly_set *set)
Free the ly_set data. Frees only the set structure content, not the referred data.
int ly_set_add(struct ly_set *set, void *node, int options)
Add a lyd_node or lys_node object into the set.
int ly_set_rm(struct ly_set *set, void *node)
Remove a lyd_node or lys_node object from the set.
struct ly_set * ly_set_dup(const struct ly_set *set)
Duplicate the existing set.
int ly_set_contains(const struct ly_set *set, void *node)
Get know if the set contains the specified object.
struct ly_set * ly_set_new(void)
Create and initiate new ly_set structure.
Structure to hold a set of (not necessary somehow connected) lyd_node or lys_node objects....
Definition libyang.h:1708
set array of ly_set It is kept in union to keep ly_set generic for data as well as schema trees
Definition libyang.h:1691
const char * ns
const char * name
uint8_t implemented
struct ly_ctx * ctx
LYS_INFORMAT
Schema input formats accepted by libyang parser functions.
Main schema node structure representing YANG module.
Common structure representing single YANG data statement describing.
Submodule schema node structure that can be included into a YANG module.
Structure describing an element in an XML tree.
Definition xml.h:92
libyang representation of data trees.
libyang representation of data model trees.
Public API of libyang XML parser.