[rrd-developers] patch the sequal

Tobias Oetiker oetiker at ee.ethz.ch
Tue Apr 18 23:14:23 MEST 2000


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-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers



More information about the rrd-developers mailing list