5 |
|
* Program to convert meta-files to Targa 8-bit color-mapped format |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
|
|
10 |
< |
#define MAXALLOC 5000 |
10 |
< |
|
11 |
< |
#define DXSIZE 400 /* default x resolution */ |
12 |
< |
|
13 |
< |
#define DYSIZE 400 /* default y resolution */ |
14 |
< |
|
15 |
< |
#define XCOM "pexpand +vOCImsp -DP %s | psort +y" |
16 |
< |
|
17 |
< |
|
18 |
< |
|
19 |
< |
|
10 |
> |
#include "rtprocess.h" |
11 |
|
#include "meta.h" |
21 |
– |
|
12 |
|
#include "plot.h" |
23 |
– |
|
13 |
|
#include "rast.h" |
25 |
– |
|
14 |
|
#include "targa.h" |
15 |
|
|
16 |
+ |
#define MAXALLOC 5000 |
17 |
+ |
#define DXSIZE 400 /* default x resolution */ |
18 |
+ |
#define DYSIZE 400 /* default y resolution */ |
19 |
+ |
#define XCOM "pexpand +vOCImsp -DP %s | psort +y" |
20 |
|
|
21 |
|
|
30 |
– |
|
22 |
|
char *progname; |
23 |
|
|
24 |
|
SCANBLOCK outblock; |
39 |
|
static short condonly = FALSE, |
40 |
|
conditioned = FALSE; |
41 |
|
|
42 |
+ |
static int putthead(struct hdStruct *hp, char *ip, FILE *fp); |
43 |
+ |
|
44 |
+ |
|
45 |
+ |
|
46 |
|
char * |
47 |
|
findtack(s) /* find place to tack on suffix */ |
48 |
|
register char *s; |
53 |
|
} |
54 |
|
|
55 |
|
|
56 |
< |
main(argc, argv) |
56 |
> |
int |
57 |
> |
main( |
58 |
> |
int argc, |
59 |
> |
char **argv |
60 |
> |
) |
61 |
|
|
63 |
– |
int argc; |
64 |
– |
char **argv; |
65 |
– |
|
62 |
|
{ |
63 |
|
FILE *fp; |
68 |
– |
FILE *popen(); |
64 |
|
char comargs[200], command[300]; |
65 |
|
|
66 |
|
fout = stdout; |
142 |
|
|
143 |
|
|
144 |
|
|
145 |
< |
|
146 |
< |
|
152 |
< |
|
153 |
< |
thispage() /* rewind current file */ |
145 |
> |
void |
146 |
> |
thispage(void) /* rewind current file */ |
147 |
|
{ |
148 |
|
if (lineno) |
149 |
|
error(USER, "cannot restart page in thispage"); |
150 |
|
} |
151 |
|
|
152 |
|
|
153 |
< |
|
154 |
< |
initfile() /* initialize this file */ |
153 |
> |
void |
154 |
> |
initfile(void) /* initialize this file */ |
155 |
|
{ |
156 |
|
static int filenum = 0; |
157 |
|
/* |
189 |
|
|
190 |
|
|
191 |
|
|
192 |
+ |
void |
193 |
+ |
nextpage(void) /* advance to next page */ |
194 |
|
|
200 |
– |
nextpage() /* advance to next page */ |
201 |
– |
|
195 |
|
{ |
196 |
|
|
197 |
|
if (lineno == 0) |
212 |
|
|
213 |
|
#define MINRUN 4 |
214 |
|
|
215 |
+ |
extern void |
216 |
+ |
printblock(void) /* output scanline block to file */ |
217 |
|
|
223 |
– |
printblock() /* output scanline block to file */ |
224 |
– |
|
218 |
|
{ |
219 |
|
int i, c2; |
220 |
|
register unsigned char *scanline; |
221 |
< |
register int j, beg, cnt; |
221 |
> |
register int j, beg, cnt = 0; |
222 |
|
|
223 |
|
if (lineno == 0) |
224 |
|
initfile(); |
250 |
|
} |
251 |
|
|
252 |
|
|
253 |
< |
putint2(i, fp) /* put a 2-byte positive integer */ |
254 |
< |
register int i; |
255 |
< |
register FILE *fp; |
253 |
> |
void |
254 |
> |
putint2( /* put a 2-byte positive integer */ |
255 |
> |
register int i, |
256 |
> |
register FILE *fp |
257 |
> |
) |
258 |
|
{ |
259 |
|
putc(i&0xff, fp); |
260 |
|
putc(i>>8&0xff, fp); |
261 |
|
} |
262 |
|
|
263 |
|
|
264 |
< |
putthead(hp, ip, fp) /* write header to output */ |
265 |
< |
struct hdStruct *hp; |
266 |
< |
char *ip; |
267 |
< |
register FILE *fp; |
264 |
> |
int |
265 |
> |
putthead( /* write header to output */ |
266 |
> |
struct hdStruct *hp, |
267 |
> |
char *ip, |
268 |
> |
register FILE *fp |
269 |
> |
) |
270 |
|
{ |
271 |
|
if (ip != NULL) |
272 |
|
putc(strlen(ip), fp); |