- /* find referenced gdes and save their index and */
- /* a pointer into their data */
- for (i = 0; i < im->gdes_c; i++) {
- switch (im->gdes[i].gf) {
- case GF_XPORT:
- ii = im->gdes[i].vidx;
- if (xport_counter > nof_xports) {
- rrd_set_error("too many xports: should not happen. Hmmm");
- free(srcptr_list);
- free(ref_list);
- free(legend_list);
- return -1;
- }
- srcptr_list[xport_counter] = im->gdes[ii].data;
- ref_list[xport_counter++] = i;
- break;
- default:
- break;
- }
- }
-
- start_tmp = im->gdes[0].start;
- end_tmp = im->gdes[0].end;
- step_tmp = im->gdes[0].step;
-
- /* fill some return values */
- *col_cnt = nof_xports;
- *start = start_tmp;
- *end = end_tmp;
- *step = step_tmp;
-
- row_cnt = ((*end) - (*start)) / (*step);
-
- /* room for rearranged data */
- /* this is a return value! */
- if (((*data) =
- malloc((*col_cnt) * row_cnt * sizeof(rrd_value_t))) == NULL) {
- free(srcptr_list);
- free(ref_list);
- free(legend_list);
- rrd_set_error("malloc xport data area");
- return (-1);
- }
- dstptr = (*data);
-
+ /* lets find the step size we have to use for xport */
+ step_list = (long*)malloc(sizeof(long)*((*col_cnt)+1));
+ step_list_ptr = step_list;