libyang  3.4.2
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
23 extern "C" {
24 #endif
25 
36 struct lyd_meta {
37  struct lyd_node *parent;
38  struct lyd_meta *next;
40  const char *name;
41  struct lyd_value value;
42 };
43 
50 static inline const char *
51 lyd_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_ */
libyang support for YANG extensions implementation.
struct ly_ctx * ctx
Definition: tree_schema.h:2132
Generic structure for a data node.
Definition: tree_data.h:799
YANG extension compiled instance.
Definition: plugins_exts.h:437
const char * name
Definition: metadata.h:40
struct lyd_node * parent
Definition: metadata.h:37
struct lyd_value value
Definition: metadata.h:41
libyang representation of YANG data trees.
struct lyd_meta * next
Definition: metadata.h:38
YANG data representation.
Definition: tree_data.h:571
const char * _canonical
Definition: tree_data.h:572
Metadata structure.
Definition: metadata.h:36
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.
struct lys_module * module
Definition: plugins_exts.h:440
struct lysc_ext_instance * annotation
Definition: metadata.h:39