summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7e1c606)
raw | patch | inline | side by side (parent: 7e1c606)
author | daryder <daryder@cisco.com> | |
Tue, 7 Oct 2014 15:11:27 +0000 (11:11 -0400) | ||
committer | daryder <daryder@cisco.com> | |
Tue, 7 Oct 2014 15:11:27 +0000 (11:11 -0400) |
src/ceph.c | patch | blob | history |
diff --git a/src/ceph.c b/src/ceph.c
index 8ac33039f1fd89625a815f4d8cd1c40ee42a38b0..4ca24cc91d408575b2e50dc5fb1bdc3b18d94c9f 100644 (file)
--- a/src/ceph.c
+++ b/src/ceph.c
#define CEPH_CB_CONTINUE 1
#define CEPH_CB_ABORT 0
+#if HAVE_YAJL_V2
+typedef size_t yajl_len_t;
+#else
+typedef unsigned int yajl_len_t;
+#endif
+
/******* ceph_daemon *******/
struct ceph_daemon
{
return CEPH_CB_CONTINUE;
}
-static int ceph_cb_number(void *ctx, const char *number_val, size_t number_len)
+static int
+ceph_cb_number(void *ctx, const char *number_val, yajl_len_t number_len)
{
yajl_struct *yajl = (yajl_struct*)ctx;
char buffer[number_len+1];
return CEPH_CB_CONTINUE;
}
-static int
-ceph_cb_string(void *ctx, const unsigned char *string_val, size_t string_len)
+static int ceph_cb_string(void *ctx, const unsigned char *string_val,
+ yajl_len_t string_len)
{
return CEPH_CB_CONTINUE;
}
}
static int
-ceph_cb_map_key(void *ctx, const unsigned char *key, size_t string_len)
+ceph_cb_map_key(void *ctx, const unsigned char *key, yajl_len_t string_len)
{
yajl_struct *yajl = (yajl_struct*)ctx;
ret = cc_handle_bool(child, &long_run_latency_avg);
if(ret)
{
- ERROR("GOT %d handling bool", ret);
return ret;
}
}
- else if(strcasecmp("ConvertSpecialMetrics", child->key) == 0)
+ else if(strcasecmp("ConvertSpecialMetricTypes", child->key) == 0)
{
ret = cc_handle_bool(child, &convert_special_metrics);
if(ret)
{
- ERROR("GOT %d handling bool", ret);
return ret;
}
}
yajl_handle hand;
yajl_status status;
- hand = yajl_alloc(&callbacks, NULL, (void *) (&io->yajl));
+ hand = yajl_alloc(&callbacks,
+#if HAVE_YAJL_V2
+ /* alloc funcs = */ NULL,
+#else
+ /* alloc funcs = */ NULL, NULL,
+#endif
+ /* context = */ (void *)(&io->yajl));
if(!hand)
{