types REFACTOR rename lysc_type_plugin structure to lyplg_type
diff --git a/src/plugins_types.c b/src/plugins_types.c
index 63e83ac..44baeb2 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -923,7 +923,7 @@
/**
* @brief Set of type plugins for YANG built-in types
*/
-struct lysc_type_plugin ly_builtin_type_plugins[LY_DATA_TYPE_COUNT] = {
+struct lyplg_type ly_builtin_type_plugins[LY_DATA_TYPE_COUNT] = {
{0}, /* LY_TYPE_UNKNOWN */
{.type = LY_TYPE_BINARY, .store = ly_type_store_binary, .validate = NULL, .compare = ly_type_compare_simple,
.print = ly_type_print_simple, .duplicate = ly_type_dup_simple, .free = ly_type_free_simple,
diff --git a/src/plugins_types.h b/src/plugins_types.h
index 966cacb..ef05fa0 100644
--- a/src/plugins_types.h
+++ b/src/plugins_types.h
@@ -63,7 +63,7 @@
* - duplicate data in lyd_value and
* - free the connected data from lyd_value.
*
- * All these functions are provided to libyang via a set of callback functions specified as ::lysc_type_plugin.
+ * All these functions are provided to libyang via a set of callback functions specified as ::lyplg_type.
* All the callbacks are supposed to do not log directly via libyang logger. Instead, they return LY_ERR value and
* ::ly_err_item error structure(s) describing the detected error(s) (helper functions ::ly_err_new() and ::ly_err_free()
* are available).
@@ -369,7 +369,7 @@
* However, if the user type plugin for the specific type is loaded, the plugin can provide it's own functions.
* The built-in types plugins and are public, so even the user type plugins can use them to do part of their own functionality.
*/
-struct lysc_type_plugin {
+struct lyplg_type {
LY_DATA_TYPE type; /**< implemented type, use LY_TYPE_UNKNOWN for derived data types */
ly_type_store_clb store; /**< store and canonize the value in the type-specific way */
ly_type_validate_clb validate; /**< optional, validate the value in the type-specific way in data */
@@ -385,7 +385,7 @@
*
* TODO hide behind some plugin getter
*/
-extern struct lysc_type_plugin ly_builtin_type_plugins[LY_DATA_TYPE_COUNT];
+extern struct lyplg_type ly_builtin_type_plugins[LY_DATA_TYPE_COUNT];
/**
* @brief Generic simple comparison callback checking the canonical value.
diff --git a/src/tree_schema.h b/src/tree_schema.h
index 7d7eacc..eae5386 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -1499,14 +1499,14 @@
struct lysc_type {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
};
struct lysc_type_num {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lysc_range *range; /**< Optional range limitation */
@@ -1514,7 +1514,7 @@
struct lysc_type_dec {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
uint8_t fraction_digits; /**< fraction digits specification */
@@ -1523,7 +1523,7 @@
struct lysc_type_str {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lysc_range *length; /**< Optional length limitation */
@@ -1545,7 +1545,7 @@
struct lysc_type_enum {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lysc_type_bitenum_item *enums; /**< enumerations list ([sized array](@ref sizedarrays)), mandatory (at least 1 item) */
@@ -1553,7 +1553,7 @@
struct lysc_type_bits {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lysc_type_bitenum_item *bits; /**< bits list ([sized array](@ref sizedarrays)), mandatory (at least 1 item),
@@ -1562,7 +1562,7 @@
struct lysc_type_leafref {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lyxp_expr *path; /**< parsed target path, compiled path cannot be stored because of type sharing */
@@ -1574,7 +1574,7 @@
struct lysc_type_identityref {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lysc_ident **bases; /**< list of pointers to the base identities ([sized array](@ref sizedarrays)),
@@ -1583,7 +1583,7 @@
struct lysc_type_instanceid {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
uint8_t require_instance; /**< require-instance flag */
@@ -1591,7 +1591,7 @@
struct lysc_type_union {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lysc_type **types; /**< list of types in the union ([sized array](@ref sizedarrays)), mandatory (at least 1 item) */
@@ -1599,7 +1599,7 @@
struct lysc_type_bin {
struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
- struct lysc_type_plugin *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
+ struct lyplg_type *plugin; /**< type's plugin with built-in as well as user functions to canonize or validate the value of the type */
LY_DATA_TYPE basetype; /**< Base type of the type */
uint32_t refcount; /**< reference counter for type sharing */
struct lysc_range *length; /**< Optional length limitation */
diff --git a/tests/utests/types/bits.c b/tests/utests/types/bits.c
index 4a0aaa6..2436f36 100644
--- a/tests/utests/types/bits.c
+++ b/tests/utests/types/bits.c
@@ -755,7 +755,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value value = {0};
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
struct lysc_type *lysc_type;
struct lysc_type lysc_type_test;
LY_ERR ly_ret;
@@ -850,7 +850,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
struct lysc_type *lysc_type;
LY_ERR ly_ret;
const char *schema;
@@ -940,7 +940,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
struct lysc_type *lysc_type;
LY_ERR ly_ret;
const char *schema;
@@ -982,7 +982,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_BITS]);
struct lysc_type *lysc_type;
const char *schema;
LY_ERR ly_ret;
diff --git a/tests/utests/types/int8.c b/tests/utests/types/int8.c
index 1a5550d..254888f 100644
--- a/tests/utests/types/int8.c
+++ b/tests/utests/types/int8.c
@@ -1379,7 +1379,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value value = {0};
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
struct lysc_type *lysc_type;
LY_ERR ly_ret;
char *alloc;
@@ -1514,7 +1514,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
struct lysc_type *lysc_type;
LY_ERR ly_ret;
const char *schema;
@@ -1602,7 +1602,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
struct lysc_type *lysc_type;
LY_ERR ly_ret;
const char *schema;
@@ -1642,7 +1642,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_INT8]);
struct lysc_type *lysc_type[2];
const char *schema;
LY_ERR ly_ret;
diff --git a/tests/utests/types/string.c b/tests/utests/types/string.c
index 58bc3b7..c838e1f 100644
--- a/tests/utests/types/string.c
+++ b/tests/utests/types/string.c
@@ -1040,7 +1040,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value value = {0};
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
struct lysc_type *lysc_type;
char *alloc_text;
unsigned int alloc_text_size;
@@ -1149,7 +1149,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
struct lysc_type *lysc_type;
LY_ERR ly_ret;
const char *schema;
@@ -1230,7 +1230,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
struct lysc_type *lysc_type;
LY_ERR ly_ret;
@@ -1269,7 +1269,7 @@
struct ly_err_item *err = NULL;
const struct lys_module *mod;
struct lyd_value values[10];
- struct lysc_type_plugin *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
+ struct lyplg_type *type = &(ly_builtin_type_plugins[LY_TYPE_STRING]);
struct lysc_type *lysc_type[2];
const char *schema;
LY_ERR ly_ret;