=========================================================================== BBS: The Abacus * HST/DS * Potterville, MI Date: 03-19-93 (13:39) Number: 118 From: ERIC STEVENS Refer#: NONE To: ALL Recvd: NO Subj: Bin2txt pd source Conf: (36) C Language --------------------------------------------------------------------------- /* ** bin2txt ** Written By Eric Stevens ** March 19, 1993 ** Released to Public Domain ** ** Reads a file saved in binary mode and copies data to a text file. ** Useful to convert CAPture files created by Telix or other terminals. ** Also displays a method to turn on and off cursor blinking. */ #include #include #include int main (int argc,char **argv) { FILE *infile; FILE *outfile; char buffer; char x = 0; union REGS foo; printf("\n\nbin2txt - Written by Eric Stevens\n"); if (argc < 3) { printf ("\nCommand Line Systax : \n "); printf ("bin2txt \n\n"); return 1; } if (!(infile = fopen(argv[1],"rb"))) { printf ("\n\"%s\" could not be found\n",argv[1]); return 1; } if (!(outfile = fopen(argv[2],"wt"))) { printf ("\n\"%s\" could not be created\n",argv[2]); return 1; } printf("\n Converting File : "); foo.h.ah = 1; /* */ foo.h.ch = 32; /* Turn Cursor Off */ int86(0x10,&foo,&foo); /* */ while (fread(&buffer,sizeof(char),1,infile)) { if (buffer == 13) buffer = 0; if (x == 20) printf("\b\x2d"); if (x == 40) printf("\b\x2f"); if (x == 60) printf("\b\x5c"); if (x == 80) printf("\b\xb3"); x++; if (x == 100) x = 0; fwrite(&buffer,sizeof(char),1,outfile); } printf("\bDone!\n"); foo.h.ah = 1; /* */ foo.h.ch = 6; /* Turn Cursor On */ foo.h.cl = 7; /* */ int86(0x10,&foo,&foo); /* */ return 0; } * SLMR 2.1a * "I'm not lying, I just have new facts..." --- MsgToss 2.0d(beta) 02/21/93 * Origin: Morning Sun, SanAntone,TX. 210-697-0806 V.32/V32b 14400 (1:387/697) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 239/1004 SEEN-BY: 280/1 390/1 396/1 5 15 730/6 2270/1 3603/20