libyang 2.1.148
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Loading...
Searching...
No Matches
metadata.h
Go to the documentation of this file.
1
16#ifndef LY_PLUGINS_EXTS_METADATA_H_
17#define LY_PLUGINS_EXTS_METADATA_H_
18
19#include "plugins_exts.h"
20#include "tree_data.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
36struct lyd_meta {
37 struct lyd_node *parent;
38 struct lyd_meta *next;
40 const char *name;
42};
43
50static inline const char *
51lyd_get_meta_value(const struct lyd_meta *meta)
52{
53 if (meta) {
54 const struct lyd_value *value = &meta->value;
55
56 return value->_canonical ? value->_canonical : lyd_value_get_canonical(meta->annotation->module->ctx, value);
57 }
58
59 return NULL;
60}
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* LY_PLUGINS_EXTS_METADATA_H_ */
struct lys_module * module
YANG extension compiled instance.
struct ly_ctx * ctx
struct lyd_meta * next
Definition metadata.h:38
const char * name
Definition metadata.h:40
struct lyd_value value
Definition metadata.h:41
struct lysc_ext_instance * annotation
Definition metadata.h:39
struct lyd_node * parent
Definition metadata.h:37
Metadata structure.
Definition metadata.h:36
libyang support for YANG extensions implementation.
libyang representation of YANG data trees.
LIBYANG_API_DECL const char * lyd_value_get_canonical(const struct ly_ctx *ctx, const struct lyd_value *value)
Get the (canonical) value of a lyd_value.
const char * _canonical
Definition tree_data.h:561
Generic structure for a data node.
Definition tree_data.h:781
YANG data representation.
Definition tree_data.h:560