7 |
|
* 4/23/86 |
8 |
|
*/ |
9 |
|
|
10 |
– |
#include <time.h> |
11 |
– |
|
12 |
– |
#include "standard.h" |
10 |
|
#include "platform.h" |
11 |
+ |
#include "standard.h" |
12 |
|
#include "color.h" |
13 |
|
#include "resolu.h" |
14 |
+ |
#include "view.h" |
15 |
|
|
16 |
|
#define min(a,b) ((a)<(b)?(a):(b)) |
17 |
|
|
20 |
|
#define BRIGHT 4 |
21 |
|
|
22 |
|
RESOLU picres; /* resolution of picture */ |
24 |
– |
|
23 |
|
int uniq = 0; /* print only unique values? */ |
26 |
– |
|
24 |
|
int doexposure = 0; /* exposure change? (>100 to print) */ |
28 |
– |
|
25 |
|
int dataonly = 0; /* data only format? */ |
30 |
– |
|
26 |
|
int putprim = ALL; /* what to put out */ |
32 |
– |
|
27 |
|
int reverse = 0; /* reverse conversion? */ |
34 |
– |
|
28 |
|
int format = 'a'; /* input/output format */ |
29 |
|
char *fmtid = "ascii"; /* format identifier for header */ |
37 |
– |
|
30 |
|
int header = 1; /* do header? */ |
39 |
– |
|
31 |
|
long skipbytes = 0; /* skip bytes in input? */ |
32 |
< |
|
42 |
< |
int swapbytes = 0; /* swap bytes in 16-bit words? */ |
43 |
< |
|
32 |
> |
int swapbytes = 0; /* swap bytes? */ |
33 |
|
int interleave = 1; /* file is interleaved? */ |
45 |
– |
|
34 |
|
int resolution = 1; /* put/get resolution string? */ |
47 |
– |
|
35 |
|
int original = 0; /* convert to original values? */ |
49 |
– |
|
36 |
|
int wrongformat = 0; /* wrong input format? */ |
51 |
– |
|
37 |
|
double gamcor = 1.0; /* gamma correction */ |
38 |
|
|
39 |
|
int ord[3] = {RED, GRN, BLU}; /* RGB ordering */ |
46 |
|
FILE *fin; |
47 |
|
FILE *fin2 = NULL, *fin3 = NULL; /* for other color channels */ |
48 |
|
|
64 |
– |
int (*getval)(), (*putval)(); |
49 |
|
|
50 |
< |
double |
51 |
< |
rgb_bright(clr) |
52 |
< |
COLOR clr; |
50 |
> |
typedef int getfunc_t(COLOR col); |
51 |
> |
typedef int putfunc_t(COLOR col); |
52 |
> |
typedef double brightfunc_t(COLOR col); |
53 |
> |
|
54 |
> |
getfunc_t *getval; |
55 |
> |
putfunc_t *putval; |
56 |
> |
brightfunc_t *mybright; |
57 |
> |
|
58 |
> |
static gethfunc checkhead; |
59 |
> |
static brightfunc_t rgb_bright, xyz_bright; |
60 |
> |
static getfunc_t getbascii, getbint, getbdouble, getbfloat, getbbyte, getbword; |
61 |
> |
static getfunc_t getcascii, getcint, getcdouble, getcfloat, getcbyte, getcword; |
62 |
> |
static putfunc_t putbascii, putbint, putbdouble, putbfloat, putbbyte, putbword; |
63 |
> |
static putfunc_t putcascii, putcint, putcdouble, putcfloat, putcbyte, putcword; |
64 |
> |
static putfunc_t putpascii, putpint, putpdouble, putpfloat, putpbyte, putpword; |
65 |
> |
|
66 |
> |
static void set_io(void); |
67 |
> |
static void pixtoval(void); |
68 |
> |
static void valtopix(void); |
69 |
> |
static void swap16(uint16 *wp, int n); |
70 |
> |
static void swap32(uint32 *wp, int n); |
71 |
> |
static void swap64(char *wp, int n); |
72 |
> |
|
73 |
> |
|
74 |
> |
static double |
75 |
> |
rgb_bright( |
76 |
> |
COLOR clr |
77 |
> |
) |
78 |
|
{ |
79 |
|
return(bright(clr)); |
80 |
|
} |
81 |
|
|
82 |
< |
double |
83 |
< |
xyz_bright(clr) |
84 |
< |
COLOR clr; |
82 |
> |
static double |
83 |
> |
xyz_bright( |
84 |
> |
COLOR clr |
85 |
> |
) |
86 |
|
{ |
87 |
|
return(clr[CIEY]); |
88 |
|
} |
89 |
|
|
90 |
< |
double (*mybright)() = &rgb_bright; |
91 |
< |
|
92 |
< |
|
93 |
< |
main(argc, argv) |
94 |
< |
int argc; |
85 |
< |
char **argv; |
90 |
> |
int |
91 |
> |
main( |
92 |
> |
int argc, |
93 |
> |
char **argv |
94 |
> |
) |
95 |
|
{ |
87 |
– |
extern int checkhead(); |
88 |
– |
extern long atol(); |
96 |
|
double d, expval = 1.0; |
97 |
|
int i; |
98 |
|
|
99 |
|
progname = argv[0]; |
100 |
+ |
mybright = &rgb_bright; /* default */ |
101 |
|
|
102 |
|
for (i = 1; i < argc; i++) |
103 |
|
if (argv[i][0] == '-' || argv[i][0] == '+') |
181 |
|
format = 'w'; |
182 |
|
fmtid = "16-bit"; |
183 |
|
break; |
184 |
+ |
case 'F': /* swapped floats */ |
185 |
+ |
swapbytes = 1; |
186 |
|
case 'f': /* float */ |
187 |
|
dataonly = 1; |
188 |
|
format = 'f'; |
189 |
|
fmtid = "float"; |
190 |
|
break; |
191 |
+ |
case 'D': /* swapped doubles */ |
192 |
+ |
swapbytes = 1; |
193 |
|
case 'd': /* double */ |
194 |
|
dataonly = 1; |
195 |
|
format = 'd'; |
360 |
|
} |
361 |
|
|
362 |
|
quit(0); |
363 |
+ |
return 0; /* pro forma return */ |
364 |
|
} |
365 |
|
|
366 |
|
|
367 |
< |
int |
368 |
< |
checkhead(line) /* deal with line from header */ |
369 |
< |
char *line; |
367 |
> |
static int |
368 |
> |
checkhead( /* deal with line from header */ |
369 |
> |
char *line, |
370 |
> |
void *p |
371 |
> |
) |
372 |
|
{ |
373 |
|
char fmt[32]; |
374 |
|
double d; |
401 |
|
} |
402 |
|
|
403 |
|
|
404 |
< |
pixtoval() /* convert picture to values */ |
404 |
> |
static void |
405 |
> |
pixtoval(void) /* convert picture to values */ |
406 |
|
{ |
407 |
|
register COLOR *scanln; |
408 |
|
int dogamma; |
475 |
|
} |
476 |
|
|
477 |
|
|
478 |
< |
valtopix() /* convert values to a pixel file */ |
478 |
> |
static void |
479 |
> |
valtopix(void) /* convert values to a pixel file */ |
480 |
|
{ |
481 |
|
int dogamma; |
482 |
|
register COLOR *scanln; |
528 |
|
} |
529 |
|
|
530 |
|
|
531 |
< |
swap16(wp, n) /* swap n 16-bit words */ |
532 |
< |
register uint16 *wp; |
533 |
< |
int n; |
531 |
> |
static void |
532 |
> |
swap16( /* swap n 16-bit words */ |
533 |
> |
register uint16 *wp, |
534 |
> |
int n |
535 |
> |
) |
536 |
|
{ |
537 |
|
while (n-- > 0) { |
538 |
|
*wp = *wp << 8 | ((*wp >> 8) & 0xff); |
540 |
|
} |
541 |
|
} |
542 |
|
|
543 |
< |
getcascii(col) /* get an ascii color value from stream(s) */ |
544 |
< |
COLOR col; |
543 |
> |
|
544 |
> |
static void |
545 |
> |
swap32( /* swap n 32-bit words */ |
546 |
> |
register uint32 *wp, |
547 |
> |
int n |
548 |
> |
) |
549 |
|
{ |
550 |
+ |
while (n-- > 0) { |
551 |
+ |
*wp = *wp << 24 | ((*wp >> 24) & 0xff) | |
552 |
+ |
(*wp & 0xff00) << 8 | (*wp & 0xff0000) >> 8; |
553 |
+ |
wp++; |
554 |
+ |
} |
555 |
+ |
} |
556 |
+ |
|
557 |
+ |
|
558 |
+ |
static void |
559 |
+ |
swap64( /* swap n 64-bit words */ |
560 |
+ |
register char *wp, |
561 |
+ |
int n |
562 |
+ |
) |
563 |
+ |
{ |
564 |
+ |
register int t; |
565 |
+ |
|
566 |
+ |
while (n-- > 0) { |
567 |
+ |
t = wp[0]; wp[0] = wp[7]; wp[7] = t; |
568 |
+ |
t = wp[1]; wp[1] = wp[6]; wp[6] = t; |
569 |
+ |
t = wp[2]; wp[2] = wp[5]; wp[5] = t; |
570 |
+ |
t = wp[3]; wp[3] = wp[4]; wp[4] = t; |
571 |
+ |
wp += 8; |
572 |
+ |
} |
573 |
+ |
} |
574 |
+ |
|
575 |
+ |
|
576 |
+ |
static int |
577 |
+ |
getcascii( /* get an ascii color value from stream(s) */ |
578 |
+ |
COLOR col |
579 |
+ |
) |
580 |
+ |
{ |
581 |
|
double vd[3]; |
582 |
|
|
583 |
|
if (fin2 == NULL) { |
594 |
|
} |
595 |
|
|
596 |
|
|
597 |
< |
getcdouble(col) /* get a double color value from stream(s) */ |
598 |
< |
COLOR col; |
597 |
> |
static int |
598 |
> |
getcdouble( /* get a double color value from stream(s) */ |
599 |
> |
COLOR col |
600 |
> |
) |
601 |
|
{ |
602 |
|
double vd[3]; |
603 |
|
|
610 |
|
fread((char *)(vd+2), sizeof(double), 1, fin3) != 1) |
611 |
|
return(-1); |
612 |
|
} |
613 |
+ |
if (swapbytes) |
614 |
+ |
swap64((char *)vd, 3); |
615 |
|
setcolor(col, vd[rord[RED]], vd[rord[GRN]], vd[rord[BLU]]); |
616 |
|
return(0); |
617 |
|
} |
618 |
|
|
619 |
|
|
620 |
< |
getcfloat(col) /* get a float color value from stream(s) */ |
621 |
< |
COLOR col; |
620 |
> |
static int |
621 |
> |
getcfloat( /* get a float color value from stream(s) */ |
622 |
> |
COLOR col |
623 |
> |
) |
624 |
|
{ |
625 |
|
float vf[3]; |
626 |
|
|
633 |
|
fread((char *)(vf+2), sizeof(float), 1, fin3) != 1) |
634 |
|
return(-1); |
635 |
|
} |
636 |
+ |
if (swapbytes) |
637 |
+ |
swap32((uint32 *)vf, 3); |
638 |
|
setcolor(col, vf[rord[RED]], vf[rord[GRN]], vf[rord[BLU]]); |
639 |
|
return(0); |
640 |
|
} |
641 |
|
|
642 |
|
|
643 |
< |
getcint(col) /* get an int color value from stream(s) */ |
644 |
< |
COLOR col; |
643 |
> |
static int |
644 |
> |
getcint( /* get an int color value from stream(s) */ |
645 |
> |
COLOR col |
646 |
> |
) |
647 |
|
{ |
648 |
|
int vi[3]; |
649 |
|
|
662 |
|
} |
663 |
|
|
664 |
|
|
665 |
< |
getcbyte(col) /* get a byte color value from stream(s) */ |
666 |
< |
COLOR col; |
665 |
> |
static int |
666 |
> |
getcbyte( /* get a byte color value from stream(s) */ |
667 |
> |
COLOR col |
668 |
> |
) |
669 |
|
{ |
670 |
|
BYTE vb[3]; |
671 |
|
|
684 |
|
} |
685 |
|
|
686 |
|
|
687 |
< |
getcword(col) /* get a 16-bit color value from stream(s) */ |
688 |
< |
COLOR col; |
687 |
> |
static int |
688 |
> |
getcword( /* get a 16-bit color value from stream(s) */ |
689 |
> |
COLOR col |
690 |
> |
) |
691 |
|
{ |
692 |
|
uint16 vw[3]; |
693 |
|
|
708 |
|
} |
709 |
|
|
710 |
|
|
711 |
< |
getbascii(col) /* get an ascii brightness value from fin */ |
712 |
< |
COLOR col; |
711 |
> |
static int |
712 |
> |
getbascii( /* get an ascii brightness value from fin */ |
713 |
> |
COLOR col |
714 |
> |
) |
715 |
|
{ |
716 |
|
double vd; |
717 |
|
|
722 |
|
} |
723 |
|
|
724 |
|
|
725 |
< |
getbdouble(col) /* get a double brightness value from fin */ |
726 |
< |
COLOR col; |
725 |
> |
static int |
726 |
> |
getbdouble( /* get a double brightness value from fin */ |
727 |
> |
COLOR col |
728 |
> |
) |
729 |
|
{ |
730 |
|
double vd; |
731 |
|
|
732 |
|
if (fread((char *)&vd, sizeof(double), 1, fin) != 1) |
733 |
|
return(-1); |
734 |
+ |
if (swapbytes) |
735 |
+ |
swap64((char *)&vd, 1); |
736 |
|
setcolor(col, vd, vd, vd); |
737 |
|
return(0); |
738 |
|
} |
739 |
|
|
740 |
|
|
741 |
< |
getbfloat(col) /* get a float brightness value from fin */ |
742 |
< |
COLOR col; |
741 |
> |
static int |
742 |
> |
getbfloat( /* get a float brightness value from fin */ |
743 |
> |
COLOR col |
744 |
> |
) |
745 |
|
{ |
746 |
|
float vf; |
747 |
|
|
748 |
|
if (fread((char *)&vf, sizeof(float), 1, fin) != 1) |
749 |
|
return(-1); |
750 |
+ |
if (swapbytes) |
751 |
+ |
swap32((uint32 *)&vf, 1); |
752 |
|
setcolor(col, vf, vf, vf); |
753 |
|
return(0); |
754 |
|
} |
755 |
|
|
756 |
|
|
757 |
< |
getbint(col) /* get an int brightness value from fin */ |
758 |
< |
COLOR col; |
757 |
> |
static int |
758 |
> |
getbint( /* get an int brightness value from fin */ |
759 |
> |
COLOR col |
760 |
> |
) |
761 |
|
{ |
762 |
|
int vi; |
763 |
|
double d; |
770 |
|
} |
771 |
|
|
772 |
|
|
773 |
< |
getbbyte(col) /* get a byte brightness value from fin */ |
774 |
< |
COLOR col; |
773 |
> |
static int |
774 |
> |
getbbyte( /* get a byte brightness value from fin */ |
775 |
> |
COLOR col |
776 |
> |
) |
777 |
|
{ |
778 |
|
BYTE vb; |
779 |
|
double d; |
786 |
|
} |
787 |
|
|
788 |
|
|
789 |
< |
getbword(col) /* get a 16-bit brightness value from fin */ |
790 |
< |
COLOR col; |
789 |
> |
static int |
790 |
> |
getbword( /* get a 16-bit brightness value from fin */ |
791 |
> |
COLOR col |
792 |
> |
) |
793 |
|
{ |
794 |
|
uint16 vw; |
795 |
|
double d; |
804 |
|
} |
805 |
|
|
806 |
|
|
807 |
< |
putcascii(col) /* put an ascii color to stdout */ |
808 |
< |
COLOR col; |
807 |
> |
static int |
808 |
> |
putcascii( /* put an ascii color to stdout */ |
809 |
> |
COLOR col |
810 |
> |
) |
811 |
|
{ |
812 |
|
fprintf(stdout, "%15.3e %15.3e %15.3e\n", |
813 |
|
colval(col,ord[0]), |
818 |
|
} |
819 |
|
|
820 |
|
|
821 |
< |
putcfloat(col) /* put a float color to stdout */ |
822 |
< |
COLOR col; |
821 |
> |
static int |
822 |
> |
putcfloat( /* put a float color to stdout */ |
823 |
> |
COLOR col |
824 |
> |
) |
825 |
|
{ |
826 |
|
float vf[3]; |
827 |
|
|
828 |
|
vf[0] = colval(col,ord[0]); |
829 |
|
vf[1] = colval(col,ord[1]); |
830 |
|
vf[2] = colval(col,ord[2]); |
831 |
+ |
if (swapbytes) |
832 |
+ |
swap32((uint32 *)vf, 3); |
833 |
|
fwrite((char *)vf, sizeof(float), 3, stdout); |
834 |
|
|
835 |
|
return(ferror(stdout) ? -1 : 0); |
836 |
|
} |
837 |
|
|
838 |
|
|
839 |
< |
putcdouble(col) /* put a double color to stdout */ |
840 |
< |
COLOR col; |
839 |
> |
static int |
840 |
> |
putcdouble( /* put a double color to stdout */ |
841 |
> |
COLOR col |
842 |
> |
) |
843 |
|
{ |
844 |
|
double vd[3]; |
845 |
|
|
846 |
|
vd[0] = colval(col,ord[0]); |
847 |
|
vd[1] = colval(col,ord[1]); |
848 |
|
vd[2] = colval(col,ord[2]); |
849 |
+ |
if (swapbytes) |
850 |
+ |
swap64((char *)vd, 3); |
851 |
|
fwrite((char *)vd, sizeof(double), 3, stdout); |
852 |
|
|
853 |
|
return(ferror(stdout) ? -1 : 0); |
854 |
|
} |
855 |
|
|
856 |
|
|
857 |
< |
putcint(col) /* put an int color to stdout */ |
858 |
< |
COLOR col; |
857 |
> |
static int |
858 |
> |
putcint( /* put an int color to stdout */ |
859 |
> |
COLOR col |
860 |
> |
) |
861 |
|
{ |
862 |
|
fprintf(stdout, "%d %d %d\n", |
863 |
|
(int)(colval(col,ord[0])*256.), |
868 |
|
} |
869 |
|
|
870 |
|
|
871 |
< |
putcbyte(col) /* put a byte color to stdout */ |
872 |
< |
COLOR col; |
871 |
> |
static int |
872 |
> |
putcbyte( /* put a byte color to stdout */ |
873 |
> |
COLOR col |
874 |
> |
) |
875 |
|
{ |
876 |
|
long i; |
877 |
|
BYTE vb[3]; |
888 |
|
} |
889 |
|
|
890 |
|
|
891 |
< |
putcword(col) /* put a 16-bit color to stdout */ |
892 |
< |
COLOR col; |
891 |
> |
static int |
892 |
> |
putcword( /* put a 16-bit color to stdout */ |
893 |
> |
COLOR col |
894 |
> |
) |
895 |
|
{ |
896 |
|
long i; |
897 |
|
uint16 vw[3]; |
910 |
|
} |
911 |
|
|
912 |
|
|
913 |
< |
putbascii(col) /* put an ascii brightness to stdout */ |
914 |
< |
COLOR col; |
913 |
> |
static int |
914 |
> |
putbascii( /* put an ascii brightness to stdout */ |
915 |
> |
COLOR col |
916 |
> |
) |
917 |
|
{ |
918 |
|
fprintf(stdout, "%15.3e\n", (*mybright)(col)); |
919 |
|
|
921 |
|
} |
922 |
|
|
923 |
|
|
924 |
< |
putbfloat(col) /* put a float brightness to stdout */ |
925 |
< |
COLOR col; |
924 |
> |
static int |
925 |
> |
putbfloat( /* put a float brightness to stdout */ |
926 |
> |
COLOR col |
927 |
> |
) |
928 |
|
{ |
929 |
|
float vf; |
930 |
|
|
931 |
|
vf = (*mybright)(col); |
932 |
+ |
if (swapbytes) |
933 |
+ |
swap32((uint32 *)&vf, 1); |
934 |
|
fwrite((char *)&vf, sizeof(float), 1, stdout); |
935 |
|
|
936 |
|
return(ferror(stdout) ? -1 : 0); |
937 |
|
} |
938 |
|
|
939 |
|
|
940 |
< |
putbdouble(col) /* put a double brightness to stdout */ |
941 |
< |
COLOR col; |
940 |
> |
static int |
941 |
> |
putbdouble( /* put a double brightness to stdout */ |
942 |
> |
COLOR col |
943 |
> |
) |
944 |
|
{ |
945 |
|
double vd; |
946 |
|
|
947 |
|
vd = (*mybright)(col); |
948 |
+ |
if (swapbytes) |
949 |
+ |
swap64((char *)&vd, 1); |
950 |
|
fwrite((char *)&vd, sizeof(double), 1, stdout); |
951 |
|
|
952 |
|
return(ferror(stdout) ? -1 : 0); |
953 |
|
} |
954 |
|
|
955 |
|
|
956 |
< |
putbint(col) /* put an int brightness to stdout */ |
957 |
< |
COLOR col; |
956 |
> |
static int |
957 |
> |
putbint( /* put an int brightness to stdout */ |
958 |
> |
COLOR col |
959 |
> |
) |
960 |
|
{ |
961 |
|
fprintf(stdout, "%d\n", (int)((*mybright)(col)*256.)); |
962 |
|
|
964 |
|
} |
965 |
|
|
966 |
|
|
967 |
< |
putbbyte(col) /* put a byte brightness to stdout */ |
968 |
< |
COLOR col; |
967 |
> |
static int |
968 |
> |
putbbyte( /* put a byte brightness to stdout */ |
969 |
> |
COLOR col |
970 |
> |
) |
971 |
|
{ |
972 |
|
register int i; |
973 |
|
BYTE vb; |
980 |
|
} |
981 |
|
|
982 |
|
|
983 |
< |
putbword(col) /* put a 16-bit brightness to stdout */ |
984 |
< |
COLOR col; |
983 |
> |
static int |
984 |
> |
putbword( /* put a 16-bit brightness to stdout */ |
985 |
> |
COLOR col |
986 |
> |
) |
987 |
|
{ |
988 |
|
long i; |
989 |
|
uint16 vw; |
998 |
|
} |
999 |
|
|
1000 |
|
|
1001 |
< |
putpascii(col) /* put an ascii primary to stdout */ |
1002 |
< |
COLOR col; |
1001 |
> |
static int |
1002 |
> |
putpascii( /* put an ascii primary to stdout */ |
1003 |
> |
COLOR col |
1004 |
> |
) |
1005 |
|
{ |
1006 |
|
fprintf(stdout, "%15.3e\n", colval(col,putprim)); |
1007 |
|
|
1009 |
|
} |
1010 |
|
|
1011 |
|
|
1012 |
< |
putpfloat(col) /* put a float primary to stdout */ |
1013 |
< |
COLOR col; |
1012 |
> |
static int |
1013 |
> |
putpfloat( /* put a float primary to stdout */ |
1014 |
> |
COLOR col |
1015 |
> |
) |
1016 |
|
{ |
1017 |
|
float vf; |
1018 |
|
|
1019 |
|
vf = colval(col,putprim); |
1020 |
+ |
if (swapbytes) |
1021 |
+ |
swap32((uint32 *)&vf, 1); |
1022 |
|
fwrite((char *)&vf, sizeof(float), 1, stdout); |
1023 |
|
|
1024 |
|
return(ferror(stdout) ? -1 : 0); |
1025 |
|
} |
1026 |
|
|
1027 |
|
|
1028 |
< |
putpdouble(col) /* put a double primary to stdout */ |
1029 |
< |
COLOR col; |
1028 |
> |
static int |
1029 |
> |
putpdouble( /* put a double primary to stdout */ |
1030 |
> |
COLOR col |
1031 |
> |
) |
1032 |
|
{ |
1033 |
|
double vd; |
1034 |
|
|
1035 |
|
vd = colval(col,putprim); |
1036 |
+ |
if (swapbytes) |
1037 |
+ |
swap64((char *)&vd, 1); |
1038 |
|
fwrite((char *)&vd, sizeof(double), 1, stdout); |
1039 |
|
|
1040 |
|
return(ferror(stdout) ? -1 : 0); |
1041 |
|
} |
1042 |
|
|
1043 |
|
|
1044 |
< |
putpint(col) /* put an int primary to stdout */ |
1045 |
< |
COLOR col; |
1044 |
> |
static int |
1045 |
> |
putpint( /* put an int primary to stdout */ |
1046 |
> |
COLOR col |
1047 |
> |
) |
1048 |
|
{ |
1049 |
|
fprintf(stdout, "%d\n", (int)(colval(col,putprim)*256.)); |
1050 |
|
|
1052 |
|
} |
1053 |
|
|
1054 |
|
|
1055 |
< |
putpbyte(col) /* put a byte primary to stdout */ |
1056 |
< |
COLOR col; |
1055 |
> |
static int |
1056 |
> |
putpbyte( /* put a byte primary to stdout */ |
1057 |
> |
COLOR col |
1058 |
> |
) |
1059 |
|
{ |
1060 |
|
long i; |
1061 |
|
BYTE vb; |
1068 |
|
} |
1069 |
|
|
1070 |
|
|
1071 |
< |
putpword(col) /* put a 16-bit primary to stdout */ |
1072 |
< |
COLOR col; |
1071 |
> |
static int |
1072 |
> |
putpword( /* put a 16-bit primary to stdout */ |
1073 |
> |
COLOR col |
1074 |
> |
) |
1075 |
|
{ |
1076 |
|
long i; |
1077 |
|
uint16 vw; |
1086 |
|
} |
1087 |
|
|
1088 |
|
|
1089 |
< |
set_io() /* set put and get functions */ |
1089 |
> |
static void |
1090 |
> |
set_io(void) /* set put and get functions */ |
1091 |
|
{ |
1092 |
|
switch (format) { |
1093 |
|
case 'a': /* ascii */ |
1215 |
|
} |
1216 |
|
return; |
1217 |
|
} |
1218 |
< |
badopt: |
1218 |
> |
/* badopt: */ /* label not used */ |
1219 |
|
fprintf(stderr, "%s: botched file type\n", progname); |
1220 |
|
quit(1); |
1221 |
|
namerr: |