| 37 |
|
|
| 38 |
|
#define FONTNAME "9x15" /* text font we'll use */ |
| 39 |
|
|
| 40 |
< |
#define CTRL(c) ('c'-'@') |
| 40 |
> |
#define CTRL(c) ((c)-'@') |
| 41 |
|
|
| 42 |
|
#define BORWIDTH 5 /* border width */ |
| 43 |
|
#define BARHEIGHT 25 /* menu bar size */ |
| 170 |
|
headline(s) /* get relevant info from header */ |
| 171 |
|
char *s; |
| 172 |
|
{ |
| 173 |
– |
static char *altname[] = {"rview","rpict",VIEWSTR,NULL}; |
| 174 |
– |
register char **an; |
| 173 |
|
char fmt[32]; |
| 174 |
|
|
| 175 |
|
if (isexpos(s)) |
| 177 |
|
else if (isformat(s)) { |
| 178 |
|
formatval(fmt, s); |
| 179 |
|
wrongformat = strcmp(fmt, COLRFMT); |
| 180 |
< |
} else |
| 181 |
< |
for (an = altname; *an != NULL; an++) |
| 184 |
< |
if (!strncmp(*an, s, strlen(*an))) { |
| 185 |
< |
if (sscanview(&ourview, s+strlen(*an)) > 0) |
| 186 |
< |
gotview++; |
| 187 |
< |
return; |
| 188 |
< |
} |
| 180 |
> |
} else if (isview(s) && sscanview(&ourview, s) > 0) |
| 181 |
> |
gotview++; |
| 182 |
|
} |
| 183 |
|
|
| 184 |
|
|
| 360 |
|
return(0); |
| 361 |
|
switch (*cp) { /* interpret command */ |
| 362 |
|
case 'q': |
| 363 |
< |
case CTRL(D): /* quit */ |
| 363 |
> |
case CTRL('D'): /* quit */ |
| 364 |
|
quit(0); |
| 365 |
|
case '\n': |
| 366 |
|
case '\r': |
| 430 |
|
free_raster(ourras); |
| 431 |
|
getras(); |
| 432 |
|
/* fall through */ |
| 433 |
< |
case CTRL(R): /* redraw */ |
| 434 |
< |
case CTRL(L): |
| 433 |
> |
case CTRL('R'): /* redraw */ |
| 434 |
> |
case CTRL('L'): |
| 435 |
|
unmap_rcolors(ourras); |
| 436 |
|
XClear(wind); |
| 437 |
|
return(redraw(0, 0, width, height)); |