23 #include "ly_common.h"
24 #include "plugins_internal.h"
43 const char *value1, *value2;
51 unit1 = value1[strlen(value1) - 1];
52 unit2 = value2[strlen(value2) - 1];
53 v1 = strtol(value1, NULL, 10);
54 v2 = strtol(value2, NULL, 10);
60 }
else if (v1 == v2) {
65 }
else if (unit1 ==
'm') {
67 }
else if ((unit1 ==
'w') && (unit2 !=
'm')) {
69 }
else if ((unit1 ==
'd') && (unit2 ==
'h')) {
85 .
module =
"libnetconf2-netconf-server",
86 .revision =
"2024-07-09",
87 .name =
"time-period",
89 .plugin.id =
"libyang 2 - time-period, version 1",
91 .plugin.validate = NULL,
93 .plugin.sort = lyplg_type_sort_time_period,
97 .plugin.lyb_data_len = -1,
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.
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, size_t *value_len)
Implementation of lyplg_type_print_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.
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, size_t value_len, uint32_t options, LY_VALUE_FORMAT format, void *prefix_data, uint32_t hints, const struct lysc_node *ctx_node, 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.