18 |
|
|
19 |
|
#include "standard.h" |
20 |
|
|
21 |
+ |
#include <string.h> |
22 |
|
#include <signal.h> |
23 |
|
#include <X11/Xlib.h> |
24 |
|
#include <X11/cursorfont.h> |
128 |
|
|
129 |
|
void onsig(int i) { sigrecv++; } |
130 |
|
|
131 |
+ |
static gethfunc headline; |
132 |
|
|
133 |
+ |
|
134 |
|
main(argc, argv) |
135 |
|
int argc; |
136 |
|
char *argv[]; |
137 |
|
{ |
135 |
– |
int headline(); |
138 |
|
int i; |
139 |
|
int pid; |
140 |
|
|
247 |
|
} |
248 |
|
|
249 |
|
|
250 |
< |
int |
251 |
< |
headline(s) /* get relevant info from header */ |
252 |
< |
char *s; |
250 |
> |
static int |
251 |
> |
headline( /* get relevant info from header */ |
252 |
> |
char *s, |
253 |
> |
void *p |
254 |
> |
) |
255 |
|
{ |
256 |
|
char fmt[32]; |
257 |
|
|
387 |
|
register int es; |
388 |
|
int cs; |
389 |
|
|
390 |
< |
if (es = err != NULL) |
390 |
> |
if ( (es = err != NULL) ) |
391 |
|
fprintf(stderr, "%s: %s: %s\n", progname, |
392 |
|
fname==NULL?"<stdin>":fname, err); |
393 |
|
if (thedisplay != NULL) |
394 |
|
XCloseDisplay(thedisplay); |
395 |
< |
if (parent < 0 & sigrecv == 0) |
395 |
> |
if ((parent < 0) & (sigrecv == 0)) |
396 |
|
kill(getppid(), SIGCONT); |
397 |
|
while (parent > 0 && wait(&cs) != -1) { /* wait for any children */ |
398 |
|
if (es == 0) |
497 |
|
if (viscmp(&xvi[i],&ourvis) > 0) |
498 |
|
quiterr("inadequate visuals on this screen"); |
499 |
|
/* OK, we'll use it */ |
500 |
< |
copystruct(&ourvis, &xvi[i]); |
500 |
> |
ourvis = xvi[i]; |
501 |
|
#ifdef DEBUG |
502 |
|
fprintf(stderr, "Selected visual type %s, depth %d\n", |
503 |
|
vistype[ourvis.class], ourvis.depth); |
540 |
|
if (ourras == NULL) |
541 |
|
goto fail; |
542 |
|
getmono(); |
543 |
< |
} else if (ourvis.class == TrueColor | ourvis.class == DirectColor) { |
543 |
> |
} else if ((ourvis.class == TrueColor) | (ourvis.class == DirectColor)) { |
544 |
|
int datsiz = ourvis.depth>16 ? sizeof(int32) : sizeof(int16); |
545 |
|
ourdata = (unsigned char *)malloc(datsiz*xmax*ymax); |
546 |
|
if (ourdata == NULL) |
588 |
|
map_rcolors(ourras, wind); |
589 |
|
if (fast) |
590 |
|
make_rpixmap(ourras, wind); |
591 |
< |
if (!sequential & parent < 0 & sigrecv == 0) { |
591 |
> |
if ((!sequential) & (parent < 0) & (sigrecv == 0)) { |
592 |
|
kill(getppid(), SIGCONT); |
593 |
|
sigrecv--; |
594 |
|
} |
797 |
|
free_rpixmap(ourras); |
798 |
|
return(0); |
799 |
|
case '0': /* recenter origin */ |
800 |
< |
if (xoff == 0 & yoff == 0) |
800 |
> |
if ((xoff == 0) & (yoff == 0)) |
801 |
|
return(0); |
802 |
|
xoff = yoff = 0; |
803 |
|
XClearWindow(thedisplay, wind); |
895 |
|
} |
896 |
|
|
897 |
|
|
898 |
< |
int |
898 |
> |
void |
899 |
|
colavg(scn, n, cavg) |
900 |
|
register COLR *scn; |
901 |
|
register int n; |
929 |
|
|
930 |
|
int |
931 |
|
dobox(f, p) /* run function over bbox */ |
932 |
< |
int (*f)(); /* function to call for each subscan */ |
932 |
> |
void (*f)(); /* function to call for each subscan */ |
933 |
|
char *p; /* pointer to private data */ |
934 |
|
{ |
935 |
|
int left, right, top, bottom; |
960 |
|
} |
961 |
|
|
962 |
|
|
963 |
< |
int |
963 |
> |
void |
964 |
|
addfix(scn, n) /* add fixation points to histogram */ |
965 |
|
COLR *scn; |
966 |
|
int n; |
1313 |
|
static int trunced = -1; /* truncated file? */ |
1314 |
|
skipit: |
1315 |
|
if (trunced >= 0 && y >= trunced) { |
1316 |
< |
bzero(scanline, xmax*sizeof(COLR)); |
1316 |
> |
memset(scanline, '\0', xmax*sizeof(COLR)); |
1317 |
|
return(-1); |
1318 |
|
} |
1319 |
|
if (y != cury) { |