type CHANGE prefix API functions
diff --git a/src/plugins_types.c b/src/plugins_types.c
index 4a80a51..a696d0d 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -26,7 +26,7 @@
#include "tree_schema.h"
API LY_ERR
-parse_int(const char *datatype, int base, int64_t min, int64_t max, const char *value, size_t value_len, int64_t *ret, struct ly_err_item **err)
+ly_type_parse_int(const char *datatype, int base, int64_t min, int64_t max, const char *value, size_t value_len, int64_t *ret, struct ly_err_item **err)
{
char *errmsg = NULL;
char *strptr = NULL;
@@ -72,7 +72,7 @@
}
API LY_ERR
-parse_uint(const char *datatype, int base, uint64_t min, uint64_t max, const char *value, size_t value_len, uint64_t *ret, struct ly_err_item **err)
+ly_type_parse_uint(const char *datatype, int base, uint64_t min, uint64_t max, const char *value, size_t value_len, uint64_t *ret, struct ly_err_item **err)
{
char *errmsg = NULL;
char *strptr = NULL;
@@ -123,7 +123,7 @@
}
API LY_ERR
-parse_dec64(uint8_t fraction_digits, const char *value, size_t value_len, int64_t *ret, struct ly_err_item **err)
+ly_type_parse_dec64(uint8_t fraction_digits, const char *value, size_t value_len, int64_t *ret, struct ly_err_item **err)
{
LY_ERR rc = LY_EINVAL;
char *errmsg = NULL;
@@ -210,7 +210,7 @@
memset(&valcopy[len], '0', fraction_digits);
}
- rc = parse_int("decimal64", 10, INT64_C(-9223372036854775807) - INT64_C(1), INT64_C(9223372036854775807), valcopy, len, &d, err);
+ rc = ly_type_parse_int("decimal64", 10, INT64_C(-9223372036854775807) - INT64_C(1), INT64_C(9223372036854775807), valcopy, len, &d, err);
if (!rc && ret) {
*ret = d;
}
@@ -335,14 +335,14 @@
{
switch (basetype) {
case LY_TYPE_INT8:
- return parse_int("int16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, INT64_C(-128), INT64_C(127), value, value_len, val, err);
+ return ly_type_parse_int("int16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, INT64_C(-128), INT64_C(127), value, value_len, val, err);
case LY_TYPE_INT16:
- return parse_int("int16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, INT64_C(-32768), INT64_C(32767), value, value_len, val, err);
+ return ly_type_parse_int("int16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, INT64_C(-32768), INT64_C(32767), value, value_len, val, err);
case LY_TYPE_INT32:
- return parse_int("int32", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10,
+ return ly_type_parse_int("int32", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10,
INT64_C(-2147483648), INT64_C(2147483647), value, value_len, val, err);
case LY_TYPE_INT64:
- return parse_int("int64", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10,
+ return ly_type_parse_int("int64", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10,
INT64_C(-9223372036854775807) - INT64_C(1), INT64_C(9223372036854775807), value, value_len, val, err);
default:
LOGINT(NULL);
@@ -425,13 +425,13 @@
{
switch (basetype) {
case LY_TYPE_UINT8:
- return parse_uint("uint16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(255), value, value_len, val, err);
+ return ly_type_parse_uint("uint16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(255), value, value_len, val, err);
case LY_TYPE_UINT16:
- return parse_uint("uint16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(65535), value, value_len, val, err);
+ return ly_type_parse_uint("uint16", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(65535), value, value_len, val, err);
case LY_TYPE_UINT32:
- return parse_uint("uint32", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(4294967295), value, value_len, val, err);
+ return ly_type_parse_uint("uint32", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(4294967295), value, value_len, val, err);
case LY_TYPE_UINT64:
- return parse_uint("uint64", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(18446744073709551615), value, value_len, val, err);
+ return ly_type_parse_uint("uint64", (options & LY_TYPE_OPTS_SCHEMA) ? 0 : 10, 0, UINT64_C(18446744073709551615), value, value_len, val, err);
default:
LOGINT(NULL);
return LY_EINVAL;
@@ -526,7 +526,7 @@
return LY_EVALID;
}
- LY_CHECK_RET(parse_dec64(type_dec->fraction_digits, value, value_len, &d, err));
+ LY_CHECK_RET(ly_type_parse_dec64(type_dec->fraction_digits, value, value_len, &d, err));
/* prepare canonized value */
if (d) {
int count = sprintf(buf, "%"PRId64" ", d);
diff --git a/src/plugins_types.h b/src/plugins_types.h
index a4cbfbb..fce958d 100644
--- a/src/plugins_types.h
+++ b/src/plugins_types.h
@@ -176,7 +176,7 @@
* @param[out] err Error information in case of failure. The error structure can be freed by ly_err_free().
* @return LY_ERR value according to the result of the parsing and validation.
*/
-LY_ERR parse_int(const char *datatype, int base, int64_t min, int64_t max, const char *value, size_t value_len,
+LY_ERR ly_type_parse_int(const char *datatype, int base, int64_t min, int64_t max, const char *value, size_t value_len,
int64_t *ret, struct ly_err_item **err);
/**
@@ -193,7 +193,7 @@
* @param[out] err Error information in case of failure. The error structure can be freed by ly_err_free().
* @return LY_ERR value according to the result of the parsing and validation.
*/
-LY_ERR parse_uint(const char *datatype, int base, uint64_t min, uint64_t max, const char *value, size_t value_len,
+LY_ERR ly_type_parse_uint(const char *datatype, int base, uint64_t min, uint64_t max, const char *value, size_t value_len,
uint64_t *ret, struct ly_err_item **err);
/**
@@ -207,7 +207,7 @@
* @param[out] err Error information in case of failure. The error structure can be freed by ly_err_free().
* @return LY_ERR value according to the result of the parsing and validation.
*/
-LY_ERR parse_dec64(uint8_t fraction_digits, const char *value, size_t value_len, int64_t *ret, struct ly_err_item **err);
+LY_ERR ly_type_parse_dec64(uint8_t fraction_digits, const char *value, size_t value_len, int64_t *ret, struct ly_err_item **err);
/**
* @brief Decide if the @p derived identity is derived from (based on) the @p base identity.