X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2Fperl-shared%2FRRDs.xs;h=f84efef67419f876f2c0ff0035eefee0176801cd;hb=58f824a51a3d59c54d24dd2e2a96afda4493b4b4;hp=bf108e375a1f7dcd3d12cb7eda52655e05cc8443;hpb=b837c0527f117b54845242ee7626df6d88394444;p=rrdtool.git diff --git a/bindings/perl-shared/RRDs.xs b/bindings/perl-shared/RRDs.xs index bf108e3..f84efef 100644 --- a/bindings/perl-shared/RRDs.xs +++ b/bindings/perl-shared/RRDs.xs @@ -10,7 +10,25 @@ extern "C" { } #endif +/* + * rrd_tool.h includes config.h, but at least on Ubuntu Breezy Badger + * 5.10 with gcc 4.0.2, the C preprocessor picks up Perl's config.h + * which is included from the Perl includes and never reads rrdtool's + * config.h. Without including rrdtool's config.h, this module does + * not compile, so include it here with an explicit path. + * + * Because rrdtool's config.h redefines VERSION which is originally + * set via Perl's Makefile.PL and passed down to the C compiler's + * command line, save the original value and reset it after the + * includes. + */ +#define VERSION_SAVED VERSION +#undef VERSION +#include "../../rrd_config.h" #include "../../src/rrd_tool.h" +#undef VERSION +#define VERSION VERSION_SAVED +#undef VERSION_SAVED /* perl 5.004 compatibility */ #if PERLPATCHLEVEL < 5 @@ -29,7 +47,6 @@ extern "C" { argv[i+1] = (char *) malloc((strlen(handle)+1)*sizeof(char)); \ strcpy(argv[i+1],handle); \ } \ - optind=0; opterr=0; \ rrd_clear_error();\ RETVAL=name(items+1,argv); \ for (i=0; i < items; i++) {\ @@ -53,7 +70,6 @@ extern "C" { argv[i+1] = (char *) malloc((strlen(handle)+1)*sizeof(char)); \ strcpy(argv[i+1],handle); \ } \ - optind=0; opterr=0; \ rrd_clear_error(); \ data=name(items+1, argv); \ for (i=0; i < items; i++) { \ @@ -132,6 +148,17 @@ rrd_last(...) OUTPUT: RETVAL +int +rrd_first(...) + PROTOTYPE: @ + PREINIT: + int i; + char **argv; + CODE: + rrdcode(rrd_first); + OUTPUT: + RETVAL + int rrd_create(...) @@ -178,6 +205,7 @@ rrd_graph(...) PREINIT: char **calcpr=NULL; int i,xsize,ysize; + double ymin,ymax; char **argv; AV *retar; PPCODE: @@ -191,9 +219,8 @@ rrd_graph(...) argv[i+1] = (char *) malloc((strlen(handle)+1)*sizeof(char)); strcpy(argv[i+1],handle); } - optind=0; opterr=0; rrd_clear_error(); - rrd_graph(items+1,argv,&calcpr,&xsize,&ysize,NULL); + rrd_graph(items+1,argv,&calcpr,&xsize,&ysize,NULL,&ymin,&ymax); for (i=0; i < items; i++) { free(argv[i+1]); } @@ -239,7 +266,6 @@ rrd_fetch(...) argv[i+1] = (char *) malloc((strlen(handle)+1)*sizeof(char)); strcpy(argv[i+1],handle); } - optind=0; opterr=0; rrd_clear_error(); rrd_fetch(items+1,argv,&start,&end,&step,&ds_cnt,&ds_namv,&data); for (i=0; i < items; i++) { @@ -318,7 +344,6 @@ rrd_xport(...) argv[i+1] = (char *) malloc((strlen(handle)+1)*sizeof(char)); strcpy(argv[i+1],handle); } - optind=0; opterr=0; rrd_clear_error(); rrd_xport(items+1,argv,&xsize,&start,&end,&step,&col_cnt,&legend_v,&data); for (i=0; i < items; i++) { @@ -382,3 +407,27 @@ rrd_updatev(...) OUTPUT: RETVAL +int +rrd_dump(...) + PROTOTYPE: @ + PREINIT: + int i; + char **argv; + CODE: + rrdcode(rrd_dump); + RETVAL = 1; + OUTPUT: + RETVAL + +int +rrd_restore(...) + PROTOTYPE: @ + PREINIT: + int i; + char **argv; + CODE: + rrdcode(rrd_restore); + RETVAL = 1; + OUTPUT: + RETVAL +