summaryrefslogtreecommitdiffstats
path: root/libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:19:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:20:17 +0000
commita64a253794ac64cb40befee54db53bde17dd0d49 (patch)
treec1024acc5f6e508814b944d99f112259bb28b1be /libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
parentNew upstream version 1.10.0+dfsg (diff)
downloadnetdata-upstream/1.11.0+dfsg.tar.xz
netdata-upstream/1.11.0+dfsg.zip
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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));