home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / researchmachines.zip / rmldat.c < prev    next >
Text File  |  1985-07-11  |  6KB  |  170 lines

  1.  
  2. /***********************************************************************/
  3.  
  4. /*  File KDATA.C  -  RML Kermit  -  Global data.
  5.         Chris Kennington,    8th July 1985.    */
  6.  
  7. #define  DEFS1    1
  8. #define     DEFS4    1
  9.  
  10. /* definition of divisor-ruler    */
  11. #define     DL    0x18
  12. #define     D    0x1f
  13. #define  DR    0x17
  14.  
  15. #include "stdio.h"
  16. #include "b:kext.h"
  17.  
  18.  
  19. /* Original Global Variables */
  20.  
  21. int     size,
  22.     rpsiz = MAXPACKSIZ,
  23.     spsiz = MAXPACKSIZ,
  24.     pad=0,
  25.     n=0,
  26.     numtry,
  27.     oldtry,
  28.     image=FALSE,
  29.     debug,
  30.     filecount;
  31.  
  32. char    state,
  33.     padchar=NULL,
  34.     eol=CR,
  35.     quote='#',
  36.     **filelist,
  37.     *filnam,
  38.     *recpkt, *packet, *oldpkt;    /* dynamic storage    */
  39. FILE    *fp;
  40.  
  41.  
  42. struct    fcb    *ownfcb;
  43. int    badcrcs=0, dupes=0, naxin=0, timouts=0;    /* error counters    */
  44. int    rptflg;                /* repeat-processing agreed    */
  45. int    commode=0x0001;            /* comms facilities-word    */
  46. int    echo=0, list=1, oldimage=0, parity=0;
  47. char    comctrl=0xea;            /* comms WR5 setting    */
  48. char    env;                /* environment        */
  49. char    esccode, pager=0, scrline=0, spdcode=1;
  50. char    files=1;            /* current-file number    */
  51. char    kmode, abtflag, nakflag;    /* Kermit mode; abort & nak flags */
  52. char    nmavoid=1;            /* File collision avoidance    */
  53. char    netslow=0, type=0;            /* Network-slow flag, block-type    */
  54. char    softeof;
  55. char    *cmdline, *osline, *ermsg, *fname, *work, *cmdparm[10], *filblank;    /* dynamic */
  56.  
  57. char    blanx[]      ="                                                                                ";
  58. char    badmsg[]  ="Remote Kermit sent wrong packet; \"%c\" expected, \"%c\" received. ";
  59. char    dots[]      =" ... ";
  60. char    errmsg[]  ="Transfer aborted by human intervention. ";
  61. char    forhelp[] =" Type \"?\" for help";
  62. char    kqhelp[]  = "        \"H\" for help-message, \"K\" for main menu, \"Q\" to cancel Kermit.";
  63. char    mainsays[]="Mainframe says: ";
  64. char    null[]      ="";            /* empty string        */
  65. char    oprompt[] ="\rDISK> ";
  66. char    *parsets[]={"None", "Odd", "Even", "Mark", 0};
  67. char    trying[]  ="trying... ";
  68. char    divisor[] ={DL,D,D,D,D,D,D,D,D,D, D,D,D,D,D,D,D,D,D,D, 
  69.             D,D,D,D,D,D,D,D,D,D, D,D,D,D,D,D,D,D,D,D,
  70.             D,D,D,D,D,D,D,D,D,D, D,D,D,D,D,D,D,D,D,D,
  71.             D,D,D,D,D,D,D,D,D,D, D,D,D,D,D,D,D,D,D,DR};
  72.  
  73. /* line-speed codes in clear                        */
  74. char     sp0[]="110",    sp1[]="300",    sp2[]="600",
  75.     sp3[]="1200",    sp4[]="2400",    sp5[]="4800",
  76.     sp6[]="9600",    sp7[]="19200",sp8[]="40800"; 
  77. char    *spval[]={sp0,sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8};
  78.  
  79. char head2[]="  Initial Release,      Local Kermit Only,      Communications:                 ";
  80. char head3[]="  Copyright (c) 1985  U.of Columbia, N.Y. & Research Machines.";
  81. char head4[]="  Mode:                       Speed:        baud;  ? for Help;  <F4>K to Escape.";
  82. char head5[]="  File:                       Packets:             type in:     type out:   ";
  83. char head6[]="  Transmission Errors:";
  84.  
  85. char    interr[]=" INTERNAL ERROR - ";
  86. char    canx[]  =" - transfer cancelled. ";
  87.  
  88.  
  89. /* Globals for comms handlers:-                    */
  90.  
  91. char  *locations[]={"by 480Z SIO4", "via Disk Unit", "by RS232C port",
  92.                 "by Aux (RS422)", "by Piconet SIM",
  93.                  "via Network","non-standard",0};
  94. int    fuzz[]      ={20000, 8000, 5000, 14000, 15000, 4000, 5000, 0}; /* timeouts */
  95.  
  96.  
  97. /* Mode structures:-                            */
  98. char    connto[] ="Connect to Mainframe";
  99. char    inform[] ="  Input must be in format expected by mainframe.";
  100. char    rcvng[]     ="Receiving Files     ";
  101. char    sendf[]     ="Sending Files       ";
  102. char    sendf1[] ="  Sends up to 8 files to the mainframe.  The file-names are prompted for, and";
  103. char    sendf2[] ="are separated by blanks.  Wildcards (* ?) may be used.";
  104.  
  105. struct  mode    modker    = {KERM,"Kermit Command      ",0};
  106.  
  107. struct  mode    modparm    = {PARM,"Set/Show Parameters ", 
  108. "  Enters the menu for displaying and changing local Kermit parameters.",0};
  109.  
  110. struct  mode    modconn    = {CONN,connto,
  111. "  Connects you to the mainframe host as a terminal.  To get back to the micro,",
  112. "after starting the mainframe Kermit, hit \"F4\" then K.",0};
  113.  
  114. struct  mode    modsend    = {SEND,sendf,sendf1,sendf2,0};
  115.  
  116. struct  mode    modrec    = {RECV,rcvng, 
  117. "  Receives any number of files from the mainframe, converting names if needed.",
  118. "You will be prompted for replacement disk letter / names; otherwise they will",
  119. "be stored on the logged-in disk under their own names.",0};
  120.  
  121. struct  mode    modcmd    = {CMND,"Commands to Server",
  122. "  Sends commands to a mainframe server-Kermit.  Hit RETURN to see menu.",0};
  123.  
  124. struct  mode    modisk    = {DISK,"Disk Maintenance    ",
  125. "  Permits manipulation of files on the local or network disks without breaking",
  126. "any call to the mainframe.  Commands available are:-",null,diskcmds,0};
  127.  
  128.             /*       01234567890123456789    each 20 chars    */
  129. struct  mode    modquit    = {QUIT,"Terminate Kermit Run",
  130. "            Cancels RML Kermit and returns to Operating System.",0};
  131.  
  132.  
  133. struct  mode  *kmodes[]    = {
  134.         &modker,  &modparm, &modconn, &modsend,
  135.         &modrec,  &modcmd,  &rclogo,  &modisk,
  136.         &modquit, 0};
  137.  
  138.  
  139. /* remote-server command structures:-                */
  140.  
  141. struct    mode    rcget    = {GET,"Get Files",
  142. "  Instruct mainframe Kermit to send file(s);",
  143. inform,0};
  144.  
  145. struct    mode    rcrmsv    = {RMSV,"Kermit Commands",
  146. "  Ask mainframe Kermit to interpret message as though in CONNECT mode;",
  147. inform,0};
  148.  
  149. struct  mode    rcrmh    = {RMH,"Mainframe OS Commands",
  150. "  Ask mainframe Kermit to treat message as Operating System command;",
  151. inform,0};
  152.  
  153. struct    mode    rcbye    = {BYE,"Logout from Mainframe",
  154. "  Send \"BYE\" to mainframe Kermit and disconnect.",0};
  155.  
  156.   /* sorry about misuse of names!    */
  157. struct    mode    rclogo    = {LOGO,"Cancel Other Kermit",
  158. "  Kill mainframe Kermit & leave you connected to mainframe OS.",0};
  159.  
  160. struct  mode    rcmain    = {MAIN,"Back to Main Menu",0};
  161.  
  162. struct    mode    *rcmds[] ={&modker,
  163.         &rcrmsv,  &rcrmh,  &rcget,  &modsend,
  164.         &rclogo,  &rcbye,  &rcmain, &modquit, 0};
  165.  
  166.  
  167. /****************  END of file KDATA.C  ***********************/
  168.  
  169.  
  170.