| 18 |
|
|
| 19 |
|
#include <signal.h> |
| 20 |
|
|
| 21 |
+ |
#include <setjmp.h> |
| 22 |
+ |
|
| 23 |
|
#include <ctype.h> |
| 24 |
|
|
| 25 |
|
VIEW ourview = STDVIEW; /* viewing parameters */ |
| 57 |
|
RECT pframe; /* current frame boundaries */ |
| 58 |
|
int pdepth; /* image depth in current frame */ |
| 59 |
|
|
| 60 |
+ |
static jmp_buf mainloop; /* longjmp back to main loop */ |
| 61 |
|
static char *reserve_mem = NULL; /* pre-allocated reserve memory */ |
| 62 |
|
|
| 63 |
|
#define RESERVE_AMT 8192 /* amount of memory to reserve */ |
| 120 |
|
|
| 121 |
|
devopen(devname); /* open device */ |
| 122 |
|
newimage(); /* set up image */ |
| 123 |
< |
|
| 123 |
> |
setjmp(mainloop); |
| 124 |
|
for ( ; ; ) { /* quit in command() */ |
| 125 |
|
while (hresolu <= 1<<pdepth && |
| 126 |
|
vresolu <= 1<<pdepth) |
| 161 |
|
} |
| 162 |
|
free(reserve_mem); |
| 163 |
|
reserve_mem = NULL; |
| 164 |
< |
for ( ; ; ) |
| 164 |
> |
do |
| 165 |
|
command("out of memory: "); |
| 166 |
+ |
while (reserve_mem == NULL); |
| 167 |
+ |
longjmp(mainloop, 1); |
| 168 |
|
} |
| 169 |
|
|
| 170 |
|
|