24 #include "ly_common.h"
25 #include "plugins_internal.h"
44 const char *value1, *value2;
52 unit1 = value1[strlen(value1) - 1];
53 unit2 = value2[strlen(value2) - 1];
54 v1 = strtol(value1, NULL, 10);
55 v2 = strtol(value2, NULL, 10);
61 }
else if (v1 == v2) {
66 }
else if (unit1 ==
'm') {
68 }
else if ((unit1 ==
'w') && (unit2 !=
'm')) {
70 }
else if ((unit1 ==
'd') && (unit2 ==
'h')) {
86 .
module =
"libnetconf2-netconf-server",
87 .revision =
"2024-07-09",
88 .name =
"time-period",
90 .plugin.id =
"ly2 time-period",
93 .plugin.validate_value = NULL,
94 .plugin.validate_tree = NULL,
96 .plugin.sort = lyplg_type_sort_time_period,
LIBYANG_API_DECL const void * lyplg_type_print_simple(const struct ly_ctx *ctx, const struct lyd_value *value, LY_VALUE_FORMAT format, void *prefix_data, ly_bool *dynamic, uint32_t *value_size_bits)
Implementation of lyplg_type_print_clb for a generic simple type.
LIBYANG_API_DECL LY_ERR lyplg_type_compare_simple(const struct ly_ctx *ctx, const struct lyd_value *val1, const struct lyd_value *val2)
Implementation of lyplg_type_compare_clb for a generic simple type.
struct lyplg_type_record plugins_time_period[]
Plugin information for time-period type implementation.
The main libyang public header.
LIBYANG_API_DECL void lyplg_type_lyb_size_variable_bytes(const struct lysc_type *type, enum lyplg_lyb_size_type *size_type, uint32_t *fixed_size_bits)
Implementation of lyplg_type_lyb_size_clb for a type with variable length rounded to bytes...
YANG data representation.
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.
LIBYANG_API_DECL LY_ERR lyplg_type_store_string(const struct ly_ctx *ctx, const struct lysc_type *type, const void *value, uint32_t value_len, uint32_t options, LY_VALUE_FORMAT format, void *prefix_data, uint32_t hints, const struct lysc_node *ctx_node, const struct lysc_ext_instance *top_ext, struct lyd_value *storage, struct lys_glob_unres *unres, struct ly_err_item **err)
Implementation of lyplg_type_store_clb for the built-in string type.
LIBYANG_API_DECL LY_ERR lyplg_type_dup_simple(const struct ly_ctx *ctx, const struct lyd_value *original, struct lyd_value *dup)
Implementation of lyplg_type_dup_clb for a generic simple type.
LIBYANG_API_DECL void lyplg_type_free_simple(const struct ly_ctx *ctx, struct lyd_value *value)
Implementation of lyplg_type_free_clb for a generic simple type.
API for (user) types plugins.