/* initialize with xtr(im,0); */
int xtr(
- image_desc_t * im,
+ image_desc_t *im,
time_t mytime)
{
static double pixie;
/* translate data values into y coordinates */
double ytr(
- image_desc_t * im,
+ image_desc_t *im,
double value)
{
static double pixie;
#undef conv_if
int im_free(
- image_desc_t * im)
+ image_desc_t *im)
{
unsigned long i, ii;
/* find SI magnitude symbol for the given number*/
void auto_scale(
- image_desc_t * im, /* image description */
+ image_desc_t *im, /* image description */
double *value,
char **symb_ptr,
double *magfact)
/* find SI magnitude symbol for the numbers on the y-axis*/
void si_unit(
- image_desc_t * im /* image description */
+ image_desc_t *im /* image description */
)
{
/* move min and max values around to become sensible */
void expand_range(
- image_desc_t * im)
+ image_desc_t *im)
{
double sensiblevalues[] = { 1000.0, 900.0, 800.0, 750.0, 700.0,
600.0, 500.0, 400.0, 300.0, 250.0,
}
void apply_gridfit(
- image_desc_t * im)
+ image_desc_t *im)
{
if (isnan(im->minval) || isnan(im->maxval))
return;
time_t *end, /* ... by the application will be ... */
unsigned long *step, /* ... adjusted to represent reality */
unsigned long *ds_cnt, /* number of data sources in file */
- rrd_value_t ** data)
+ rrd_value_t **data)
{ /* two dimensional array containing the data */
int i, reduce_factor = ceil((double) (*step) / (double) cur_step);
unsigned long col, dst_row, row_cnt, start_offset, end_offset, skiprows =
relevant rrds ... */
int data_fetch(
- image_desc_t * im)
+ image_desc_t *im)
{
int i, ii;
int skip;
/* find gdes containing var*/
long find_var(
- image_desc_t * im,
+ image_desc_t *im,
char *key)
{
long ii;
/* run the rpn calculator on all the VDEF and CDEF arguments */
int data_calc(
- image_desc_t * im)
+ image_desc_t *im)
{
int gdi;
/* massage data so, that we get one value for each x coordinate in the graph */
int data_proc(
- image_desc_t * im)
+ image_desc_t *im)
{
long i, ii;
double pixstep = (double) (im->end - im->start)
struct tm tm;
localtime_r(&start, &tm);
+
switch (baseint) {
case TMT_SECOND:
- tm.tm_sec -= tm.tm_sec % basestep;
+ tm. tm_sec -= tm.tm_sec % basestep;
+
break;
case TMT_MINUTE:
- tm.tm_sec = 0;
- tm.tm_min -= tm.tm_min % basestep;
+ tm. tm_sec = 0;
+ tm. tm_min -= tm.tm_min % basestep;
+
break;
case TMT_HOUR:
- tm.tm_sec = 0;
- tm.tm_min = 0;
- tm.tm_hour -= tm.tm_hour % basestep;
+ tm. tm_sec = 0;
+ tm. tm_min = 0;
+ tm. tm_hour -= tm.tm_hour % basestep;
+
break;
case TMT_DAY:
/* we do NOT look at the basestep for this ... */
- tm.tm_sec = 0;
- tm.tm_min = 0;
- tm.tm_hour = 0;
+ tm. tm_sec = 0;
+ tm. tm_min = 0;
+ tm. tm_hour = 0;
+
break;
case TMT_WEEK:
/* we do NOT look at the basestep for this ... */
- tm.tm_sec = 0;
- tm.tm_min = 0;
- tm.tm_hour = 0;
- tm.tm_mday -= tm.tm_wday - 1; /* -1 because we want the monday */
+ tm. tm_sec = 0;
+ tm. tm_min = 0;
+ tm. tm_hour = 0;
+ tm. tm_mday -= tm.tm_wday - 1; /* -1 because we want the monday */
+
if (tm.tm_wday == 0)
- tm.tm_mday -= 7; /* we want the *previous* monday */
+ tm. tm_mday -= 7; /* we want the *previous* monday */
+
break;
case TMT_MONTH:
- tm.tm_sec = 0;
- tm.tm_min = 0;
- tm.tm_hour = 0;
- tm.tm_mday = 1;
- tm.tm_mon -= tm.tm_mon % basestep;
+ tm. tm_sec = 0;
+ tm. tm_min = 0;
+ tm. tm_hour = 0;
+ tm. tm_mday = 1;
+ tm. tm_mon -= tm.tm_mon % basestep;
+
break;
case TMT_YEAR:
- tm.tm_sec = 0;
- tm.tm_min = 0;
- tm.tm_hour = 0;
- tm.tm_mday = 1;
- tm.tm_mon = 0;
- tm.tm_year -= (tm.tm_year + 1900) % basestep;
+ tm. tm_sec = 0;
+ tm. tm_min = 0;
+ tm. tm_hour = 0;
+ tm. tm_mday = 1;
+ tm. tm_mon = 0;
+ tm. tm_year -= (
+ tm.tm_year + 1900) %basestep;
}
return mktime(&tm);
time_t madetime;
localtime_r(¤t, &tm);
+
do {
switch (baseint) {
case TMT_SECOND:
- tm.tm_sec += basestep;
+ tm. tm_sec += basestep;
+
break;
case TMT_MINUTE:
- tm.tm_min += basestep;
+ tm. tm_min += basestep;
+
break;
case TMT_HOUR:
- tm.tm_hour += basestep;
+ tm. tm_hour += basestep;
+
break;
case TMT_DAY:
- tm.tm_mday += basestep;
+ tm. tm_mday += basestep;
+
break;
case TMT_WEEK:
- tm.tm_mday += 7 * basestep;
+ tm. tm_mday += 7 * basestep;
+
break;
case TMT_MONTH:
- tm.tm_mon += basestep;
+ tm. tm_mon += basestep;
+
break;
case TMT_YEAR:
- tm.tm_year += basestep;
+ tm. tm_year += basestep;
}
madetime = mktime(&tm);
} while (madetime == -1); /* this is necessary to skip impssible times
/* calculate values required for PRINT and GPRINT functions */
int print_calc(
- image_desc_t * im,
+ image_desc_t *im,
char ***prdata)
{
long i, ii, validsteps;
/* place legends with color spots */
int leg_place(
- image_desc_t * im)
+ image_desc_t *im)
{
/* graph labels */
int interleg = im->text_prop[TEXT_PROP_LEGEND].size * 2.0;
int calc_horizontal_grid(
- image_desc_t * im)
+ image_desc_t *im)
{
double range;
double scaledrange;
}
int draw_horizontal_grid(
- image_desc_t * im)
+ image_desc_t *im)
{
int i;
double scaledstep;
/* logaritmic horizontal grid */
int horizontal_log_grid(
- image_desc_t * im)
+ image_desc_t *im)
{
double yloglab[][10] = {
{1.0, 10., 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
void vertical_grid(
- image_desc_t * im)
+ image_desc_t *im)
{
int xlab_sel; /* which sort of label and grid ? */
time_t ti, tilab, timajor;
void axis_paint(
- image_desc_t * im)
+ image_desc_t *im)
{
/* draw x and y axis */
/* gfx_new_line ( im->canvas, im->xorigin+im->xsize,im->yorigin,
}
void grid_paint(
- image_desc_t * im)
+ image_desc_t *im)
{
long i;
int res = 0;
*****************************************************/
int lazy_check(
- image_desc_t * im)
+ image_desc_t *im)
{
FILE *fd = NULL;
int size = 1;
#ifdef WITH_PIECHART
void pie_part(
- image_desc_t * im,
+ image_desc_t *im,
gfx_color_t color,
double PieCenterX,
double PieCenterY,
#endif
int graph_size_location(
- image_desc_t * im,
+ image_desc_t *im,
int elements
#ifdef WITH_PIECHART
,
/* draw that picture thing ... */
int graph_paint(
- image_desc_t * im,
+ image_desc_t *im,
char ***calcpr)
{
int i, ii;
*****************************************************/
int gdes_alloc(
- image_desc_t * im)
+ image_desc_t *im)
{
im->gdes_c++;
}
void rrd_graph_init(
- image_desc_t * im)
+ image_desc_t *im)
{
unsigned int i;
void rrd_graph_options(
int argc,
char *argv[],
- image_desc_t * im)
+ image_desc_t *im)
{
int stroff;
char *parsetime_error = NULL;
}
int rrd_graph_color(
- image_desc_t * im,
+ image_desc_t *im,
char *var,
char *err,
int optional)