home *** CD-ROM | disk | FTP | other *** search
/ Flop Magazin 31 / Flop_Magazin_31_1994_05_Raster_cs_Side_B.atr / parjoy.c < prev    next >
Text File  |  2023-02-26  |  1KB  |  1 lines

  1. /*¢¢    'PARJOY' File Transmitter V2.0¢    (c)1994 Jiri Svoboda, Freeware.¢¢*/¢¢#include <stdio.h>¢¢#define HEADER  "\n'PARJOY' File Transmitter V2.0\n(c)1994 Jiri Svoboda, Freeware\n\n"¢#define HELP    "Usage: PARJOY <input> <output>\n\n"¢#define OPENERR "Can't open '%s'!\n\n"¢#define TRANS1  "Transmitting...\n"¢#define TRANS2  "End of transmission.\n\n"¢¢¢void main(argc, argv)¢¢int argc;¢char *argv[];¢¢    $(¢        FILE *infile,¢             *outfile;¢        char inbuf[1],¢             outbuf[4];¢¢        printf(HEADER);¢        if (argc!=3)¢            $(¢                printf(HELP);¢                return;¢            $)¢        if (!(infile= fopen(argv[1],"rb") ))¢            $(¢                printf(OPENERR,argv[1]);¢                return;¢            $)¢        if (!(outfile= fopen(argv[2],"wb") ))¢            $(¢                printf(OPENERR,argv[2]);¢                fclose(infile);¢                return;¢            $)¢        printf(TRANS1);¢        for (;;)¢            $(¢                if (!( fread(inbuf,sizeof(char),1,infile) ))¢                    break;¢¢                outbuf[0]=(inbuf[0]>>6)&3;¢                outbuf[1]=(inbuf[0]>>4)&3;¢                outbuf[2]=(inbuf[0]>>2)&3;¢                outbuf[3]= inbuf[0]    &3;¢¢                fwrite(outbuf,sizeof(char),4,outfile);¢            $)¢        fclose(outfile);¢        fclose(infile);¢        printf(TRANS2);¢    $)¢¢