33 #define VAXSHORT( var, fp )
34 { var = fgetc(fp)&0xFF
; var |= (fgetc(fp)) << 8
; }
38 #define OPCODE(inst) (inst[0
] & ~LONG)
39 #define LONGP(inst) (inst[0
] & LONG)
40 #define DATUM(inst) (inst[1
] & 0xff
)
43 #define put16(a) (putc
((a)&0xff
,outfile),putc
(((a)>>8
)&0xff
,outfile))
80 if ( in_hdr->priv.get.vert_skip > 0 )
82 in_hdr->priv.get.scan_y += in_hdr->priv.get.vert_skip;
83 if ( in_hdr->priv.get.vert_skip > 1 )
87 if ( in_hdr->priv.get.is_eof )
93 if ( the_hdr->priv.put.nblank > 0 )
96 the_hdr->priv.put.nblank = 0;
101 buffer = (
char *)malloc( buflen );
108 inst[0] = getc( infile );
109 inst[1] = getc( infile );
114 in_hdr->priv.get.is_eof = 1;
122 putc( inst[0], outfile );
123 putc( inst[1], outfile );
126 putc( getc( infile ), outfile );
127 putc( getc( infile ), outfile );
132 putc( inst[0], outfile );
133 putc( inst[1], outfile );
137 putc( inst[0], outfile );
138 putc( inst[1], outfile );
141 putc( getc( infile ), outfile );
142 putc( getc( infile ), outfile );
147 putc( inst[0], outfile );
148 putc( inst[1], outfile );
157 nc = 2 * ((nc + 1) / 2);
159 while ( nc > buflen )
161 fread( buffer, nc, 1, infile );
162 fwrite( buffer, nc, 1, outfile );
166 fread( buffer, nc, 1, infile );
167 fwrite( buffer, nc, 1, outfile );
171 putc( inst[0], outfile );
172 putc( inst[1], outfile );
175 putc( getc( infile ), outfile );
176 putc( getc( infile ), outfile );
179 putc( getc( infile ), outfile );
180 putc( getc( infile ), outfile );
184 in_hdr->priv.get.is_eof = 1;
190 "%s: rle_cp: Unrecognized opcode: %d, reading %s\n",
200 in_hdr->priv.get.scan_y = in_hdr
->ymax;
201 in_hdr->priv.get.vert_skip = 0;
void rle_cp(rle_hdr *in_hdr, rle_hdr *the_hdr)
void rle_puteof(rle_hdr *the_hdr)
#define SkipBlankLines(n)
void rle_skiprow(rle_hdr *the_hdr, int nrow)
#define VAXSHORT(var, fp)