}
free(raw_data);
- result = rb_ary_new2(4);
- rb_ary_store(result, 0, INT2FIX(start));
- rb_ary_store(result, 1, INT2FIX(end));
+ result = rb_ary_new2(5);
+ rb_ary_store(result, 0, INT2NUM(start));
+ rb_ary_store(result, 1, INT2NUM(end));
rb_ary_store(result, 2, names);
rb_ary_store(result, 3, data);
+ rb_ary_store(result, 4, INT2FIX(step));
return result;
}
return result;
}
-VALUE rb_rrd_info(VALUE self, VALUE args)
+VALUE rb_rrd_info(
+ VALUE self,
+ VALUE args)
{
string_arr a;
- info_t *p, *data;
- VALUE result;
+ info_t *p, *data;
+ VALUE result;
a = string_arr_new(args);
data = rrd_info(a.len, a.strings);
string_arr_delete(a);
- RRD_CHECK_ERROR
+ RRD_CHECK_ERROR result = rb_hash_new();
- result = rb_hash_new();
while (data) {
- VALUE key = rb_str_new2(data->key);
+ VALUE key = rb_str_new2(data->key);
+
switch (data->type) {
case RD_I_VAL:
if (isnan(data->value.u_val)) {
rb_hash_aset(result, key, Qnil);
- }
- else {
+ } else {
rb_hash_aset(result, key, rb_float_new(data->value.u_val));
}
break;