Category : Modula II Source Code
Archive   : M2PROT.ZIP
Filename : QCDISP.DEF

 
Output of file : QCDISP.DEF contained in archive : M2PROT.ZIP
(*# call(o_a_copy => off) *)
(*%F _fdata *)
(*# call(seg_name => null) *)
(*%E *)
(*# module(implementation=>on) *)
(*# data(seg_name => null) *)
DEFINITION MODULE QCdisp;

(* NOTE: THIS IS AN ABRIDGED VERSION OF QCdisp TO DEFINE PROCEDURES *)
(* USED IN FILE TRANSFER PROTOCOLS *)

(* This JPI Modula-2 module is part of *)

(* QC -- a communications program *)
(* by Carl Neiburger *)
(* 169 N. 25th St.*)
(* San Jose, Calif. 95116 *)

(* CompuServe No. 72336,2257 *)

(* DataDisplay produces a screen looking like this:

2 Date Sending/Receiving (ASCII/Binary) Modem speed: 0000 bps Time
3 D:\PATH\Filename
4 Protoco-CRC Data rate: 00000 Bytes Time left: 000:00
5
6 Packets Total Bytes Data Bytes Data Left Errors
7 Sent
8 Received
0 1 2 3 4 5 6 7
1 0 0 0 0 0 0 0
*)
FROM FioAsm IMPORT PathStr;
FROM UTIL IMPORT str9;

TYPE

DataField = ( Packets, TotalBytes, DataBytes, Errs, DataLeft );
ProtoType = (XModem, XModem1K, YModem, Telink, Kermit, BPlus, ZModem );
ProtoNameArray =ARRAY ProtoType OF str9;

QCDefType = RECORD
baud : [SHORTCARD(0)..SHORTCARD(5)];
(* baud (0) = 300;
baud (1) = 600;
baud (2) = 1200;
baud (3) = 2400;
baud (4) = 4800;
baud (5) = 9600 *)
Protocol : ProtoType;
(* Record also includes defaults unrelated to transfer protocols *)
END;

QCDefTypePtr = POINTER TO QCDefType;

CONST

QCDef = QCDefType(
3, (* baud *)
XModem); (* Protocol *)

ProtoNames =
ProtoNameArray('XModem ', 'XModem-1K', 'YModem ', 'Telink ',
'Kermit ', 'B Plus ', 'ZModem ' );

AbortMsg = 'Aborting at your request.';
TimeoutMsg = 'Time out.';
TimeoutAbortMsg = 'Timed out. Aborting.';
CreateError = 'Error creating file.';
WriteErrorMsg = 'Write error. Aborting.';
CloseError = 'Error closing file.';
OpenError = 'Cannot open file.';

VAR
QCDefPtr : QCDefTypePtr;
(* Used to dynamically modify QCDef *)

DataRegisters : ARRAY BOOLEAN, DataField OF LONGCARD;

PROCEDURE PressKey( message: ARRAY OF CHAR );
(* Displays a message, asking user to press key to continue *)

PROCEDURE ShowTransferTime;
(* When transfer of one file is completed, shows how long it took
with data transmission speed *)

PROCEDURE ShowErrorType(ItsCRC: BOOLEAN);
(* When transfer display is on, shows whether CRC is in use *)

PROCEDURE UpdateData;
(* Updates screen display using current figures from DataRegisters *)

PROCEDURE StartDisplay( UseProto: BOOLEAN; Proto : ProtoType;
Receiving : BOOLEAN );
(* Initializes file transfer display and resets DataRegisters to zero *)
(* UseProto indicates whether a transfer protocol is in use (GIF
transfers may use none *)
(* Proto is the name of the protocol, if known, for screen display.
For XModem family, protocol may not be immediately known. *)
(* Receiving is true if downloading. Causes word "Receiving" to appear
in display. *)

PROCEDURE ShowTransferType( FileType: ARRAY OF CHAR );
(* When transfer display is on, shows what protocol is in use *)

PROCEDURE ShowTimeLeft( Receiving: BOOLEAN);
(* When transfer is in progress, shows estimated time left, if known *)
(* Receiving is TRUE for download, FALSE for upload *)

PROCEDURE DisplayData( field: DataField; Receiving: BOOLEAN);
(* Updates the identified field in DataRegisters *)

PROCEDURE IncrDataBytes( Num: CARDINAL; Receiving: BOOLEAN );
(* Increments DataRegisters[DataBytes, Receiving] and
Decrements DataRegisters[DataLeft, Receiving] by Num bytes,
and calls UpdateData and ShowTimeLeft *)
(* Receiving is TRUE for download, FALSE for upload *)

PROCEDURE ShowFileName( Name : ARRAY OF CHAR; Receiving: BOOLEAN );
(* When transfer display is on, shows file name. Required for
multifile transfers *)
(* Receiving is TRUE for download, FALSE for upload *)

PROCEDURE ShowPacketSize( i : CARDINAL );
(* Displays size of packets in use. May change in protocols
that have algorithms to adjust for frequency of errors *)

PROCEDURE StatusMessage( Msg : ARRAY OF CHAR; WaitForKey : BOOLEAN );
(* Displays a message on transfer status.
If WaitForKey, requests user to press a key to continue *)

PROCEDURE StopDisplay;
(* At close of transfer, ends display *)

PROCEDURE PromptForChar( prompt : ARRAY OF CHAR; VAR ch:CHAR );
(* Asks user to enter a character according to choices displayed
in Prompt *)

PROCEDURE Yes ( prompt : ARRAY OF CHAR ): BOOLEAN;
(* Asks user to enter 'Y' or 'N'. Returns TRUE for 'Y' *)

PROCEDURE PromptForString(
prompt : ARRAY OF CHAR; VAR s : ARRAY OF CHAR ): BOOLEAN;
(* Asks user to enter a string in response to prompt. *)
(* Returns TRUE if s <> '' *)

END QCdisp.


  3 Responses to “Category : Modula II Source Code
Archive   : M2PROT.ZIP
Filename : QCDISP.DEF

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/