Loading...
Searching...
No Matches
metadata.h
Go to the documentation of this file.
#ifndef LY_PLUGINS_EXTS_METADATA_H_
#define LY_PLUGINS_EXTS_METADATA_H_
#include "plugins_exts.h"
#include "tree_data.h"
#ifdef __cplusplus
extern "C" {
#endif
struct lyd_meta {
struct lyd_node *parent;
struct lyd_meta *next;
struct lysc_ext_instance *annotation;
const char *name;
struct lyd_value value;
};
static inline const char *
lyd_get_meta_value(const struct lyd_meta *meta)
{
if (meta) {
const struct lyd_value *value = &meta->value;
return value->_canonical ? value->_canonical : lyd_value_get_canonical(meta->annotation->module->ctx, value);
}
return NULL;
}
#ifdef __cplusplus
}
#endif
#endif /* LY_PLUGINS_EXTS_METADATA_H_ */
lysc_ext_instance
YANG extension compiled instance.
Definition plugins_exts.h:437
lyd_meta::next
struct lyd_meta * next
Definition metadata.h:38
lyd_meta::name
const char * name
Definition metadata.h:40
lyd_meta::value
struct lyd_value value
Definition metadata.h:41
lyd_meta::annotation
struct lysc_ext_instance * annotation
Definition metadata.h:39
lyd_meta::parent
struct lyd_node * parent
Definition metadata.h:37
lyd_meta
Metadata structure.
Definition metadata.h:36
plugins_exts.h
libyang support for YANG extensions implementation.
tree_data.h
libyang representation of YANG data trees.
lyd_value_get_canonical
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.
lyd_value::_canonical
const char * _canonical
Definition tree_data.h:568
lyd_node
Generic structure for a data node.
Definition tree_data.h:795
lyd_value
YANG data representation.
Definition tree_data.h:567