time_t *start,
time_t *end, /* which time frame do you want ?
* will be changed to represent reality */
- unsigned long *step, /* which stepsize do you want?
+ unsigned long *step, /* which stepsize do you want?
* will be changed to represent reality */
unsigned long *ds_cnt, /* number of data sources in file */
char ***ds_namv, /* names of data_sources */
rrd_value_t **data) /* two dimensional array containing the data */
{
+ int ret;
if (callback){
- return callback(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
+ ret = callback(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
+ if (*start > *end){
+ rrd_set_error("Your callback returns a start after end. start: %lld end: %lld",(long long int)*start,(long long int)*end);
+ return -1;
+ }
+ if (*step == 0){
+ rrd_set_error("Your callback returns a step of 0");
+ return -1;
+ }
+ return ret;
}
else {
rrd_set_error("use rrd_fetch_cb_register to register your callback prior to calling rrd_fetch_fn_cb");
- return -1;
- }
+ return -1;
+ }
}