79 static char temp[] =
"rlecatXXXXXX";
85 int rle_cnt, rle_err,
y, nskip;
97 if (
scanargs( argc, argv,
"% c%- n%-repeat-count!d o%-outfile!s files%*s",
98 &cflag, &nflag, &rep_cnt,
99 &
oflag, &outfname, &nfiles, &infname ) == 0 )
122 int fd = mkstemp(temp);
123 if (fd == -1 || (tmpfile = fdopen(fd,
"w+")) == NULL) {
124 perror(
"Unable to open tempfile");
132 for ( file_cnt = 0; file_cnt < nfiles; file_cnt++ )
135 rle_names( &in_hdr, out_hdr.
cmd, infname[file_cnt], 0 );
163 sprintf( buf,
"TITLE=%s", infname[file_cnt] );
165 sprintf( buf,
"TITLE=%s(%d)", infname[file_cnt],
189 while ( (nskip =
rle_getraw( &in_hdr, rows, n_op )) != 32768 )
217 if ( !cflag && nflag )
218 rep_file( &tmp_hdr, &out_hdr, rep_cnt );
232 if ( cflag && nflag )
233 rep_file( &tmp_hdr, &out_hdr, rep_cnt );
FILE * rle_open_f_noexit(const char *prog_name, const char *f_name, const char *mode)
void rle_skiprow(rle_hdr *the_hdr, int nrow)
int scanargs(int argc, char **argv, const char *format,...)
void rle_freeraw(rle_hdr *the_hdr, scanraw, nraw)
char * rle_getcom(const char *name, rle_hdr *the_hdr)
const char * rle_putcom(const char *value, rle_hdr *the_hdr)
void rle_addhist(char *argv[], rle_hdr *in_hdr, rle_hdr *out_hdr)
void rle_puteof(rle_hdr *the_hdr)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
int rle_get_setup(rle_hdr *the_hdr)
int rle_get_error(int code, const char *pgmname, const char *fname)
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
void rle_put_setup(rle_hdr *the_hdr)
char * cmd_name(char **argv)
unsigned int rle_getraw(rle_hdr *the_hdr, scanraw, nraw)
#define RLE_CHECK_ALLOC(pgm, ptr, name)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)