home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari FTP
/
ATARI_FTP_0693.zip
/
ATARI_FTP_0693
/
Tex
/
Dvi
/
dvieps.arc
/
EPS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-10-28
|
880b
|
46 lines
/* simple-minded dump-to-epson frob */
#include <stdio.h>
#include <file.h>
#include <osbind.h>
main(argc, argv)
int argc;
char ** argv;
{
char * name, * p;
int nbufs, nbytes;
char buf[1024];
int inf, outf;
if (argc < 2)
{
fprintf(stderr, "Eps what?\n");
exit(1);
}
name = (char * )malloc(256);
strcpy(name, argv[1]);
if ((inf = open(name, O_RDONLY, 0)) <= 0)
{
strcat(name, ".eps");
if ((inf = open(name, O_RDONLY, 0)) <= 0)
{
fprintf(stderr, "Eps: can't open %s or %s. Giving up.\n",
argv[1], name);
exit(2);
}
}
/* outf = open("PRN:", O_WRONLY, 0); */
for (nbufs = 0 ; ((nbytes = Fread(inf, 1024, &buf)) > 0) ; nbufs++)
{
/* Fwrite(outf, nbytes, &buf); */
for (p = &buf[0] ; nbytes > 0 ; nbytes--)
Cprnout(*p++);
fprintf(stdout, " %dK", nbufs);
}
close(inf);
close(outf);
}