11 static char rcsid[] =
"$Header: /l/spencer/src/urt/tools/RCS/rlecat.c,v 3.0.1.4 1992/04/30 14:11:43 spencer Exp $";
28 static void rep_file(rle_hdr *, rle_hdr *,
int);
30 static void rep_file();
79 static char temp[] =
"rlecatXXXXXX";
85 int rle_cnt, rle_err, y, nskip;
87 FILE *outfile, *tmpfile = NULL;
88 rle_hdr in_hdr, out_hdr;
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++ )
163 sprintf( buf,
"TITLE=%s", infname[file_cnt] );
165 sprintf( buf,
"TITLE=%s(%d)", infname[file_cnt],
217 if ( !cflag && nflag )
232 if ( cflag && nflag )
264 rle_hdr *in_hdr, *out_hdr;
271 while ( --rep_cnt > 0 )
275 n < pos && (nr = fread( buf, 1, BUFSIZ, in_hdr
->rle_file )) > 0;
rle_hdr * rle_hdr_cp(rle_hdr *from_hdr, rle_hdr *to_hdr)
void rle_freeraw(rle_hdr *the_hdr, scanraw, nraw)
void rle_names(rle_hdr *the_hdr, const char *pgmname, const char *fname, int img_num)
int rle_raw_alloc(rle_hdr *the_hdr, rle_op ***scanp, int **nrawp)
char * cmd_name(char **argv)
void main(int argc, char **argv)
int rle_get_setup(rle_hdr *the_hdr)
void rle_putraw(rle_op **scanraw, int *nraw, rle_hdr *the_hdr)
int rle_get_error(int code, const char *pgmname, const char *fname)
int scanargs(int argc, char **argv, const char *format,...)
void rle_puteof(rle_hdr *the_hdr)
void rle_addhist(argv, rle_hdr *in_hdr, rle_hdr *out_hdr)
FILE * rle_open_f_noexit(char *prog_name, char *file_name, char *mode)
void rle_skiprow(rle_hdr *the_hdr, int nrow)
char * rle_getcom(char *name, rle_hdr *the_hdr) const
void rle_put_setup(rle_hdr *the_hdr)
const char * rle_putcom(char *value, rle_hdr *the_hdr) const
void rle_raw_free(rle_hdr *the_hdr, rle_op **scanp, nrawp)
static void rep_file(rle_hdr *in_hdr, rle_hdr *out_hdr, int rep_cnt)
rle_hdr * rle_hdr_init(rle_hdr *the_hdr)
unsigned int rle_getraw(rle_hdr *the_hdr, scanraw, nraw)
#define RLE_CHECK_ALLOC(pgm, ptr, name)