home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / BSRC_250.LZH / ZMODEM.H < prev    next >
Text File  |  1991-09-15  |  11KB  |  254 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*                   Zmodem definitions for BinkleyTerm                     */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*    For complete  details  of the licensing restrictions, please refer    */
  17. /*    to the License  agreement,  which  is published in its entirety in    */
  18. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.250.    */
  19. /*                                                                          */
  20. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  21. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  22. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  23. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  24. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  25. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  26. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  27. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  28. /*                                                                          */
  29. /*                                                                          */
  30. /* You can contact Bit Bucket Software Co. at any one of the following      */
  31. /* addresses:                                                               */
  32. /*                                                                          */
  33. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  34. /* P.O. Box 460398                AlterNet 7:491/0                          */
  35. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  36. /*                                Internet f491.n343.z1.fidonet.org         */
  37. /*                                                                          */
  38. /* Please feel free to contact us at any time to share your comments about  */
  39. /* our software and/or licensing policies.                                  */
  40. /*                                                                          */
  41. /*                                                                          */
  42. /*  This module is based largely on a similar module in OPUS-CBCS V1.03b.   */
  43. /*  The original work is (C) Copyright 1986, Wynn Wagner III. The original  */
  44. /*  authors have graciously allowed us to use their code in this work.      */
  45. /*                                                                          */
  46. /*--------------------------------------------------------------------------*/
  47.  
  48.  
  49. #define flushmo() wait_for_clear()
  50. #define Z_UpdateCRC(cp,crc) ( crctab[((crc >> 8) & 255) ^ cp] ^ (crc << 8))
  51. #define Z_32UpdateCRC(c,crc) (cr3tab[((int) crc ^ c) & 0xff] ^ ((crc >> 8) & 0x00FFFFFF))
  52.  
  53.  
  54.  
  55.  
  56. /*--------------------------------------------------------------------------*/
  57. /* Routines from N_Zmodem.H ...                                             */
  58. /*--------------------------------------------------------------------------*/
  59.  
  60. #define ZPAD            '*'
  61. #define ZDLE            030
  62. #define ZDLEE           (ZDLE^0100)
  63. #define ZBIN            'A'
  64. #define ZHEX            'B'
  65. #define ZBIN32          'C'
  66.  
  67. /*--------------------------------------------------------------------------*/
  68. /* Frame types (see array "frametypes" in zm.c)                             */
  69. /*--------------------------------------------------------------------------*/
  70. #define ZRQINIT         0
  71. #define ZRINIT          1
  72. #define ZSINIT          2
  73. #define ZACK            3
  74. #define ZFILE           4
  75. #define ZSKIP           5
  76. #define ZNAK            6
  77. #define ZABORT          7
  78. #define ZFIN            8
  79. #define ZRPOS           9
  80. #define ZDATA           10
  81. #define ZEOF            11
  82. #define ZFERR           12
  83. #define ZCRC            13
  84. #define ZCHALLENGE      14
  85. #define ZCOMPL          15
  86. #define ZCAN            16
  87. #define ZFREECNT        17
  88. #define ZCOMMAND        18
  89. #define ZSTDERR         19
  90.  
  91. /*--------------------------------------------------------------------------*/
  92. /* ZDLE sequences                                                           */
  93. /*--------------------------------------------------------------------------*/
  94. #define ZCRCE           'h'
  95. #define ZCRCG           'i'
  96. #define ZCRCQ           'j'
  97. #define ZCRCW           'k'
  98. #define ZRUB0           'l'
  99. #define ZRUB1           'm'
  100.  
  101. /*--------------------------------------------------------------------------*/
  102. /* Z_GetZDL return values (internal)                                        */
  103. /* -1 is general error, -2 is timeout                                       */
  104. /*--------------------------------------------------------------------------*/
  105. #define GOTOR           0400
  106. #define GOTCRCE         (ZCRCE|GOTOR)
  107. #define GOTCRCG         (ZCRCG|GOTOR)
  108. #define GOTCRCQ         (ZCRCQ|GOTOR)
  109. #define GOTCRCW         (ZCRCW|GOTOR)
  110. #define GOTCAN          (GOTOR|030)
  111.  
  112. /*--------------------------------------------------------------------------*/
  113. /* Byte positions within header array                                       */
  114. /*--------------------------------------------------------------------------*/
  115. #define ZF0             3
  116. #define ZF1             2
  117. #define ZF2             1
  118. #define ZF3             0
  119. #define ZP0             0
  120. #define ZP1             1
  121. #define ZP2             2
  122. #define ZP3             3
  123.  
  124. /*--------------------------------------------------------------------------*/
  125. /* Bit Masks for ZRINIT flags byte ZF0                                      */
  126. /*--------------------------------------------------------------------------*/
  127. #define CANFDX          01
  128. #define CANOVIO         02
  129. #define CANBRK          04
  130. #define CANCRY          010
  131. #define CANLZW          020
  132. #define CANFC32         040
  133.  
  134.  
  135.  
  136.  
  137.  
  138. /*--------------------------------------------------------------------------*/
  139. /* PARAMETERS FOR ZFILE FRAME...                                            */
  140. /*--------------------------------------------------------------------------*/
  141.  
  142. /*--------------------------------------------------------------------------*/
  143. /* Conversion options one of these in ZF0                                   */
  144. /*--------------------------------------------------------------------------*/
  145. #define ZCBIN           1
  146. #define ZCNL            2
  147. #define ZCRESUM         3
  148.  
  149. /*--------------------------------------------------------------------------*/
  150. /* Management options, one of these in ZF1                                  */
  151. /*--------------------------------------------------------------------------*/
  152. #define ZMNEW           1
  153. #define ZMCRC           2
  154. #define ZMAPND          3
  155. #define ZMCLOB          4
  156. #define ZMSPARS         5
  157. #define ZMDIFF          6
  158. #define ZMPROT          7
  159.  
  160. /*--------------------------------------------------------------------------*/
  161. /* Transport options, one of these in ZF2                                   */
  162. /*--------------------------------------------------------------------------*/
  163. #define ZTLZW           1
  164. #define ZTCRYPT         2
  165. #define ZTRLE           3
  166.  
  167. /*--------------------------------------------------------------------------*/
  168. /* Parameters for ZCOMMAND frame ZF0 (otherwise 0)                          */
  169. /*--------------------------------------------------------------------------*/
  170. #define ZCACK1          1
  171.  
  172.  
  173.  
  174.  
  175.  
  176. /*--------------------------------------------------------------------------*/
  177. /* Miscellaneous definitions                                                */
  178. /*--------------------------------------------------------------------------*/
  179. #define OK              0
  180. #define ERROR           (-1)
  181. #define TIMEOUT         (-2)
  182. #define RCDO            (-3)
  183. #define FUBAR           (-4)
  184.  
  185. #define XON             ('Q'&037)
  186. #define XOFF            ('S'&037)
  187. #define CPMEOF          ('Z'&037)
  188.  
  189. #define RXBINARY        FALSE
  190. #define RXASCII         FALSE
  191. #define LZCONV          0
  192. #define LZMANAG         0
  193. #define LZTRANS         0
  194. #define PATHLEN         128
  195. #define KSIZE           1024
  196. #define WAZOOMAX        8192
  197. #define SECSPERDAY      (24L*60L*60L)
  198.  
  199.  
  200.  
  201. /*--------------------------------------------------------------------------*/
  202. /* Parameters for calling ZMODEM routines                                   */
  203. /*--------------------------------------------------------------------------*/
  204. #define SPEC_COND       2
  205. #define TRUE            1
  206. #define FALSE           0
  207. #define END_BATCH       (-1)
  208. #define NOTHING_TO_DO   (-2)
  209. #define DELETE_AFTER    '-'
  210. #define TRUNC_AFTER     '#'
  211. #define NOTHING_AFTER   '@'
  212. #define DO_WAZOO        TRUE
  213. #define DONT_WAZOO      FALSE
  214.  
  215.  
  216. /*--------------------------------------------------------------------------*/
  217. /* ASCII MNEMONICS                                                          */
  218. /*--------------------------------------------------------------------------*/
  219. #define NUL 0x00
  220. #define SOH 0x01
  221. #define STX 0x02
  222. #define ETX 0x03
  223. #define EOT 0x04
  224. #define ENQ 0x05
  225. #define ACK 0x06
  226. #define BEL 0x07
  227. #define BS  0x08
  228. #define HT  0x09
  229. #define LF  0x0a
  230. #define VT  0x0b
  231. #define FF  0x0c
  232. #define CR  0x0d
  233. #define SO  0x0e
  234. #define SI  0x0f
  235. #define DLE 0x10
  236. #define DC1 0x11
  237. #define DC2 0x12
  238. #define DC3 0x13
  239. #define DC4 0x14
  240. #define NAK 0x15
  241. #define SYN 0x16
  242. #define ETB 0x17
  243. #define CAN 0x18
  244. #define EM  0x19
  245. #define SUB 0x1a
  246. #define ESC 0x1b
  247. #define FS  0x1c
  248. #define GS  0x1d
  249. #define RS  0x1e
  250. #define US  0x1f
  251.  
  252.  
  253. /* END OF FILE: zmodem.h */
  254.