15 #ifndef LY_EXTENSIONS_H_
16 #define LY_EXTENSIONS_H_
32 #define LYEXT_API_VERSION 1
39 #define LYEXT_VERSION_CHECK
41 #define LYEXT_VERSION_CHECK int lyext_api_version = LYEXT_API_VERSION;
226 void lyext_log(
const struct ly_ctx *ctx, LY_LOG_LEVEL level,
const char *plugin,
const char *
function,
const char *format, ...);
237 #define LYEXT_LOG(ctx, level, plugin, str, args...) \
238 lyext_log(ctx, level, plugin, __func__, str, ##args); \
256 void lyext_vlog(
const struct ly_ctx *ctx, LY_VECODE vecode,
const char *plugin,
const char *
function,
270 #define LYEXT_VLOG(ctx, vecode, plugin, elem_type, elem, str, args...) \
271 lyext_vlog(ctx, vecode, plugin, __func__, elem_type, elem, str, ##args)
284 void (*private_destructor)(
const struct lys_node *node,
void *priv));
Common structure representing single YANG data statement describing.
lyext_check_inherit_clb check_inherit
int(* lyext_valid_data_clb)(struct lys_ext_instance *ext, struct lyd_node *node)
Callback to decide if data is valid towards to schema.
int(* lyext_check_result_clb)(struct lys_ext_instance *ext)
Callback to check that the extension instance is correct - have the valid argument, cardinality, etc.
LYEXT_PAR
Extension instance structure parent enumeration.
Compiled if-feature expression structure.
lyext_valid_data_clb valid_data
int(* lyext_check_inherit_clb)(struct lys_ext_instance *ext, struct lys_node *node)
Callback to decide whether the extension will be inherited into the provided schema node...
LYEXT_SUBSTMT
List of substatement without extensions storage. If the module contains extension instances in these ...
lyext_check_position_clb check_position
struct lys_ext_instance ** ext
struct lyext_plugin * plugin
void lyext_log(const struct ly_ctx *ctx, LY_LOG_LEVEL level, const char *plugin, const char *function, const char *format,...)
Logging function for extension plugins, use LYEXT_LOG macro instead!
struct lyext_substmt * substmt
void lyext_vlog(const struct ly_ctx *ctx, LY_VECODE vecode, const char *plugin, const char *function, LYEXT_VLOG_ELEM elem_type, const void *elem, const char *format,...)
Validation logging function for extension plugins, use LYEXT_VLOG macro instead!
lyext_check_result_clb check_result
Description of the extension instance substatement.
Generic structure for a data node, directly applicable to the data nodes defined as LYS_CONTAINER...
LYEXT_TYPE
Extension types.
Generic extension instance structure.
int(* lyext_check_position_clb)(const void *parent, LYEXT_PAR parent_type, LYEXT_SUBSTMT substmt_type)
Callback to check that the extension can be instantiated inside the provided node.
void lys_iffeature_free(struct ly_ctx *ctx, struct lys_iffeature *iffeature, uint8_t iffeature_size, int shallow, void(*private_destructor)(const struct lys_node *node, void *priv))
Free iffeature structure. In API only for plugins that want to handle if-feature statements similarly...
LYEXT_VLOG_ELEM
Type of object concerned by a validation error. This is used to determine how to compute the path of ...