diff --git a/bindings/ruby/main.c b/bindings/ruby/main.c
index d2a7ace09b1b05ad9b3aad2bb401e2ae614afcbf..d18b905c356d21c71de67de3895847f88ed73bde 100644 (file)
--- a/bindings/ruby/main.c
+++ b/bindings/ruby/main.c
#include <unistd.h>
#include <ruby.h>
+#include <math.h>
#include "../../src/rrd_tool.h"
typedef struct string_arr_t {
int argc,
char **argv);
+typedef rrd_info_t *(
+ *RRDINFOFUNC) (
+ int argc,
+ char **argv);
+
#define RRD_CHECK_ERROR \
if (rrd_test_error()) \
rb_raise(rb_eRRDError, rrd_get_error()); \
/* Calls Returning Data via the Info Interface */
VALUE rb_rrd_infocall(
- RRDFUNC func,
+ RRDINFOFUNC func,
VALUE args)
{
string_arr a;
case RD_I_STR:
rb_hash_aset(result, key, rb_str_new2(data->value.u_str));
break;
+ case RD_I_INT:
+ rb_hash_aset(result, key, INT2FIX(data->value.u_int));
+ break;
case RD_I_BLO:
rb_hash_aset(result, key,
- rb_str_new(data->value.u_blo.ptr,
+ rb_str_new((char *)data->value.u_blo.ptr,
data->value.u_blo.size));
break;
}