home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckl196.zip / ckcker.h < prev    next >
C/C++ Source or Header  |  1999-12-30  |  41KB  |  1,216 lines

  1. /* ckcker.h -- Symbol and macro definitions for C-Kermit */
  2.  
  3. /*
  4.   Author: Frank da Cruz <fdc@columbia.edu>,
  5.   Columbia University Academic Information Systems, New York City.
  6.  
  7.   Copyright (C) 1985, 2000,
  8.     Trustees of Columbia University in the City of New York.
  9.     All rights reserved.  See the C-Kermit COPYING.TXT file or the
  10.     copyright text in the ckcmai.c module for disclaimer and permissions.
  11. */
  12.  
  13. #ifndef CKCKER_H
  14. #define CKCKER_H
  15.  
  16. #define I_AM_KERMIT  0            /* Personalities */
  17. #define I_AM_TELNET  1
  18. #define I_AM_RLOGIN  2
  19. #define I_AM_IKSD    3
  20.  
  21. #ifndef NOSTREAMING
  22. #ifndef STREAMING
  23. #define STREAMING
  24. #endif /* STREAMING */
  25. #endif /* NOSTREAMING */
  26. /*
  27.   If NEWDEFAULTS is defined then:
  28.    - RECEIVE PACKET-LENGTH is 4095 rather than 90
  29.    - WINDOW is 30 rather than 1
  30.    - BLOCK-CHECK is 3 rather than 1
  31.    - FILE TYPE is BINARY rather than TEXT
  32. */
  33. #ifdef OS2                /* OS/2, Windows NT, Windows 95 */
  34. #ifndef NEWDEFAULTS
  35. #define NEWDEFAULTS
  36. #endif /* NEWDEFAULTS */
  37. #endif /* OS2 */
  38.  
  39. #ifdef NOICP                /* No Interactive Command Parser */
  40. #ifndef NOSPL                /* implies... */
  41. #define NOSPL                /* No Script Programming Language */
  42. #endif /* NOSPL */
  43. #ifndef NOCSETS                /* No character-set translation */
  44. #define NOCSETS                /* because the only way to set it up */
  45. #endif /* NOCSETS */            /* is with interactive commands */
  46. #endif /* NOICP */
  47.  
  48. #ifdef pdp11                /* There is a maximum number of */
  49. #ifndef NOCKSPEED            /* of -D's allowed on the CC */
  50. #define NOCKSPEED            /* command line, so some of them */
  51. #endif /* NOCKSPEED */            /* have to go here... */
  52. #ifndef NOREDIRECT
  53. #define NOREDIRECT
  54. #endif /* NOREDIRECT */
  55. #ifdef WHATAMI
  56. #undef WHATAMI
  57. #endif /* WHATAMI */
  58. #endif /* pdp11 */
  59.  
  60. #ifdef UIDBUFLEN
  61. #define LOGINLEN UIDBUFLEN
  62. #else
  63. #define LOGINLEN 32            /* Length of server login field */
  64. #endif /* UIDBUFLEN */
  65.  
  66. /* Bell values */
  67.  
  68. #define   XYB_NONE  0            /* No bell */
  69. #define   XYB_AUD   1            /* Audible bell */
  70. #define   XYB_VIS   2            /* Visible bell */
  71. #define   XYB_BEEP  0            /* Audible Beep */
  72. #define   XYB_SYS   4            /* Audible System Sounds */
  73.  
  74. /* File status bits */
  75.  
  76. #define FS_OK   1            /* File transferred OK */
  77. #define FS_REFU 2            /* File was refused */
  78. #define FS_DISC 4            /* File was discarded */
  79. #define FS_INTR 8            /* Transfer was interrupted by user */
  80. #define FS_ERR  16            /* Fatal error during transfer */
  81.  
  82. /* Control-character (un)prefixing options */
  83.  
  84. #define PX_ALL  0            /* Prefix all control chars */
  85. #define PX_CAU  1            /* Unprefix cautiously */
  86. #define PX_WIL  2            /* Unprefix with wild abandon */
  87. #define PX_NON  3            /* Unprefix all (= prefix none) */
  88.  
  89. /* Destination codes */
  90.  
  91. #define  DEST_D 0    /*  DISK */
  92. #define  DEST_S 1    /*  SCREEN */
  93. #define  DEST_P 2    /*  PRINTER */
  94. #define  DEST_N 3    /*  NOWHERE (calibration run) */
  95.  
  96. /* File transfer protocols */
  97.  
  98. #define  PROTO_K    0    /*   Kermit   */
  99. #ifdef CK_XYZ
  100. #define  PROTO_X    1    /*   XMODEM     */
  101. #define  PROTO_XC   2    /*   XMODEM-CRC */
  102. #define  PROTO_Y    3    /*   YMODEM     */
  103. #define  PROTO_G    4    /*   YMODEM-g */
  104. #define  PROTO_Z    5    /*   ZMODEM   */
  105. #define  PROTO_O    6   /*   OTHER    */
  106. #define  NPROTOS    7   /*   How many */
  107. #else
  108. #define  NPROTOS    1   /*   How many */
  109. #endif /* CK_XYZ */
  110.  
  111. struct ck_p {                /* C-Kermit Protocol info structure */
  112.     char * p_name;            /* Protocol name */
  113.     int rpktlen;            /* Packet length - receive */
  114.     int spktlen;            /* Packet length - send */
  115.     int spktflg;            /* ... */
  116.     int winsize;            /* Window size */
  117.     int prefix;                /* Control-char prefixing options */
  118.     int fnca;                /* Filename collision action */
  119.     int fncn;                /* Filename conversion */
  120.     int fnsp;                /* Send filename path stripping */
  121.     int fnrp;                /* Receive filename path stripping */
  122.     char * h_b_init;        /* Host receive initiation string - text   */
  123.     char * h_t_init;        /* Host receive initiation string - binary */
  124.     char * h_x_init;        /* Host server string */
  125.     char * p_b_scmd;        /* SEND cmd for external protocol - text   */
  126.     char * p_t_scmd;        /* SEND cmd for external protocol - binary */
  127.     char * p_b_rcmd;        /* RECV cmd for external protocol - text   */
  128.     char * p_t_rcmd;        /* RECV cmd for external protocol - binary */
  129. };
  130.  
  131. struct filelist {            /* Send-file list element */
  132.     char * fl_name;            /* Filename */
  133.     int fl_mode;            /* Transfer mode */
  134.     char * fl_alias;            /* Name to send the file under */
  135.     struct filelist * fl_next;        /* Pointer to next element */
  136. };
  137.  
  138. /* Kermit system IDs and associated properties... */
  139.  
  140. struct sysdata {
  141.     char *sid_code;    /* Kermit system ID code */
  142.     char *sid_name;    /* Descriptive name */
  143.     short sid_unixlike;    /* Tree-structured directory with separators */
  144.     char  sid_dirsep;    /* Directory separator character if unixlike */
  145.     short sid_dev;    /* Can start with dev: */
  146.     short sid_case;    /* Bit mapped: 1 = case matters, 2 = case preserved */
  147.     short sid_recfm;    /* Text record separator */
  148. /*
  149.    0 = unknown or nonstream
  150.    1 = cr
  151.    2 = lf
  152.    3 = crlf
  153. */
  154. };
  155.  
  156. #define SET_ON   1    /* General values for settings that can be ON */
  157. #define SET_OFF  0            /* OFF, */
  158. #define SET_AUTO 2            /* or AUTO */
  159.  
  160. #define PATH_OFF 0    /* Pathnames off (to be stripped) */
  161. #define PATH_REL 1      /* Pathnames on, left relative if possible */
  162. #define PATH_ABS 2      /* Pathnames absolute always */
  163. #define PATH_AUTO 4    /* Pathnames handled automatically */
  164.  
  165. /* GET Options */
  166.  
  167. #define GOPT_DEL 1            /* Delete source file */
  168. #define GOPT_REC 2            /* Recursive */
  169. #define GOPT_RES 4            /* Recover (Resend) */
  170. #define GOPT_CMD 8            /* Filename is a Command */
  171.  
  172. /* GET Transfer Modes */
  173.  
  174. #define GMOD_TXT 0            /* Text */
  175. #define GMOD_BIN 1            /* Binary */
  176. #define GMOD_AUT 2            /* Auto */
  177. #define GMOD_LBL 3            /* Labeled */
  178.  
  179. /* GET Filename Options */
  180.  
  181. #define GNAM_LIT 0            /* Literal */
  182. #define GNAM_CNV 1            /* Converted */
  183.  
  184. /* GET Pathname Options */
  185.  
  186. #define GPTH_OFF 0            /* Pathnames Off */
  187. #define GPTH_REL 1            /* Pathnames Relative */
  188. #define GPTH_ABX 2            /* Pathnames Absolute */
  189.  
  190. #ifndef NOSPL
  191. /*
  192.   The IF REMOTE-ONLY command is available only in versions
  193.   that actually can be used in remote mode, and only if we have
  194.   an interactive command parser.
  195. */
  196. #define CK_IFRO
  197. #ifdef MAC
  198. #undef CK_IFRO
  199. #else
  200. #ifdef GEMDOS
  201. #undef CK_IFRO
  202. #endif /* GEMDOS */
  203. #endif /* MAC */
  204. #endif /* NOSPL */
  205.  
  206. /* Systems whose CONNECT modules can execute Application Program Commands */
  207.  
  208. #ifdef NOSPL                /* Script programming language */
  209. #ifdef CK_APC                /* is required for APC. */
  210. #undef CK_APC
  211. #endif /* CK_APC */
  212. #ifndef NOAPC
  213. #define NOAPC
  214. #endif /* NOAPC */
  215. #ifndef NOAUTODL
  216. #define NOAUTODL
  217. #endif /* NOAUTODL */
  218. #endif /* NOSPL */
  219.  
  220. #ifndef NOAPC                /* Unless they said NO APC */
  221. #ifndef CK_APC                /* And they didn't already define it */
  222. #ifdef OS2                /* OS/2 gets it */
  223. #define CK_APC
  224. #endif /* OS2 */
  225. #ifdef UNIX                /* UNIX gets it */
  226. #define CK_APC
  227. #endif /* UNIX */
  228. #ifdef VMS                /* VMS too */
  229. #define CK_APC
  230. #endif /* VMS */
  231. #endif /* CK_APC */
  232. #endif /* NOAPC */
  233.  
  234. #ifdef CK_APC                /* APC buffer length */
  235. #define APCBUFLEN (CMDBL + 10)
  236. #define APC_OFF 0    /* APC OFF (disabled) */
  237. #define APC_ON 1    /* APC ON (enabled for non-dangerous commands) */
  238. #define APC_UNCH 2    /* APC UNCHECKED (enabled for ALL commands) */
  239. #define APC_INACTIVE 0    /* APC not in use */
  240. #define APC_REMOTE   1    /* APC in use from Remote */
  241. #define APC_LOCAL    2    /* APC being used from within Kermit */
  242. #ifndef NOAUTODL
  243. #ifndef CK_AUTODL    /* Autodownload */
  244. #ifdef OS2
  245. #define CK_AUTODL
  246. #else
  247. #ifdef UNIX
  248. #define CK_AUTODL
  249. #else
  250. #ifdef VMS
  251. #define CK_AUTODL
  252. #else
  253. #ifdef CK_AUTODL
  254. #undef CK_AUTODL
  255. #endif /* CK_AUTODL  */
  256. #endif /* NOAUTODL */
  257. #endif /* VMS */
  258. #endif /* UNIX */
  259. #endif /* OS2 */
  260. #endif /* CK_AUTODL */
  261.  
  262. #else  /* CK_APC not defined */
  263.  
  264. #ifdef NOICP
  265. #ifdef UNIX
  266. #ifndef CK_AUTODL
  267. #define CK_AUTODL
  268. #endif /* CK_AUTODL */
  269. #endif /* UNIX */
  270. #else  /* Not NOICP... */
  271. #ifdef CK_AUTODL
  272. #undef CK_AUTODL
  273. #endif /* CK_AUTODL */
  274. #endif /* NOICP */
  275. #endif /* CK_APC */
  276.  
  277. #ifdef NOAUTODL
  278. #ifdef CK_AUTODL
  279. #undef CK_AUTODL
  280. #endif /* CK_AUTODL */
  281. #endif /* NOAUTODL */
  282.  
  283. /* Codes for what we are doing now - bit mask values */
  284.  
  285. #define W_NOTHING  0            /* Nothing */
  286. #define W_INIT     1            /* Initializing protocol */
  287. #define W_SEND     2            /* SENDing or MAILing */
  288. #define W_RECV     4            /* RECEIVEing or GETting */
  289. #define W_REMO     8            /* Doing a REMOTE command */
  290. #define W_CONNECT 16            /* CONNECT mode */
  291. #define W_COMMAND 32            /* Command mode */
  292. #define W_DIALING 64            /* Dialing a modem */
  293.  
  294. #ifndef NOWHATAMI
  295. #ifndef WHATAMI
  296. #define WHATAMI
  297. #endif /* WHATAMI */
  298. #endif /* NOWHATAMI */
  299.  
  300. #ifdef WHATAMI                /* Bit mask positions for WHATAMI */
  301. #define WMI_SERVE   1            /* Server mode */
  302. #define WMI_FMODE   2            /* File transfer mode */
  303. #define WMI_FNAME   4            /* File name conversion */
  304. #define WMI_STREAM  8            /* I have a reliable transport */
  305. #define WMI_CLEAR  16            /* I have a clear channel */
  306. #define WMI_FLAG   32            /* Flag that WHATAMI field is valid */
  307. /* WHATAMI2 bits... */
  308. #define WMI2_XMODE  1            /* Transfer mode auto(0)/manual(1) */
  309. #define WMI2_RECU   2            /* Transfer is recursive */
  310. #define WMI2_FLAG  32            /* Flag that WHATAMI2 field is valid */
  311. #endif /* WHATAMI */
  312.  
  313. /* Terminal types */
  314. #define VT100     0            /* Also for VT52 mode */
  315. #define TEKTRONIX 1
  316.  
  317. /* Normal packet and window size */
  318.  
  319. #define MAXPACK 94            /* Maximum unextended packet size */
  320.                     /* Can't be more than 94. */
  321. #ifdef pdp11                /* Maximum sliding window slots */
  322. #define MAXWS  8
  323. #else
  324. #define MAXWS 32            /* Can't be more than 32. */
  325. #endif /* pdp11 */
  326.  
  327. /* Maximum long packet size for sending packets */
  328. /* Override these from cc command line via -DMAXSP=nnn */
  329.  
  330. #ifdef DYNAMIC
  331. #ifndef MAXSP
  332. #define MAXSP 9024
  333. #endif /* MAXSP */
  334. #else  /* not DYNAMIC */
  335. #ifndef MAXSP
  336. #ifdef pdp11
  337. #define MAXSP 1024
  338. #else
  339. #define MAXSP 2048
  340. #endif /* pdp11 */
  341. #endif /* MAXSP */
  342. #endif /* DYNAMIC */
  343.  
  344. /* Maximum long packet size for receiving packets */
  345. /* Override these from cc command line via -DMAXRP=nnn */
  346.  
  347. #ifdef DYNAMIC
  348. #ifndef MAXRP
  349. #define MAXRP 9024
  350. #endif /* MAXRP */
  351. #else  /* not DYNAMIC */
  352. #ifndef MAXRP
  353. #ifdef pdp11
  354. #define MAXRP 1024
  355. #else
  356. #define MAXRP 2048
  357. #endif /* pdp11 */
  358. #endif /* MAXRP */
  359. #endif /* DYNAMIC */
  360. /*
  361.   Default sizes for windowed packet buffers.
  362.   Override these from cc command line via -DSBSIZ=nnn, -DRBSIZ=nnn.
  363.   Or just -DBIGBUFOK.
  364. */
  365. #ifndef MAXGETPATH            /* Maximum number of directories */
  366. #ifdef BIGBUFOK                /* for GET path... */
  367. #define MAXGETPATH 128
  368. #else
  369. #define MAXGETPATH 16
  370. #endif /* BIGBUFOK */
  371. #endif /* MAXGETPATH */
  372.  
  373. #ifndef NOSPL                /* Query buffer length */
  374. #ifdef OS2
  375. #define QBUFL 4095
  376. #else
  377. #ifdef BIGBUFOK
  378. #define QBUFL 4095
  379. #else
  380. #define QBUFL 1023
  381. #endif /* BIGBUFOK */
  382. #endif /* OS2 */
  383. #endif /* NOSPL */
  384.  
  385. #ifdef DYNAMIC
  386. #ifndef SBSIZ
  387. #ifdef BIGBUFOK                /* If big buffers are safe... */
  388. #define SBSIZ 290000            /* Allow for 10 x 9024 or 20 x 4096 */
  389. #else                    /* Otherwise... */
  390. #ifdef pdp11
  391. #define SBSIZ 3020
  392. #else
  393. #define SBSIZ 9050            /* Allow for 3 x 3000, etc. */
  394. #endif /* pdp11 */
  395. #endif /* BIGBUFOK */
  396. #endif /* SBSIZ */
  397.  
  398. #ifndef RBSIZ
  399. #ifdef BIGBUFOK
  400. #define RBSIZ 290000
  401. #else
  402. #ifdef pdp11
  403. #define RBSIZ 3020
  404. #else
  405. #define RBSIZ 9050
  406. #endif /* pdp11 */
  407. #endif /* BIGBUFOK */
  408. #endif /* RBSIZ */
  409. #else  /* not DYNAMIC */
  410. #ifdef pdp11
  411. #define SBSIZ 3020
  412. #define RBSIZ 3020
  413. #else
  414. #ifndef SBSIZ
  415. #define SBSIZ (MAXSP * (MAXWS + 1))
  416. #endif /* SBSIZ */
  417. #ifndef RBSIZ
  418. #define RBSIZ (MAXRP * (MAXWS + 1))
  419. #endif /* RBSIZ */
  420. #endif /* pdp11 */
  421. #endif /* DYNAMIC */
  422.  
  423. #ifdef BIGBUFOK
  424. #define PKTMSGLEN 1023
  425. #else
  426. #define PKTMSGLEN 80
  427. #endif /* BIGBUFOK */
  428.  
  429. /* Kermit parameters and defaults */
  430.  
  431. #define CTLQ       '#'            /* Control char prefix I will use */
  432. #define MYEBQ       '&'            /* 8th-Bit prefix char I will use */
  433. #define MYRPTQ       '~'            /* Repeat count prefix I will use */
  434.  
  435. #define MAXTRY        10            /* Times to retry a packet */
  436. #define MYPADN        0            /* How many padding chars I need */
  437. #define MYPADC        '\0'        /* Which padding character I need */
  438.  
  439. #define DMYTIM        8            /* Initial timeout interval to use. */
  440. #define URTIME        15            /* Timeout interval to use on me. */
  441. #define DSRVTIM     0            /* Default server cmd wait timeout. */
  442.  
  443. #define DEFTRN        0            /* Default line turnaround handshake */
  444.  
  445. #define MYEOL        CR            /* Incoming packet terminator. */
  446.  
  447. #ifdef NEWDEFAULTS
  448. #define DRPSIZ      4095            /* Default incoming packet size. */
  449. #define DFWSIZ      30            /* Default window size */
  450. #define DFBCT        3            /* Default block-check type */
  451. #else
  452. #define DRPSIZ        90            /* Default incoming packet size. */
  453. #define DFWSIZ       1            /* Default window size */
  454. #define DFBCT        3            /* Default block-check type */
  455. #endif /* NEWDEFAULTS */
  456.  
  457. #define DSPSIZ        90            /* Default outbound packet size. */
  458.  
  459. #define DDELAY      1            /* Default delay. */
  460. #define DSPEED        9600        /* Default line speed. */
  461.  
  462. #ifdef OS2                /* Default CONNECT-mode */
  463. #define DFESC 29            /* escape character */
  464. #else
  465. #ifdef NEXT                /* Ctrl-] for PC and NeXT */
  466. #define DFESC 29
  467. #else
  468. #ifdef GEMDOS                /* And Atari ST */
  469. #define DFESC 29
  470. #else
  471. #define DFESC 28            /* Ctrl-backslash for others */
  472. #endif /* GEMDOS */
  473. #endif /* NEXT */
  474. #endif /* OS2 */
  475.  
  476. #ifdef NOPUSH                /* NOPUSH implies NOJC */
  477. #ifndef NOJC                /* (no job control) */
  478. #define NOJC
  479. #endif /* NOJC */
  480. #endif /* NOPUSH */
  481.  
  482. #ifdef UNIX                /* Default for SET SUSPEND */
  483. #ifdef NOJC                /* UNIX but job control disabled */
  484. #define DFSUSP      0
  485. #else                    /* UNIX, job control enabled. */
  486. #define DFSUSP      1
  487. #endif /* NOJC */
  488. #else
  489. #define DFSUSP      0
  490. #endif /* UNIX */
  491.  
  492. #ifndef DFCDMSG
  493. #ifdef UNIXOROSK
  494. #define DFCDMSG "{{./.readme}{README.TXT}{READ.ME}}"
  495. #else
  496. #define DFCDMSG "{{README.TXT}{READ.ME}}"
  497. #endif /* UNIXOROSK */
  498. #endif /* DFCDMSG */
  499.  
  500. /* Files */
  501.  
  502. #define ZCTERM      0            /* Console terminal */
  503. #define ZSTDIO      1        /* Standard input/output */
  504. #define ZIFILE        2        /* Current input file (SEND, etc) (in) */
  505. #define ZOFILE      3            /* Current output file (RECEIVE, GET) (out) */
  506. #define ZDFILE      4            /* Current debugging log file (out) */
  507. #define ZTFILE      5            /* Current transaction log file (out) */
  508. #define ZPFILE      6            /* Current packet log file (out) */
  509. #define ZSFILE      7        /* Current session log file (out) */
  510. #define ZSYSFN        8        /* Input/Output from a system function */
  511. #define ZRFILE      9           /* Local file for READ (in) */
  512. #define ZWFILE     10           /* Local file for WRITE (out) */
  513. #define ZMFILE     11        /* Miscellaneous file, e.g. for XLATE */
  514. #define ZDIFIL     12        /* DIAL log */
  515. #define ZNFILS     13            /* How many defined file numbers */
  516.  
  517. #ifdef CKCHANNELIO
  518.  
  519. /* File modes */
  520.  
  521. #define FM_REA      1            /* Read */
  522. #define FM_WRI      2            /* Write */
  523. #define FM_APP      4            /* Append */
  524. #define FM_RWA      7            /* Read/Write/Append mask */
  525. #define FM_BIN      8            /* Binary */
  526. #define FM_RWB     15            /* Read/Write/Append/Binary mask */
  527. #define FM_CMD     16            /* Command */
  528. #define FM_EOF     64            /* (status) At EOF */
  529.  
  530. /* File errors */
  531.  
  532. #define FX_NER      0            /* No error */
  533. #define FX_SYS     -1            /* System error */
  534. #define FX_EOF     -2            /* End of file */
  535. #define FX_NOP     -3            /* Channel not open */
  536. #define FX_CHN     -4            /* Channel out of range */
  537. #define FX_RNG     -5            /* Argument range error */
  538. #define FX_FNF     -6            /* File not found */
  539. #define FX_BFN     -7            /* Bad or missing filename */
  540. #define FX_NMF     -8            /* No more files */
  541. #define FX_FOP     -9            /* Forbidden operation */
  542. #define FX_ACC    -10            /* Access denied */
  543. #define FX_BOM    -11            /* Bad combination of open modes */
  544. #define FX_OFL    -12            /* Buffer overflow */
  545. #define FX_LNU    -13            /* Current line number unknown */
  546. #define FX_NYI    -99            /* Feature not implemented yet */
  547. #define FX_UNK   -999            /* Unknown error */
  548.  
  549. _PROTOTYP( int z_open, (char *, int) );
  550. _PROTOTYP( int z_close, (int) );
  551. _PROTOTYP( int z_out, (int, char *, int, int) );
  552. _PROTOTYP( int z_in, (int, char *, int, int, int) );
  553. _PROTOTYP( int z_flush, (int) );
  554. _PROTOTYP( int z_seek, (int, long) );
  555. _PROTOTYP( int z_line, (int, long) );
  556. _PROTOTYP( int z_getmode, (int) );
  557. _PROTOTYP( int z_getfnum, (int) );
  558. _PROTOTYP( long z_getpos, (int) );
  559. _PROTOTYP( long z_getline, (int) );
  560. _PROTOTYP( long z_count, (int, int) );
  561. _PROTOTYP( char * z_getname, (int) );
  562. _PROTOTYP( char * ckferror, (int) );
  563.  
  564. #endif /* CKCHANNELIO */
  565.  
  566. /*  Buffered file i/o ...  */
  567. #ifdef OS2                /* K-95 */
  568. #define INBUFSIZE 32768
  569. #define OBUFSIZE 32768
  570. #else
  571. #ifdef pdp11
  572. #define INBUFSIZE 512
  573. #define OBUFSIZE 512
  574. #else
  575. /* In VMS, allow for longest possible RMS record */
  576. #ifdef VMS
  577. #define INBUFSIZE 32768            /* File input buffer size */
  578. #define OBUFSIZE 32768            /* File output buffer size */
  579. #else  /* Not VMS */
  580. #ifdef BIGBUFOK                /* Systems where memory is */
  581. #define INBUFSIZE 32768            /* not a problem... */
  582. #define OBUFSIZE 32768
  583. #else /* Not BIGBUFOK */
  584. #ifdef STRATUS
  585. #ifdef DYNAMIC
  586. #define INBUFSIZE 32767            /* File input buffer size */
  587. #define OBUFSIZE 32767            /* File output buffer size */
  588. #else /* STRATUS, not DYNAMIC */
  589. #define INBUFSIZE 4096            /* File input buffer size */
  590. #define OBUFSIZE 4096            /* File output buffer size */
  591. #endif /* DYNAMIC */
  592. #else /* not STRATUS */
  593. #define INBUFSIZE 1024
  594. #define OBUFSIZE 1024
  595. #endif /* STRATUS */
  596. #endif /* BIGBUFOK */
  597. #endif /* VMS */
  598. #endif /* pdp11 */
  599. #endif /* OS2 */
  600.  
  601. /* File-transfer character in/out macros for buffered i/o */
  602.  
  603. /* Get the next file byte */
  604. #ifndef CKCMAI
  605. #ifndef NOXFER
  606. extern char ** sndarray;
  607. #endif /* NOXFER */
  608. #endif /* CKCMAI */
  609. #ifdef NOSPL
  610. #define zminchar() (((--zincnt)>=0) ? ((int)(*zinptr++) & 0377) : zinfill())
  611. #else
  612. #ifdef NOXFER
  613. #define zminchar() (((--zincnt)>=0) ? ((int)(*zinptr++) & 0377) : zinfill())
  614. #else
  615. #define zminchar() \
  616. (sndarray?agnbyte():(((--zincnt)>=0) ? ((int)(*zinptr++) & 0377) : zinfill()))
  617. #endif /* NOXFER */
  618. #endif /* NOSPL */
  619.  
  620. /* Stuff a character into the input buffer */
  621. #define zmstuff(c) zinptr--, *zinptr = c, zincnt++
  622.  
  623. /* Put a character to a file */
  624. #define zmchout(c) \
  625. ((*zoutptr++=(char)(c)),(((++zoutcnt)>=zobufsize)?zoutdump():0))
  626.  
  627. /* Screen functions */
  628.  
  629. #ifdef NODISPLAY
  630. #define xxscreen(a,b,c,d)
  631. #define ckscreen(a,b,c,d)
  632. #else
  633. _PROTOTYP( VOID ckscreen, (int, char, long, char *) );
  634. #ifdef VMS
  635. #define xxscreen(a,b,c,d) \
  636. if (local && fdispla != XYFD_N) \
  637. ckscreen((int)a,(char)b,(long)c,(char *)d)
  638. #else
  639. #define xxscreen(a,b,c,d) \
  640. if (local && !backgrd && fdispla != XYFD_N) \
  641. ckscreen((int)a,(char)b,(long)c,(char *)d)
  642. #endif /* VMS */
  643. #endif /* NODISPLAY */
  644.  
  645. #define SCR_FN 1        /* filename */
  646. #define SCR_AN 2        /* as-name */
  647. #define SCR_FS 3     /* file-size */
  648. #define SCR_XD 4        /* x-packet data */
  649. #define SCR_ST 5          /* File status: */
  650. #define   ST_OK   0       /*  Transferred OK */
  651. #define   ST_DISC 1     /*  Discarded */
  652. #define   ST_INT  2     /*  Interrupted */
  653. #define   ST_SKIP 3     /*  Skipped */
  654. #define   ST_ERR  4     /*  Fatal Error */
  655. #define   ST_REFU 5     /*  Refused (use Attribute codes for reason) */
  656. #define   ST_INC  6    /*  Incompletely received */
  657. #define   ST_MSG  7    /*  Informational message */
  658. #define SCR_PN 6        /* packet number */
  659. #define SCR_PT 7        /* packet type or pseudotype */
  660. #define SCR_TC 8        /* transaction complete */
  661. #define SCR_EM 9        /* error message */
  662. #define SCR_WM 10       /* warning message */
  663. #define SCR_TU 11    /* arbitrary undelimited text */
  664. #define SCR_TN 12       /* arbitrary new text, delimited at beginning */
  665. #define SCR_TZ 13       /* arbitrary text, delimited at end */
  666. #define SCR_QE 14    /* quantity equals (e.g. "foo: 7") */
  667. #define SCR_CW 15    /* close screen window */
  668. #define SCR_CD 16       /* display current directory */
  669.  
  670. /* Macros */
  671.  
  672. #ifndef CKCMAI
  673. extern int tcp_incoming;        /* Used by ENABLE macro */
  674. #endif /* CKCMAI */
  675.  
  676. #ifndef TCPSOCKET
  677. /*
  678.   ENABLED tells whether a server-side service is enabled.
  679.   0 = disabled, 1 = local, 2 = remote.
  680.   A "set host *" connection is technically local but logically remote
  681. */
  682. #define ENABLED(x) ((local && (x & 1)) || (!local && (x & 2)))
  683. #else
  684. #define ENABLED(x) (((local && !tcp_incoming) && (x & 1)) || \
  685. ((!local || tcp_incoming) && (x&2)))
  686. #endif /* TCPSOCKET */
  687.  
  688. /* These are from the book */
  689.  
  690. #define tochar(ch)  (((ch) + SP ) & 0xFF )    /* Number to character */
  691. #define xunchar(ch) (((ch) - SP ) & 0xFF )    /* Character to number */
  692. #define ctl(ch)     (((ch) ^ 64 ) & 0xFF )    /* Control/Uncontrol toggle */
  693. #define unpar(ch)   (((ch) & 127) & 0xFF )    /* Clear parity bit */
  694.  
  695. /* Modem and dialing definitions */
  696.  
  697. #ifndef NODIAL
  698.  
  699. /* Modem capabilities (bit values) */
  700. #define CKD_AT   1            /* Hayes AT commands and responses */
  701. #define CKD_V25  2            /* V.25bis commands and responses */
  702. #define CKD_SB   4            /* Speed buffering */
  703. #define CKD_EC   8            /* Error correction */
  704. #define CKD_DC  16            /* Data compression */
  705. #define CKD_HW  32            /* Hardware flow control */
  706. #define CKD_SW  64            /* (Local) software flow control */
  707. #define CKD_KS 128            /* Kermit spoofing */
  708. #define CKD_TB 256            /* Made by Telebit */
  709.  
  710. /* DIAL command result codes */
  711. #define DIA_UNK   -1            /* No DIAL command given yet */
  712. #define DIA_OK     0            /* DIAL succeeded */
  713. #define DIA_NOMO   1            /* Modem type not specified */
  714. #define DIA_NOLI   2            /* Communication line not spec'd */
  715. #define DIA_OPEN   3            /* Line can't be opened */
  716. #define DIA_NOSP   4            /* Speed not specified */
  717. #define DIA_HANG   5            /* Hangup failure */
  718. #define DIA_IE     6            /* Internal error (malloc, etc) */
  719. #define DIA_IO     7            /* I/O error */
  720. #define DIA_TIMO   8            /* Dial timeout expired */
  721. #define DIA_INTR   9            /* Dialing interrupted by user */
  722. #define DIA_NRDY  10            /* Modem not ready */
  723. #define DIA_PART  11            /* Partial dial command OK */
  724. #define DIA_DIR   12            /* Dialing directory error */
  725. #define DIA_HUP   13            /* Modem was hung up OK */
  726. #define DIA_ERR   20            /* Modem command error */
  727. #define DIA_NOIN  21            /* Failure to initialize modem */
  728. #define DIA_BUSY  22            /* Phone busy */
  729. #define DIA_NOCA  23            /* No carrier */
  730. #define DIA_NODT  24            /* No dialtone */
  731. #define DIA_RING  25            /* Ring, incoming call */
  732. #define DIA_NOAN  26            /* No answer */
  733. #define DIA_DISC  27            /* Disconnected */
  734. #define DIA_VOIC  28            /* Answered by voice */
  735. #define DIA_NOAC  29            /* Access denied, forbidden call */
  736. #define DIA_BLCK  30            /* Blacklisted */
  737. #define DIA_DELA  31            /* Delayed */
  738. #define DIA_FAX   32            /* Fax */
  739. #define DIA_DIGI  33                    /* Digital Line */
  740. #define DIA_TAPI  34            /* TAPI dialing failure */
  741. #define DIA_UERR  98            /* Unknown error */
  742. #define DIA_UNSP  99        /* Unspecified failure detected by modem */
  743.  
  744. #define MDMINF    struct mdminf
  745.  
  746. MDMINF {            /* Structure for modem-specific information */
  747.  
  748.     char * name;        /* Descriptive name */
  749.     char * pulse;        /* Command to force pulse dialing */
  750.     char * tone;        /* Command to force tone dialing */
  751.     int    dial_time;        /* Time modem allows for dialing (secs) */
  752.     char * pause_chars;        /* Character(s) to tell modem to pause */
  753.     int       pause_time;        /* Time associated with pause chars (secs) */
  754.     char * wake_str;        /* String to wakeup modem & put in cmd mode */
  755.     int       wake_rate;        /* Delay between wake_str characters (msecs) */
  756.     char * wake_prompt;        /* String prompt after wake_str */
  757.     char * dmode_str;        /* String to put modem in dialing mode */
  758.     char * dmode_prompt;    /* String prompt for dialing mode */
  759.     char * dial_str;        /* Dialing string, with "%s" for number */
  760.     int    dial_rate;        /* Interchar delay to modem (msec) */
  761.     int    esc_time;        /* Escape sequence guard time (msec) */
  762.     int    esc_char;        /* Escape character */
  763.     char * hup_str;        /* Hangup string */
  764.     char * hwfc_str;        /* Hardware flow control string */
  765.     char * swfc_str;        /* Software flow control string */
  766.     char * nofc_str;        /* No flow control string */
  767.     char * ec_on_str;        /* Error correction on string */
  768.     char * ec_off_str;        /* Error correction off string */
  769.     char * dc_on_str;        /* Data compression on string */
  770.     char * dc_off_str;        /* Data compression off string */
  771.     char * aa_on_str;        /* Autoanswer on string */
  772.     char * aa_off_str;        /* Autoanswer off string */
  773.     char * sb_on_str;        /* Speed buffering on string */
  774.     char * sb_off_str;        /* Speed buffering off string */
  775.     char * sp_on_str;        /* Speaker on string */
  776.     char * sp_off_str;        /* Speaker off string */
  777.     char * vol1_str;        /* Volume low string */
  778.     char * vol2_str;        /* Volume med string */
  779.     char * vol3_str;        /* Volume high string */
  780.     char * ignoredt;        /* Ignore dialtone string */
  781.     char * ini2;        /* Last-minute init string */
  782.     long   max_speed;        /* Maximum interface speed */
  783.     long   capas;        /* Capability bits */
  784.     /* function to read modem's response string to a non-dialing command */
  785.     _PROTOTYP( int (*ok_fn), (int,int) );
  786. };
  787. #endif /* NODIAL */
  788.  
  789. /* Symbols for File Attributes */
  790.  
  791. #define AT_XALL  0            /* All of them */
  792. #define AT_ALLY  1            /* All of them on (Yes) */
  793. #define AT_ALLN  2            /* All of them off (no) */
  794. #define AT_LENK  3            /* Length in K */
  795. #define AT_FTYP  4            /* File Type */
  796. #define AT_DATE  5            /* Creation date */
  797. #define AT_CREA  6            /* Creator */
  798. #define AT_ACCT  7            /* Account */
  799. #define AT_AREA  8            /* Area */
  800. #define AT_PSWD  9            /* Password for area */
  801. #define AT_BLKS 10            /* Blocksize */
  802. #define AT_ACCE 11            /* Access */
  803. #define AT_ENCO 12            /* Encoding */
  804. #define AT_DISP 13            /* Disposition */
  805. #define AT_LPRO 14            /* Local Protection */
  806. #define AT_GPRO 15            /* Generic Protection */
  807. #define AT_SYSI 16            /* System ID */
  808. #define AT_RECF 17            /* Record Format */
  809. #define AT_SYSP 18            /* System-Dependent Parameters */
  810. #define AT_LENB 19            /* Length in Bytes */
  811. #define AT_EOA  20            /* End of Attributes */
  812.  
  813. /* Kermit packet information structure */
  814.  
  815. struct pktinfo {            /* Packet information structure */
  816.     CHAR *bf_adr;            /*  buffer address */
  817.     int   bf_len;            /*  buffer length */
  818.     CHAR *pk_adr;            /* Packet address within buffer */
  819.     int   pk_len;            /*  length of data within buffer */
  820.     int   pk_typ;            /*  packet type */
  821.     int   pk_seq;            /*  packet sequence number */
  822.     int   pk_rtr;            /*  retransmission count */
  823. };
  824.  
  825. /* Send Modes (indicating which type of SEND command was used) */
  826.  
  827. #define SM_SEND     0
  828. #define SM_MSEND    1
  829. #define SM_RESEND   2
  830. #define SM_PSEND    3
  831. #define SM_MAIL     4
  832. #define SM_PRINT    5
  833.  
  834. /* File-related symbols and structures */
  835. /* Used by SET FILE command but also by protocol and i/o modules */
  836.  
  837. #define XMODE_A 0    /* Transfer mode Automatic */
  838. #define XMODE_M 1    /* Transfer mode Manual    */
  839.  
  840. #define   XYFILN 0      /*  Naming  */
  841. #define     XYFN_L 0    /*    Literal */
  842. #define     XYFN_C 1    /*    Converted */
  843. #define   XYFILT 1      /*  Type    */
  844. #define     XYFT_T 0    /*    Text  */
  845. #define     XYFT_B 1    /*    Binary */
  846. #define     XYFT_I 2    /*    Image or Block (VMS) */
  847. #define     XYFT_L 3    /*    Labeled (tagged binary) (VMS or OS/2) */
  848. #define     XYFT_U 4    /*    Binary Undefined (VMS) */
  849. #define     XYFT_M 5    /*    MacBinary (Macintosh) */
  850. #define     XYFT_D 99   /*    Debug (for session logs) */
  851. #define   XYFILW 2      /*  Warning */
  852. #define   XYFILD 3      /*  Display */
  853. #define     XYFD_N 0    /*    None, Off */
  854. #define     XYFD_R 1    /*    Regular, Dots */
  855. #define     XYFD_C 2    /*    Cursor-positioning (e.g. with curses) */
  856. #define     XYFD_S 3    /*    CRT Screen */
  857. #define     XYFD_B 4    /*    Brief */
  858. #define   XYFILC 4      /*  Character set */
  859. #define   XYFILF 5      /*  Record Format */
  860. #define     XYFF_S  0   /*    Stream */
  861. #define     XYFF_V  1   /*    Variable */
  862. #define     XYFF_VB 2   /*    Variable with RCW's */
  863. #define     XYFF_F  3   /*    Fixed length */
  864. #define     XYFF_U  4   /*    Undefined */
  865. #define   XYFILR 6      /*  Record length */
  866. #define   XYFILO 7      /*  Organization */
  867. #define     XYFO_S 0    /*    Sequential */
  868. #define     XYFO_I 1    /*    Indexed */
  869. #define     XYFO_R 2    /*    Relative */
  870. #define   XYFILP 8      /*  Printer carriage control */
  871. #define     XYFP_N 0    /*    Newline (imbedded control characters) */
  872. #define     XYFP_F 1    /*    FORTRAN (space, 1, +, etc, in column 1 */
  873. #define     XYFP_P 2    /*    Special printer carriage controls */
  874. #define     XYFP_X 4    /*    None */
  875. #define   XYFILX 9      /*  Collision Action */
  876. #define     XYFX_A 3    /*    Append */
  877. #define     XYFX_Q 5    /*    Ask */
  878. #define     XYFX_B 2    /*    Backup */
  879. #define     XYFX_D 4    /*    Discard */
  880. #define     XYFX_R 0    /*    Rename */
  881. #define     XYFX_X 1    /*    Replace */
  882. #define     XYFX_U 6    /*    Update */
  883. #define   XYFILB 10     /*  Blocksize */
  884. #define   XYFILZ 11     /*  Disposition */
  885. #define     XYFZ_N 0    /*    New, Create */
  886. #define     XYFZ_A 1    /*    New, append if file exists, else create */
  887. #define     XYFZ_O 2    /*    Old, file must exist */
  888. #define   XYFILS 12     /*  File Byte Size */
  889. #define   XYFILL 13     /*  File Label (VMS) */
  890. #define   XYFILI 14     /*  File Incomplete */
  891. #define   XYFILQ 15     /*  File path action (strip or not) */
  892. #define   XYFILG 16     /*  File download directory */
  893. #define   XYFILA 17     /*  Line terminator for local text files */
  894. #define     XYFA_L 012  /*    LF (as in UNIX) */
  895. #define     XYFA_C 015  /*    CR (as in OS-9 or Mac OS) */
  896. #define     XYFA_2 000  /*  CRLF -- Note: this must be defined as 0 */
  897. #define   XYFILY 18     /*  Destination */
  898. #define   XYFILV 19    /*  EOF Detection Method */
  899. #define     XYEOF_L 0   /*    File length */
  900. #define     XYEOF_Z 1   /*    Ctrl-Z in file */
  901. #define   XYFILH 20     /*  OUTPUT parameters - buffered, blocking, etc */
  902. #define   XYFIBP 21    /*  BINARY-PATTERN */
  903. #define   XYFITP 22     /*  TEXT-PATTERN */
  904. #define   XYFIPA 23     /*  PATTERNS ON/OFF */
  905. #define   XYFILU 24     /*  UCS ... */
  906.  
  907. /* Connection closed reasons */
  908.  
  909. #define WC_REMO   0            /* Closed by remote */
  910. #define WC_CLOS   1            /* Closed from our end */
  911. #define WC_TELOPT 2            /* Telnet negotiation failure */
  912.  
  913. #ifdef BIGBUFOK
  914. #define FTPATTERNS 256
  915. #else
  916. #define FTPATTERNS 64
  917. #endif /* BIGBUFOK */
  918.  
  919. #ifdef OS2
  920. struct tt_info_rec {            /* Terminal emulation info */
  921.     char  *x_name;
  922.     char *x_aliases[4];
  923.     char  *x_id;
  924. };
  925. #endif /* OS2 */
  926.  
  927. #ifndef NOIKSD
  928. #ifdef IKSDB                /* IKSD Database definitions */
  929.  
  930. /* Field values */
  931.  
  932. #define DBF_INUSE    1            /* Flag bits... In use */
  933. #define DBF_USER     2            /* Real user (versus anonymous) */
  934. #define DBF_LOGGED   4            /* Logged in (versus not) */
  935.  
  936. /* Data Definitions... */
  937.  
  938. /* Numeric fields, hex, right justified, 0-filled on left */
  939.  
  940. #define db_FLAGS     0            /* Field 0: Flags */
  941. #define DB_FLAGS     0            /* Offset: 0 */
  942. #define dB_FLAGS     4            /* Length: 4 (hex digits) */
  943.  
  944. #define db_ATYPE     1            /* Field 1: Authentication type */
  945. #define DB_ATYPE     4            /* 4 hex digits */
  946. #define dB_ATYPE     4
  947.  
  948. #define db_AMODE     2            /* Field 2: Authentication mode */
  949. #define DB_AMODE     8            /* 4 hex digits */
  950. #define dB_AMODE     4
  951.  
  952. #define db_STATE     3            /* Field 3: State - 4 hex digits*/
  953. #define DB_STATE    12            /* 4 hex digits */
  954. #define dB_STATE     4
  955.  
  956. #define db_MYPID     4            /* Field 4: My PID */
  957. #define DB_MYPID    16            /* 16 hex digits left padded with 0 */
  958. #define dB_MYPID    16
  959.  
  960. #define db_SADDR     5            /* Field 5: Server (my) IP address */
  961. #define DB_SADDR    32            /* 16 hex digits left padded with 0 */
  962. #define dB_SADDR    16
  963.  
  964. #define db_CADDR     6            /* Field 6: Client IP address */
  965. #define DB_CADDR    48            /* 16 hex digits left padded with 0 */
  966. #define dB_CADDR    16
  967.  
  968. /* Date-time fields (17 right-adjusted in 18 for Y10K readiness) */
  969.  
  970. #define db_START     7            /* Field 7: Session start date-time */
  971. #define DB_START    65            /* 64 is leading space for Y10K */
  972. #define dB_START    17
  973.  
  974. #define db_LASTU     8            /* Field 8: Last lastu date-time */
  975. #define DB_LASTU    83            /* 82 is leading space for Y10K */
  976. #define dB_LASTU    17
  977.  
  978. #define db_ULEN      9            /* Field 9: Length of Username */
  979. #define DB_ULEN    100            /* 4 hex digits */
  980. #define dB_ULEN      4
  981.  
  982. #define db_DLEN     10            /* Field 10: Length of Directory */
  983. #define DB_DLEN    104            /* 4 hex digits */
  984. #define dB_DLEN      4
  985.  
  986. #define db_ILEN     11            /* Field 11: Length of Info */
  987. #define DB_ILEN    108            /* 4 hex digits */
  988. #define dB_ILEN      4
  989.  
  990. #define db_PAD1     12            /* Field 12: (Reserved) */
  991. #define DB_PAD1    112            /* filled with spaces */
  992. #define dB_PAD1    912
  993.  
  994. /* String fields, all right-padded with blanks */
  995.  
  996. #define db_USER     13            /* Field 13: Username */
  997. #define DB_USER   1024            /* right-padded with spaces */
  998. #define dB_USER   1024
  999.  
  1000. #define db_DIR      14            /* Field 14: Current directory */
  1001. #define DB_DIR    2048            /* right-padded with spaces */
  1002. #define dB_DIR    1024
  1003.  
  1004. #define db_INFO     15            /* Field 15: State-specific info */
  1005. #define DB_INFO   3072            /* right-padded with spaces */
  1006. #define dB_INFO   1024
  1007.  
  1008. #define DB_RECL   4096            /* Database record length */
  1009.  
  1010. /* Offset, length, and type of each field thru its db_XXX symbol */
  1011.  
  1012. #define DBT_HEX 1            /* Hexadecimal number */
  1013. #define DBT_STR 2            /* String */
  1014. #define DBT_DAT 3            /* Date-Time yyyymmdd hh:mm:ss */
  1015. #define DBT_UND 9            /* Undefined and blank */
  1016.  
  1017. struct iksdbfld {
  1018.     int off;                /* Position (offset) */
  1019.     int len;                /* Length (bytes) */
  1020.     int typ;                /* Data type */
  1021. };
  1022. #endif /* IKSDB */
  1023. #endif /* NOIKSD */
  1024.  
  1025. /* ANSI forward declarations for protocol-related functions. */
  1026.  
  1027. _PROTOTYP( int input, (void) );
  1028. _PROTOTYP( int inibufs, (int, int) );
  1029. _PROTOTYP( int makebuf, (int, int, CHAR [], struct pktinfo *) );
  1030. _PROTOTYP( int mksbuf, (int) );
  1031. _PROTOTYP( int mkrbuf, (int) );
  1032. _PROTOTYP( int spack, (char, int, int, CHAR *) );
  1033. _PROTOTYP( VOID proto, (void) );
  1034. _PROTOTYP( int rpack, (void) );
  1035. _PROTOTYP( int ack, (void) );
  1036. _PROTOTYP( int nack, (int) );
  1037. _PROTOTYP( int ackn, (int) );
  1038. _PROTOTYP( int ack1, (CHAR *) );
  1039. _PROTOTYP( int ackns, (int, CHAR *) );
  1040. #ifdef STREAMING
  1041. _PROTOTYP( int fastack, (void) );
  1042. #endif /* STREAMING */
  1043. _PROTOTYP( int resend, (int) );
  1044. _PROTOTYP( int errpkt, (CHAR *) );
  1045. _PROTOTYP( VOID logpkt, (char, int, CHAR *, int) );
  1046. _PROTOTYP( CHAR dopar, (CHAR) );
  1047. _PROTOTYP( int chk1, (CHAR *, int) );
  1048. _PROTOTYP( unsigned int chk2, (CHAR *, int) );
  1049. _PROTOTYP( unsigned int chk3, (CHAR *, int) );
  1050. _PROTOTYP( int sipkt, (char) );
  1051. _PROTOTYP( int sopkt, (void) );
  1052. _PROTOTYP( int sinit, (void) );
  1053. _PROTOTYP( VOID rinit, (CHAR *) );
  1054. _PROTOTYP( int spar, (CHAR *) );
  1055. _PROTOTYP( int rcvfil, (char *) );
  1056. _PROTOTYP( CHAR * rpar, (void) );
  1057. _PROTOTYP( int gnfile, (void) );
  1058. _PROTOTYP( int getsbuf, (int) );
  1059. _PROTOTYP( int getrbuf, (void) );
  1060. _PROTOTYP( int freesbuf, (int) );
  1061. _PROTOTYP( int freerbuf, (int) );
  1062. _PROTOTYP( int dumpsbuf, (void) );
  1063. _PROTOTYP( int dumprbuf, (void) );
  1064. _PROTOTYP( VOID freerpkt, (int) );
  1065. _PROTOTYP( int chkwin, (int, int, int) );
  1066. _PROTOTYP( int rsattr, (CHAR *) );
  1067. _PROTOTYP( char *getreason, (char *) );
  1068. _PROTOTYP( int scmd, (char, CHAR *) );
  1069. _PROTOTYP( int encstr, (CHAR *) );
  1070. _PROTOTYP( int decode, (CHAR *, int (*)(char), int) );
  1071. _PROTOTYP( int bdecode, (CHAR *, int (*)(char)) );
  1072. _PROTOTYP( int fnparse, (char *) );
  1073. _PROTOTYP( int syscmd, (char *, char *) );
  1074. _PROTOTYP( int cwd, (char *) );
  1075. _PROTOTYP( int remset, (char *) );
  1076. _PROTOTYP( int initattr, (struct zattr *) );
  1077. _PROTOTYP( int gattr, (CHAR *, struct zattr *) );
  1078. _PROTOTYP( int adebu, (char *, struct zattr *) );
  1079. _PROTOTYP( int canned, (CHAR *) );
  1080. _PROTOTYP( int opent, (struct zattr *) );
  1081. _PROTOTYP( int ckopenx, (struct zattr *) );
  1082. _PROTOTYP( int opena, (char *, struct zattr *) );
  1083. _PROTOTYP( int openi, (char *) );
  1084. _PROTOTYP( int openo, (char *, struct zattr *, struct filinfo *) );
  1085. _PROTOTYP( int openc, (int, char *) );
  1086. _PROTOTYP( int reof, (char *, struct zattr *) );
  1087. _PROTOTYP( VOID reot, (void) );
  1088. _PROTOTYP( int sfile, (int) );
  1089. _PROTOTYP( int sattr, (int, int) );
  1090. _PROTOTYP( int sdata, (void) );
  1091. _PROTOTYP( int seof, (int) );
  1092. _PROTOTYP( int sxeof, (int) );
  1093. _PROTOTYP( int seot, (void) );
  1094. _PROTOTYP( int window, (int) );
  1095. _PROTOTYP( int clsif, (void) );
  1096. _PROTOTYP( int clsof, (int) );
  1097. _PROTOTYP( CHAR setgen, (char, char *, char *, char *) );
  1098. _PROTOTYP( int getpkt, (int, int) );
  1099. _PROTOTYP( int maxdata, (void) );
  1100. _PROTOTYP( int putsrv, (char) );
  1101. _PROTOTYP( int puttrm, (char) );
  1102. _PROTOTYP( int putque, (char) );
  1103. _PROTOTYP( int putfil, (char) );
  1104. _PROTOTYP( int putmfil, (char) );
  1105. _PROTOTYP( int zputfil, (char) );
  1106. _PROTOTYP( VOID zdstuff, (CHAR) );
  1107. _PROTOTYP( int tinit, (int) );
  1108. _PROTOTYP( VOID pktinit, (void) );
  1109. _PROTOTYP( VOID resetc, (void) );
  1110. _PROTOTYP( VOID xsinit, (void) );
  1111. _PROTOTYP( int adjpkl, (int,int,int) );
  1112. _PROTOTYP( int chktimo, (int,int) );
  1113. _PROTOTYP( int nxtpkt, (void) );
  1114. _PROTOTYP( VOID rcalcpsz, (void) );
  1115. _PROTOTYP( int srinit, (int, int, int) );
  1116. _PROTOTYP( VOID tstats, (void) );
  1117. _PROTOTYP( VOID fstats, (void) );
  1118. _PROTOTYP( VOID intmsg, (long) );
  1119. _PROTOTYP( VOID ermsg, (char *) );
  1120. _PROTOTYP( int chkint, (void) );
  1121. _PROTOTYP( VOID sdebu, (int) );
  1122. _PROTOTYP( VOID rdebu, (CHAR *, int) );
  1123. _PROTOTYP( char * dbchr, ( int ) );
  1124. #ifdef COMMENT
  1125. _PROTOTYP( SIGTYP stptrap, (int, int) );
  1126. _PROTOTYP( SIGTYP trap, (int, int) );
  1127. #else
  1128. _PROTOTYP( SIGTYP stptrap, (int) );
  1129. _PROTOTYP( SIGTYP trap, (int) );
  1130. #endif /* COMMENT */
  1131. _PROTOTYP( char * ck_errstr, (void) );
  1132. #ifndef NOXFER
  1133. _PROTOTYP( int agnbyte, (void) );
  1134. #endif /* NOXFER */
  1135. _PROTOTYP( int xgnbyte, (int, int) );
  1136. _PROTOTYP( int xpnbyte, (int, int, int, int (*)(char)) );
  1137.  
  1138. /* User interface functions needed by main program, etc. */
  1139.  
  1140. _PROTOTYP( int doconect, (int) );
  1141. _PROTOTYP( VOID setflow, (void) );
  1142. _PROTOTYP( VOID prescan, (int) );
  1143. _PROTOTYP( VOID setint, (void) );
  1144. _PROTOTYP( VOID doinit, (void) );
  1145. _PROTOTYP( VOID dofast, (void) );
  1146. _PROTOTYP( VOID cmdini, (void) );
  1147. _PROTOTYP( int dotake, (char *) );
  1148. _PROTOTYP( int cmdlin, (void) );
  1149. _PROTOTYP( int conect, (void) );
  1150. _PROTOTYP( int ckcgetc, (int) );
  1151. _PROTOTYP( int ckcputc, (int) );
  1152. _PROTOTYP (int mdmhup, (void) );
  1153. _PROTOTYP( VOID herald, (void) );
  1154. _PROTOTYP( VOID fixcmd, (void) );
  1155. _PROTOTYP( int doarg, (char) );
  1156. _PROTOTYP( int doxarg, (char **, int) );
  1157. _PROTOTYP( VOID usage, (void) );
  1158. _PROTOTYP( VOID doclean, (int) );
  1159. _PROTOTYP( int sndhlp, () );
  1160. _PROTOTYP( int sndstring, (char *) );
  1161. _PROTOTYP( VOID ckhost, (char *, int) );
  1162. _PROTOTYP( int gettcs, (int, int) );
  1163. _PROTOTYP( VOID getdialenv, (void) );
  1164. _PROTOTYP( VOID setprefix, (int) );
  1165. _PROTOTYP(VOID initproto,(int,char *,char *,char *,char *,char *,char*,char*));
  1166. _PROTOTYP( VOID initpat, (void) );
  1167. _PROTOTYP( VOID initcsets, (void) );
  1168. _PROTOTYP( char * getsysid, (char *) );
  1169. _PROTOTYP( int getsysix, (char *) );
  1170. #ifdef CK_TIMERS
  1171. _PROTOTYP( VOID rttinit, (void) );
  1172. _PROTOTYP( int getrtt, (int, int) );
  1173. #endif /* CK_TIMERS */
  1174.  
  1175. _PROTOTYP( int is_a_tty, (int) );
  1176. _PROTOTYP( int snddir, (char *) );
  1177. _PROTOTYP( int snddel, (char *) );
  1178. _PROTOTYP( int sndtype, (char *) );
  1179. _PROTOTYP( int dooutput, (char *, int) );
  1180. _PROTOTYP( int isabsolute, (char *) );
  1181. _PROTOTYP( VOID whoarewe, (void) );
  1182. _PROTOTYP( int ckmkdir, (int, char *, char **, int, int) );
  1183. _PROTOTYP( int autoexitchk, (CHAR) );
  1184. _PROTOTYP( VOID fcps, (void) );
  1185. #ifdef OS2
  1186. _PROTOTYP( VOID logchar, (unsigned short) );
  1187. #else /* OS2 */
  1188. _PROTOTYP( VOID logchar, (char) );
  1189. #endif /* OS2 */
  1190. _PROTOTYP( VOID logstr, (char *, int) );
  1191.  
  1192. #ifdef NOLOCAL
  1193. #define dologend()
  1194. #else
  1195. _PROTOTYP( VOID dologend, (void) );
  1196. #endif /* NOLOCAL */
  1197.  
  1198. #ifdef NODISPLAY
  1199. #define fxdinit(a)
  1200. #else
  1201. _PROTOTYP( VOID fxdinit, (int) );
  1202. #endif /* NODISPLAY */
  1203.  
  1204. #ifdef CK_APC
  1205. _PROTOTYP( int chkspkt, (char *) );
  1206. _PROTOTYP( int kstart, (CHAR) );
  1207. _PROTOTYP( VOID autodown, (int));
  1208. #ifdef CK_XYZ
  1209. _PROTOTYP( int zstart, (CHAR) );
  1210. #endif /* CK_XYZ */
  1211. #endif /* CK_APC */
  1212.  
  1213. #endif /* CKCKER_H */
  1214.  
  1215. /* End of ckcker.h */
  1216.