[prev in list] [next in list] [prev in thread] [next in thread]
List: rrd-users
Subject: [rrd-users] patch the sequal
From: oetiker () ee ! ethz ! ch (Tobias Oetiker)
Date: 2000-04-18 21:14:23
Message-ID: Pine.GSO.4.21.0004182312390.12369-100000 () drwho ! ee ! ethz ! ch
[Download RAW message or body]
Folks ...
sorry forgot the breaks in the switch ...
it should be
int lazy_check(image_desc_t *im){
FILE *fd = NULL;
int size = 1;
struct stat gifstat;
if (im->lazy == 0) return 0; /* no lazy option */
if (stat(im->graphfile,&gifstat) != 0)
return 0; /* can't stat */
/* one pixel in the existing graph is more then what we would
change here ... */
if (time(NULL) - gifstat.st_mtime >
(im->end - im->start) / im->xsize)
return 0;
if ((fd = fopen(im->graphfile,"rb")) == NULL)
return 0; /* the file does not exist */
switch (im->imgformat) {
case IF_GIF:
size = GifSize(fd,&(im->xgif),&(im->ygif));
break;
case IF_PNG:
size = PngSize(fd,&(im->xgif),&(im->ygif));
break;
}
fclose(fd);
return size;
}
cheers
tobi
--
______ __ _
/_ __/_ / / (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
/ // _ \/ _ \/ / TEL: +41(0)1-6325286 FAX:...1517 ICQ: 10419518
/_/ \.__/_.__/_/ oetiker at ee.ethz.ch http://ee-staff.ethz.ch/~oetiker
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic