Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site puff.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!uwvax!puff!wirch From: wirch@puff.UUCP Newsgroups: net.sources Subject: IBM to Amiga READ command text filter Message-ID: <503@puff.UUCP> Date: Mon, 28-Oct-85 10:13:39 EST Article-I.D.: puff.503 Posted: Mon Oct 28 10:13:39 1985 Date-Received: Wed, 30-Oct-85 06:27:14 EST Distribution: net Organization: U of Wisconsin CS Dept Lines: 81 An Amiga developer friend, John Foust, late of the net, gave this to me to post. This is the IBM to Amiga text filter. It translates stdin to the hex stream that AmigaDOS "READ" needs, expanding TABs to spaces, ignoring CR, and passing LF. Rick Wirch ---------------- cut here ------------------- /* toamiga.c A program to transfer ASCII files from a IBM PC to the Amiga, for use with the Amiga READ command. This filter ignores CR, passes LFs, and expands TABs to spaces. Stdin should be a ASCII text file. Stdout gets a stream of hex nybbles, with end of stream marked by 'Q'. V1.0: John Foust, October 26, 1985 with Lattice C v2.15 under PC-DOS. This is public domain software. If want to send me money, go for it. */ #include "stdio.h" /* TAB stop size for the output file. Any TABs are expanded to spaces. */ #define TABSIZE 8 /* a convenient buffer size for level 2 i/o */ #define BIGSIZE 512*32 /* input buffer */ char bigbuf[BIGSIZE+1]; main() { char c; int x,y, linepos; /* current column number in virtual output file */ do { x = fread(&bigbuf,1,BIGSIZE,stdin); for (y=0;y