home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / TERMS / ZMP-SRC.LZH / ZMP.H < prev    next >
Text File  |  2000-06-30  |  15KB  |  637 lines

  1. /****************************** zmp.h *************************************/
  2.  
  3. #define        FALSE           0
  4. #define        TRUE            1
  5.  
  6. #define        MAXOVLY    0x5100    /* Largest overlay size */
  7.  
  8. #ifndef        MAIN
  9. #define        EXTERN   extern
  10. #else
  11. #define        EXTERN
  12. #endif
  13.  
  14. #undef         HOSTON     /* Define to allow host mode */
  15.  
  16. #ifdef         HI_TECH_C
  17. #undef         ZCPR3    /* #define if using zcpr3 */
  18. #endif
  19.  
  20. #ifdef         ZCPR3
  21. #define        MSWAIT    delay
  22. #define        LOCATE    gotoxy
  23. #else
  24. #define        MSWAIT   mswait
  25. #define        LOCATE   locate
  26. #endif
  27.  
  28.  
  29. /* Make allowances for the vagaries of different C compilers (sigh!) */
  30.  
  31. #ifdef         C80
  32. #define        MEMORY_FULL -1        /* Error return from alloc() */
  33. #else
  34. #define        MEMORY_FULL 0
  35. #define        NBDOS    bdoshl
  36. #endif
  37.  
  38. #ifndef        RZMP            /* Things we don't need in RZMP */
  39.  
  40. #define        PBUFSIZ         2048    /*2k printer buffer*/
  41. #define        DFLTINDEX       5       /* pointer to default baud */
  42.  
  43. /*************************************************************************/
  44. /*                                                                       */
  45. /*      These #defines determine which keys will be interpreted as       */
  46. /*  command characters.                                                  */
  47. /*                                                                       */
  48. /*************************************************************************/
  49.  
  50. #define        RECEIVE         'R'      /*receive file*/
  51. #define        CAPTURE         'M'      /*toggle capture mode*/
  52. #define        DIR             'D'      /*get disk directory*/
  53. #define        PRTSCRN         'Y'      /*print screen*/
  54. #define        SEND            'S'      /*send file*/
  55. #define        HANGUP          'X'      /*hangup*/
  56. #define        COMMAND         'L'      /*change line parameters*/
  57. #define        HELP            'H'      /*get instructions*/
  58. #define        QUIT            'Q'      /*quit*/
  59. #define        DIAL            'I'    /*make phone call*/
  60. #define        HOST            'O'    /* host mode */
  61. #define        CONFIG          'C'    /*configure system*/
  62. #define        TOGPRT          'P'    /*toggle printer*/
  63. #define        DISK            'F'    /*file/disk operations*/
  64. #define        CLRSCR          'Z'      /*clear local screen*/
  65. #define        BRK             'B'      /*send break*/
  66. #define        DISPKEYS        'K'      /*display keyboard macros*/
  67. #define        USER            'U'      /*user-defined overlay*/
  68.  
  69. /* Constants for directory routines */
  70. #define        DIRLINES         23    /* # of lines per page */
  71. #define        SORTCOLS          4    /* # of columns of sorted entries */
  72. #define        UNSORTCOLS        5    /* # of columns of unsorted entries */
  73.  
  74. #endif                /* End of things not needed in RZMP */
  75.  
  76. /* Locations for file transfer box */
  77. #define        RPTPOS          42    /* Where the status goes */
  78. #define        LC       RPTPOS-23
  79. #define        TR               2
  80. #define        HT              12
  81. #define        WD              41
  82. #define           RC         LC+WD-1
  83. #define        BR         TR+HT-1
  84. #define        HORIZ          '-'
  85. #define        VERT           '|'
  86. #define        UL             '+'
  87. #define        UR             '+'
  88. #define        LL             '+'
  89. #define        LR             '+'
  90.  
  91. /***************** line numbers for report function *************************/
  92.  
  93. #define     PROTOCOL    3
  94. #define     PATHNAME    4
  95. #define     FILESIZE    5
  96. #define     BLKCHECK    6
  97. #define     SENDTIME    7
  98. #define     KBYTES      8
  99. #define     BLOCKS      9
  100. #define     FBLOCKS     10
  101. #define     ERRORS      11
  102. #define     MESSAGE     12
  103.  
  104.  
  105. #define        BUFSTART        16384   /*16k text buffer starting size*/
  106. #define        OK              0
  107. #define        NERROR         (-1)
  108. #define        ERROR           0
  109. #define        KEYHIT          0
  110. #define        MAXFILES        255    /* max number of expanded files */
  111. #define        FNSIZE          17   /* filename: 1(A)+3(15:)+8+1+3+null */
  112. #define        BUFIOT          0    /* error return on buffered fopen */
  113. #define        UBIOT           -1    /* unbuffered open */
  114.  
  115.  
  116. /**************************************************************************/
  117. /*                                                                        */
  118. /*      Miscellaneous ASCII characters.                                   */
  119. /*                                                                        */
  120. /**************************************************************************/
  121.  
  122. #define        SOH            1
  123. #define        STX            2
  124. #define        CTRLC          3
  125. #define        EOT            4
  126. #define        CTRLE          5
  127. #define        ENQ            5
  128. #define        ACK            6
  129. #define        BELL           7
  130. #define        BS             8
  131. #define        LF            10
  132. #define        CTRLK         11
  133. #define        CR            13
  134. #define        CTRLQ         17          /* xon */
  135. #define        XON           ('q'&037)
  136. #define        CTRLS         19          /* xoff */
  137. #define        XOFF          ('s'&037)
  138. #define        NAK           21
  139. #define        CAN           ('X'&037)
  140. #define        CTRLX         24
  141. #define        CPMEOF        26
  142. #define        CTRLZ         26      /*end of text-file character*/
  143. #define        ESC           27
  144. #define        DEL          127
  145.  
  146. /******************* constants used in file transfer **********************/
  147.  
  148. /* Ward Christensen / CP/M parameters - Don't change these! */
  149.  
  150. #ifndef        AZTEC_C
  151. #define        NULL            0
  152. #define        EOF            (-1)
  153. #endif
  154.  
  155. #define        TIMEOUT        (-2)
  156. #define        RCDO           (-3)
  157. #define        ERRORMAX       5
  158. #define        RETRYMAX       10
  159. #define        WCEOT          (-10)
  160. #define        SECSIZ         128    /* cp/m's Magic Number record size */
  161. #define        PATHLEN        257    /* ready for 4.2 bsd ? */
  162. #define        KSIZE          1024    /* record size with k option */
  163. #define        WANTCRC         'C'
  164. #define        ORIGIN          0x0100  /*starting point for cp/m programs*/
  165. #define        COMPSIZ         35      /*cpm bdos compute file size command*/
  166.  
  167.  
  168. #define        CPMBUF          0x80    /*address of cpm file buffer*/
  169. #define        DONE            0xff    /*flag for no more entries*/
  170. #define        RET             '!'     /*symbol for CR string terminator */
  171. #define        WAITASEC        '~'     /* one second delay */
  172. #define        BIOSADDR        1       /*ptr to base of bios + 3*/
  173. #define        LISTST          42      /*index to list status routine*/
  174. #define        ENABLE          0xfb    /*code for EI*/
  175. #define        RTN             0xc9    /*code for RET*/
  176. #define        JUMP            0xc3    /*code for JMP*/
  177.  
  178. /* BDOS entry functions */
  179. #define        CONIN           1       /* console input*/
  180. #define        CONOUT          2       /* console output */
  181. #define        DIRCTIO         6       /* direct-console io */
  182. #define        INPUT           0xff    /* direct-console io input*/
  183. #define        GCS             11      /* get console status*/
  184. #define        RESET           13      /* reset disk command*/
  185. #define        SELDSK          14      /* select disk command*/
  186. #define        SFF             17      /* search for first command*/
  187. #define        SFN             18      /* search for next command*/
  188. #define        GETCUR          25      /* get current disk command */
  189. #define        SETDMA          26      /* set dma address */
  190. #define        GETALL          27      /* allocation vector*/
  191. #define        GETDPB          31      /* disk parameter block addr*/
  192.  
  193.  
  194. /************************ configuration variables **********************************/
  195.  
  196. #ifndef RZMP        /* More things not needed in RZMP */
  197.  
  198. EXTERN int BFlag
  199. #ifdef   MAIN
  200. = FALSE
  201. #endif
  202. ;
  203. EXTERN int PFlag
  204. #ifdef   MAIN
  205. = FALSE
  206. #endif
  207. ;
  208. EXTERN int FDx
  209. #ifdef   MAIN
  210. = TRUE
  211. #endif
  212. ;
  213. EXTERN int RemEcho
  214. #ifdef   MAIN
  215. = FALSE
  216. #endif
  217. ;
  218. EXTERN int Online
  219. #ifdef   MAIN
  220. = FALSE
  221. #endif
  222. ;
  223. EXTERN int Filter
  224. #ifdef   MAIN
  225. = FALSE
  226. #endif
  227. ;
  228. EXTERN int ParityMask
  229. #ifdef   MAIN
  230. = FALSE
  231. #endif
  232. ;
  233. EXTERN char Msgfile[20]
  234. #ifdef   MAIN
  235. = "ZMP.MSG"
  236. #endif
  237. ;
  238. EXTERN char Phonefile[20]
  239. #ifdef   MAIN
  240. = "ZMP.FON"
  241. #endif
  242. ;
  243. EXTERN char Logfile[20]
  244. #ifdef   MAIN
  245. = "ZMP.LOG"
  246. #endif
  247. ;
  248. EXTERN char Cfgfile[20]
  249. #ifdef   MAIN
  250. = "ZMP.CFG"
  251. #endif
  252. ;
  253. EXTERN char Configovly[9]
  254. #ifdef   MAIN
  255. = "ZMCONFIG"
  256. #endif
  257. ;
  258. EXTERN char Initovly[9]
  259. #ifdef   MAIN
  260. = "ZMINIT"
  261. #endif
  262. ;
  263. EXTERN char Termovly[9]
  264. #ifdef   MAIN
  265. = "ZMTERM"
  266. #endif
  267. ;
  268. EXTERN char Xferovly[9]
  269. #ifdef   MAIN
  270. = "ZMXFER"
  271. #endif
  272. ;
  273. EXTERN char KbMacro[10][22]
  274. #ifdef   MAIN
  275.  = { "Macro Key 0!",
  276.      "Macro Key 1!",
  277.      "Macro Key 2!",
  278.      "Macro Key 3!",
  279.      "Macro Key 4!",
  280.      "Macro Key 5!",
  281.      "Macro Key 6!",
  282.      "Macro Key 7!",
  283.      "Macro Key 8!",
  284.      "Macro Key 9!" }
  285. #endif
  286. ;
  287.  
  288. EXTERN struct modemparms {
  289.    char init[41];
  290.    char dialcmd[9];
  291.    char dialsuffix[9];
  292.    char connect[21];
  293.    char busy1[21];
  294.    char busy2[21];
  295.    char busy3[21];
  296.    char busy4[21];
  297.    char hangup[21];
  298.    int timeout;
  299.    int pause;
  300. } Modem
  301. #ifdef   MAIN
  302.    = {
  303.    "ATE0V1X4S0=0!",
  304.    "ATD",
  305.    "!",
  306.    "CONNECT",
  307.    "BUSY",
  308.    "NO CARRIER",
  309.    "NO ANSWER",
  310.    "ERROR",
  311.    "~+++~ATH0!",
  312.    40,8
  313.    }
  314. #endif
  315. ;
  316.  
  317. #ifdef HOSTON
  318.  
  319. EXTERN struct hostparms {
  320.    char welcome[40];
  321.    char autoanswer[20];
  322.    char password[20];
  323.    char user[20];
  324.    int modemconnection;
  325. } Host
  326. #ifdef MAIN
  327. = {
  328.    "Welcome to HModem Host!",
  329.    "ATS0=2!",
  330.    "PASSWORD",
  331.    "null",
  332.    TRUE }
  333. #endif
  334. ;
  335. #endif
  336.          
  337. EXTERN struct lineparms {
  338.    int baudindex;
  339.    char parity;
  340.    int databits;
  341.    int stopbits;
  342. } Line
  343. #ifdef MAIN
  344. = { DFLTINDEX, 'N', 8, 1 }
  345. #endif
  346. ;
  347. EXTERN unsigned Pbufsiz
  348. #ifdef   MAIN
  349. = PBUFSIZ
  350. #endif
  351. ;
  352. EXTERN int Maxdrive
  353. #ifdef   MAIN
  354. = 'P'
  355. #endif
  356. ;
  357. EXTERN struct phonebook {
  358.    char name[19];
  359.    char number[19];
  360.    int pbaudindex;        
  361.    char pparity;
  362.    int pdatabits;
  363.    int pstopbits;
  364.    int echo;
  365. } *Book;
  366.  
  367. EXTERN char *Prtbuf;
  368. EXTERN unsigned Buftop;
  369. EXTERN char *Prthead;
  370. EXTERN char *Prttail;
  371. EXTERN char *Prttop;
  372. EXTERN char *Prtbottom;
  373. EXTERN int Inhost
  374. #ifdef MAIN
  375.  = FALSE
  376. #endif
  377. ;
  378. #ifdef INIT
  379. char Version[41]
  380. =  "Version 1.5 -- 7 January 1989"    /* version number for ZMP */
  381. /*  ^_____________________________________^    Maximum length! */
  382. #endif
  383. ;
  384. EXTERN char Lastlog[20];
  385. #ifdef C80
  386. extern char Cmode;
  387. #endif
  388.  
  389. EXTERN int Dialing;
  390. EXTERN int Lastkey;
  391.  
  392. EXTERN char Mci[21]
  393. #ifdef MAIN
  394.  = " "
  395. #endif
  396. ;
  397. EXTERN char Sprint[21]
  398. #ifdef MAIN
  399.  = " "
  400. #endif
  401. ;
  402. EXTERN int Chardelay
  403. #ifdef   MAIN
  404. = 0
  405. #endif
  406. ;
  407. EXTERN int Linedelay
  408. #ifdef   MAIN
  409. = 0
  410. #endif
  411. ;
  412. EXTERN int FirsTerm        /* Flag -- first time terminal overlay runs */
  413. #ifdef   MAIN
  414. = TRUE
  415. #endif
  416. ;
  417.  
  418. #else                /* End of things not needed in RZMP */
  419. EXTERN char Version[41]
  420. #ifdef MAIN
  421. =  "Version 1.4 -- 29 November 1988"    /* version number for RZMP */
  422. /*  ^_____________________________________^    Maximum length! */
  423. #endif
  424. ;
  425. EXTERN char Txovly[20]
  426. #ifdef   MAIN
  427. = "RZMPTX.OVR"
  428. #endif
  429. ;
  430. EXTERN char Rxovly[20]
  431. #ifdef   MAIN
  432. = "RZMPRX.OVR"
  433. #endif
  434. ;
  435. EXTERN char Infile[20]
  436. #ifdef   MAIN
  437. = "RZMP.DAT"
  438. #endif
  439. ;
  440. EXTERN char Outfile[20]
  441. #ifdef   MAIN
  442. = "RZMP.OUT"
  443. #endif
  444. ;
  445. EXTERN char *Uploads;        /* Upload/download count */
  446. EXTERN char *Downloads;
  447. EXTERN char *Badtypes;        /* List of bad filetypes */
  448.  
  449. EXTERN int MAdrive, MAuser;    /* max allowable drive/user */
  450. EXTERN int Upldrive;        /* non-wheel upload area */
  451. EXTERN int Upluser;
  452. EXTERN int Logdrive;        /* du: for .LOG file */
  453. EXTERN int Loguser;
  454. EXTERN int Uprivdrive;        /* private upload area */
  455. EXTERN int Uprivuser;
  456. EXTERN int Dprivdrive;        /* private download area */
  457. EXTERN int Dprivuser;
  458. EXTERN int Tempdrive;        /* temporary file area */
  459. EXTERN int Tempuser;
  460. EXTERN int Private;        /* Flag -- private up/download */
  461. EXTERN int Transmit;        /* Flag -- sending files */
  462. EXTERN int Receive;        /* Flag -- receiving files */
  463. EXTERN int Filemode;        /* Flag -- send list is in a disk file */
  464. EXTERN int Shutup;        /* Flag -- suppress unnecessary messages */
  465. EXTERN int Bye;            /* Flag -- using BYE for modem I/O */
  466.  
  467. EXTERN int Outopen;        /* Flag -- Output file is open */
  468. EXTERN int Outfd;        /* file descriptor for output file */
  469. EXTERN char *Outbuf;        /* Pointer to output buffer */
  470.  
  471. #endif                /* End of stuff for RZMP */
  472.  
  473.  
  474. EXTERN int Invokdrive, Currdrive, Invokuser, Curruser;
  475. EXTERN int Overdrive, Overuser, Userid;
  476.  
  477. EXTERN char *Userover;
  478.  
  479. EXTERN struct settings {
  480.    int cbaudindex;
  481.    char cparity;
  482.    int cdatabits;
  483.    int cstopbits;
  484. } Current;
  485.  
  486. EXTERN unsigned Baudtable[14]
  487. #ifdef MAIN
  488.  = { 110,300,450,600,710,1200,2400,4800,9600,19200,38400,57600,76800 }
  489. #endif
  490. ;
  491. EXTERN int QuitFlag        /* Operator abort */
  492. #ifdef   MAIN
  493. = FALSE
  494. #endif
  495. ;
  496. EXTERN int StopFlag        /* abort/stop from remote end */
  497. #ifdef   MAIN
  498. = FALSE
  499. #endif
  500. ;
  501. EXTERN int Crcflag
  502. #ifdef   MAIN
  503. = TRUE
  504. #endif
  505. ;
  506. EXTERN int XonXoff
  507. #ifdef   MAIN
  508. = FALSE
  509. #endif
  510. ;
  511. EXTERN int XonXoffOk
  512. #ifdef   MAIN
  513. = FALSE
  514. #endif
  515. ;
  516. EXTERN int Sending    /* file transfer direction */
  517. #ifdef   MAIN
  518. = FALSE
  519. #endif
  520. ;
  521. EXTERN int Zmodem
  522. #ifdef MAIN
  523.  = FALSE
  524. #endif
  525. ;
  526. EXTERN int Nozmodem
  527. #ifdef MAIN
  528.  = FALSE
  529. #endif
  530. ;
  531. EXTERN int Blklen
  532. #ifdef MAIN
  533.  = SECSIZ
  534. #endif
  535. ;
  536. EXTERN int Xmodem
  537. #ifdef MAIN
  538.  = FALSE
  539. #endif
  540. ;
  541. EXTERN int Zrwindow          /* RX window size (controls garbage count) */
  542. #ifdef MAIN
  543.  = 1400
  544. #endif
  545. ;
  546. EXTERN unsigned Bufsize
  547. #ifdef   MAIN
  548. = BUFSTART
  549. #endif
  550. ;
  551.  
  552. EXTERN char Pathname[128];
  553. EXTERN char Buf[128];                /* general purpose buffer */
  554. EXTERN char *MainBuffer;
  555. EXTERN unsigned TxtPtr
  556. #ifdef   MAIN
  557. = 0
  558. #endif
  559. ;
  560. EXTERN int Stopped
  561. #ifdef MAIN
  562.  = FALSE
  563. #endif
  564. ;
  565. EXTERN char *Mspeed
  566. #ifdef MAIN
  567.  = (char *) 0x3c
  568. #endif
  569. ;
  570. EXTERN char *Wheel
  571. #ifdef MAIN
  572.  = (char *) 0x3e
  573. #endif
  574. ;
  575. EXTERN int Wantfcs32
  576. #ifdef MAIN
  577.  = TRUE
  578. #endif
  579. ;
  580.  
  581. struct stat {
  582.    char fname[9];
  583.    char fext[4];
  584.    int dcode;
  585.    int records;
  586. };
  587.  
  588. struct direntry {
  589.    char userno;
  590.    char flname[8];
  591.    char ftype[3];
  592.    char fextent;
  593.    char reserved[2];
  594.    char record;
  595.    char map[16];
  596. };
  597.  
  598. struct sortentry {
  599.     unsigned char user;    /* user area */
  600.     char name[8];        /* filename */
  601.     char type[3];        /* filetype */
  602.     char ex;        /* low byte of extent (0 - 31) */
  603.     char s1;        /* unused */
  604.     char s2;        /* count of extents over 31 */
  605.     unsigned char rc;    /* record count */
  606. };
  607.  
  608. EXTERN struct fcb {
  609.    char drive;
  610.    char filename[8];
  611.    char filetype[3];
  612.    char extent;
  613.    int freserved;
  614.    char recused;
  615.    unsigned abused[8];
  616.    char seqrec;
  617.    unsigned ranrec;
  618.    char ranreco;
  619. } Thefcb;
  620.  
  621. struct dpb {
  622.    unsigned spt;
  623.    char bsh;
  624.    char blm;
  625.    char exm;
  626.    unsigned dsm;
  627.    unsigned drm;
  628.    char al0;
  629.    char al1;
  630.    unsigned cks;
  631.    unsigned off;
  632. };
  633.  
  634. EXTERN char **Pathlist;
  635.  
  636. /******************************* end of zmp.h ******************************/
  637.