X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=bindings%2Fruby%2Fmain.c;h=355625f9c2ec5d87b6124b1ec05cca1243decfdf;hb=88f9f8473259baa892d8819b7cf374c0e561103f;hp=d18b905c356d21c71de67de3895847f88ed73bde;hpb=24a1cb649dd3b5c5d93fa470ebfe4d88abb2af00;p=rrdtool.git diff --git a/bindings/ruby/main.c b/bindings/ruby/main.c index d18b905..355625f 100644 --- a/bindings/ruby/main.c +++ b/bindings/ruby/main.c @@ -38,7 +38,7 @@ string_arr string_arr_new( int i; Check_Type(rb_strings, T_ARRAY); - a.len = RARRAY(rb_strings)->len + 1; + a.len = RARRAY_LEN(rb_strings) + 1; a.strings = malloc(a.len * sizeof(char *)); a.strings[0] = "dummy"; /* first element is a dummy element */ @@ -144,6 +144,13 @@ VALUE rb_rrd_update( return rrd_call(rrd_update, args); } +VALUE rb_rrd_flushcached( + VALUE self, + VALUE args) +{ + return rrd_call(rrd_flushcached, args); +} + /* Calls Returning Data via the Info Interface */ @@ -309,7 +316,7 @@ VALUE rb_rrd_last( string_arr_delete(a); RRD_CHECK_ERROR - return rb_funcall(rb_cTime, rb_intern("at"), 1, INT2FIX(last)); + return rb_funcall(rb_cTime, rb_intern("at"), 1, UINT2NUM(last)); } void Init_RRD( @@ -327,6 +334,7 @@ void Init_RRD( rb_define_module_function(mRRD, "restore", rb_rrd_restore, -2); rb_define_module_function(mRRD, "tune", rb_rrd_tune, -2); rb_define_module_function(mRRD, "update", rb_rrd_update, -2); + rb_define_module_function(mRRD, "flushcached", rb_rrd_flushcached, -2); rb_define_module_function(mRRD, "info", rb_rrd_info, -2); rb_define_module_function(mRRD, "updatev", rb_rrd_updatev, -2); rb_define_module_function(mRRD, "graphv", rb_rrd_graphv, -2);