diff options
Diffstat (limited to '')
-rw-r--r-- | libnetdata/adaptive_resortable_list/adaptive_resortable_list.c (renamed from src/adaptive_resortable_list.c) | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/adaptive_resortable_list.c b/libnetdata/adaptive_resortable_list/adaptive_resortable_list.c index c564efff3..7f4c6c53d 100644 --- a/src/adaptive_resortable_list.c +++ b/libnetdata/adaptive_resortable_list/adaptive_resortable_list.c @@ -1,4 +1,6 @@ -#include "adaptive_resortable_list.h" +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "../libnetdata.h" // the default processor() of the ARL // can be overwritten at arl_create() @@ -20,6 +22,15 @@ inline void arl_callback_str2kernel_uint_t(const char *name, uint32_t hash, cons // fprintf(stderr, "name '%s' with hash %u and value '%s' is %llu\n", name, hash, value, (unsigned long long)*d); } +inline void arl_callback_ssize_t(const char *name, uint32_t hash, const char *value, void *dst) { + (void)name; + (void)hash; + + register ssize_t *d = dst; + *d = (ssize_t)str2ll(value, NULL); + // fprintf(stderr, "name '%s' with hash %u and value '%s' is %zd\n", name, hash, value, *d); +} + // create a new ARL ARL_BASE *arl_create(const char *name, void (*processor)(const char *, uint32_t, const char *, void *), size_t rechecks) { ARL_BASE *base = callocz(1, sizeof(ARL_BASE)); |