From: oetiker Date: Tue, 11 Nov 2003 19:46:21 +0000 (+0000) Subject: replaced time_value with rrd_time_value as MacOS X introduced a struct of that name... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e59507fce724b583cf9ab2c402907bd2c9d3f91e;p=rrdtool.git replaced time_value with rrd_time_value as MacOS X introduced a struct of that name in their standard headers git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@218 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/parsetime.c b/src/parsetime.c index 0c2f3f9..df93284 100644 --- a/src/parsetime.c +++ b/src/parsetime.c @@ -475,7 +475,7 @@ expect2(int desired, char *complain_fmt, ...) * It allso applies those m-guessing euristics. */ static char * -plus_minus(struct time_value *ptv, int doop) +plus_minus(struct rrd_time_value *ptv, int doop) { static int op = PLUS; static int prev_multiplier = -1; @@ -555,7 +555,7 @@ plus_minus(struct time_value *ptv, int doop) * tod() computes the time of day (TIME-OF-DAY-SPEC) */ static char * -tod(struct time_value *ptv) +tod(struct rrd_time_value *ptv) { int hour, minute = 0; int tlen; @@ -631,7 +631,7 @@ tod(struct time_value *ptv) * assign_date() assigns a date, adjusting year as appropriate */ static char * -assign_date(struct time_value *ptv, long mday, long mon, long year) +assign_date(struct rrd_time_value *ptv, long mday, long mon, long year) { if (year > 138) { if (year > 1970) @@ -659,7 +659,7 @@ assign_date(struct time_value *ptv, long mday, long mon, long year) * day() picks apart DAY-SPEC-[12] */ static char * -day(struct time_value *ptv) +day(struct rrd_time_value *ptv) { long mday=0, wday, mon, year = ptv->tm.tm_year; int tlen; @@ -777,7 +777,7 @@ day(struct time_value *ptv) /* * parsetime() is the external interface that takes tspec, parses - * it and puts the result in the time_value structure *ptv. + * it and puts the result in the rrd_time_value structure *ptv. * It can return either absolute times (these are ensured to be * correct) or relative time references that are expected to be * added to some absolute time value and then normalized by @@ -785,7 +785,7 @@ day(struct time_value *ptv) * the pointer to the error message in the case of problems */ char * -parsetime(char *tspec, struct time_value *ptv) +parsetime(char *tspec, struct rrd_time_value *ptv) { time_t now = time(NULL); int hr = 0; @@ -913,8 +913,8 @@ parsetime(char *tspec, struct time_value *ptv) } /* parsetime */ -int proc_start_end (struct time_value *start_tv, - struct time_value *end_tv, +int proc_start_end (struct rrd_time_value *start_tv, + struct rrd_time_value *end_tv, time_t *start, time_t *end){ if (start_tv->type == RELATIVE_TO_END_TIME && /* same as the line above */ diff --git a/src/rrd.h b/src/rrd.h index a2478b2..b09e316 100644 --- a/src/rrd.h +++ b/src/rrd.h @@ -5,6 +5,9 @@ ***************************************************************************** * $Id$ * $Log$ + * Revision 1.6 2003/11/11 19:46:21 oetiker + * replaced time_value with rrd_time_value as MacOS X introduced a struct of that name in their standard headers + * * Revision 1.5 2003/04/25 18:35:08 jake * Alternate update interface, updatev. Returns info about CDPs written to disk as result of update. Output format is similar to rrd_info, a hash of key-values. * @@ -82,7 +85,7 @@ typedef enum { #define TIME_OK NULL -struct time_value { +struct rrd_time_value { timetype type; long offset; struct tm tm; @@ -98,10 +101,10 @@ struct rrd_context { /* returns the current per-thread rrd_context */ struct rrd_context *rrd_get_context(void); -char *parsetime(char *spec, struct time_value *ptv); +char *parsetime(char *spec, struct rrd_time_value *ptv); /* END parsetime.h */ -int proc_start_end (struct time_value *, struct time_value *, time_t *, time_t *); +int proc_start_end (struct rrd_time_value *, struct rrd_time_value *, time_t *, time_t *); /* HELPER FUNCTIONS */ void rrd_set_error(char *,...); diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index a523706..b49f5f5 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -243,7 +243,7 @@ char* rrdgoodfor(long argc, char **args){ * */ #define MAX_STRFTIME_SIZE 256 char* printstrftime(long argc, char **args){ - struct time_value start_tv, end_tv; + struct rrd_time_value start_tv, end_tv; char *parsetime_error = NULL; char formatted[MAX_STRFTIME_SIZE]; struct tm *the_tm; diff --git a/src/rrd_create.c b/src/rrd_create.c index a3bfafe..78f52d6 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -19,7 +19,7 @@ rrd_create(int argc, char **argv) { time_t last_up = time(NULL)-10; unsigned long pdp_step = 300; - struct time_value last_up_tv; + struct rrd_time_value last_up_tv; char *parsetime_error = NULL; long long_tmp; int rc; diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c index d5c5709..1206644 100644 --- a/src/rrd_fetch.c +++ b/src/rrd_fetch.c @@ -5,6 +5,9 @@ ***************************************************************************** * $Id$ * $Log$ + * Revision 1.7 2003/11/11 19:46:21 oetiker + * replaced time_value with rrd_time_value as MacOS X introduced a struct of that name in their standard headers + * * Revision 1.6 2003/01/16 23:27:54 oetiker * fix border condition in rra selection of rrd_fetch * -- Stanislav Sinyagin @@ -67,7 +70,7 @@ rrd_fetch(int argc, time_t start_tmp=0, end_tmp=0; enum cf_en cf_idx; - struct time_value start_tv, end_tv; + struct rrd_time_value start_tv, end_tv; char *parsetime_error = NULL; /* init start and end time */ diff --git a/src/rrd_graph.c b/src/rrd_graph.c index ef3c727..ef7c9b6 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -2704,7 +2704,7 @@ rrd_graph_options(int argc, char *argv[],image_desc_t *im) char scan_gtm[12],scan_mtm[12],scan_ltm[12],col_nam[12]; time_t start_tmp=0,end_tmp=0; long long_tmp; - struct time_value start_tv, end_tv; + struct rrd_time_value start_tv, end_tv; gfx_color_t color; parsetime("end-24h", &start_tv); diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c index a33a8ef..ef1e8e7 100644 --- a/src/rrd_graph_helper.c +++ b/src/rrd_graph_helper.c @@ -287,7 +287,7 @@ rrd_parse_def(char *line, unsigned int *eaten, graph_desc_t *gdp, image_desc_t * int i=0; char command[6]; /* step, start, end */ char tmpstr[256]; - struct time_value start_tv,end_tv; + struct rrd_time_value start_tv,end_tv; time_t start_tmp=0,end_tmp=0; char *parsetime_error=NULL; diff --git a/src/rrd_update.c b/src/rrd_update.c index 44312bd..de708df 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -5,6 +5,9 @@ ***************************************************************************** * $Id$ * $Log$ + * Revision 1.14 2003/11/11 19:46:21 oetiker + * replaced time_value with rrd_time_value as MacOS X introduced a struct of that name in their standard headers + * * Revision 1.13 2003/11/11 19:38:03 oetiker * rrd files should NOT change size ever ... bulk update code wa buggy. * -- David M. Grimes @@ -466,7 +469,7 @@ _rrd_update(char *filename, char *template, int argc, char **argv, char *p; char *parsetime_error = NULL; enum {atstyle, normal} timesyntax; - struct time_value ds_tv; + struct rrd_time_value ds_tv; if (stepper == NULL){ rrd_set_error("failed duplication argv entry"); free(updvals); diff --git a/src/rrd_xport.c b/src/rrd_xport.c index b943fe2..488c24c 100644 --- a/src/rrd_xport.c +++ b/src/rrd_xport.c @@ -48,7 +48,7 @@ rrd_xport(int argc, char **argv, int *xsize, time_t start_tmp=0,end_tmp=0; char symname[100]; long scancount; - struct time_value start_tv, end_tv; + struct rrd_time_value start_tv, end_tv; char *parsetime_error = NULL; rrd_graph_init(&im);