| 1 |
< |
/* Copyright (c) 1992 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1993 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 18 |
|
|
| 19 |
|
#include "data.h" |
| 20 |
|
|
| 21 |
+ |
/* picture memory usage before warning */ |
| 22 |
+ |
#ifndef PSIZWARN |
| 23 |
+ |
#ifdef BIGMEM |
| 24 |
+ |
#define PSIZWARN 3000000 |
| 25 |
+ |
#else |
| 26 |
+ |
#define PSIZWARN 1000000 |
| 27 |
+ |
#endif |
| 28 |
+ |
#endif |
| 29 |
|
|
| 30 |
+ |
#ifndef TABSIZ |
| 31 |
|
#define TABSIZ 97 /* table size (prime) */ |
| 32 |
+ |
#endif |
| 33 |
|
|
| 34 |
|
#define hash(s) (shash(s)%TABSIZ) |
| 35 |
|
|
| 208 |
|
getheader(fp, headaspect, &inpaspect); |
| 209 |
|
if (!fgetsresolu(&inpres, fp)) |
| 210 |
|
goto readerr; |
| 211 |
+ |
#if PSIZWARN |
| 212 |
+ |
/* check memory usage */ |
| 213 |
+ |
i = 3*sizeof(DATATYPE)*inpres.xr*inpres.yr; |
| 214 |
+ |
if (i > PSIZWARN) { |
| 215 |
+ |
sprintf(errmsg, "picture file \"%s\" using %d bytes of memory", |
| 216 |
+ |
pname, i); |
| 217 |
+ |
error(WARNING, errmsg); |
| 218 |
+ |
} |
| 219 |
+ |
#endif |
| 220 |
|
for (i = 0; i < 3; i++) { |
| 221 |
|
pp[i].nd = 2; |
| 222 |
|
pp[i].dim[0].ne = inpres.yr; |