/*======================================================================* * Program to view RLE pictures from a COMMAND_MENU file. * *======================================================================*/ #version $50 #reserve 6 #copyright "Viewrle.cmd Copyright 1995 K-Products" #address $7000 #include runtime.h #include bbs_pro.h #define MAXBUFF 16384 #define DISK2 2 #define D_MODEM 5 char buffer [MAXBUFF]; main() { if (length (parm1) == 0) { echose("Usage: VIEWRLE filename.ext"); return; } if (bbs_active == 0 || ignore_modem > 0) { echose("VIEWRLE may not be ran locally!"); return; } echo (125); cr_lf(); echose(" BBS Express! Pro VIEWRLE v5.0"); echose(" RLE Picture Viewer"); cr_lf(); echose("Make sure your terminal program is in"); echose("VIDTEX mode before viewing picture."); cr_lf(); echose("At completion of the picture, Flash"); echose("users may have to press the UNDO key."); echose("Then, press the key."); cr_lf(); cr_lf(); echos("Press to view or to quit: "); if (y_or_n() == 'Y') { display_file(); get_a_return(); } } get_a_return() { char temp [5]; get_string (temp, 1, 0, 1); } display_file() { byte rc1; int x, bytesin, count; printf("%e%e%e>>>> User is viewing an RLE file <<<<"); MIOsuspend(); if (open (DISK2, parm1, 4, 0) != OK) { /* open input file? */ MIOresume(); echose("Unable to open input file!"); return; } do { MIOsuspend(); bytesin = blockread (DISK2, buffer, sizeof(buffer)); MIOresume(); if (IOresult (DISK2) == OK || IOresult (DISK2) == 136) { count = 0; for (x=0; x < bytesin; ++x) { do { } while (bytes_out()); putd (D_MODEM, buffer [x]); ++count; if (count > 512) { carrier(); count = 0; } } } } while (IOresult (DISK2) == OK); MIOsuspend(); close (DISK2); MIOresume(); }