summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0fc2426)
raw | patch | inline | side by side (parent: 0fc2426)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 9 Jun 2008 05:12:27 +0000 (05:12 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 9 Jun 2008 05:12:27 +0000 (05:12 +0000) |
index 109d66f3194d7b0c5c45a57d96559631dcdf31f4..1b85f965550e1dbc8a15779dceeabb76bdd9834a 100644 (file)
for (i = 0; i < ds_cnt; i++)
rrd_freemem(ds_namv[i]);
- rrd_freemem(ds_namv); /* rrdtool don't use PyMem_Malloc :) */
+ rrd_freemem(ds_namv); /* rrdtool don't use PyMem_Malloc :) */
rrd_freemem(data);
}
}
static PyObject *PyDict_FromInfo(
- rrd_info_t *data)
+ rrd_info_t * data)
{
PyObject *r;
diff --git a/program/src/pngsize.c b/program/src/pngsize.c
index 1a7b4378948d818ca6de1897eb6c66acfc51da9a..5cac36c158fdc3d5a2d375b0198ee28aa531e567 100644 (file)
--- a/program/src/pngsize.c
+++ b/program/src/pngsize.c
#ifdef PNG_SETJMP_SUPPORTED
# define png_jmpbuf(png_ptr) ((png_ptr)->PNG_jmpbuf)
#else
-#ifdef jmpbuf
-#undef jmpbuf
-#endif
+#ifdef jmpbuf
+#undef jmpbuf
+#endif
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif
#endif
diff --git a/program/src/rrd.h b/program/src/rrd.h
index fc3efd684c26b593f07ab49448e24df740eb3302..dc1569e9d50ddf16c070cb8cff945368353c47e4 100644 (file)
--- a/program/src/rrd.h
+++ b/program/src/rrd.h
rrd_info_type_t,
rrd_infoval_t);
void rrd_info_print(
- rrd_info_t *data);
+ rrd_info_t * data);
void rrd_info_free(
rrd_info_t *);
int rrd_update(
char *rrd_parsetime(
const char *spec,
- rrd_time_value_t *ptv);
+ rrd_time_value_t * ptv);
/* END rrd_parsetime.h */
typedef struct rrd_context {
rrd_context_t *rrd_new_context(
void);
void rrd_free_context(
- rrd_context_t *buf);
+ rrd_context_t * buf);
/* void rrd_set_error_r (rrd_context_t *, char *, ...); */
/* void rrd_clear_error_r(rrd_context_t *); */
index 175a76637e5c87e2ca7d5b726a00f9aa505a61f1..722a18519caec80548ea21aeb66c7f0f1aff9f36 100644 (file)
--- a/program/src/rrd_error.c
+++ b/program/src/rrd_error.c
context. Using these functions would require to change each and
every function containing any of the non _r versions... */
void rrd_set_error_r(
- rrd_context_t *rrd_ctx,
+ rrd_context_t * rrd_ctx,
char *fmt,
...)
{
}
int rrd_test_error_r(
- rrd_context_t *rrd_ctx)
+ rrd_context_t * rrd_ctx)
{
return rrd_ctx->rrd_error[0] != '\0';
}
void rrd_clear_error_r(
- rrd_context_t *rrd_ctx)
+ rrd_context_t * rrd_ctx)
{
rrd_ctx->rrd_error[0] = '\0';
}
char *rrd_get_error_r(
- rrd_context_t *rrd_ctx)
+ rrd_context_t * rrd_ctx)
{
return rrd_ctx->rrd_error;
}
rrd_context_t *rrd_new_context(
void)
{
- rrd_context_t *rrd_ctx =
- (rrd_context_t *) malloc(sizeof(rrd_context_t));
+ rrd_context_t *rrd_ctx = (rrd_context_t *) malloc(sizeof(rrd_context_t));
if (!rrd_ctx) {
return NULL;
}
void rrd_free_context(
- rrd_context_t *rrd_ctx)
+ rrd_context_t * rrd_ctx)
{
if (rrd_ctx) {
free(rrd_ctx);
#if 0
void rrd_globalize_error(
- rrd_context_t *rrd_ctx)
+ rrd_context_t * rrd_ctx)
{
if (rrd_ctx) {
rrd_set_error(rrd_ctx->rrd_error);
index 1b452848edb0e15663dd08c3285bab1200166fe4..2b1c05be921676622129bf4e400f919a8a1c2502 100644 (file)
--- a/program/src/rrd_graph.h
+++ b/program/src/rrd_graph.h
cairo_font_options_t *font_options; /* cairo font options */
cairo_antialias_t graph_antialias; /* antialiasing for the graph */
- rrd_info_t *grinfo; /* root pointer to extra graph info */
- rrd_info_t *grinfo_current; /* pointing to current entry */
+ rrd_info_t *grinfo; /* root pointer to extra graph info */
+ rrd_info_t *grinfo_current; /* pointing to current entry */
} image_desc_t;
/* Prototypes */
diff --git a/program/src/rrd_info.c b/program/src/rrd_info.c
index 257219af9f6bd6192a4dab2a5764079adbf4b3f0..0577cc04b23ad560bce943f2110ceeb23ed6ef02 100644 (file)
--- a/program/src/rrd_info.c
+++ b/program/src/rrd_info.c
/* the function formerly known as push was renamed to info_push and later
* rrd_info_push because it is now used outside the scope of this file */
rrd_info_t
- *rrd_info_push(
- rrd_info_t *info,
- char *key,
- rrd_info_type_t type,
- rrd_infoval_t value)
+ * rrd_info_push(rrd_info_t * info,
+ char *key, rrd_info_type_t type, rrd_infoval_t value)
{
rrd_info_t *next;
{
unsigned int i, ii = 0;
rrd_t rrd;
- rrd_info_t *data = NULL, *cd;
+ rrd_info_t *data = NULL, *cd;
rrd_infoval_t info;
rrd_file_t *rrd_file;
enum cf_en current_cf;
info.u_str = rrd.ds_def[i].dst;
cd = rrd_info_push(cd, sprintf_alloc("ds[%s].type",
- rrd.ds_def[i].ds_nam),
- RD_I_STR, info);
+ rrd.ds_def[i].ds_nam),
+ RD_I_STR, info);
current_ds = dst_conv(rrd.ds_def[i].dst);
switch (current_ds) {
rrd.ds_def, &buffer);
info.u_str = buffer;
cd = rrd_info_push(cd,
- sprintf_alloc("ds[%s].cdef", rrd.ds_def[i].ds_nam),
- RD_I_STR, info);
+ sprintf_alloc("ds[%s].cdef",
+ rrd.ds_def[i].ds_nam), RD_I_STR,
+ info);
free(buffer);
}
break;
default:
info.u_cnt = rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt;
cd = rrd_info_push(cd,
- sprintf_alloc("ds[%s].minimal_heartbeat",
- rrd.ds_def[i].ds_nam), RD_I_CNT,
- info);
+ sprintf_alloc("ds[%s].minimal_heartbeat",
+ rrd.ds_def[i].ds_nam), RD_I_CNT,
+ info);
info.u_val = rrd.ds_def[i].par[DS_min_val].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("ds[%s].min", rrd.ds_def[i].ds_nam),
- RD_I_VAL, info);
+ sprintf_alloc("ds[%s].min",
+ rrd.ds_def[i].ds_nam), RD_I_VAL,
+ info);
info.u_val = rrd.ds_def[i].par[DS_max_val].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("ds[%s].max", rrd.ds_def[i].ds_nam),
- RD_I_VAL, info);
+ sprintf_alloc("ds[%s].max",
+ rrd.ds_def[i].ds_nam), RD_I_VAL,
+ info);
break;
}
info.u_str = rrd.pdp_prep[i].last_ds;
cd = rrd_info_push(cd,
- sprintf_alloc("ds[%s].last_ds", rrd.ds_def[i].ds_nam),
- RD_I_STR, info);
+ sprintf_alloc("ds[%s].last_ds",
+ rrd.ds_def[i].ds_nam), RD_I_STR,
+ info);
info.u_val = rrd.pdp_prep[i].scratch[PDP_val].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("ds[%s].value", rrd.ds_def[i].ds_nam),
- RD_I_VAL, info);
+ sprintf_alloc("ds[%s].value",
+ rrd.ds_def[i].ds_nam), RD_I_VAL,
+ info);
info.u_cnt = rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt;
cd = rrd_info_push(cd,
- sprintf_alloc("ds[%s].unknown_sec",
- rrd.ds_def[i].ds_nam), RD_I_CNT, info);
+ sprintf_alloc("ds[%s].unknown_sec",
+ rrd.ds_def[i].ds_nam), RD_I_CNT,
+ info);
}
for (i = 0; i < rrd.stat_head->rra_cnt; i++) {
info.u_str = rrd.rra_def[i].cf_nam;
- cd = rrd_info_push(cd, sprintf_alloc("rra[%d].cf", i), RD_I_STR, info);
+ cd = rrd_info_push(cd, sprintf_alloc("rra[%d].cf", i), RD_I_STR,
+ info);
current_cf = cf_conv(rrd.rra_def[i].cf_nam);
info.u_cnt = rrd.rra_def[i].row_cnt;
- cd = rrd_info_push(cd, sprintf_alloc("rra[%d].rows", i), RD_I_CNT, info);
+ cd = rrd_info_push(cd, sprintf_alloc("rra[%d].rows", i), RD_I_CNT,
+ info);
info.u_cnt = rrd.rra_ptr[i].cur_row;
cd = rrd_info_push(cd, sprintf_alloc("rra[%d].cur_row", i), RD_I_CNT,
- info);
+ info);
info.u_cnt = rrd.rra_def[i].pdp_cnt;
- cd = rrd_info_push(cd, sprintf_alloc("rra[%d].pdp_per_row", i), RD_I_CNT,
- info);
+ cd = rrd_info_push(cd, sprintf_alloc("rra[%d].pdp_per_row", i),
+ RD_I_CNT, info);
switch (current_cf) {
case CF_HWPREDICT:
case CF_MHWPREDICT:
info.u_val = rrd.rra_def[i].par[RRA_hw_alpha].u_val;
- cd = rrd_info_push(cd, sprintf_alloc("rra[%d].alpha", i), RD_I_VAL,
- info);
+ cd = rrd_info_push(cd, sprintf_alloc("rra[%d].alpha", i),
+ RD_I_VAL, info);
info.u_val = rrd.rra_def[i].par[RRA_hw_beta].u_val;
cd = rrd_info_push(cd, sprintf_alloc("rra[%d].beta", i), RD_I_VAL,
- info);
+ info);
break;
case CF_SEASONAL:
case CF_DEVSEASONAL:
info.u_val = rrd.rra_def[i].par[RRA_seasonal_gamma].u_val;
- cd = rrd_info_push(cd, sprintf_alloc("rra[%d].gamma", i), RD_I_VAL,
- info);
+ cd = rrd_info_push(cd, sprintf_alloc("rra[%d].gamma", i),
+ RD_I_VAL, info);
if (atoi(rrd.stat_head->version) >= 4) {
info.u_val =
rrd.rra_def[i].par[RRA_seasonal_smoothing_window].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].smoothing_window", i),
- RD_I_VAL, info);
+ sprintf_alloc("rra[%d].smoothing_window",
+ i), RD_I_VAL, info);
}
break;
case CF_FAILURES:
info.u_val = rrd.rra_def[i].par[RRA_delta_pos].u_val;
cd = rrd_info_push(cd, sprintf_alloc("rra[%d].delta_pos", i),
- RD_I_VAL, info);
+ RD_I_VAL, info);
info.u_val = rrd.rra_def[i].par[RRA_delta_neg].u_val;
cd = rrd_info_push(cd, sprintf_alloc("rra[%d].delta_neg", i),
- RD_I_VAL, info);
+ RD_I_VAL, info);
info.u_cnt = rrd.rra_def[i].par[RRA_failure_threshold].u_cnt;
- cd = rrd_info_push(cd, sprintf_alloc("rra[%d].failure_threshold", i),
- RD_I_CNT, info);
+ cd = rrd_info_push(cd,
+ sprintf_alloc("rra[%d].failure_threshold", i),
+ RD_I_CNT, info);
info.u_cnt = rrd.rra_def[i].par[RRA_window_len].u_cnt;
cd = rrd_info_push(cd, sprintf_alloc("rra[%d].window_length", i),
- RD_I_CNT, info);
+ RD_I_CNT, info);
break;
case CF_DEVPREDICT:
break;
default:
info.u_val = rrd.rra_def[i].par[RRA_cdp_xff_val].u_val;
cd = rrd_info_push(cd, sprintf_alloc("rra[%d].xff", i), RD_I_VAL,
- info);
+ info);
break;
}
rrd.cdp_prep[i * rrd.stat_head->ds_cnt +
ii].scratch[CDP_hw_intercept].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].cdp_prep[%d].intercept",
- i, ii), RD_I_VAL, info);
+ sprintf_alloc
+ ("rra[%d].cdp_prep[%d].intercept", i, ii),
+ RD_I_VAL, info);
info.u_val =
rrd.cdp_prep[i * rrd.stat_head->ds_cnt +
ii].scratch[CDP_hw_slope].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].cdp_prep[%d].slope", i,
- ii), RD_I_VAL, info);
+ sprintf_alloc("rra[%d].cdp_prep[%d].slope",
+ i, ii), RD_I_VAL, info);
info.u_cnt =
rrd.cdp_prep[i * rrd.stat_head->ds_cnt +
ii].scratch[CDP_null_count].u_cnt;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].cdp_prep[%d].NaN_count",
- i, ii), RD_I_CNT, info);
+ sprintf_alloc
+ ("rra[%d].cdp_prep[%d].NaN_count", i, ii),
+ RD_I_CNT, info);
break;
case CF_SEASONAL:
info.u_val =
rrd.cdp_prep[i * rrd.stat_head->ds_cnt +
ii].scratch[CDP_hw_seasonal].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].cdp_prep[%d].seasonal",
- i, ii), RD_I_VAL, info);
+ sprintf_alloc
+ ("rra[%d].cdp_prep[%d].seasonal", i, ii),
+ RD_I_VAL, info);
break;
case CF_DEVSEASONAL:
info.u_val =
rrd.cdp_prep[i * rrd.stat_head->ds_cnt +
ii].scratch[CDP_seasonal_deviation].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].cdp_prep[%d].deviation",
- i, ii), RD_I_VAL, info);
+ sprintf_alloc
+ ("rra[%d].cdp_prep[%d].deviation", i, ii),
+ RD_I_VAL, info);
break;
case CF_DEVPREDICT:
break;
history[j] = '\0';
info.u_str = history;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].cdp_prep[%d].history",
- i, ii), RD_I_STR, info);
+ sprintf_alloc
+ ("rra[%d].cdp_prep[%d].history", i, ii),
+ RD_I_STR, info);
}
break;
default:
rrd.cdp_prep[i * rrd.stat_head->ds_cnt +
ii].scratch[CDP_val].u_val;
cd = rrd_info_push(cd,
- sprintf_alloc("rra[%d].cdp_prep[%d].value", i,
- ii), RD_I_VAL, info);
+ sprintf_alloc("rra[%d].cdp_prep[%d].value",
+ i, ii), RD_I_VAL, info);
info.u_cnt =
rrd.cdp_prep[i * rrd.stat_head->ds_cnt +
ii].scratch[CDP_unkn_pdp_cnt].u_cnt;
cd = rrd_info_push(cd,
- sprintf_alloc
- ("rra[%d].cdp_prep[%d].unknown_datapoints", i,
- ii), RD_I_CNT, info);
+ sprintf_alloc
+ ("rra[%d].cdp_prep[%d].unknown_datapoints",
+ i, ii), RD_I_CNT, info);
break;
}
}
void rrd_info_print(
- rrd_info_t *data)
+ rrd_info_t * data)
{
while (data) {
printf("%s = ", data->key);
}
void rrd_info_free(
- rrd_info_t *data)
+ rrd_info_t * data)
{
rrd_info_t *save;
diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c
index 75281e0b88340c7accf92701067759f024db5207..4caebd394cf156970f622bddb4e12d68513cafba 100644 (file)
--- a/program/src/rrd_open.c
+++ b/program/src/rrd_open.c
#endif
/* get the address of the start of this page */
-#if defined USE_MADVISE || defined HAVE_POSIX_FADVISE
+#if defined USE_MADVISE || defined HAVE_POSIX_FADVISE
#ifndef PAGE_START
#define PAGE_START(addr) ((addr)&(~(_page_size-1)))
#endif
#if defined DEBUG && DEBUG > 1
mincore_print(rrd_file, "after");
#endif
-#endif /* without madvise and posix_fadvise ist does not make much sense todo anything */
+#endif /* without madvise and posix_fadvise ist does not make much sense todo anything */
}
{
free(mem);
}
-
index c1aef0b76e4852e29a3800d9d0233ce85c7eb584..7fa355938fe6ed399bc955f7626f86d345087623 100644 (file)
* It also applies those m-guessing heuristics.
*/
static char *plus_minus(
- rrd_time_value_t *ptv,
+ rrd_time_value_t * ptv,
int doop)
{
static int op = PLUS;
* tod() computes the time of day (TIME-OF-DAY-SPEC)
*/
static char *tod(
- rrd_time_value_t *ptv)
+ rrd_time_value_t * ptv)
{
int hour, minute = 0;
int tlen;
* assign_date() assigns a date, adjusting year as appropriate
*/
static char *assign_date(
- rrd_time_value_t *ptv,
+ rrd_time_value_t * ptv,
long mday,
long mon,
long year)
* day() picks apart DAY-SPEC-[12]
*/
static char *day(
- rrd_time_value_t *ptv)
+ rrd_time_value_t * ptv)
{
/* using time_t seems to help portability with 64bit oses */
time_t mday = 0, wday, mon, year = ptv->tm.tm_year;
*/
char *rrd_parsetime(
const char *tspec,
- rrd_time_value_t *ptv)
+ rrd_time_value_t * ptv)
{
time_t now = time(NULL);
int hr = 0;
int rrd_proc_start_end(
- rrd_time_value_t *start_tv,
- rrd_time_value_t *end_tv,
+ rrd_time_value_t * start_tv,
+ rrd_time_value_t * end_tv,
time_t *start,
time_t *end)
{
diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c
index 670e3c3a8dea2f6e4733eefe36745159bd542ad8..be6a1d4c883b4de5e39c3b6fc102a79597d4e2ac 100644 (file)
--- a/program/src/rrd_tool.c
+++ b/program/src/rrd_tool.c
}
} else if (strcmp("graphv", argv[1]) == 0) {
- rrd_info_t *grinfo = NULL; /* 1 to distinguish it from the NULL that rrd_graph sends in */
+ rrd_info_t *grinfo = NULL; /* 1 to distinguish it from the NULL that rrd_graph sends in */
grinfo = rrd_graph_v(argc - 1, &argv[1]);
if (grinfo) {
index 594dfd9dadf9b88ce601fad79319d73a94da3f4e..9f27593e184299282d3d3df2d3ca7d9276dc6ff1 100644 (file)
--- a/program/src/rrd_update.c
+++ b/program/src/rrd_update.c
char **updvals,
long *tmpl_idx,
unsigned long tmpl_cnt,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
int version,
unsigned long *skip_update,
int *schedule_smooth);
unsigned long *rra_current,
time_t current_time,
unsigned long *skip_update,
- rrd_info_t **pcdp_summary);
+ rrd_info_t ** pcdp_summary);
static int write_RRA_row(
rrd_file_t *rrd_file,
unsigned long rra_idx,
unsigned long *rra_current,
unsigned short CDP_scratch_idx,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
time_t rra_time);
static int smooth_all_rras(
char **argv)
{
char *tmplt = NULL;
- rrd_info_t *result = NULL;
+ rrd_info_t *result = NULL;
rrd_infoval_t rc;
struct option long_options[] = {
{"template", required_argument, 0, 't'},
const char *tmplt,
int argc,
const char **argv,
- rrd_info_t *pcdp_summary)
+ rrd_info_t * pcdp_summary)
{
int arg_i = 2;
char **updvals,
long *tmpl_idx,
unsigned long tmpl_cnt,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
int version,
unsigned long *skip_update,
int *schedule_smooth)
unsigned long *rra_current,
time_t current_time,
unsigned long *skip_update,
- rrd_info_t **pcdp_summary)
+ rrd_info_t ** pcdp_summary)
{
unsigned long rra_idx;
unsigned long rra_start;
unsigned long rra_idx,
unsigned long *rra_current,
unsigned short CDP_scratch_idx,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
time_t rra_time)
{
unsigned long ds_idx, cdp_idx;
iv.u_val = rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].u_val;
/* append info to the return hash */
*pcdp_summary = rrd_info_push(*pcdp_summary,
- sprintf_alloc("[%d]RRA[%s][%lu]DS[%s]",
- rra_time,
- rrd->rra_def[rra_idx].
- cf_nam,
- rrd->rra_def[rra_idx].
- pdp_cnt,
- rrd->ds_def[ds_idx].
- ds_nam), RD_I_VAL, iv);
+ sprintf_alloc
+ ("[%d]RRA[%s][%lu]DS[%s]", rra_time,
+ rrd->rra_def[rra_idx].cf_nam,
+ rrd->rra_def[rra_idx].pdp_cnt,
+ rrd->ds_def[ds_idx].ds_nam),
+ RD_I_VAL, iv);
}
if (rrd_write(rrd_file,
&(rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].