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

  1. /*  C K C D E B . H  */
  2.  
  3. /*
  4.   Thu Dec 30 10:49:21 1999
  5.  
  6.   NOTE TO CONTRIBUTORS: This file, and all the other C-Kermit files, must be
  7.   compatible with C preprocessors that support only #ifdef, #else, #endif,
  8.   #define, and #undef.  Please do not use #if, logical operators, or other
  9.   preprocessor features in any of the portable C-Kermit modules.  You can,
  10.   of course, use these constructions in system-specific modules when you they
  11.   are supported.
  12. */
  13.  
  14. /*
  15.   This file is included by all C-Kermit modules, including the modules
  16.   that aren't specific to Kermit (like the command parser and the ck?tio and
  17.   ck?fio modules).  It should be included BEFORE any other C-Kermit header
  18.   files.  It specifies format codes for debug(), tlog(), and similar
  19.   functions, and includes any necessary definitions to be used by all C-Kermit
  20.   modules, and also includes some feature selection compile-time switches, and
  21.   also system- or compiler-dependent definitions, plus #includes and prototypes
  22.   required by all C-Kermit modules.
  23. */
  24.  
  25. /*
  26.   Author: Frank da Cruz <fdc@columbia.edu>,
  27.   Columbia University Academic Information Systems, New York City.
  28.  
  29.   Copyright (C) 1985, 2000,
  30.     Trustees of Columbia University in the City of New York.
  31.     All rights reserved.  See the C-Kermit COPYING.TXT file or the
  32.     copyright text in the ckcmai.c module for disclaimer and permissions.
  33. */
  34.  
  35. /*
  36.   Etymology: The name of this file means "C-Kermit Common-C-Language Debugging
  37.   Header", because originally it contained only the formats (F000-F111) for
  38.   the debug() and tlog() functions.  See how it has grown...
  39. */
  40.  
  41. #ifndef CKCDEB_H            /* Don't include me more than once. */
  42. #define CKCDEB_H
  43.  
  44. #ifdef MACOSX10                /* Mac OS X 1.0 */
  45. #ifndef MACOSX                /* implies Mac OS X */
  46. #define MACOSX
  47. #endif /* MACOSX */
  48. #endif /* MACOSX10 */
  49.  
  50. #ifdef MACOSX                /* Mac OS X */
  51. #ifndef BSD44                /* implies 4.4 BSD */
  52. #define BSD44
  53. #endif /* BSD44 */
  54. #endif /* MACOSX */
  55.  
  56. #ifdef SCO_OSR505            /* SCO 3.2v5.0.5 */
  57. #ifndef SCO_OSR504            /* implies SCO 3.2v5.0.4 */
  58. #define SCO_OSR504
  59. #endif /* SCO_OSR504 */
  60. #endif /* SCO_OSR505 */
  61.  
  62. #ifdef SCO_OSR504            /* SCO 3.2v5.0.4 */
  63. #ifndef CK_SCOV5            /* implies SCO 3.2v5.0 */
  64. #define CK_SCOV5
  65. #endif /* CK_SCOV5 */
  66. #include <sys/types.h>            /* To sidestep header-file mess */
  67. #endif /* SCO_OSR504 */
  68.  
  69. #ifdef CK_SCO32V4            /* SCO 3.2v4 */
  70. #ifndef XENIX
  71. #define XENIX
  72. #endif /* XENIX */
  73. #ifndef SVR3
  74. #define SVR3
  75. #endif /* SVR3 */
  76. #ifndef DIRENT
  77. #define DIRENT
  78. #endif /* DIRENT */
  79. #ifndef RENAME
  80. #define RENAME
  81. #endif /* RENAME */
  82. #ifndef SVR3JC
  83. #define SVR3JC
  84. #endif /* SVR3JC */
  85. #ifndef CK_RTSCTS
  86. #define CK_RTSCTS
  87. #endif /* CK_RTSCTS */
  88. #ifndef PID_T
  89. #define PID_T pid_t
  90. #endif /* PID_T */
  91. #ifndef PWID_T
  92. #define PWID_T int
  93. #endif /* PWID_T */
  94. #endif /* CK_SCO32V4 */
  95.  
  96. #ifdef NOICP                /* If no command parser */
  97. #ifndef NOSPL                /* Then no script language either */
  98. #define NOSPL
  99. #endif /* NOSPL */
  100. #ifndef NOCSETS                /* Or characer sets */
  101. #define NOCSETS
  102. #endif /* NOCSETS */
  103. #endif /* NOICP */
  104.  
  105. /* Features that can be eliminated from a no-file-transfer version */
  106.  
  107. #ifdef NOXFER
  108. #ifndef NOCURSES            /* Fullscreen file-transfer display */
  109. #define NOCURSES
  110. #endif /* NOCURSES */
  111. #ifndef NOCKXYZ                /* XYZMODEM support */
  112. #define NOCKXYZ
  113. #endif /* NOCKXYZ */
  114. #ifndef NOCKSPEED            /* Ctrl-char unprefixing */
  115. #define NOCKSPEED
  116. #endif /* NOCKSPEED */
  117. #ifndef NOSERVER            /* Server mode */
  118. #define NOSERVER
  119. #endif /* NOSERVER */
  120. #ifndef NOCKTIMERS            /* Dynamic packet timers */
  121. #define NOCKTIMERS
  122. #endif /* NOCKTIMERS */
  123. #ifndef NOPATTERNS            /* File-type patterns */
  124. #define NOPATTERNS
  125. #endif /* NOPATTERNS */
  126. #ifndef NOSTREAMING            /* Streaming */
  127. #define NOSTREAMING
  128. #endif /* NOSTREAMING */
  129. #ifndef NOIKSD                /* Internet Kermit Service */
  130. #define NOIKSD
  131. #endif /* NOIKSD */
  132. #ifndef NOPIPESEND            /* Sending from pipes */
  133. #define NOPIPESEND
  134. #endif /* NOPIPESEND */
  135. #ifndef NOAUTODL            /* Autodownload */
  136. #define NOAUTODL
  137. #endif /* NOAUTODL */
  138. #ifndef NOMSEND                /* MSEND */
  139. #define NOMSEND
  140. #endif /* NOMSEND */
  141. #ifndef NOTLOG                /* Transaction logging */
  142. #define NOTLOG
  143. #endif /* NOTLOG */
  144. #ifndef NOCKXXCHAR            /* Packet character doubling */
  145. #define NOCKXXCHAR
  146. #endif /* NOCKXXCHAR */
  147. #endif /* NOXFER */
  148.  
  149. #ifdef NOICP                /* No Interactive Command Parser */
  150. #ifndef NODIAL                /* Implies No DIAL command */
  151. #define NODIAL
  152. #endif /* NODIAL */
  153. #ifndef NOCKXYZ                /* and no external protocols */
  154. #define NOCKXYZ
  155. #endif /* NOCKXYZ */
  156. #endif /* NOICP */
  157.  
  158. /* Features that can be eliminated from a remote-only version */
  159.  
  160. #ifdef NOLOCAL
  161. #ifndef NOCURSES            /* Fullscreen file-transfer display */
  162. #define NOCURSES
  163. #endif /* NOCURSES */
  164. #ifndef NODIAL
  165. #define NODIAL
  166. #endif /* NODIAL */
  167. #ifndef NOSCRIPT
  168. #define NOSCRIPT
  169. #endif /* NOSCRIPT */
  170. #ifndef NOAPC
  171. #define NOAPC
  172. #endif /* NOAPC */
  173. #ifndef NOSETKEY
  174. #define NOSETKEY
  175. #endif /* NOSETKEY */
  176. #ifndef NOXMIT
  177. #define NOXMIT
  178. #endif /* NOXMIT */
  179. #ifdef CK_CURSES
  180. #undef CK_CURSES
  181. #endif /* CK_CURSES */
  182. #ifndef NONET
  183. #define NONET
  184. #endif /* NONET */
  185. #endif /* NOLOCAL */
  186.  
  187. #ifdef NONET
  188. #ifdef NETCONN
  189. #undef NETCONN
  190. #endif /* NETCONN */
  191. #ifdef SUNX25
  192. #undef SUNX25
  193. #endif /* SUNX25 */
  194. #ifdef IBMX25
  195. #undef IBMX25
  196. #endif /* IBMX25 */
  197. #ifdef STRATUSX25
  198. #undef STRATUSX25
  199. #endif /* STRATUSX25 */
  200. #ifdef CK_NETBIOS
  201. #undef CK_NETBIOS
  202. #endif /* CK_NETBIOS */
  203. #ifdef SUPERLAT
  204. #undef SUPERLAT
  205. #endif /* SUPERLAT */
  206. #ifdef NPIPE
  207. #undef NPIPE
  208. #endif /* NPIPE */
  209. #ifdef NETFILE
  210. #undef NETFILE
  211. #endif /* NETFILE */
  212. #ifdef NETCMD
  213. #undef NETCMD
  214. #endif /* NETCMD */
  215. #ifdef NETPTY
  216. #undef NETPTY
  217. #endif /* NETPTY */
  218. #ifdef TCPSOCKET
  219. #undef TCPSOCKET
  220. #endif /* TCPSOCKET */
  221. #ifdef NOTCPOPTS
  222. #undef NOTCPOPTS
  223. #endif /* NOTCPOPTS */
  224. #ifdef RLOGCODE
  225. #undef RLOGCODE
  226. #endif /* RLOGCODE */
  227. #ifdef NETDLL
  228. #undef NETDLL
  229. #endif /* NETDLL */
  230. #ifdef SSH
  231. #undef SSH
  232. #endif /* SSH */
  233. #ifndef NOHTTP
  234. #define NOHTTP
  235. #endif /* NOHTTP */
  236. #ifndef NOBROWSER
  237. #define NOBROWSER
  238. #endif /* NOBROWSER */
  239. #endif /* NONET */
  240. /*
  241.   Note that none of the above precludes TNCODE, which can be defined in
  242.   the absence of TCPSOCKET, etc, to enable server-side Telnet negotation.
  243. */
  244. #ifndef TNCODE                /* This is for the benefit of */
  245. #ifdef TCPSOCKET            /* modules that might need TNCODE */
  246. #define TNCODE                /* not all of ckcnet.h... */
  247. #endif /* TCPSOCKET */
  248. #endif /* TNCODE */
  249.  
  250. #ifndef NETCONN
  251. #ifdef TCPSOCKET
  252. #define NETCONN
  253. #endif /* TCPSOCKET */
  254. #endif /* NETCONN */
  255.  
  256. #ifndef DEFPAR                /* Default parity */
  257. #define DEFPAR 0            /* Must be here because it is used */
  258. #endif /* DEFPAR */            /* by all classes of modules */
  259.  
  260. #ifdef NT
  261. #ifndef OS2ORWIN32
  262. #define OS2ORWIN32
  263. #endif /* OS2ORWIN32 */
  264. #ifndef OS2
  265. #define WIN32ONLY
  266. #endif /* OS2 */
  267. #endif /* NT */
  268.  
  269. #ifdef OS2                /* For OS/2 debugging */
  270. #ifndef OS2ORWIN32
  271. #define OS2ORWIN32
  272. #endif /* OS2ORWIN32 */
  273. #include "ckoker.h"
  274. #ifdef NT
  275. #define NOCRYPT
  276. #include <windows.h>
  277. #define NTSIG
  278. #else /* NT */
  279. #define OS2ONLY
  280. #include <os2def.h>
  281. #endif /* NT */
  282. #ifndef OS2ORUNIX
  283. #define OS2ORUNIX
  284. #endif /* OS2ORUNIX */
  285. #endif /* OS2 */
  286.  
  287. #include <stdio.h>            /* Begin by including this. */
  288. #include <ctype.h>            /* and this. */
  289.  
  290. #ifdef MAC
  291. /*
  292.  * The MAC doesn't use standard stdio routines.
  293.  */
  294. #undef getchar
  295. #define getchar()   mac_getchar()
  296. #undef putchar
  297. #define putchar(c)    mac_putchar(c)
  298. #define printf        mac_printf
  299. #define perror        mac_perror
  300. #define puts        mac_puts
  301. extern int mac_putchar (int c);
  302. extern int mac_puts (const char *string);
  303. extern int mac_printf(const char *, ...);
  304. extern int mac_getchar (void);
  305. #endif /* MAC */
  306.  
  307. #ifdef OS2
  308. #define printf Vscrnprintf
  309. #define fprintf Vscrnfprintf
  310. extern int Vscrnprintf(const char *, ...);
  311. extern int Vscrnfprintf(FILE *, const char *, ...);
  312. #ifdef putchar
  313. #undef putchar
  314. #endif /* putchar */
  315. #define putchar(x) Vscrnprintf("%c",x)
  316. #define perror(x)  Vscrnperror(x)
  317. #endif /* OS2 */
  318.  
  319. /* System-type compilation switches */
  320.  
  321. #ifdef FT21                /* Fortune For:Pro 2.1 implies 1.8 */
  322. #ifndef FT18
  323. #define FT18
  324. #endif /* FT18 */
  325. #endif /* FT21 */
  326.  
  327. #ifdef __bsdi__
  328. #ifndef BSDI
  329. #define BSDI
  330. #endif /* BSDI */
  331. #endif /* __bsdi__ */
  332.  
  333. #ifdef AIXPS2                /* AIXPS2 implies AIX370 */
  334. #ifndef AIX370
  335. #define AIX370
  336. #endif /* AIX370 */
  337. #endif /* AIXPS2 */
  338.  
  339. #ifdef AIX370                /* AIX PS/2 or 370 implies BSD4 */
  340. #ifndef BSD4
  341. #define BSD4
  342. #endif /* BSD4 */
  343. #endif /* AIX370 */
  344.  
  345. #ifdef AIXESA                /* AIX/ESA implies BSD4.4 */
  346. #ifndef BSD44
  347. #define BSD44
  348. #endif /* BSD44 */
  349. #endif /* AIXESA */
  350.  
  351. #ifdef AIX45                /* AIX45 implies AIX44 */
  352. #ifndef AIX44
  353. #define AIX44
  354. #endif /* AIX44 */
  355. #endif /* AIX45 */
  356.  
  357. #ifdef AIX44                /* AIX44 implies AIX43 */
  358. #ifndef AIX43
  359. #define AIX43
  360. #endif /* AIX43 */
  361. #endif /* AIX44 */
  362.  
  363. #ifdef AIX43                /* AIX43 implies AIX42 */
  364. #ifndef AIX42
  365. #define AIX42
  366. #endif /* AIX42 */
  367. #endif /* AIX43 */
  368.  
  369. #ifdef AIX42                /* AIX42 implies AIX41 */
  370. #ifndef AIX41
  371. #define AIX41
  372. #endif /* AIX41 */
  373. #endif /* AIX42 */
  374.  
  375. #ifdef SV68R3V6                /* System V/68 R32V6 implies SVR3 */
  376. #ifndef SVR3
  377. #define SVR3
  378. #endif /* SVR3 */
  379. #endif /* SV68R3V6 */
  380.  
  381. #ifdef SV88R32                /* System V/88 R32 implies SVR3 */
  382. #ifndef SVR3
  383. #define SVR3
  384. #endif /* SVR3 */
  385. #endif /* SV88R32 */
  386.  
  387. #ifdef DGUX540                /* DG UX 5.40 implies Sys V R 4 */
  388. #ifndef SVR4
  389. #define SVR4
  390. #endif /* SVR4 */
  391. #endif /* DGUX540 */
  392.  
  393. #ifndef DGUX
  394. #ifdef DGUX540                /* DG/UX 5.40 implies DGUX */
  395. #define DGUX
  396. #else
  397. #ifdef DGUX430                /* So does DG/UX 4.30 */
  398. #define DGUX
  399. #endif /* DGUX430 */
  400. #endif /* DGUX540 */
  401. #endif /* DGUX */
  402.  
  403. #ifdef IRIX65                /* IRIX 6.5 implies IRIX 6.4 */
  404. #ifndef IRIX64
  405. #define IRIX64
  406. #endif /* IRIX64 */
  407. #endif /* IRIX65 */
  408.  
  409. #ifdef IRIX64                /* IRIX 6.4 implies IRIX 6.2 */
  410. #ifndef BSD44ORPOSIX
  411. #define BSD44ORPOSIX            /* for ckutio's benefit */
  412. #endif /* BSD44ORPOSIX */
  413. #ifndef IRIX62
  414. #define IRIX62
  415. #endif /* IRIX62 */
  416. #endif /* IRIX64 */
  417.  
  418. #ifdef IRIX62                /* IRIX 6.2 implies IRIX 6.0 */
  419. #ifndef IRIX60
  420. #define IRIX60
  421. #endif /* IRIX60 */
  422. #endif /* IRIX62 */
  423.  
  424. #ifdef IRIX60                /* IRIX 6.0 implies IRIX 5.1 */
  425. #ifndef IRIX51
  426. #define IRIX51
  427. #endif /* IRIX51 */
  428. #ifndef IRIX52                /* And IRIX 5.2 (for hwfc) */
  429. #define IRIX52
  430. #endif /* IRIX52 */
  431. #endif /* IRIX60 */
  432.  
  433. #ifndef IRIX                /* IRIX 4.0 or greater implies IRIX */
  434. #ifdef IRIX64
  435. #define IRIX
  436. #else
  437. #ifdef IRIX62
  438. #define IRIX
  439. #else
  440. #ifdef IRIX60
  441. #define IRIX
  442. #else
  443. #ifdef IRIX51
  444. #define IRIX
  445. #else
  446. #ifdef IRIX40
  447. #define IRIX
  448. #endif /* IRIX40 */
  449. #endif /* IRIX51 */
  450. #endif /* IRIX60 */
  451. #endif /* IRIX62 */
  452. #endif /* IRIX64 */
  453. #endif /* IRIX */
  454.  
  455. #ifdef SUNOS41                /* SUNOS41 implies SUNOS4 */
  456. #ifndef SUNOS4
  457. #define SUNOS4
  458. #endif /* SUNOS4 */
  459. #endif /* SUNOS41 */
  460.  
  461. #ifdef SOLARIS7                /* Solaris 7 implies 2.6 */
  462. #ifndef SOLARIS26
  463. #define SOLARIS26
  464. #endif /* SOLARIS26 */
  465. #endif /* SOLARIS7 */
  466.  
  467. #ifdef SOLARIS26            /* Solaris 2.6 implies 2.5 */
  468. #ifndef SOLARIS25
  469. #define SOLARIS25
  470. #endif /* SOLARIS25 */
  471. #endif /* SOLARIS26 */
  472.  
  473. #ifdef SOLARIS25
  474. #ifndef SOLARIS
  475. #define SOLARIS
  476. #endif /* SOLARIS */
  477. #ifndef POSIX
  478. #define POSIX
  479. #endif /* POSIX */
  480. #endif /* SOLARIS25 */
  481.  
  482. #ifdef SOLARIS24
  483. #ifndef SOLARIS
  484. #define SOLARIS
  485. #endif /* SOLARIS */
  486. #endif /* SOLARIS24 */
  487.  
  488. #ifdef SUN4S5                /* Sun-4 System V environment */
  489. #ifndef SVR3                /* implies System V R3 or later */
  490. #define SVR3
  491. #endif /* SVR3 */
  492. #endif /* SUN4S5 */
  493.  
  494. #ifdef MIPS                /* MIPS System V environment */
  495. #ifndef SVR3                /* implies System V R3 or later */
  496. #define SVR3
  497. #endif /* SVR3 */
  498. #endif /* MIPS */
  499.  
  500. #ifdef HPUX9                /* HP-UX 9.x */
  501. #ifndef SVR3
  502. #define SVR3
  503. #endif /* SVR3 */
  504. #ifndef HPUX
  505. #define HPUX
  506. #endif /* HPUX */
  507. #ifndef HPUX9PLUS
  508. #define HPUX9PLUS
  509. #endif /* HPUX9PLUS */
  510. #endif /* HPUX9 */
  511.  
  512. #ifdef HPUX10                /* HP-UX 10.x */
  513. #ifndef HPUX1010            /* If anything higher is defined */
  514. #ifdef HPUX1020                /* define HPUX1010 too. */
  515. #define HPUX1010
  516. #endif /* HPUX1020 */
  517. #ifdef HPUX1030
  518. #define HPUX1010
  519. #endif /* HPUX1030 */
  520. #endif /* HPUX1010 */
  521.  
  522. #ifdef HPUX1100                /* HP-UX 11.00 implies 10.10 */
  523. #ifndef HPUX1010
  524. #define HPUX1010
  525. #endif /* HPUX1010 */
  526. #endif /* HPUX1100 */
  527.  
  528. #ifndef SVR4
  529. #define SVR4
  530. #endif /* SVR4 */
  531. #ifndef HPUX
  532. #define HPUX
  533. #endif /* HPUX */
  534. #ifndef HPUX9PLUS
  535. #define HPUX9PLUS
  536. #endif /* HPUX9PLUS */
  537. #endif /* HPUX10 */
  538.  
  539. #ifdef QNX                /* QNX Software Systems Inc */
  540. #ifndef POSIX                /* QNX 4.0 or later is POSIX */
  541. #define POSIX
  542. #endif /* POSIX */
  543. #ifndef __386__                /* Comes in 16-bit and 32-bit */
  544. #define __16BIT__
  545. #define CK_QNX16
  546. #else
  547. #define __32BIT__
  548. #define CK_QNX32
  549. #endif /* __386__ */
  550. #endif /* QNX */
  551.  
  552. /*
  553.   4.4BSD is a mixture of System V R4, POSIX, and 4.3BSD.
  554. */
  555. #ifdef BSD44                /* 4.4 BSD */
  556. #ifndef SVR4                /* BSD44 implies SVR4 */
  557. #define SVR4
  558. #endif /* SVR4 */
  559. #ifndef NOSETBUF            /* NOSETBUF is safe */
  560. #define NOSETBUF
  561. #endif /* NOSETBUF */
  562. #ifndef DIRENT                /* Uses <dirent.h> */
  563. #define DIRENT
  564. #endif /* DIRENT */
  565. #endif /* BSD44 */
  566.  
  567. #ifdef SVR3                /* SVR3 implies ATTSV */
  568. #ifndef ATTSV
  569. #define ATTSV
  570. #endif /* ATTSV */
  571. #endif /* SVR3 */
  572.  
  573. #ifdef SVR4                /* SVR4 implies ATTSV */
  574. #ifndef ATTSV
  575. #define ATTSV
  576. #endif /* ATTSV */
  577. #ifndef SVR3                /* ...as well as SVR3 */
  578. #define SVR3
  579. #endif /* SVR3 */
  580. #endif /* SVR4 */
  581.  
  582. #ifdef OXOS
  583. #ifndef ATTSV
  584. #define ATTSV                /* OXOS implies ATTSV */
  585. #endif /* ! ATTSV */
  586. #define SW_ACC_ID            /* access() wants privs on */
  587. #define kill priv_kill            /* kill() wants privs on */
  588. #ifndef NOSETBUF
  589. #define NOSETBUF            /* NOSETBUF is safe */
  590. #endif /* ! NOSETBUF */
  591. #endif /* OXOS */
  592.  
  593. #ifdef UTSV                /* UTSV implies ATTSV */
  594. #ifndef ATTSV
  595. #define ATTSV
  596. #endif /* ATTSV */
  597. #endif /* UTSV */
  598.  
  599. #ifdef XENIX                /* XENIX implies ATTSV */
  600. #ifndef ATTSV
  601. #define ATTSV
  602. #endif /* ATTSV */
  603. #endif /* XENIX */
  604.  
  605. #ifdef AUX                /* AUX implies ATTSV */
  606. #ifndef ATTSV
  607. #define ATTSV
  608. #endif /* ATTSV */
  609. #endif /* AUX */
  610.  
  611. #ifdef ATT7300                /* ATT7300 implies ATTSV */
  612. #ifndef ATTSV
  613. #define ATTSV
  614. #endif /* ATTSV */
  615. #endif /* ATT7300 */
  616.  
  617. #ifdef ATT6300                /* ATT6300 implies ATTSV */
  618. #ifndef ATTSV
  619. #define ATTSV
  620. #endif /* ATTSV */
  621. #endif /* ATT6300 */
  622.  
  623. #ifdef HPUX                /* HPUX implies ATTSV */
  624. #ifndef ATTSV
  625. #define ATTSV
  626. #endif /* ATTSV */
  627. #endif /* HPUX */
  628.  
  629. #ifdef ISIII                /* ISIII implies ATTSV */
  630. #ifndef ATTSV
  631. #define ATTSV
  632. #endif /* ATTSV */
  633. #endif /* ISIII */
  634.  
  635. #ifdef NEXT33                /* NEXT33 implies NEXT */
  636. #ifndef NEXT
  637. #define NEXT
  638. #endif /* NEXT */
  639. #endif /* NEXT33 */
  640.  
  641. #ifdef NEXT                /* NEXT implies BSD4 */
  642. #ifndef BSD4
  643. #define BSD4
  644. #endif /* BSD4 */
  645. #endif /* NEXT */
  646.  
  647. #ifdef SUNOS4                /* SUNOS4 implies BSD4 */
  648. #ifndef BSD4
  649. #define BSD4
  650. #endif /* BSD4 */
  651. #endif /* SUNOS4 */
  652.  
  653. #ifdef BSD41                /* BSD41 implies BSD4 */
  654. #ifndef BSD4
  655. #define BSD4
  656. #endif /* BSD4 */
  657. #endif /* BSD41 */
  658.  
  659. #ifdef BSD43                /* BSD43 implies BSD4 */
  660. #ifndef BSD4
  661. #define BSD4
  662. #endif /* BSD4 */
  663. #endif /* BSD43 */
  664.  
  665. #ifdef BSD4                /* BSD4 implies ANYBSD */
  666. #ifndef ANYBSD
  667. #define ANYBSD
  668. #endif /* ANYBSD */
  669. #endif /* BSD4 */
  670.  
  671. #ifdef BSD29                /* BSD29 implies ANYBSD */
  672. #ifndef ANYBSD
  673. #define ANYBSD
  674. #endif /* ANYBSD */
  675. #endif /* BSD29 */
  676.  
  677. #ifdef ATTSV                /* ATTSV implies UNIX */
  678. #ifndef UNIX
  679. #define UNIX
  680. #endif /* UNIX */
  681. #endif /* ATTSV */
  682.  
  683. #ifdef ANYBSD                /* ANYBSD implies UNIX */
  684. #ifndef UNIX
  685. #define UNIX
  686. #endif /* UNIX */
  687. #endif /* ANYBSD */
  688.  
  689. #ifdef POSIX                /* POSIX implies UNIX */
  690. #ifndef UNIX
  691. #define UNIX
  692. #endif /* UNIX */
  693. #ifndef DIRENT                /* and DIRENT, i.e. <dirent.h> */
  694. #ifndef SDIRENT
  695. #define DIRENT
  696. #endif /* SDIRENT */
  697. #endif /* DIRENT */
  698. #ifndef NOFILEH                /* POSIX doesn't use <sys/file.h> */
  699. #define NOFILEH
  700. #endif /* NOFILEH */
  701. #endif /* POSIX */
  702.  
  703. #ifdef V7
  704. #ifndef UNIX
  705. #define UNIX
  706. #endif /* UNIX */
  707. #endif /* V7 */
  708.  
  709. #ifdef COHERENT
  710. #ifndef UNIX
  711. #define UNIX
  712. #endif /* UNIX */
  713. #ifdef COMMENT
  714. #ifndef NOCURSES
  715. #define NOCURSES
  716. #endif /* NOCURSES */
  717. #endif /* COMMENT */
  718. #endif /* COHERENT */
  719.  
  720. #ifdef MINIX
  721. #ifndef UNIX
  722. #define UNIX
  723. #endif /* UNIX */
  724. #endif /* MINIX */
  725. /*
  726.   The symbol SVORPOSIX is defined for both AT&T and POSIX compilations
  727.   to make it easier to select items that System V and POSIX have in common,
  728.   but which BSD, V7, etc, do not have.
  729. */
  730. #ifdef ATTSV
  731. #ifndef SVORPOSIX
  732. #define SVORPOSIX
  733. #endif /* SVORPOSIX */
  734. #endif /* ATTSV */
  735.  
  736. #ifdef POSIX
  737. #ifndef SVORPOSIX
  738. #define SVORPOSIX
  739. #endif /* SVORPOSIX */
  740. #endif /* POSIX */
  741.  
  742. /*
  743.   The symbol SVR4ORPOSIX is defined for both AT&T System V R4 and POSIX
  744.   compilations to make it easier to select items that System V R4 and POSIX
  745.   have in common, but which BSD, V7, and System V R3 and earlier, etc, do
  746.   not have.
  747. */
  748. #ifdef POSIX
  749. #ifndef SVR4ORPOSIX
  750. #define SVR4ORPOSIX
  751. #endif /* SVR4ORPOSIX */
  752. #endif /* POSIX */
  753. #ifdef SVR4
  754. #ifndef SVR4ORPOSIX
  755. #define SVR4ORPOSIX
  756. #endif /* SVR4ORPOSIX */
  757. #endif /* SVR4 */
  758.  
  759. /*
  760.   The symbol BSD44ORPOSIX is defined for both 4.4BSD and POSIX compilations
  761.   to make it easier to select items that 4.4BSD and POSIX have in common,
  762.   but which System V, BSD, V7, etc, do not have.
  763. */
  764. #ifdef BSD44
  765. #ifndef BSD44ORPOSIX
  766. #define BSD44ORPOSIX
  767. #endif /* BSD44ORPOSIX */
  768. #endif /* BSD44 */
  769.  
  770. #ifdef POSIX
  771. #ifndef BSD44ORPOSIX
  772. #define BSD44ORPOSIX
  773. #endif /* BSD44ORPOSIX */
  774. #endif /* POSIX */
  775.  
  776. #ifdef UNIX                /* For items common to OS/2 and UNIX */
  777. #ifndef OS2ORUNIX
  778. #define OS2ORUNIX
  779. #endif /* OS2ORUNIX */
  780. #endif /* UNIX */
  781.  
  782. #ifdef UNIX                /* For items common to VMS and UNIX */
  783. #define VMSORUNIX
  784. #else
  785. #ifdef VMS
  786. #define VMSORUNIX
  787. #endif /* VMS */
  788. #endif /* UNIX */
  789.  
  790. #ifndef UNIXOROSK            /* UNIX or OS-9 (or OS-9000) */
  791. #ifdef UNIX
  792. #define UNIXOROSK
  793. #else
  794. #ifdef OSK
  795. #define UNIXOROSK
  796. #endif /* OSK */
  797. #endif /* UNIX */
  798. #endif /* UNIXOROSK */
  799.  
  800. #ifndef OSKORUNIX
  801. #ifdef UNIXOROSK
  802. #define OSKORUNIX
  803. #endif /* UNIXOROSK */
  804. #endif /* OSKORUNIX */
  805.  
  806. #ifdef OS2
  807. #define CK_ANSIC            /* OS/2 supports ANSIC and more extensions */
  808. #endif /* OS2 */
  809.  
  810. #ifdef OSF50            /* Newer OSF/1 versions imply older ones */
  811. #ifndef OSF40
  812. #define OSF40
  813. #endif /* OSF40 */
  814. #endif /* OSF50 */
  815.  
  816. #ifdef OSF40
  817. #ifndef OSF32
  818. #define OSF32
  819. #endif /* OSF32 */
  820. #endif /* OSF40 */
  821.  
  822. #ifdef OSF32
  823. #ifndef OSF30
  824. #define OSF30
  825. #endif /* OSF30 */
  826. #endif /* OSF32 */
  827.  
  828. #ifdef OSF30
  829. #ifndef OSF20
  830. #define OSF20
  831. #endif /* OSF20 */
  832. #endif /* OSF30 */
  833.  
  834. #ifdef OSF20
  835. #ifndef OSF10
  836. #define OSF10
  837. #endif /* OSF10 */
  838. #endif /* OSF20 */
  839.  
  840. #ifdef __DECC                /* For DEC Alpha VMS or OSF/1 */
  841. #ifndef CK_ANSIC
  842. #define CK_ANSIC            /* Even with /stand=vaxc, need ansi */
  843. #endif /* CKANSIC */
  844. #ifndef SIG_V
  845. #define SIG_V                /* and signal type is VOID */
  846. #endif /* SIG_V */
  847. #ifndef CK_ANSILIBS
  848. #define CK_ANSILIBS            /* (Martin Zinser, Feb 1995) */
  849. #endif /* CK_ANSILIBS */
  850. #ifndef _POSIX_C_SOURCE
  851. #define _POSIX_C_SOURCE 1
  852. #endif /* _POSIX_C_SOURCE */
  853. #endif    /* __DECC */
  854.  
  855. #ifdef apollo                /* May be ANSI-C, check further */
  856. #ifdef __STDCPP__
  857. #define CK_ANSIC            /* Yes, this is real ANSI-C */
  858. #define SIG_V
  859. #else
  860. #define NOANSI                /* Nope, not ANSI */
  861. #undef __STDC__                /* Even though it say it is! */
  862. #define SIG_I
  863. #endif /* __STDCPP__ */
  864. #endif /* apollo */
  865.  
  866. #ifdef POSIX                /* -DPOSIX on cc command line */
  867. #ifndef _POSIX_SOURCE            /* Implies _POSIX_SOURCE */
  868. #define _POSIX_SOURCE
  869. #endif /* _POSIX_SOURCE */
  870. #endif /* POSIX */
  871.  
  872. /*
  873.   ANSI C?  That is, do we have function prototypes, new-style
  874.   function declarations, and parameter type checking and coercion?
  875. */
  876. #ifdef MAC                /* MPW C is ANSI */
  877. #ifndef NOANSI
  878. #ifndef CK_ANSIC
  879. #define CK_ANSIC
  880. #endif /* CK_ANSIC */
  881. #endif /* NOANSI */
  882. #endif /* MAC */
  883.  
  884. #ifdef STRATUS                /* Stratus VOS */
  885. #ifndef CK_ANSIC
  886. #define CK_ANSIC
  887. #endif /* CK_ANSIC */
  888. #ifndef NOSTAT
  889. #define NOSTAT
  890. #endif /* NOSTAT */
  891. #endif /* STRATUS */
  892.  
  893. #ifndef NOANSI
  894. #ifdef __STDC__                /* __STDC__ means ANSI C */
  895. #ifndef CK_ANSIC
  896. #define CK_ANSIC
  897. #endif /* CK_ANSIC */
  898. #endif /* __STDC__ */
  899. #endif /* NOANSI */
  900. /*
  901.   _PROTOTYP() is used for forward declarations of functions so we can have
  902.   parameter and return value type checking if the compiler offers it.
  903.   __STDC__ should be defined by the compiler only if function prototypes are
  904.   allowed.  Otherwise, we get old-style forward declarations.  Our own private
  905.   CK_ANSIC symbol tells whether we use ANSI C prototypes.  To force use of
  906.   ANSI prototypes, include -DCK_ANSIC on the cc command line.  To disable the
  907.   use of ANSI prototypes, include -DNOANSI.
  908. */
  909. #ifdef CK_ANSIC
  910. #define _PROTOTYP( func, parms ) func parms
  911. #else /* Not ANSI C */
  912. #define _PROTOTYP( func, parms ) func()
  913. #endif /* CK_ANSIC */
  914.  
  915. #ifdef NOLOGIN                /* NOLOGIN implies NOIKSD */
  916. #ifndef NOIKSD
  917. #define NOIKSD
  918. #endif /* NOIKSD */
  919. #endif /* NOLOGIN */
  920.  
  921. #ifdef NOIKSD                /* Internet Kermit Service Daemon */
  922. #ifndef NOPRINTFSUBST
  923. #define NOPRINTFSUBST
  924. #endif /* NOPRINTFSUBST */
  925. #ifndef NOLOGIN
  926. #define NOLOGIN
  927. #endif /* NOLOGIN */
  928. #ifndef NOSYSLOG
  929. #define NOSYSLOG
  930. #endif /* NOSYSLOG */
  931. #ifndef NOWTMP
  932. #define NOWTMP
  933. #endif /* NOWTMP */
  934. #else
  935. #ifndef IKSD
  936. #ifdef OS2ORUNIX            /* Platforms where IKSD is supported */
  937. #define IKSD
  938. #ifdef OS2ONLY
  939. #ifndef NOLOGIN
  940. #define NOLOGIN
  941. #endif /* NOLOGIN */
  942. #endif /* OS2 */
  943. #endif /* OS2ORUNIX */
  944. #endif /* IKSD */
  945. #endif /* NOIKSD */
  946.  
  947. #ifdef IKSD                /* IKSD options... */
  948. #ifndef IKSDCONF            /* IKSD configuration file */
  949. #ifdef UNIX
  950. #define IKSDCONF "/etc/iksd.conf"
  951. #else
  952. #ifdef OS2
  953. #define IKSDCONF "iksd.ksc"
  954. #endif /* OS2 */
  955. #endif /* UNIX */
  956. #endif /* IKSDCONF */
  957. #ifndef NOIKSDB
  958. #ifndef IKSDB                /* IKSD database */
  959. #ifdef UNIX
  960. #define IKSDB
  961. #define IK_LCKTRIES 16            /* How many times to try to get lock */
  962. #define IK_LCKSLEEP 1            /* How long to sleep between tries */
  963. #define IK_LOCKFILE "iksd.lck"        /* Database lockfilename */
  964. #define IK_DBASEDIR "/var/log/"        /* Database directory */
  965. #define IK_DBASEFIL "iksd.db"        /* Database filename */
  966. #else /* UNIX */
  967. #ifdef OS2
  968. #define IKSDB
  969. #ifndef NOFTRUNCATE            /* ftruncate() not available */
  970. #define NOFTRUNCATE
  971. #endif /* NOFTRUNCATE */
  972. #define IK_LCKTRIES 16            /* How many times to try to get lock */
  973. #define IK_LCKSLEEP 1            /* How long to sleep between tries */
  974. #define IK_LOCKFILE "iksd.lck"        /* DB lockfilename (in systemroot) */
  975. #define IK_DBASEFIL "iksd.db"        /* Database filename */
  976. #endif /* OS2 */
  977. #endif /* UNIX */
  978. #endif /* IKSDB */
  979. #endif /* NOIKSDB */
  980. #endif /* IKSD */
  981. /*
  982.   Substitutes for printf() and friends used in IKS to compensate for
  983.   lack of a terminal driver, mainly to supply CR after LF.
  984. */
  985. #ifndef NOPRINTFSUBST
  986. #ifndef CKWART_C
  987. #ifdef UNIX
  988. #ifndef pdp11
  989. #ifndef CKXPRINTF
  990. #define CKXPRINTF
  991. #endif /* CKXPRINTF */
  992. #endif /* pdp11 */
  993. #endif /* UNIX */
  994. #endif /* CKWART_C */
  995. #endif /* NOPRINTFSUBST */
  996.  
  997. #ifdef CKXPRINTF
  998. #define printf ckxprintf
  999. #define fprintf ckxfprintf
  1000. #ifdef CK_ANSIC
  1001. _PROTOTYP(int ckxprintf,(const char *, ...));
  1002. #ifdef NEXT
  1003. _PROTOTYP(void ckxperror,(const char *));
  1004. #else
  1005. #ifdef CK_SCOV5
  1006. _PROTOTYP(void ckxperror,(const char *));
  1007. #else
  1008. _PROTOTYP(int ckxperror,(const char *));
  1009. #endif /* CK_SCOV5 */
  1010. #endif /* NEXT */
  1011. _PROTOTYP(int ckxfprintf,(FILE *, const char *, ...));
  1012. #endif /* CK_ANSIC */
  1013. #ifdef putchar
  1014. #undef putchar
  1015. #endif /* putchar */
  1016. #define putchar(x) ckxprintf("%c",x)
  1017. #ifdef putc
  1018. #undef putc
  1019. #endif /* putc */
  1020. #define putc(a,b) ckxfprintf(b,"%c",a)
  1021. #define perror(x)  ckxperror(x)
  1022. #endif /* CKXPRINTF */
  1023.  
  1024. /*
  1025.   Altos-specific items: 486, 586, 986 models...
  1026. */
  1027. #ifdef A986
  1028. #define M_VOID
  1029. #define void int
  1030. #define CHAR char
  1031. #define SIG_I
  1032. #endif /* A986 */
  1033.  
  1034. /* Signal handling */
  1035.  
  1036. #ifdef QNX
  1037. #ifndef CK_POSIX_SIG
  1038. #define CK_POSIX_SIG
  1039. #endif /* CK_POSIX_SIG */
  1040. #endif /* QNX */
  1041.  
  1042. /* Void type */
  1043.  
  1044. #ifndef VOID                /* Used throughout all C-Kermit */
  1045. #ifdef CK_ANSIC                /* modules... */
  1046. #define VOID void
  1047. #else
  1048. #define VOID int
  1049. #endif /* CK_ANSIC */
  1050. #endif /* VOID */
  1051.  
  1052. /* Const type */
  1053.  
  1054. #ifndef CONST
  1055. #ifdef OSK
  1056. #ifdef _UCC
  1057. #define CONST const
  1058. #else
  1059. #define CONST
  1060. #endif /* _UCC */
  1061. #else
  1062. #ifdef CK_ANSIC
  1063. #define CONST const
  1064. #else
  1065. #define CONST
  1066. #endif /* CK_ANSIC */
  1067. #endif /* OSK */
  1068. #endif /* CONST */
  1069.  
  1070. /* Signal type */
  1071.  
  1072. #ifndef SIG_V                /* signal() type, if not def'd yet */
  1073. #ifndef SIG_I
  1074. #ifdef OS2
  1075. #define SIG_V
  1076. #else
  1077. #ifdef POSIX
  1078. #define SIG_V
  1079. #else
  1080. #ifdef SVR3                /* System V R3 and later */
  1081. #define SIG_V
  1082. #else
  1083. #ifdef SUNOS4                /* SUNOS V 4.0 and later */
  1084. #ifndef sun386
  1085. #define SIG_V
  1086. #else
  1087. #define SIG_I
  1088. #endif /* sun386 */
  1089. #else
  1090. #ifdef NEXT                /* NeXT */
  1091. #define SIG_V
  1092. #else
  1093. #ifdef AIX370
  1094. #include <signal.h>
  1095. #define SIG_V
  1096. #define SIGTYP __SIGVOID        /* AIX370 */
  1097. #else
  1098. #ifdef STRATUS                /* Stratus VOS */
  1099. #define SIG_V
  1100. #else
  1101. #ifdef MAC
  1102. #define SIGTYP long
  1103. #define SIG_I
  1104. #ifndef MPW33
  1105. #define SIG_IGN 0
  1106. #endif /* MPW33 */
  1107. #define SIGALRM 1
  1108. #ifndef MPW33
  1109. #define SIGINT  2
  1110. #endif /* MPW33 */
  1111. #else /* Everything else */
  1112. #define SIG_I
  1113. #endif /* MAC */
  1114. #endif /* STRATUS */
  1115. #endif /* AIX370 */
  1116. #endif /* NEXT */
  1117. #endif /* SUNOS4 */
  1118. #endif /* SVR3 */
  1119. #endif /* POSIX */
  1120. #endif /* OS2 */
  1121. #endif /* SIG_I */
  1122. #endif /* SIG_V */
  1123.  
  1124. #ifdef SIG_I
  1125. #define SIGRETURN return(0)
  1126. #ifndef SIGTYP
  1127. #define SIGTYP int
  1128. #endif /* SIGTYP */
  1129. #endif /* SIG_I */
  1130.  
  1131. #ifdef SIG_V
  1132. #define SIGRETURN return
  1133. #ifndef SIGTYP
  1134. #define SIGTYP void
  1135. #endif /* SIGTYP */
  1136. #endif /* SIG_V */
  1137.  
  1138. #ifdef NT
  1139. #ifndef SIGTYP
  1140. #define SIGTYP void
  1141. #endif /* SIGTYP */
  1142.  
  1143. #define strdup _strdup
  1144. #endif /* NT */
  1145.  
  1146. #ifndef SIGTYP
  1147. #define SIGTYP int
  1148. #endif /* SIGTYP */
  1149.  
  1150. #ifndef SIGRETURN
  1151. #define SIGRETURN return(0)
  1152. #endif /* SIGRETURN */
  1153.  
  1154. #ifdef CKNTSIG
  1155. /* This does not work, so don't use it. */
  1156. #define signal ckntsignal
  1157. SIGTYP (*ckntsignal(int type, SIGTYP (*)(int)))(int);
  1158. #endif /* CKNTSIG */
  1159.  
  1160. /* Unsigned numbers */
  1161.  
  1162. #ifndef USHORT
  1163. #define USHORT unsigned short
  1164. #endif /* USHORT */
  1165.  
  1166. #ifndef UINT
  1167. #define UINT unsigned int
  1168. #endif /* UINT */
  1169.  
  1170. #ifndef ULONG
  1171. #define ULONG unsigned long
  1172. #endif /* ULONG */
  1173.  
  1174. /* We want all characters to be unsigned if the compiler supports it */
  1175.  
  1176. #ifdef KUI
  1177. #ifdef CHAR
  1178. #undef CHAR
  1179. #endif /* CHAR */
  1180. #define CHAR unsigned char
  1181. #else
  1182. #ifdef PROVX1
  1183. typedef char CHAR;
  1184. /* typedef long LONG; */
  1185. typedef int void;
  1186. #else
  1187. #ifdef MINIX
  1188. typedef unsigned char CHAR;
  1189. #else
  1190. #ifdef V7
  1191. typedef char CHAR;
  1192. #else
  1193. #ifdef C70
  1194. typedef char CHAR;
  1195. /* typedef long LONG; */
  1196. #else
  1197. #ifdef BSD29
  1198. typedef char CHAR;
  1199. /* typedef long LONG; */
  1200. #else
  1201. #ifdef datageneral
  1202. #define CHAR unsigned char            /* 3.22 compiler */
  1203. #else
  1204. #ifdef HPUX
  1205. #define CHAR unsigned char
  1206. #else
  1207. #ifdef OS2
  1208. #ifdef NT
  1209. #define CHAR unsigned char
  1210. #else /* NT */
  1211. #ifdef CHAR
  1212. #undef CHAR
  1213. #endif /* CHAR */
  1214. typedef unsigned char CHAR;
  1215. #endif /* NT */
  1216. #else /* OS2 */
  1217. #ifdef VMS
  1218. typedef unsigned char CHAR;
  1219. #else
  1220. #ifdef CHAR
  1221. #undef CHAR
  1222. #endif /* CHAR */
  1223. typedef unsigned char CHAR;
  1224. #endif /* VMS */
  1225. #endif /* OS2 */
  1226. #endif /* HPUX */
  1227. #endif /* datageneral */
  1228. #endif /* BSD29 */
  1229. #endif /* C70 */
  1230. #endif /* V7 */
  1231. #endif /* MINIX */
  1232. #endif /* PROVX1 */
  1233. #endif /* KUI */
  1234.  
  1235. union ck_short {            /* Mainly for Unicode */
  1236.     USHORT x_short;
  1237.     CHAR x_char[2];
  1238. };
  1239.  
  1240. #ifdef MAC                /* Macintosh file routines */
  1241. #ifndef CKWART_C            /* But not in "wart"... */
  1242. #ifdef feof
  1243. #undef feof
  1244. #endif /* feof */
  1245. #define feof mac_feof
  1246. #define rewind mac_rewind
  1247. #define fgets mac_fgets
  1248. #define fopen mac_fopen
  1249. #define fclose mac_fclose
  1250. int mac_feof();
  1251. void mac_rewind();
  1252. char *mac_fgets();
  1253. FILE *mac_fopen();
  1254. int mac_fclose();
  1255. #endif /* CKCPRO_W */
  1256. #endif /* MAC */
  1257. /*
  1258.    Systems whose mainline modules have access to the communication-line
  1259.    file descriptor, ttyfd.
  1260. */
  1261. #ifndef CK_TTYFD
  1262. #ifdef UNIX
  1263. #define CK_TTYFD
  1264. #else
  1265. #ifdef OS2
  1266. #define CK_TTYFD
  1267. #else
  1268. #ifdef VMS
  1269. #define CK_TTYFD
  1270. #endif /* VMS */
  1271. #endif /* OS2 */
  1272. #endif /* UNIX */
  1273. #endif /* CK_TTYFD */
  1274.  
  1275. /* Systems where we can get our own process ID */
  1276.  
  1277. #ifndef CK_PID
  1278. #ifdef UNIX
  1279. #define CK_PID
  1280. #endif /* UNIX */
  1281. #ifdef OS2
  1282. #define CK_PID
  1283. #endif /* OS2 */
  1284. #ifdef VMS
  1285. #define CK_PID
  1286. #endif /* VMS */
  1287. #endif /* CK_PID */
  1288.  
  1289. /* Systems that support the Microsoft Telephony API (TAPI) */
  1290.  
  1291. #ifndef CK_TAPI
  1292. #ifdef NT
  1293. #define CK_TAPI
  1294. #endif /* NT */
  1295. #endif /* CK_TAPI */
  1296.  
  1297. #ifndef NONZXPAND
  1298. #ifndef NZXPAND
  1299. #ifdef OS2ORUNIX
  1300. #define NZXPAND
  1301. #else
  1302. #ifdef VMS
  1303. #define NZXPAND
  1304. #else
  1305. #ifdef datageneral
  1306. #define NZXPAND
  1307. #else
  1308. #ifdef OSK
  1309. #define NZXPAND
  1310. #endif /* OSK */
  1311. #endif /* datageneral */
  1312. #endif /* VMS */
  1313. #endif /* OS2ORUNIX */
  1314. #endif /* NZXPAND */
  1315. #else
  1316. #ifdef NZXPAND
  1317. #undef NZXPAND
  1318. #endif /* NZXPAND */
  1319. #endif /* NONZXPAND */
  1320.  
  1321. /* nzxpand() option flags */
  1322.  
  1323. #define ZX_FILONLY   1            /* Match only regular files */
  1324. #define ZX_DIRONLY   2            /* Match only directories */
  1325. #define ZX_RECURSE   4            /* Descend through directory tree */
  1326. #define ZX_MATCHDOT  8            /* Match "dot files" */
  1327. #define ZX_NOBACKUP 16            /* Don't match "backup files" */
  1328.  
  1329. #ifndef NZXPAND
  1330. #define nzxpand(a,b) zxpand(a)
  1331. #endif /* NZXPAND */
  1332.  
  1333. #ifndef NOZXREWIND
  1334. #ifndef ZXREWIND            /* Platforms that have zxrewind() */
  1335. #ifdef OS2ORUNIX
  1336. #define ZXREWIND
  1337. #else
  1338. #ifdef VMS
  1339. #define ZXREWIND
  1340. #else
  1341. #ifdef datageneral
  1342. #define ZXREWIND
  1343. #else
  1344. #ifdef OSK
  1345. #define ZXREWIND
  1346. #endif /* OSK */
  1347. #endif /* datageneral */
  1348. #endif /* VMS */
  1349. #endif /* OS2ORUNIX */
  1350. #endif /* ZXREWIND */
  1351. #else
  1352. #ifdef ZXREWIND
  1353. #undef ZXREWIND
  1354. #endif /* ZXREWIND */
  1355. #endif /* NOZXREWIND */
  1356.  
  1357. /* Temporary-directory-for-RECEIVE feature ... */
  1358. /* This says whether we have the isdir() function defined. */
  1359.  
  1360. #ifdef UNIX                /* UNIX has it */
  1361. #ifndef CK_TMPDIR
  1362. #ifndef pdp11
  1363. #define CK_TMPDIR
  1364. #define TMPDIRLEN 256
  1365. #endif /* pdp11 */
  1366. #endif /* CK_TMPDIR */
  1367. #endif /* UNIX */
  1368.  
  1369. #ifdef VMS                /* VMS too */
  1370. #ifndef CK_TMPDIR
  1371. #define CK_TMPDIR
  1372. #define TMPDIRLEN 256
  1373. #endif /* CK_TMPDIR */
  1374. #endif /* VMS */
  1375.  
  1376. #ifdef OS2                /* OS two too */
  1377. #ifndef CK_TMPDIR
  1378. #define CK_TMPDIR
  1379. #define TMPDIRLEN 129
  1380. #endif /* CK_TMPDIR */
  1381. #endif /* OS2 */
  1382.  
  1383. #ifdef STRATUS                /* Stratus VOS too. */
  1384. #ifndef CK_TMPDIR
  1385. #define CK_TMPDIR
  1386. #define TMPDIRLEN 256
  1387. #endif /* CK_TMPDIR */
  1388. #endif /* STRATUS */
  1389.  
  1390. #ifdef OSK                /* OS-9 too */
  1391. #ifndef CK_TMPDIR
  1392. #define CK_TMPDIR
  1393. #define TMPDIRLEN 256
  1394. #endif /* CK_TMPDIR */
  1395. #endif /* OSK */
  1396.  
  1397. #ifdef datageneral            /* AOS/VS too */
  1398. #ifndef CK_TMPDIR
  1399. #define CK_TMPDIR
  1400. #define TMPDIRLEN 256
  1401. #endif /* CK_TMPDIR */
  1402. #endif /* datageneral */
  1403.  
  1404. #ifdef CK_TMPDIR            /* Needs command parser */
  1405. #ifdef NOICP
  1406. #undef CK_TMPDIR
  1407. #endif /* NOICP */
  1408. #endif /* CK_TMPDIR */
  1409.  
  1410. /* Whether to include <sys/time.h> */
  1411.  
  1412. #ifndef NOTIMEH                /* <time.h> */
  1413. #ifndef TIMEH
  1414. #define TIMEH
  1415. #endif /* TIMEH */
  1416. #endif /* NOTIMEH */
  1417.  
  1418. #ifndef NOSYSTIMEH            /* <sys/time.h> */
  1419. #ifndef SYSTIMEH
  1420. #ifdef UNIX                /* UNIX */
  1421. #ifdef SVORPOSIX            /* System V or POSIX... */
  1422. #ifdef M_UNIX
  1423. #define SYSTIMEH
  1424. #else
  1425. #ifdef SCO_32V4
  1426. #define SYSTIMEH
  1427. #else
  1428. #ifdef OXOS
  1429. #define SYSTIMEH
  1430. #else
  1431. #ifdef BSD44
  1432. #define SYSTIMEH
  1433. #else
  1434. #ifdef __linux__
  1435. #define SYSTIMEH
  1436. #else
  1437. #ifdef AIXRS
  1438. #ifndef AIX41
  1439. #define SYSTIMEH
  1440. #endif /* AIX41 */
  1441. #else
  1442. #ifdef IRIX60
  1443. #define SYSTIMEH
  1444. #else
  1445. #ifdef I386IX
  1446. #define SYSTIMEH
  1447. #else
  1448. #ifdef SV68R3V6
  1449. #define SYSTIMEH
  1450. #endif /* SV68R3V6 */
  1451. #endif /* I386IX */
  1452. #endif /* IRIX60 */
  1453. #endif /* AIXRS */
  1454. #endif /* __linux__ */
  1455. #endif /* BSD44 */
  1456. #endif /* OXOS */
  1457. #endif /* SCO_32V4 */
  1458. #endif /* M_UNIX */
  1459.  
  1460. #else  /* Not SVORPOSIX */
  1461.  
  1462. #ifndef BELLV10                /* All but these... */
  1463. #ifndef PROVX1
  1464. #ifndef V7
  1465. #ifndef BSD41
  1466. #ifndef COHERENT
  1467. #define SYSTIMEH
  1468. #endif /* COHERENT */
  1469. #endif /* BSD41 */
  1470. #endif /* V7 */
  1471. #endif /* PROVX1 */
  1472. #endif /* BELLV10 */
  1473. #endif /* SVORPOSIX */
  1474. #endif /* UNIX */
  1475. #endif /* SYSTIMEH */
  1476. #endif /* NOSYSTIMEH */
  1477.  
  1478. #ifndef NOSYSTIMEBH            /* <sys/timeb.h> */
  1479. #ifndef SYSTIMEBH
  1480. #ifdef OSF
  1481. #define SYSTIMEBH
  1482. #else
  1483. #ifdef COHERENT
  1484. #define SYSTIMEBH
  1485. #else
  1486. #ifdef BSD41
  1487. #define SYSTIMEBH
  1488. #else
  1489. #ifdef BSD29
  1490. #define SYSTIMEBH
  1491. #else
  1492. #ifdef TOWER1
  1493. #define SYSTIMEBH
  1494. #else
  1495. #ifdef FT21
  1496. #define SYSTIMEBH
  1497. #else
  1498. #ifdef BELLV10
  1499. #define SYSTIMEBH
  1500. #endif /* BELLV10 */
  1501. #endif /* FT21 */
  1502. #endif /* TOWER1 */
  1503. #endif /* BSD29 */
  1504. #endif /* BSD41 */
  1505. #endif /* COHERENT */
  1506. #endif /* OSF */
  1507. #endif /* SYSTIMEBH */
  1508. #endif /* NOSYSTIMEBH */
  1509.  
  1510. /*
  1511.  Debug and transaction logging is included automatically unless you define
  1512.  NODEBUG or NOTLOG.  Do this if you want to save the space and overhead.
  1513.  (Note, in version 4F these definitions changed from "{}" to the null string
  1514.  to avoid problems with semicolons after braces, as in: "if (x) tlog(this);
  1515.  else tlog(that);"
  1516. */
  1517. #ifndef NODEBUG
  1518. #ifndef DEBUG
  1519. #define DEBUG
  1520. #endif /* DEBUG */
  1521. #else
  1522. #ifdef DEBUG
  1523. #undef DEBUG
  1524. #endif /* DEBUG */
  1525. #endif /* NODEBUG */
  1526.  
  1527. #ifndef NOTLOG
  1528. #ifndef TLOG
  1529. #define TLOG
  1530. #endif /* TLOG */
  1531. #endif /* NOTLOG */
  1532.  
  1533. /* debug() macro style selection. */
  1534.  
  1535. #ifdef VMS
  1536. #ifndef IFDEBUG
  1537. #define IFDEBUG
  1538. #endif /* IFDEBUG */
  1539. #endif /* VMS */
  1540.  
  1541. #ifdef MAC
  1542. #ifndef IFDEBUG
  1543. #define IFDEBUG
  1544. #endif /* IFDEBUG */
  1545. #endif /* MAC */
  1546.  
  1547. #ifdef OS2
  1548. #ifndef IFDEBUG
  1549. #define IFDEBUG
  1550. #endif /* IFDEBUG */
  1551. #endif /* OS2 */
  1552.  
  1553. #ifdef OXOS                /* tst is faster than jsr */
  1554. #ifndef IFDEBUG
  1555. #define IFDEBUG
  1556. #endif /* IFDEBUG */
  1557. #endif /* OXOS */
  1558.  
  1559. #ifndef CKCMAI
  1560. extern int deblog;
  1561. extern int matchdot;
  1562. extern int tt_bell;
  1563. #endif /* CKCMAI */
  1564.  
  1565. #ifdef OS2
  1566. _PROTOTYP( void bleep, (short) );
  1567. #else /* OS2 */
  1568. #define bleep(x) if(tt_bell)putchar('\07')
  1569. #endif /* OS2 */
  1570.  
  1571. #ifndef DEBUG
  1572. /* Compile all the debug() statements away.  Saves a lot of space and time. */
  1573. #define debug(a,b,c,d)
  1574. #define hexdump(a,b,c)
  1575. /* Now define the debug() macro. */
  1576. #else
  1577. #ifdef IFDEBUG
  1578. /* Use this form to avoid function calls: */
  1579. #define debug(a,b,c,d) if (deblog) dodebug(a,b,(char *)(c),(long)d)
  1580. #define hexdump(a,b,c) if (deblog) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  1581. #else
  1582. /* Use this form to save space: */
  1583. #define debug(a,b,c,d) dodebug(a,b,(char *)(c),(long)d)
  1584. #define hexdump(a,b,c) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  1585. #endif /* DEBUG */
  1586.  
  1587. #ifdef COMMENT
  1588. #ifdef BEBOX
  1589. #undef debug
  1590. #define debug(a,b,c,d) if (deblog) printf("a=%1.1x:b=%s,c=%s,d=%0d\n",a,b,c,d)
  1591. #endif /* BEBOX */
  1592. #endif /* COMMENT */
  1593.  
  1594. _PROTOTYP(int dodebug,(int, char *, char *, long));
  1595. _PROTOTYP(VOID dohexdump,(CHAR *, CHAR *, int));
  1596. #endif /* DEBUG */
  1597.  
  1598. #ifdef NOICP
  1599. #ifdef TLOG
  1600. #undef TLOG
  1601. #endif /* TLOG */
  1602. #endif /* NOICP */
  1603.  
  1604. #ifndef TLOG
  1605. #define tlog(a,b,c,d)
  1606. #else
  1607. #ifndef CKCMAI
  1608. /* Debugging included.  Declare debug log flag in main program only. */
  1609. extern int tralog, tlogfmt;
  1610. #endif /* CKCMAI */
  1611. _PROTOTYP(VOID dotlog,(int, char *, char *, long));
  1612. #define tlog(a,b,c,d) if (tralog && tlogfmt) dotlog(a,b,c,d)
  1613. _PROTOTYP(VOID doxlog,(int, char *, long, int, int, char *));
  1614. #endif /* TLOG */
  1615.  
  1616. /* Formats for debug() and tlog() */
  1617.  
  1618. #define F000 0
  1619. #define F001 1
  1620. #define F010 2
  1621. #define F011 3
  1622. #define F100 4
  1623. #define F101 5
  1624. #define F110 6
  1625. #define F111 7
  1626.  
  1627. #ifdef __linux__
  1628. #ifndef LINUX
  1629. #define LINUX
  1630. #endif /* LINUX */
  1631. #endif /* __linux__ */
  1632.  
  1633. /* Platforms where small size is needed */
  1634.  
  1635. #ifdef pdp11
  1636. #define CK_SMALL
  1637. #endif /* pdp11 */
  1638.  
  1639. #ifdef SUNOS4                /* "built in makefile entry" */
  1640. #ifndef NOSETBUF            /* for SunOS 4.x */
  1641. #define NOSETBUF
  1642. #endif /* NOSETBUF */
  1643. #ifndef DIRENT
  1644. #define DIRENT
  1645. #endif /* DIRENT */
  1646. #ifndef NONET
  1647. #ifndef TCPSOCKET
  1648. #define TCPSOCKET
  1649. #endif /* TCPSOCKET */
  1650. #endif /* NONET */
  1651. #ifndef SAVEDUID
  1652. #define SAVEDUID
  1653. #endif /* SAVEDUID */
  1654. #ifndef DYNAMIC
  1655. #define DYNAMIC
  1656. #endif /* DYNAMIC */
  1657. #endif /* SUNOS4 */
  1658.  
  1659. #ifdef SOLARIS                /* "built in makefile entry" */
  1660. #ifndef NOSETBUF            /* for Solaris 2.x */
  1661. #define NOSETBUF
  1662. #endif /* NOSETBUF */
  1663. #ifndef NOCURSES
  1664. #ifndef CK_CURSES
  1665. #define CK_CURSES
  1666. #endif /* CK_CURSES */
  1667. #endif /* NOCURSES */
  1668. #ifndef CK_NEWTERM
  1669. #define CK_NEWTERM
  1670. #endif /* CK_NEWTERM */
  1671. #ifndef DIRENT
  1672. #define DIRENT
  1673. #endif /* DIRENT */
  1674. #ifndef TCPSOCKET
  1675. #define TCPSOCKET
  1676. #endif /* TCPSOCKET */
  1677. #ifndef SVR4
  1678. #define SVR4
  1679. #endif /* SVR4 */
  1680. #ifndef HADDRLIST
  1681. #define HADDRLIST
  1682. #endif /* HADDRLIST */
  1683. #ifndef STERMIOX
  1684. #define STERMIOX
  1685. #endif /* STERMIOX */
  1686. #ifndef SELECT
  1687. #define SELECT
  1688. #endif /* SELECT */
  1689. #ifndef DYNAMIC
  1690. #define DYNAMIC
  1691. #endif /* DYNAMIC */
  1692. #ifndef NOUUCP
  1693. #ifndef HDBUUCP
  1694. #define HDBUUCP
  1695. #endif /* HDBUUCP */
  1696. #endif /* NOUUCP */
  1697. #endif /* SOLARIS */
  1698.  
  1699. /* Can we use realpath()? */
  1700.  
  1701. #ifndef NOREALPATH
  1702. #ifdef pdp11
  1703. #define NOREALPATH
  1704. #endif /* pdp11 */
  1705. #endif /* NOREALPATH */
  1706.  
  1707. #ifndef NOREALPATH
  1708. #ifdef UNIX
  1709. #ifdef HPUX5
  1710. #define NOREALPATH
  1711. #else
  1712. #ifdef HPUX6
  1713. #define NOREALPATH
  1714. #else
  1715. #ifdef HPUX7
  1716. #define NOREALPATH
  1717. #else
  1718. #ifdef HPUX8
  1719. #define NOREALPATH
  1720. #else
  1721. #ifdef SV68R3V6
  1722. #define NOREALPATH
  1723. #else
  1724. #ifdef XENIX
  1725. #define NOREALPATH
  1726. #else
  1727. #ifdef CK_SCO32V4
  1728. #define NOREALPATH
  1729. #else
  1730. #ifdef CK_SCOV5
  1731. #define NOREALPATH
  1732. #else
  1733. #ifdef OSF32
  1734. #define NOREALPATH
  1735. #else
  1736. #ifdef OSF30
  1737. #define NOREALPATH
  1738. #else
  1739. #ifdef ultrix
  1740. #define NOREALPATH
  1741. #else
  1742. #ifdef COHERENT
  1743. #define NOREALPATH
  1744. #endif /* COHERENT */
  1745. #endif /* ultrix */
  1746. #endif /* OSF30 */
  1747. #endif /* OSF32 */
  1748. #endif /* CK_SCOV5 */
  1749. #endif /* CK_SCO32V4 */
  1750. #endif /* XENIX */
  1751. #endif /* SV68R3V6 */
  1752. #endif /* HPUX8 */
  1753. #endif /* HPUX7 */
  1754. #endif /* HPUX6 */
  1755. #endif /* HPUX5 */
  1756. #endif /* NOREALPATH */
  1757.  
  1758. #ifndef NOREALPATH
  1759. #ifndef CKREALPATH
  1760. #define CKREALPATH
  1761. #endif /* NOREALPATH */
  1762. #endif /* CKREALPATH */
  1763. #endif /* UNIX */
  1764.  
  1765. /* CKSYMLINK should be set only if we can use readlink() */
  1766.  
  1767. #ifdef UNIX
  1768. #ifndef NOSYMLINK
  1769. #ifndef CKSYMLINK
  1770. #define CKSYMLINK
  1771. #endif /* NOSYMLINK */
  1772. #endif /* CKSYMLINK */
  1773. #endif /* UNIX */
  1774.  
  1775. /* Platforms where we can use lstat() instead of stat() (for symlinks) */
  1776. /* This should be set only if both lstat() and readlink() are available */
  1777.  
  1778. #ifndef NOLSTAT
  1779. #ifndef NOSYMLINK
  1780. #ifndef USE_LSTAT
  1781. #ifdef UNIX
  1782. #ifdef CKSYMLINK
  1783. #ifdef SVR4                /* SVR4 has lstat() */
  1784. #define USE_LSTAT
  1785. #else
  1786. #ifdef BSD42                /* 4.2BSD and 4.3BSD have it */
  1787. #define USE_LSTAT            /* This should include old HPUXs */
  1788. #else
  1789. #ifdef BSD44                /* 4.4BSD has it */
  1790. #define USE_LSTAT
  1791. #else
  1792. #ifdef LINUX                /* LINUX has it */
  1793. #define USE_LSTAT
  1794. #else
  1795. #ifdef SUNOS4                /* SunOS has it */
  1796. #define USE_LSTAT
  1797. #endif /* SUNOS4 */
  1798. #endif /* LINUX */
  1799. #endif /* BSD44 */
  1800. #endif /* BSD42 */
  1801. #endif /* SVR4 */
  1802. #endif /* CKSYMLINK */
  1803. #endif /* UNIX */
  1804. #endif /* USE_LSTAT */
  1805. #endif /* NOSYMLINK */
  1806. #endif /* NOLSTAT */
  1807.  
  1808. #ifdef NOLSTAT
  1809. #ifdef USE_LSTAT
  1810. #undef USE_LSTAT
  1811. #endif /* USE_LSTAT */
  1812. #endif /* NOLSTAT */
  1813.  
  1814. #ifndef NOTTYLOCK            /* UNIX systems that have ttylock() */
  1815. #ifndef USETTYLOCK
  1816. #ifdef AIXRS                /* AIX 3.1 and later */
  1817. #define USETTYLOCK
  1818. #else
  1819. #ifdef USE_UU_LOCK            /* FreeBSD or other with uu_lock() */
  1820. #define USETTYLOCK
  1821. #endif /* USE_UU_LOCK */
  1822. #endif /* AIXRS */
  1823. #endif /* USETTYLOCK */
  1824. #endif /* NOTTYLOCK */
  1825.  
  1826. /* Kermit feature selection */
  1827.  
  1828. #ifndef NOSPL
  1829. #ifndef NOCHANNELIO            /* Channel-based file i/o package */
  1830. #ifndef CKCHANNELIO
  1831. #ifdef UNIX
  1832. #define CKCHANNELIO
  1833. #else
  1834. #ifdef OS2
  1835. #define CKCHANNELIO
  1836. #else
  1837. #ifdef VMS
  1838. #define CKCHANNELIO
  1839. #else
  1840. #ifdef STRATUS
  1841. #define CKCHANNELIO
  1842. #endif /* STRATUS */
  1843. #endif /* VMS */
  1844. #endif /* OS2 */
  1845. #endif /* UNIX */
  1846. #endif /* CKCHANNELIO */
  1847. #endif /* NOCHANNELIO */
  1848. #endif /* NOSPL */
  1849.  
  1850. #ifndef NOCKEXEC            /* EXEC command */
  1851. #ifndef NOPUSH
  1852. #ifndef CKEXEC
  1853. #ifdef UNIX                /* UNIX can do it */
  1854. #define CKEXEC
  1855. #endif /* UNIX */
  1856. #endif /* CKEXEC */
  1857. #endif /* NOPUSH */
  1858. #endif /* NOCKEXEC */
  1859.  
  1860. #ifndef NOFAST                /* Fast Kermit protocol by default */
  1861. #ifndef CK_FAST
  1862. #ifdef UNIX
  1863. #define CK_FAST
  1864. #else
  1865. #ifdef VMS
  1866. #define CK_FAST
  1867. #else
  1868. #ifdef OS2
  1869. #define CK_FAST
  1870. #endif /* OS2 */
  1871. #endif /* VMS */
  1872. #endif /* UNIX */
  1873. #endif /* CK_FAST */
  1874. #endif /* NOFAST */
  1875.  
  1876. #ifdef UNIX                /* Transparent print */
  1877. #ifndef NOXPRINT
  1878. #ifndef XPRINT
  1879. #define XPRINT
  1880. #endif /* XPRINT */
  1881. #endif /* NOXPRINT */
  1882. #endif /* UNIX */
  1883.  
  1884. #ifndef NOHWPARITY            /* Hardware parity */
  1885. #ifndef HWPARITY
  1886. #ifdef SVORPOSIX            /* System V or POSIX can have it */
  1887. #define HWPARITY
  1888. #else
  1889. #ifdef OS2                /* K95 can have it */
  1890. #define HWPARITY
  1891. #endif /* OS2 */
  1892. #endif /* SVORPOSIX */
  1893. #endif /* HWPARITY */
  1894. #endif /* NOHWPARITY */
  1895.  
  1896. #ifdef UNIX
  1897. #ifndef NETCMD                /* Can SET NETWORK TYPE COMMAND */
  1898. #define NETCMD
  1899. #endif /* NETCMD */
  1900. #endif /* UNIX */
  1901.  
  1902. /* Pty support, nonportable, available on a case-by-case basis */
  1903.  
  1904. #ifndef NOPTY
  1905. #ifdef NEXT                /* NeXTSTEP (tested on 3.1)*/
  1906. #define NETPTY
  1907. #else
  1908. #ifdef CK_SCOV5                /* SCO OSR5 (tested on 5.0.5)*/
  1909. #define NETPTY
  1910. #else
  1911. #ifdef QNX                /* QNX (tested on 4.25) */
  1912. #define NETPTY
  1913. #else
  1914. #ifdef SINIX                            /* Sinix (tested on 5.42) */
  1915. #define NETPTY
  1916. #else
  1917. #ifdef DGUX540                /* DG/UX 5.4++ (tested on 5.4R4.11) */
  1918. #define NETPTY
  1919. #else
  1920. #ifdef OSF32                /* Digital Unix 3.2 */
  1921. #define NETPTY
  1922. #else
  1923. #ifdef OSF40                /* Digital Unix 4.0 / Tru64 */
  1924. #define NETPTY
  1925. #else
  1926. #ifdef IRIX60                /* IRIX 6.0 (not earlier) */
  1927. #define NETPTY
  1928. #else
  1929. #ifdef HPUX10                /* HPUX 10.00 or later */
  1930. #define NETPTY
  1931. #ifndef HAVE_PTYTRAP
  1932. #define HAVE_PTYTRAP
  1933. #endif /* HAVE_PTYTRAP */
  1934. #else
  1935. #ifdef HPUX9                /* HPUX 9.00 (not earlier) */
  1936. #define NETPTY
  1937. #ifndef HAVE_PTYTRAP
  1938. #define HAVE_PTYTRAP
  1939. #endif /* HAVE_PTYTRAP */
  1940. #else
  1941. #ifdef BSD44                /* BSD44, {Net,Free,Open}BSD */
  1942. #define NETPTY
  1943. #else
  1944. #ifdef BSDI                /* BSDI/OS (tested in 4) */
  1945. #define NETPTY
  1946. #else
  1947. #ifdef SOLARIS                /* Solaris (tested in 2.5) */
  1948. #define NETPTY
  1949. #else
  1950. #ifdef UW7                /* Unixware 7 */
  1951. #define NETPTY
  1952. #else
  1953. #ifdef SUNOS41                /* SunOS (tested in 4.1.3) */
  1954. #define NETPTY
  1955. #else
  1956. #ifdef AIX41                /* AIX 4.1 and later */
  1957. #define NETPTY
  1958. #else
  1959. #ifdef LINUX                /* Linux */
  1960. #define NETPTY
  1961. #endif /* LINUX */
  1962. #endif /* AIX41 */
  1963. #endif /* SUNOS41 */
  1964. #endif /* UW7 */
  1965. #endif /* SOLARIS */
  1966. #endif /* BSDI */
  1967. #endif /* BSD44 */
  1968. #endif /* HPUX9 */
  1969. #endif /* HPUX10 */
  1970. #endif /* IRIX60 */
  1971. #endif /* OSF40 */
  1972. #endif /* OSF32 */
  1973. #endif /* DGUX540 */
  1974. #endif /* SINIX */
  1975. #endif /* QNX */
  1976. #endif /* CK_SCOV5 */
  1977. #endif /* NEXT */
  1978.  
  1979. #else /* NOPTY */
  1980.  
  1981. #ifdef NETPTY
  1982. #undef NETPTY
  1983. #endif /* NETPTY */
  1984. #endif /* NOPTY */
  1985.  
  1986. #ifdef NETPTY                           /* NETCMD required for NETPTY */
  1987. #ifndef NETCMD
  1988. #define NETCMD
  1989. #endif /* NETCMD */
  1990. #endif /* NETPTY */
  1991.  
  1992. #ifndef CK_UTSNAME            /* Can we call uname()? */
  1993. #ifdef VMS
  1994. #define CK_UTSNAME
  1995. #else
  1996. #ifdef OS2
  1997. #define CK_UTSNAME
  1998. #else
  1999. #ifdef POSIX                /* It's in POSIX.1 */
  2000. #define CK_UTSNAME
  2001. #else
  2002. #ifdef SUNOS41                /* It's in SunOS 4.1 */
  2003. #define CK_UTSNAME
  2004. #else
  2005. #ifdef AIXRS                /* It's in AIX */
  2006. #define CK_UTSNAME
  2007. #else
  2008. #ifdef SVR4                /* It's in SVR4 (but not SVR3) */
  2009. #define CK_UTSNAME
  2010. #else
  2011. #ifdef HPUX                /* It's in HP-UX 5.00 and later */
  2012. #define CK_UTSNAME
  2013. #else
  2014. #ifdef OSF                /* It's in OSF/1 / Digital UNIX */
  2015. #define CK_UTSNAME
  2016. #else
  2017. #ifdef CK_SCOV5
  2018. #define CK_UTSNAME
  2019. #endif /* CK_SCOV5 */
  2020. #endif /* OSF */
  2021. #endif /* HPUX */
  2022. #endif /* SVR4 */
  2023. #endif /* AIXRS */
  2024. #endif /* SUNOS41 */
  2025. #endif /* POSIX */
  2026. #endif /* OS2 */
  2027. #endif /* VMS */
  2028. #endif /* CK_UTSNAME */
  2029.  
  2030. /* This section for anything that might use floating-point */
  2031.  
  2032. /* If the following causes trouble use -DFLOAT=float on the command line */
  2033.  
  2034. #ifndef NOFLOAT
  2035.  
  2036. #ifndef CKFLOAT
  2037. #ifdef __alpha
  2038. /* Don't use double on 64-bit platforms -- bad things happen */
  2039. #define CKFLOAT float
  2040. #define CKFLOAT_S "float"
  2041. #else
  2042. #define CKFLOAT double
  2043. #define CKFLOAT_S "double"
  2044. #endif /* __alpha */
  2045. #endif /* CKFLOAT */
  2046.  
  2047. #ifndef NOGFTIMER            /* Floating-point timers */
  2048. #ifndef GFTIMER
  2049. #ifdef UNIX                /* For UNIX */
  2050. #define GFTIMER
  2051. #endif /* UNIX */
  2052. #ifdef VMS                /* VMS */
  2053. #ifndef OLD_VMS                /* 5.0 and later */
  2054. #define GFTIMER
  2055. #endif /* OLD_VMS */
  2056. #endif /* VMS */
  2057. #ifdef OS2                /* And K95 */
  2058. #define GFTIMER
  2059. #endif /* OS2 */
  2060. #ifdef STRATUS                /* And Stratus VOS */
  2061. #define GFTIMER
  2062. #endif /* STRATUS */
  2063. #endif /* GFTIMER */
  2064. #endif /* NOGFTIMER */
  2065.  
  2066. #ifdef NOSPL
  2067. #ifdef FNFLOAT
  2068. #undef FNFLOAT
  2069. #endif /* FNFLOAT */
  2070. #endif /* NOSPL */
  2071.  
  2072. #ifndef NOSPL
  2073. #ifndef FNFLOAT                /* Floating-point math functions */
  2074. #ifdef VMS                /* defined by default in VMS */
  2075. #define FNFLOAT
  2076. #else
  2077. #ifdef OS2                /* and K95 */
  2078. #define FNFLOAT
  2079. #endif /* OS2 */
  2080. #endif /* VMS */
  2081. #endif /* FNFLOAT */
  2082. #endif /* NOSPL */
  2083.  
  2084. #else  /* NOFLOAT is defined */
  2085.  
  2086. #ifdef CKFLOAT
  2087. #undef CKFLOAT
  2088. #endif /* CKFLOAT */
  2089.  
  2090. #ifdef GFTIMER
  2091. #undef GFTIMER
  2092. #endif /* GFTIMER */
  2093.  
  2094. #ifdef FNFLOAT
  2095. #undef FNFLOAT
  2096. #endif /* FNFLOAT */
  2097.  
  2098. #endif /* NOFLOAT */
  2099.  
  2100. #ifdef GFTIMER                /* Fraction of second to use when */
  2101. #ifndef GFMINTIME            /* elapsed time is <= 0 */
  2102. #define GFMINTIME 0.005
  2103. #endif /* GFMINTIME */
  2104. #endif /* GFTIMER */
  2105.  
  2106. #ifndef CKCMAI
  2107. extern long ztmsec, ztusec;        /* Fraction of sec of current time */
  2108. #endif /* CKCMAI */
  2109.  
  2110. #ifndef NOUNPREFIXZERO            /* Allow unprefixing of  NUL (0) */
  2111. #ifndef UNPREFIXZERO            /* in file-transfer packets */
  2112. #define UNPREFIXZERO
  2113. #endif /* UNPREFIXZERO */
  2114. #endif /* NOUNPREFIXZERO */
  2115.  
  2116. #ifdef CK_SMALL
  2117. #define NOCAL                /* Calibrate */
  2118. #endif /* CK_SMALL */
  2119.  
  2120. #ifndef NOPATTERNS            /* Filetype matching patterns */
  2121. #ifndef PATTERNS
  2122. #ifndef VMS
  2123. #ifndef CK_SMALL
  2124. #define PATTERNS
  2125. #endif /* CK_SMALL */
  2126. #endif /* VMS */
  2127. #endif /* PATTERNS */
  2128. #endif /* NOPATTERNS */
  2129.  
  2130. #ifndef NOCAL
  2131. #ifndef CALIBRATE
  2132. #define CALIBRATE
  2133. #endif /* CALIBRATE */
  2134. #else
  2135. #ifdef CALIBRATE
  2136. #undef CALIBRATE
  2137. #endif /* CALIBRATE */
  2138. #endif /* NOCAL */
  2139.  
  2140. #ifndef NORECURSE            /* Recursive directory traversal */
  2141. #ifndef RECURSIVE
  2142. #ifdef VMS
  2143. #define RECURSIVE
  2144. #else
  2145. #ifdef OS2ORUNIX
  2146. #ifndef CK_SMALL
  2147. #define RECURSIVE
  2148. #endif /* CK_SMALL */
  2149. #else
  2150. #ifdef STRATUS
  2151. #define RECURSIVE
  2152. #else
  2153. #ifdef OSK
  2154. #define RECURSIVE
  2155. #endif /* OSK */
  2156. #endif /* STRATUS */
  2157. #endif /* OS2ORUNIX */
  2158. #endif /* VMS */
  2159. #endif /* RECURSIVE */
  2160. #endif /* NORECURSE */
  2161.  
  2162. #ifndef CK_SMALL            /* Enable file-transfer tuning code */
  2163. #ifndef CKTUNING            /* in which more code is added */
  2164. #ifndef NOTUNING            /* to avoid function calls, etc */
  2165. #define CKTUNING
  2166. #endif /* NOTUNING */
  2167. #endif /* CKTUNING */
  2168. #endif /* CK_SMALL */
  2169.  
  2170. #ifndef NOURL                /* Parse URLs in SET HOST, etc */
  2171. #define CK_URL
  2172. #endif /* NOURL */
  2173.  
  2174. #ifndef NOTRIGGER
  2175. #ifndef CK_TRIGGER            /* Trigger string to exit CONNECT */
  2176. #ifdef OS2ORUNIX            /* OK for UNIX and K95 */
  2177. #define CK_TRIGGER
  2178. #else
  2179. #ifdef VMS                /* and VMS */
  2180. #define CK_TRIGGER
  2181. #else
  2182. #ifdef datageneral            /* and AOS/VS */
  2183. #define CK_TRIGGER
  2184. #endif /* datageneral */
  2185. #endif /* OS2ORUNIX */
  2186. #endif /* VMS */
  2187. #endif /* CK_TRIGGER */
  2188. #endif /* NOTRIGGER */
  2189.  
  2190. #ifdef CK_TRIGGER
  2191. #define TRIGGERS 8            /* How many triggers allowed */
  2192. #endif /* CK_TRIGGER */
  2193.  
  2194. #ifndef XLIMITS                /* CONNECT limits */
  2195. #ifdef OS2
  2196. #define XLIMITS
  2197. #endif /* OS2 */
  2198. #endif /* XLIMITS */
  2199.  
  2200. #ifdef NOFRILLS
  2201. #ifndef NOBROWSER
  2202. #define NOBROWSER
  2203. #endif /* NOBROWSER */
  2204. #endif /* NOFRILLS */
  2205.  
  2206. #ifndef NOHTTP                /* HTTP features need... */
  2207. #ifdef NOICP                /* an interactive command parser */
  2208. #define NOHTTP
  2209. #endif /* NOICP */
  2210. #ifndef OS2ORUNIX            /* K95 or UNIX (because of */
  2211. #define NOHTTP                /* time functions, time_t, etc) */
  2212. #endif /* OS2ORUNIX */
  2213. #endif /* NOHTTP */
  2214.  
  2215. /* The HTTP code is not very portable, so it must be asked for with -DCKHTTP */
  2216. #ifndef NONET
  2217. #ifdef TCPSOCKET
  2218. #ifndef NOHTTP
  2219. #ifndef CKHTTP
  2220. #ifdef SUNOS4                /* We can use it in SunOS */
  2221. #define CKHTTP
  2222. #endif /* SUNOS4 */
  2223. #ifdef SOLARIS                /* And in Solaris */
  2224. #define CKHTTP
  2225. #endif /* SOLARIS */
  2226. #ifdef LINUX                /* And Linux */
  2227. #define CKHTTP
  2228. #endif /* LINUX */
  2229. #ifdef HPUX10                /* And HP-UX 10 and above */
  2230. #define CKHTTP
  2231. #endif /* HPUX10 */
  2232. #ifdef OS2                /* And in K-95 */
  2233. #define CKHTTP
  2234. #endif /* OS2 */
  2235. #ifdef AIX41                /* In AIX 4.1 and higher */
  2236. #define CKHTTP
  2237. #endif /* AIX41 */
  2238. #ifdef UNIXWARE                /* In Unixware 2.1 and higher */
  2239. #define CKHTTP                /* and probably also in 1.x and 2.0 */
  2240. #endif /* UNIXWARE */
  2241. /* Add more here... */
  2242. #endif /* CKHTTP */
  2243. #ifndef CKHTTP                /* If CKHTTP not defined yet */
  2244. #define NOHTTP                /* then define HOHTTP */
  2245. #endif /* CKHTTP */
  2246. #endif /* NOHTTP */
  2247.  
  2248. #ifndef NOBROWSER
  2249. #ifdef UNIX
  2250. #ifndef BROWSER
  2251. #ifndef NOPUSH
  2252. #define BROWSER
  2253. #endif /* NOPUSH */
  2254. #endif /* BROWSER */
  2255. #endif /* UNIX */
  2256. #ifdef OS2
  2257. #ifndef BROWSER
  2258. #ifndef NOPUSH
  2259. #define BROWSER
  2260. #endif /* NOPUSH */
  2261. #endif /* BROWSER */
  2262. #endif /* OS2 */
  2263. #else
  2264. #ifdef BROWSER
  2265. #undef BROWSER
  2266. #endif /* BROWSER */
  2267. #endif /* NOBROWSER */
  2268. #endif /* TCPSOCKET */
  2269. #endif /* NONET */
  2270.  
  2271. #ifdef TCPSOCKET
  2272. #ifdef CK_SOCKS5            /* CK_SOCKS5 implies CK_SOCKS */
  2273. #ifndef CK_SOCKS
  2274. #define CK_SOCKS
  2275. #endif /* CK_SOCKS */
  2276. #endif /* CK_SOCKS5 */
  2277.  
  2278. #ifndef CK_AUTHENTICATION
  2279. #ifdef OS2
  2280. #ifdef OS2ONLY
  2281. #define NO_KERBEROS
  2282. #endif /* OS2ONLY */
  2283. #ifndef NO_KERBEROS
  2284. #define CK_KERBEROS
  2285. #define KRB4
  2286. #define KRB5
  2287. #endif /* NO_KERBEROS */
  2288. #ifndef _M_PPC
  2289. #ifndef _M_ALPHA
  2290. #ifndef NO_ENCRYPTION
  2291. #ifndef NO_SSL
  2292. #define CK_SSL
  2293. #define SSLDLL
  2294. #endif /* NO_SSL */
  2295. #endif /* NO_ENCRYPTION */
  2296. #endif /* _M_ALPHA */
  2297. #endif /* _M_PPC */
  2298. #ifndef NO_SRP
  2299. #define CK_SRP
  2300. #endif /* NO_SRP */
  2301. #define CK_AUTHENTICATION
  2302. #endif /* OS2 */
  2303. #endif /* CK_AUTHENTICATION */
  2304.  
  2305. #ifdef CK_AUTHENTICATION        /* Encryption must have Auth */
  2306. #ifndef CK_ENCRYPTION
  2307. #ifndef NO_ENCRYPTION
  2308. #ifdef OS2
  2309. #define CK_ENCRYPTION
  2310. #endif /* OS2 */
  2311. #endif /* NO_ENCRYPTION */
  2312. #endif /* CK_ENCRYPTION */
  2313. #endif /* CK_AUTHENTICATION */
  2314.  
  2315. #ifdef COMMENT
  2316. #ifndef NO_KERBEROS
  2317. #ifndef CK_KERBEROS            /* Temporary: for testing */
  2318. #ifdef UNIX                /* This enables only parsing */
  2319. #define CK_KERBEROS
  2320. #endif /* UNIX */
  2321. #endif /* CK_KERBEROS */
  2322. #endif /* NO_KERBEROS */
  2323. #endif /* COMMENT */
  2324.  
  2325. #ifdef NO_AUTHENTICATION                /* Allow authentication to be */
  2326. #ifdef CK_AUTHENTICATION                /* disabled in NT and OS/2    */
  2327. #undef CK_AUTHENTICATION
  2328. #endif /* CK_AUTHENTICATION */
  2329. #ifdef CK_KERBEROS
  2330. #undef CK_KERBEROS
  2331. #endif /* CK_KERBEROS */
  2332. #ifdef CK_SRP
  2333. #undef CK_SRP
  2334. #endif /* CK_SRP */
  2335. #ifdef CK_ENCRYPTION
  2336. #undef CK_ENCRYPTION
  2337. #endif /* CK_ENCRYPTION */
  2338. #endif /* NO_AUTHENTICATION */
  2339.  
  2340. #ifdef NO_ENCRYPTION                    /* Allow encryption to be */
  2341. #ifdef CK_ENCRYPTION                    /* disabled in NT and OS/2 */
  2342. #undef CK_ENCRYPTION
  2343. #endif /* CK_ENCRYPTION */
  2344. #endif /* NO_ENCRYPTION */
  2345.  
  2346. #ifndef OS2ORUNIX
  2347. #ifndef NOPUTENV
  2348. #define NOPUTENV
  2349. #endif /* NOPUTENV */
  2350. #endif /* OS2ORUNIX */
  2351.  
  2352. #ifndef CK_ENVIRONMENT
  2353. #ifdef OS2
  2354. #define CK_ENVIRONMENT
  2355. #else
  2356. #ifdef UNIX
  2357. #define CK_ENVIRONMENT
  2358. #else
  2359. #ifdef STRATUS
  2360. #define CK_ENVIRONMENT
  2361. #else
  2362. #ifdef VMS
  2363. #define CK_ENVIRONMENT
  2364. #endif /* VMS */
  2365. #endif /* STRATUS */
  2366. #endif /* UNIX */
  2367. #endif /* OS2 */
  2368. #endif /* CK_ENVIRONMENT */
  2369. #ifndef NOSNDLOC            /* RFC 779 SEND LOCATION */
  2370. #ifndef CK_SNDLOC
  2371. #define CK_SNDLOC
  2372. #endif /* CK_SNDLOC */
  2373. #endif /* NOSNDLOC */
  2374. #ifndef NOXDISPLOC            /* RFC 1096 XDISPLOC */
  2375. #ifndef CK_XDISPLOC
  2376. #define CK_XDISPLOC
  2377. #endif /* CK_XDISPLOC */
  2378. #endif /* NOXDISPLOC */
  2379. #ifndef NOFORWARDX
  2380. #ifndef NOPUTENV
  2381. #ifndef NOSELECT
  2382. #ifndef CK_FORWARD_X
  2383. #ifdef NT                /* EXPERIMENTAL */
  2384. #define CK_FORWARD_X
  2385. #endif /* NT */
  2386. #endif /* CK_FORWARD_X */
  2387. #endif /* NOSELECT */
  2388. #endif /* NOPUTENV */
  2389. #endif /* NOFORWARDX */
  2390. #endif /* TCPSOCKET */
  2391.  
  2392. #ifndef NOCTRLZ                /* Allow SET FILE EOF CTRL-Z */
  2393. #ifndef CK_CTRLZ
  2394. #ifdef OS2
  2395. #define CK_CTRLZ
  2396. #endif /* OS2 */
  2397. #endif /* CK_CTRLZ */
  2398. #endif /* NOCTRLZ */
  2399.  
  2400. #ifndef NOPERMS                /* File permissions in A packets */
  2401. #ifndef CK_PERMS
  2402. #ifdef UNIX
  2403. #define CK_PERMS
  2404. #else
  2405. #ifdef VMS
  2406. #define CK_PERMS
  2407. #endif /* VMS */
  2408. #endif /* UNIX */
  2409. #endif /* CK_PERMS */
  2410. #endif /* NOPERMS */
  2411. #ifdef CK_PERMS
  2412. #define CK_PERMLEN 24            /* Max length of sys-dependent perms */
  2413. #endif /* CK_PERMS */
  2414.  
  2415. #ifdef UNIX                /* NOSETBUF for everybody */
  2416. #ifndef NOSETBUF
  2417. #ifndef USE_SETBUF            /* This is the escape clause */
  2418. #define NOSETBUF
  2419. #endif /* USE_SETBUF */
  2420. #endif /* NOSETBUF */
  2421. #endif /* UNIX */
  2422.  
  2423. #ifndef USE_STRERROR            /* Whether to use strerror() */
  2424. #ifdef pdp11
  2425. #define USE_STRERROR
  2426. #endif /* pdp11 */
  2427. #endif /* USE_STRERROR */
  2428.  
  2429. #ifdef VMS                /* Features for all VMS builds */
  2430. #ifndef NOJC
  2431. #define NOJC
  2432. #endif /* NOJC */
  2433. #ifndef NOSETBUF
  2434. #define NOSETBUF
  2435. #endif /* NOSETBUF */
  2436. #ifndef DYNAMIC
  2437. #define DYNAMIC
  2438. #endif /* DYNAMIC */
  2439. #ifndef NOCURSES
  2440. #ifndef CK_CURSES
  2441. #define CK_CURSES
  2442. #endif /* CK_CURSES */
  2443. #endif /* NOCURSES */
  2444. #endif /* VMS */
  2445.  
  2446. #ifndef NOCKTIMERS            /* Dynamic timeouts */
  2447. #ifndef CK_TIMERS
  2448. #define CK_TIMERS
  2449. #endif /* CK_TIMERS */
  2450. #endif /* NOCKTIMERS */
  2451.  
  2452. #define CK_SPEED            /* Control-prefix removal */
  2453. #ifdef NOCKSPEED
  2454. #undef CK_SPEED
  2455. #endif /* NOCKSPEED */
  2456.  
  2457. #ifndef NOCKXXCHAR
  2458. #ifndef CKXXCHAR
  2459. #ifdef UNIX
  2460. #define CKXXCHAR
  2461. #else
  2462. #ifdef OS2
  2463. #define CKXXCHAR
  2464. #endif /* OS2 */
  2465. #endif /* UNIX */
  2466. #endif /* CKXXCHAR */
  2467. #endif /* NOCKXXCHAR */
  2468.  
  2469. #ifdef MAC                /* For Macintosh, no escape */
  2470. #define NOPUSH                /* to operating system */
  2471. #endif /* MAC */
  2472.  
  2473. /* Systems where we can call zmkdir() to create directories. */
  2474.  
  2475. #ifndef CK_MKDIR
  2476. #ifndef NOMKDIR
  2477.  
  2478. #ifdef UNIX
  2479. #ifndef pdp11
  2480. #define CK_MKDIR
  2481. #endif /* pdp11 */
  2482. #endif /* UNIX */
  2483.  
  2484. #ifdef OS2
  2485. #define CK_MKDIR
  2486. #endif /* OS2 */
  2487.  
  2488. #ifdef VMS
  2489. #define CK_MKDIR
  2490. #endif /* VMS */
  2491.  
  2492. #ifdef STRATUS
  2493. #define CK_MKDIR
  2494. #endif /* STRATUS */
  2495.  
  2496. #ifdef OSK
  2497. #define CK_MKDIR
  2498. #endif /* OSK */
  2499.  
  2500. #ifdef datageneral
  2501. #define CK_MKDIR
  2502. #endif /* datageneral */
  2503.  
  2504. #endif /* CK_MKDIR */
  2505. #endif /* NOMKDIR */
  2506.  
  2507. #ifdef NOMKDIR                /* Allow for command-line override */
  2508. #ifdef CK_MKDIR
  2509. #undef CK_MKDIR
  2510. #endif /* CK_MKDIR */
  2511. #endif /* NOMKDIR */
  2512.  
  2513. /* Systems for which we can enable the REDIRECT command automatically */
  2514. /*   As of 6.0.193, it should work for all UNIX... */
  2515.  
  2516. #ifndef NOREDIRECT
  2517. #ifndef CK_REDIR
  2518. #ifdef UNIX
  2519. #define CK_REDIR
  2520. #endif /* UNIX */
  2521. #ifdef OS2                /* As well as OS/2 and friends... */
  2522. #define CK_REDIR
  2523. #endif /* OS2 */
  2524. #endif /* CK_REDIR */
  2525. #endif /* NOREDIRECT */
  2526.  
  2527. #ifdef NOPUSH                /* But... REDIRECT command is not */
  2528. #ifdef CK_REDIR                /*  allowed if NOPUSH is defined. */
  2529. #undef CK_REDIR
  2530. #endif /* CK_REDIR */
  2531. #ifdef NETCMD                /* Nor is SET NET COMMAND */
  2532. #undef NETCMD
  2533. #endif /* NETCMD */
  2534. #ifdef NETPTY
  2535. #undef NETPTY
  2536. #endif /* NETPTY */
  2537. #endif /* NOPUSH */
  2538.  
  2539. #ifndef PEXITSTAT            /* \v(pexitstat) variable defined */
  2540. #ifdef OS2ORUNIX
  2541. #define PEXITSTAT
  2542. #else
  2543. #ifdef VMS
  2544. #define PEXITSTAT
  2545. #endif /* VMS */
  2546. #endif /* OS2ORUNIX */
  2547. #endif /* PEXITSTAT */
  2548.  
  2549. /* The following allows automatic enabling of REDIRECT to be overridden... */
  2550.  
  2551. #ifdef NOREDIRECT
  2552. #ifdef NETCMD
  2553. #undef NETCMD
  2554. #endif /* NETCMD */
  2555. #ifdef NETPTY
  2556. #undef NETPTY
  2557. #endif /* NETPTY */
  2558. #ifdef CK_REDIR
  2559. #undef CK_REDIR
  2560. #endif /* CK_REDIR */
  2561. #endif /* NOREDIRECT */
  2562.  
  2563. #ifdef NONETCMD
  2564. #ifdef NETCMD
  2565. #undef NETCMD
  2566. #endif /* NETCMD */
  2567. #ifdef NETPTY
  2568. #undef NETPTY
  2569. #endif /* NETPTY */
  2570. #endif /* NONETCMD */
  2571.  
  2572. #ifdef CK_REDIR
  2573. _PROTOTYP( int ttruncmd, (char *) );
  2574. #endif /* CK_REDIR */
  2575.  
  2576. /* Use built-in DIRECTORY command */
  2577.  
  2578. #ifndef NOMYDIR
  2579. #ifndef DOMYDIR
  2580. #ifdef UNIXOROSK
  2581. #define DOMYDIR
  2582. #else
  2583. #ifdef OS2
  2584. #define DOMYDIR
  2585. #else
  2586. #ifdef VMS
  2587. #define DOMYDIR
  2588. #endif /* VMS */
  2589. #endif /* OS2 */
  2590. #endif /* UNIXOROSK */
  2591. #endif /* DOMYDIR */
  2592. #endif /* NOMYDIR */
  2593.  
  2594. /* Sending from and receiving to commands/pipes */
  2595.  
  2596. #ifndef PIPESEND
  2597. #ifdef UNIX
  2598. #define PIPESEND
  2599. #endif /* UNIX */
  2600. #ifdef OS2
  2601. #define PIPESEND
  2602. #endif /* OS2 */
  2603. #endif /* PIPESEND */
  2604.  
  2605. #ifdef PIPESEND
  2606. #ifdef NOPIPESEND
  2607. #undef PIPESEND
  2608. #endif /* NOPIPESEND */
  2609. #ifdef NOPUSH
  2610. #undef PIPESEND
  2611. #endif /* NOPUSH */
  2612. #endif /* PIPESEND */
  2613.  
  2614. #ifdef NOPUSH
  2615. #ifdef BROWSER
  2616. #undef BROWSER
  2617. #endif /* BROWSER */
  2618. #endif /* NOPUSH */
  2619.  
  2620. /* Versions where we support the RESEND command */
  2621.  
  2622. #ifndef NORESEND
  2623. #ifndef CK_RESEND
  2624. #ifdef UNIX
  2625. #ifndef pdp11
  2626. #define CK_RESEND
  2627. #endif /* pdp11 */
  2628. #endif /* UNIX */
  2629.  
  2630. #ifdef VMS
  2631. #define CK_RESEND
  2632. #endif /* VMS */
  2633.  
  2634. #ifdef OS2
  2635. #define CK_RESEND
  2636. #endif /* OS2 */
  2637.  
  2638. #ifdef AMIGA
  2639. #define CK_RESEND
  2640. #endif /* AMIGA */
  2641.  
  2642. #ifdef datageneral
  2643. #define CK_RESEND
  2644. #endif /* datageneral */
  2645.  
  2646. #ifdef STRATUS
  2647. #define CK_RESEND
  2648. #endif /* STRATUS */
  2649.  
  2650. #ifdef OSK
  2651. #define CK_RESEND
  2652. #endif /* OSK */
  2653.  
  2654. #endif /* CK_RESEND */
  2655. #endif /* NORESEND */
  2656.  
  2657. /* Systems implementing "Doomsday Kermit" protocol ... */
  2658.  
  2659. #ifndef DOOMSDAY
  2660. #ifdef UNIX
  2661. #define DOOMSDAY
  2662. #else
  2663. #ifdef VMS
  2664. #define DOOMSDAY
  2665. #else
  2666. #ifdef OS2
  2667. #define DOOMSDAY
  2668. #else
  2669. #ifdef STRATUS
  2670. #define DOOMSDAY
  2671. #endif /* STRATUS */
  2672. #endif /* OS2 */
  2673. #endif /* VMS */
  2674. #endif /* UNIX */
  2675. #endif /* DOOMSDAY */
  2676.  
  2677. /* Systems where we want the Thermometer to be used for fullscreen */
  2678.  
  2679. #ifdef OS2
  2680. #ifndef CK_PCT_BAR
  2681. #define CK_PCT_BAR
  2682. #endif /* CK_PCT_BAR */
  2683. #endif /* OS2 */
  2684.  
  2685. /* Systems where we have a REXX command */
  2686.  
  2687. #ifdef OS2
  2688. #ifdef __32BIT__
  2689. #ifndef NOREXX
  2690. #define CK_REXX
  2691. #endif /* NOREXX */
  2692. #endif /* __32BIT__ */
  2693. #endif /* OS2 */
  2694.  
  2695. /* Platforms that have a ZCHKPID function */
  2696.  
  2697. #ifdef OS2ORUNIX
  2698. #define ZCHKPID
  2699. #endif /* OS2ORUNIX */
  2700.  
  2701. #ifndef ZCHKPID
  2702. /* If we can't check pids then we have treat all pids as active & valid. */
  2703. #define zchkpid(x) 1
  2704. #endif /* ZCHKPID */
  2705.  
  2706. /* Systems that have a ZRENAME function */
  2707.  
  2708. #define ZRENAME                /* They all do */
  2709.  
  2710. /* Systems that have a ZCOPY function */
  2711.  
  2712. #ifndef ZCOPY
  2713. #ifdef VMS
  2714. #define ZCOPY
  2715. #else
  2716. #ifdef OS2
  2717. #define ZCOPY
  2718. #else
  2719. #ifdef UNIX
  2720. #define ZCOPY
  2721. #else
  2722. #ifdef STRATUS
  2723. #define ZCOPY
  2724. #endif /* STRATUS */
  2725. #endif /* UNIX */
  2726. #endif /* OS2 */
  2727. #endif /* VMS */
  2728. #endif /* ZCOPY */
  2729.  
  2730. /* Systems that have ttgwsiz() (they all should but they don't) */
  2731.  
  2732. #ifndef NOTTGWSIZ
  2733. #ifndef CK_TTGWSIZ
  2734. #ifdef UNIX
  2735. #define CK_TTGWSIZ
  2736. #else
  2737. #ifdef VMS
  2738. #define CK_TTGWSIZ
  2739. #else
  2740. #ifdef OS2
  2741. #define CK_TTGWSIZ
  2742. #else
  2743. #ifdef OSK
  2744. #define CK_TTGWSIZ
  2745. #endif /* OSK */
  2746. #endif /* OS2 */
  2747. #endif /* VMS */
  2748. #endif /* UNIX */
  2749. #endif /* CK_TTGWSIZ */
  2750. #endif /* NOTTGWSIZ */
  2751.  
  2752. #ifdef NOTTGWSIZ
  2753. #ifdef CK_TTGWSIZ
  2754. #undef CK_TTGWSIZ
  2755. #endif /* CK_TTGWSIZ */
  2756. #endif /* NOTTGWSIZ */
  2757.  
  2758. /* OS/2 C-Kermit features not available in 16-bit version... */
  2759.  
  2760. #ifdef OS2
  2761. #ifndef __32BIT__
  2762. #ifdef PCFONTS                /* PC Font support */
  2763. #undef PCFONTS
  2764. #endif /* PCFONTS */
  2765. #ifdef NPIPE                /* Named Pipes communication */
  2766. #undef NPIPE
  2767. #endif /* NPIPE */
  2768. #ifdef CK_NETBIOS            /* NETBIOS communication */
  2769. #undef CK_NETBIOS
  2770. #endif /* CK_NETBIOS */
  2771. #ifdef OS2MOUSE                /* Mouse */
  2772. #undef OS2MOUSE
  2773. #endif /* OS2MOUSE */
  2774. #ifdef OS2PM                /* Presentation Manager */
  2775. #undef OS2PM
  2776. #endif /* OS2PM */
  2777. #ifdef CK_REXX                /* Rexx */
  2778. #undef CK_REXX
  2779. #endif /* CK_REXX */
  2780. #endif /* __32BIT__ */
  2781. #endif /* OS2 */
  2782.  
  2783. /* OS/2 C-Kermit features not available in Windows NT version... */
  2784.  
  2785. #ifdef OS2
  2786. #ifdef NT
  2787. #ifdef PCFONTS                /* PC Font support */
  2788. #undef PCFONTS
  2789. #endif /* PCFONTS */
  2790. #ifdef NPIPE                /* Named Pipes communication */
  2791. #undef NPIPE
  2792. #endif /* NPIPE */
  2793. #ifdef OS2PM                /* Presentation Manager */
  2794. #undef OS2PM
  2795. #endif /* OS2PM */
  2796. #ifdef CK_REXX                /* Rexx */
  2797. #undef CK_REXX
  2798. #endif /* CK_REXX */
  2799. #endif /* NT */
  2800. #endif /* OS2 */
  2801.  
  2802. /*
  2803.   Systems that have select().
  2804.   This is used for both msleep() and for read-buffer checking in in_chk().
  2805. */
  2806. #define CK_SLEEPINT 250 /* milliseconds - set this to something that
  2807.                            divides evenly into 1000 */
  2808. #ifndef SELECT
  2809. #ifndef NOSELECT
  2810. #ifdef __linux__
  2811. #define SELECT
  2812. #else
  2813. #ifdef SUNOS4
  2814. #define SELECT
  2815. #else
  2816. #ifdef NEXT
  2817. #define SELECT
  2818. #else
  2819. #ifdef HPUX
  2820. /*
  2821.   Not really.  I think it's only in HP-UX 7.0 and later, except it's also
  2822.   in earlier versions that have TCP/IP installed.  Override this default
  2823.   in particular HP-UX makefile entries by adding -DNOSELECT, as in (e.g.)
  2824.   the HP-UX 6.5 ones.
  2825. */
  2826. #define SELECT
  2827. #else
  2828. #ifdef AIXRS
  2829. #define SELECT
  2830. #else
  2831. #ifdef BSD44
  2832. #define SELECT
  2833. #else
  2834. #ifdef BSD4
  2835. #define SELECT
  2836. #else
  2837. #ifdef OXOS
  2838. #define SELECT
  2839. #else
  2840. #ifdef OS2
  2841. #define SELECT
  2842. #else
  2843. #ifdef BEBOX
  2844. #define SELECT
  2845. #endif /* BEBOX */
  2846. #endif /* OS2 */
  2847. #endif /* OXOS */
  2848. #endif /* BSD4 */
  2849. #endif /* BSD44 */
  2850. #endif /* AIXRS */
  2851. #endif /* HPUX */
  2852. #endif /* NEXT */
  2853. #endif /* __linux__ */
  2854. #endif /* SUNOS4 */
  2855. #endif /* NOSELECT */
  2856. #endif /* SELECT */
  2857.  
  2858. /*
  2859.   The following section moved here from ckcnet.h in 6.1 because select()
  2860.   is now used for non-networking purposes.
  2861. */
  2862.  
  2863. /* On HP-9000/500 HP-UX 5.21 this stuff is not defined in any header file */
  2864.  
  2865. #ifdef hp9000s500
  2866. #ifndef NEEDSELECTDEFS
  2867. #define NEEDSELECTDEFS
  2868. #endif /* NEEDSELECTDEFS */
  2869. #endif /* hp9000s500 */
  2870.  
  2871. #ifdef NEEDSELECTDEFS
  2872. typedef long fd_mask;
  2873. #ifndef NBBY
  2874. #define NBBY 8
  2875. #endif /* NBBY */
  2876. #ifndef FD_SETSIZE
  2877. #define FD_SETSIZE 32
  2878. #endif /* FD_SETSIZE */
  2879. #ifndef NFDBITS
  2880. #define NFDBITS (sizeof(fd_mask) * NBBY)
  2881. #endif /* NFDBITS */
  2882. #ifndef howmany
  2883. #define howmany(x,y) (((x)+((y)-1))/(y))
  2884. #endif /* howmany */
  2885. typedef struct fd_set {
  2886.     fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  2887. } fd_set;
  2888. #ifndef FD_SET
  2889. #define FD_SET(n,p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  2890. #endif /* FD_SET */
  2891. #ifndef FD_CLR
  2892. #define FD_CLR(n,p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  2893. #endif /* FD_CLR */
  2894. #ifndef FD_ISSET
  2895. #define FD_ISSET(n,p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  2896. #endif /* FD_ISSET */
  2897. #ifndef FD_COPY
  2898. #define FD_COPY(f,t) (bcopy(f,t,sizeof(*(f)))
  2899. #endif /* FD_COPY */
  2900. #ifndef FD_ZERO
  2901. #define FD_ZERO(p) bzero((char *)(p),sizeof(*(p)))
  2902. #endif /* FD_ZERO */
  2903. #endif /* NEEDSELECTDEFS */
  2904.  
  2905. /*
  2906.   CK_NEED_SIG is defined if the system cannot check the console to
  2907.   to see if characters are waiting.  This is used during local-mode file
  2908.   transfer to interrupt the transfer, refresh the screen display, etc.
  2909.   If CK_NEED_SIG is defined, then file-transfer interruption characters
  2910.   have to be preceded a special character, e.g. the SIGQUIT character.
  2911.   CK_NEED_SIG should be defined if the conchk() function is not operational.
  2912. */
  2913. #ifdef NOPOLL                /* For overriding CK_POLL definition */
  2914. #ifdef CK_POLL
  2915. #undef CK_POLL
  2916. #endif /* CK_POLL */
  2917. #endif /* NOPOLL */
  2918.  
  2919. #ifndef CK_POLL                /* If we don't have poll() */
  2920. #ifndef RDCHK                /* And we don't have rdchk() */
  2921. #ifndef SELECT                /* And we don't have select() */
  2922. #ifdef ATTSV
  2923. #ifndef aegis
  2924. #ifndef datageneral
  2925. #ifndef OXOS
  2926. #define CK_NEED_SIG
  2927. #endif /* OXOS */
  2928. #endif /* datageneral */
  2929. #endif /* aegis */
  2930. #endif /* ATTSV */
  2931. #ifdef POSIX
  2932. #ifndef CK_NEED_SIG
  2933. #define CK_NEED_SIG
  2934. #endif /* CK_NEED_SIG */
  2935. #endif /* POSIX */
  2936. #endif /* SELECT */
  2937. #endif /* RDCHK */
  2938. #endif /* CK_POLL */
  2939.  
  2940. #ifdef HPUX                /* HP-UX has select() */
  2941. #ifdef CK_NEED_SIG
  2942. #undef CK_NEED_SIG
  2943. #endif /* CK_NEED_SIG */
  2944. #endif /* HPUX */
  2945.  
  2946. #ifdef AIXRS                /* AIX has select() */
  2947. #ifdef CK_NEED_SIG
  2948. #undef CK_NEED_SIG
  2949. #endif /* CK_NEED_SIG */
  2950. #endif /* AIXRS */
  2951.  
  2952. #ifdef BSD44                /* 4.4BSD has FIONREAD */
  2953. #ifdef CK_NEED_SIG
  2954. #undef CK_NEED_SIG
  2955. #endif /* CK_NEED_SIG */
  2956. #endif /* BSD44 */
  2957.  
  2958. #ifdef QNX                /* QNX has FIONREAD and select() */
  2959. #ifdef CK_NEED_SIG
  2960. #undef CK_NEED_SIG
  2961. #endif /* CK_NEED_SIG */
  2962. #endif /* QNX */
  2963.  
  2964. #ifdef COHERENT
  2965. #ifndef NOTIMEZONE
  2966. #define NOTIMEZONE
  2967. #endif /* NOTIMEZONE */
  2968. #endif /* COHERENT */
  2969.  
  2970. #ifdef UNIX
  2971. #ifndef HAVE_TZ                /* Can we use struct timezone? */
  2972. #ifndef NOTIMEZONE
  2973. #ifdef PTX
  2974. #define NOTIMEZONE
  2975. #else
  2976. #ifndef SELECT
  2977. #ifdef COHERENT
  2978. #define NOTIMEZONE
  2979. #else
  2980. #ifdef BELLV10
  2981. #define NOTIMEZONE
  2982. #endif /* BELLV10 */
  2983. #endif /* COHERENT */
  2984. #endif /* SELECT */
  2985. #endif /* PTX */
  2986. #endif /* NOTIMEZONE */
  2987. #endif /* HAVE_TZ */
  2988. #ifndef NOTIMEVAL            /* Can we use struct timeval? */
  2989. #ifndef HAVE_TV
  2990. #define HAVE_TV
  2991. #endif /* HAVE_TV */
  2992. #endif /* NOTIMEVAL */
  2993. #ifndef NOTIMEZONE
  2994. #ifndef HAVE_TZ
  2995. #define HAVE_TZ
  2996. #endif /* HAVE_TZ */
  2997. #endif /* NOTIMEZONE */
  2998. #endif /* UNIX */
  2999.  
  3000. #ifdef SCO32
  3001. #ifdef HAVE_TV
  3002. #undef HAVE_TV
  3003. #endif /* HAVE_TV */
  3004. #ifdef HAVE_TZ
  3005. #undef HAVE_TZ
  3006. #endif /* HAVE_TZ */
  3007. #ifndef NOTIMEVAL
  3008. #define NOTIMEVAL
  3009. #endif /* NOTIMEVAL */
  3010. #ifndef NOTIMEZONE
  3011. #define NOTIMEZONE
  3012. #endif /* NOTIMEZONE */
  3013. #endif /* SCO32 */
  3014.  
  3015. #ifdef ATT7300
  3016. #ifdef HAVE_TV
  3017. #undef HAVE_TV
  3018. #endif /* HAVE_TV */
  3019. #ifdef HAVE_TZ
  3020. #undef HAVE_TZ
  3021. #endif /* HAVE_TZ */
  3022. #ifndef NOTIMEVAL
  3023. #define NOTIMEVAL
  3024. #endif /* NOTIMEVAL */
  3025. #ifndef NOTIMEZONE
  3026. #define NOTIMEZONE
  3027. #endif /* NOTIMEZONE */
  3028. #endif /* ATT7300 */
  3029.  
  3030. /*
  3031.   Automatic parity detection.
  3032.   This actually implies a lot more now: length-driven packet reading,
  3033.   "Doomsday Kermit" IBM Mainframe file transfer through 3270 data streams, etc.
  3034. */
  3035. #ifdef UNIX                /* For Unix */
  3036. #ifndef NOPARSEN
  3037. #define PARSENSE
  3038. #endif /* NOPARSEN */
  3039. #endif /* UNIX */
  3040.  
  3041. #ifdef VMS                /* ... and VMS */
  3042. #ifndef NOPARSEN
  3043. #define PARSENSE
  3044. #endif /* NOPARSEN */
  3045. #ifdef __GNUC__
  3046. #define VMSGCC
  3047. #endif /* __GNUC__ */
  3048. #endif /* VMS */
  3049.  
  3050. #ifdef MAC                /* and Macintosh */
  3051. #ifndef NOPARSEN
  3052. #define PARSENSE
  3053. #endif /* NOPARSEN */
  3054. #endif /* MAC */
  3055.  
  3056. #ifdef STRATUS                /* and Stratus VOS */
  3057. #ifndef NOPARSEN
  3058. #define PARSENSE
  3059. #endif /* NOPARSEN */
  3060. #endif /* STRATUS */
  3061.  
  3062. #ifdef OS2                /* and OS/2, finally */
  3063. #ifndef NOPARSEN
  3064. #define PARSENSE
  3065. #endif /* NOPARSEN */
  3066. #endif /* OS2 */
  3067.  
  3068. #ifndef NODYNAMIC            /* DYNAMIC is default for UNIX */
  3069. #ifndef DYNAMIC                /* as of C-Kermit 7.0 */
  3070. #ifdef UNIX
  3071. #define DYNAMIC
  3072. #endif /* UNIX */
  3073. #endif /* DYNAMIC */
  3074. #endif /* NODYNAMIC */
  3075.  
  3076. #ifdef DYNAMIC                /* If DYNAMIC is defined */
  3077. #define DCMDBUF                /* then also define this. */
  3078. #endif /* DYNAMIC */
  3079.  
  3080. #ifndef CK_LBRK                /* Can send Long BREAK */
  3081.  
  3082. #ifdef UNIX                /* (everybody but OS-9) */
  3083. #define CK_LBRK
  3084. #endif /* UNIX */
  3085. #ifdef VMS
  3086. #define CK_LBRK
  3087. #endif /* VMS */
  3088. #ifdef datageneral
  3089. #define CK_LBRK
  3090. #endif /* datageneral */
  3091. #ifdef GEMDOS
  3092. #define CK_LBRK
  3093. #endif /* GEMDOS */
  3094. #ifdef OS2
  3095. #define CK_LBRK
  3096. #endif /* OS2 */
  3097. #ifdef AMIGA
  3098. #define CK_LBRK
  3099. #endif /* AMIGA */
  3100. #ifdef STRATUS
  3101. #define CK_LBRK
  3102. #endif /* STRATUS */
  3103.  
  3104. #endif /* CK_LBRK */
  3105.  
  3106. /* Carrier treatment */
  3107. /* These are defined here because they are shared by the system dependent */
  3108. /* and the system independent modules. */
  3109.  
  3110. #define  CAR_OFF 0    /* Off: ignore carrier always. */
  3111. #define  CAR_ON  1      /* On: heed carrier always, except during DIAL. */
  3112. #define  CAR_AUT 2      /* Auto: heed carrier, but only if line is declared */
  3113.             /* to be a modem line, and only during CONNECT. */
  3114.  
  3115. /* And more generically (for use with any ON/OFF/AUTO feature) */
  3116. #define  CK_OFF  0
  3117. #define  CK_ON   1
  3118. #define  CK_AUTO 2
  3119.  
  3120. #ifndef NOLOCAL
  3121. /*
  3122.   Serial interface speeds available.
  3123.  
  3124.   As of C-Kermit 6.1 there is a new method to get the supported
  3125.   speeds, which obviates the need for all the craziness below.  At runtime,
  3126.   just call the new ttspdlist() routine to get a list of supported speeds.
  3127.   Then the user interface module can build a keyword table or menu from it.
  3128. */
  3129. #ifndef TTSPDLIST
  3130. #ifdef UNIX                /* For now, only for UNIX */
  3131. #ifndef OLINUXHISPEED            /* But not systems with hacks for */
  3132. #ifndef MINIX                /* high speeds, like 110 = 115200 */
  3133. #define TTSPDLIST
  3134. #endif /* MINIX */
  3135. #endif /* OLINUXHISPEED */
  3136. #else
  3137. #ifdef VMS
  3138. #define TTSPDLIST            /* VMS gets it too */
  3139. #endif /* VMS */
  3140. #endif /* UNIX */
  3141. #endif /* TTSPDLIST */
  3142.  
  3143. #ifndef NODIAL                /* Hangup by modem command */
  3144. #ifndef NOMDMHUP
  3145. #ifndef MDMHUP
  3146. #define MDMHUP
  3147. #endif /* MDMHUP */
  3148. #endif /* NOMDMHUP */
  3149. #endif /* NODIAL */
  3150.  
  3151. #ifdef NOSPL
  3152. #ifndef NOLOGDIAL            /* Connection log needs mjd(), etc. */
  3153. #define NOLOGDIAL
  3154. #endif /* NOLOGDIAL */
  3155. #endif /* NOSPL */
  3156.  
  3157. #ifndef NOLOGDIAL            /* Connection log */
  3158. #ifndef CXLOGFILE
  3159. #define CXLOGFILE "CX.LOG"        /* Default connection log file name */
  3160. #endif /* CXLOGFILE */
  3161. #ifndef CKLOGDIAL
  3162. #ifndef CK_SMALL
  3163. #define CKLOGDIAL
  3164. #define CXLOGBUFL 1024            /* Connection log record buffer size */
  3165. #endif /* CK_SMALL */
  3166. #endif /* NOLOGDIAL */
  3167. #endif /* CKLOGDIAL */
  3168.  
  3169. #endif /* NOLOCAL */
  3170.  
  3171. #ifdef NOTTSPDLIST            /* Except if NOTTSPDLIST is defined */
  3172. #ifdef TTSPDLIST
  3173. #undef TTSPDLIST
  3174. #endif /* TTSPDLIST */
  3175. #endif /* NOTTSPDLIST */
  3176.  
  3177. #ifdef TTSPDLIST
  3178.  
  3179. _PROTOTYP( long * ttspdlist, (void) );
  3180.  
  3181. #else /* TTSPDLIST not defined */
  3182. /*
  3183.   We must use a long and convoluted series of #ifdefs that have to be kept in
  3184.   sync with the code in the ck?tio.c module.
  3185.  
  3186.   We assume that everybody supports: 0, 110, 300, 600, 1200, 2400, 4800, and
  3187.   9600 bps.  Symbols for other speeds are defined here.  You can also add
  3188.   definitions on the CC command lines.  These definitions affect the SET SPEED
  3189.   keyword table, and are not necessarily usable in the system-dependent
  3190.   speed-setting code in the ck?tio.c modules, which depends on system-specific
  3191.   symbols like (in UNIX) B19200.  In other words, just defining it doesn't
  3192.   mean it'll work -- you also have to supply the supporting code in ttsspd()
  3193.   and ttgspd() in ck?tio.c.
  3194.  
  3195.   The symbols have the form BPS_xxxx, where xxxx is the speed in bits per
  3196.   second, or (for bps values larger than 9999) thousands of bps followed by K.
  3197.   The total symbol length should be 8 characters or less.  Some values are
  3198.   enabled automatically below.  You can disable a particular value by defining
  3199.   NOB_xxxx on the CC command line. */
  3200. #ifndef NOB_50
  3201. #define BPS_50                /* 50 bps */
  3202. #endif
  3203.  
  3204. #ifndef NOB_75
  3205. #define BPS_75                /* 75 bps */
  3206. #endif
  3207.  
  3208. #ifndef NOB7512
  3209. #ifdef ANYBSD
  3210. #define BPS_7512            /* 75/1200 Split Speed */
  3211. #endif /* ANYBSD */
  3212. #endif /* NOB7512 */
  3213.  
  3214. #ifndef NOB134
  3215. #ifdef SOLARIS25
  3216. #define BPS_134
  3217. #else
  3218. #undef BPS_134                /* 134.5 bps (IBM 2741) */
  3219. #endif /* BPS_134 */
  3220. #endif /* NOB134 */
  3221.  
  3222. #ifndef NOB_150
  3223. #define BPS_150                /* 150 bps */
  3224. #endif
  3225.  
  3226. #ifndef NOB_200
  3227. #define BPS_200                /* 200 bps */
  3228. #endif
  3229.  
  3230. #ifndef NOB_1800
  3231. #ifdef MAC
  3232. #define BPS_1800            /* 1800 bps */
  3233. #else
  3234. #ifdef SOLARIS25
  3235. #define BPS_1800
  3236. #endif
  3237. #endif
  3238. #endif
  3239.  
  3240. #ifndef NOB_3600
  3241. #ifndef SOLARIS25
  3242. #define BPS_3600            /* 3600 bps */
  3243. #endif
  3244. #endif
  3245.  
  3246. #ifndef NOB_7200
  3247. #ifndef SOLARIS25
  3248. #define BPS_7200            /* 7200 bps */
  3249. #endif /* SOLARIS25 */
  3250. #endif
  3251.  
  3252. #ifndef NOB_14K
  3253. #ifdef BSD44
  3254. #define BPS_14K                /* 14400 bps */
  3255. #else
  3256. #ifdef OS2
  3257. #define BPS_14K
  3258. #else
  3259. #ifdef NEXT
  3260. #define BPS_14K
  3261. #else
  3262. #ifdef MAC
  3263. #define BPS_14K
  3264. #else
  3265. #ifdef AMIGA
  3266. #define BPS_14K
  3267. #endif /* AMIGA */
  3268. #endif /* MAC */
  3269. #endif /* NEXT */
  3270. #endif /* OS2 */
  3271. #endif /* BSD44 */
  3272. #endif /* NOB_14K */
  3273.  
  3274. #ifndef NOB_19K
  3275. #define BPS_19K                /* 19200 bps */
  3276. #endif
  3277.  
  3278. #ifndef NOB_28K
  3279. #ifdef BSD44
  3280. #define BPS_28K
  3281. #else
  3282. #ifdef OS2
  3283. #define BPS_28K
  3284. #else
  3285. #ifdef NEXT
  3286. #define BPS_28K                /* 28800 bps */
  3287. #else
  3288. #ifdef MAC
  3289. #define BPS_28K                /* 28800 bps */
  3290. #endif /* MAC */
  3291. #endif /* NEXT */
  3292. #endif /* OS2 */
  3293. #endif /* BSD44 */
  3294. #endif /* NOB_28K */
  3295.  
  3296. #ifndef NOB_38K
  3297. #define BPS_38K                /* 38400 bps */
  3298. #endif
  3299.  
  3300. #ifndef NOB_57K
  3301. #ifdef Plan9
  3302. #define BPS_57K
  3303. #else
  3304. #ifdef SOLARIS25
  3305. #define BPS_57K
  3306. #else
  3307. #ifdef VMS
  3308. #define BPS_57K                /* 57600 bps */
  3309. #else
  3310. #ifdef OS2
  3311. #define BPS_57K
  3312. #else
  3313. #ifdef __linux__
  3314. #define BPS_57K
  3315. #else
  3316. #ifdef HPUX
  3317. #define BPS_57K
  3318. #else
  3319. #ifdef NEXT
  3320. #define BPS_57K
  3321. #else
  3322. #ifdef __386BSD__
  3323. #define BPS_57K
  3324. #else
  3325. #ifdef __FreeBSD__
  3326. #define BPS_57K
  3327. #else
  3328. #ifdef __NetBSD__
  3329. #define BPS_57K
  3330. #else
  3331. #ifdef MAC
  3332. #define BPS_57K
  3333. #else
  3334. #ifdef QNX
  3335. #define BPS_57K
  3336. #else
  3337. #ifdef BEBOX
  3338. #define BPS_57K
  3339. #else
  3340. #ifdef IRIX62
  3341. #define BPS_57K
  3342. #else
  3343. #ifdef SCO_OSR504
  3344. #define BPS_57K
  3345. #else
  3346. #ifdef BSDI2
  3347. #define BPS_57K
  3348. #endif /* BSDI2 */
  3349. #endif /* SCO_OSR504 */
  3350. #endif /* IRIX62 */
  3351. #endif /* BEBOX */
  3352. #endif /* QNX */
  3353. #endif /* MAC */
  3354. #endif /* __NetBSD__ */
  3355. #endif /* __FreeBSD__ */
  3356. #endif /* __386BSD__ */
  3357. #endif /* NEXT */
  3358. #endif /* HPUX */
  3359. #endif /* __linux__ */
  3360. #endif /* OS2 */
  3361. #endif /* VMS */
  3362. #endif /* SOLARIS25 */
  3363. #endif /* Plan9 */
  3364. #endif /* NOB_57K */
  3365.  
  3366. #ifndef NOB_76K
  3367. #ifdef BSDI2
  3368. #define BPS_76K
  3369. #endif /* BSDI2 */
  3370. #ifdef Plan9
  3371. #define BPS_76K
  3372. #endif /* Plan9 */
  3373. #ifdef SOLARIS25
  3374. #define BPS_76K
  3375. #endif /* SOLARIS25 */
  3376. #ifdef VMS
  3377. #define BPS_76K                /* 76800 bps */
  3378. #endif /* VMS */
  3379. #ifdef OS2
  3380. #ifdef __32BIT__
  3381. #define BPS_76K
  3382. #endif /* __32BIT__ */
  3383. #endif /* OS2 */
  3384. #ifdef QNX
  3385. #define BPS_76K
  3386. #endif /* QNX */
  3387. #ifdef IRIX62
  3388. #define BPS_76K
  3389. #endif /* IRIX62 */
  3390. #ifdef SCO_OSR504
  3391. #define BPS_76K
  3392. #endif /* SCO_OSR504 */
  3393. #endif /* NOB_76K */
  3394.  
  3395. #ifndef NOB_115K
  3396. #ifdef BSDI2
  3397. #define BPS_115K
  3398. #endif /* BSDI2 */
  3399. #ifdef Plan9
  3400. #define BPS_115K
  3401. #endif /* Plan9 */
  3402. #ifdef SOLARIS25
  3403. #define BPS_115K
  3404. #endif /* SOLARIS25 */
  3405. #ifdef VMS
  3406. #define BPS_115K            /* 115200 bps */
  3407. #else
  3408. #ifdef QNX
  3409. #define BPS_115K
  3410. #else
  3411. #ifdef HPUX
  3412. #define BPS_115K
  3413. #else
  3414. #ifdef __linux__
  3415. #define BPS_115K
  3416. #else
  3417. #ifdef __386BSD__
  3418. #define BPS_115K
  3419. #else
  3420. #ifdef __FreeBSD__
  3421. #define BPS_115K
  3422. #else
  3423. #ifdef __NetBSD__
  3424. #define BPS_115K
  3425. #else
  3426. #ifdef OS2
  3427. #ifdef __32BIT__
  3428. #define BPS_115K
  3429. #endif /* __32BIT__ */
  3430. #else
  3431. #ifdef BEBOX
  3432. #define BPS_115K
  3433. #else
  3434. #ifdef IRIX62
  3435. #define BPS_115K
  3436. #else
  3437. #ifdef SCO_OSR504
  3438. #define BPS_115K
  3439. #endif /* SCO_OSR504 */
  3440. #endif /* IRIX62 */
  3441. #endif /* BEBOX */
  3442. #endif /* OS2 */
  3443. #endif /* __NetBSD__ */
  3444. #endif /* __FreeBSD__ */
  3445. #endif /* __386BSD__ */
  3446. #endif /* __linux__ */
  3447. #endif /* HPUX */
  3448. #endif /* QNX */
  3449. #endif /* VMS */
  3450. #endif /* NOB_115K */
  3451.  
  3452. #ifndef NOB_230K            /* 230400 bps */
  3453. #ifdef BSDI2
  3454. #define BPS_230K
  3455. #else
  3456. #ifdef SCO_OSR504
  3457. #define BPS_230K
  3458. #else
  3459. #ifdef __linux__
  3460. #define BPS_230K
  3461. #else
  3462. #ifdef SOLARIS25
  3463. #define BPS_230K
  3464. #else
  3465. #ifdef OS2
  3466. #ifdef __32BIT__
  3467. #define BPS_230K
  3468. #endif /* __32BIT__ */
  3469. #else
  3470. #undef BPS_230K
  3471. #endif /* OS2 */
  3472. #endif /* SOLARIS25 */
  3473. #endif /* __linux__ */
  3474. #endif /* SCO_OSR504 */
  3475. #endif /* BSDI2 */
  3476. #endif /* NOB_230K */
  3477.  
  3478. #ifndef NOB_460K            /* 460800 bps */
  3479. #ifdef SCO_OSR504
  3480. #define BPS_460K
  3481. #else
  3482. #ifdef __linux__
  3483. #define BPS_460K
  3484. #else
  3485. #ifdef OS2
  3486. #ifdef __32BIT__
  3487. #define BPS_460K
  3488. #endif /* __32BIT__ */
  3489. #else
  3490. #undef BPS_460K
  3491. #endif /* __linux__ */
  3492. #endif /* SCO_OSR504 */
  3493. #endif /* OS2 */
  3494. #endif /* NOB_460K */
  3495.  
  3496. #ifndef NOB_921K            /* 921600 bps */
  3497. #ifdef SCO_OSR504
  3498. #define BPS_921K
  3499. #endif /* SCO_OSR504 */
  3500. #endif /* NOB_921K */
  3501.  
  3502. #ifdef BPS_921K                /* Maximum speed defined */
  3503. #define MAX_SPD 921600L
  3504. #else
  3505. #ifdef BPS_460K
  3506. #define MAX_SPD 460800L
  3507. #else
  3508. #ifdef BPS_230K
  3509. #define MAX_SPD 230400L
  3510. #else
  3511. #ifdef BPS_115K
  3512. #define MAX_SPD 115200L
  3513. #else
  3514. #ifdef BPS_76K
  3515. #define MAX_SPD 76800L
  3516. #else
  3517. #ifdef BPS_57K
  3518. #define MAX_SPD 57600L
  3519. #else
  3520. #ifdef BPS_38K
  3521. #define MAX_SPD 38400L
  3522. #else
  3523. #ifdef BPS_28K
  3524. #define MAX_SPD 28800L
  3525. #else
  3526. #ifdef BPS_19K
  3527. #define MAX_SPD 19200L
  3528. #else
  3529. #ifdef BPS_14K
  3530. #define MAX_SPD 14400L
  3531. #else
  3532. #define MAX_SPD 9600L
  3533. #endif
  3534. #endif
  3535. #endif
  3536. #endif
  3537. #endif
  3538. #endif
  3539. #endif
  3540. #endif
  3541. #endif
  3542. #endif
  3543. #endif /* TTSPDLIST */
  3544.  
  3545. #ifndef CONGSPD                /* Systems that can call congspd() */
  3546. #ifdef UNIX
  3547. #define CONGSPD
  3548. #endif /* UNIX */
  3549. #ifdef VMS
  3550. #define CONGSPD
  3551. #endif /* VMS */
  3552. #ifdef STRATUS
  3553. #define CONGSPD
  3554. #endif /* STRATUS */
  3555. #endif /* CONGSPD */
  3556.  
  3557. /* Types of flow control available */
  3558.  
  3559. #define CK_XONXOFF            /* Everybody can do this, right? */
  3560.  
  3561. #ifdef AMIGA                /* Commodore Amiga */
  3562. #define CK_RTSCTS            /* has RTS/CTS */
  3563. #endif /* AMIGA */
  3564.  
  3565. #ifdef SUN4S5                /* SunOS in System V environment */
  3566. #define CK_RTSCTS
  3567. #else                    /* SunOS 4.0/4.1 in BSD environment */
  3568. #ifdef SUNOS4                /* SunOS 4.0+later supports RTS/CTS */
  3569. #ifdef SUNOS41                /* Easy in 4.1 and later */
  3570. #define CK_RTSCTS
  3571. #else                    /* Harder in 4.0 */
  3572. #ifndef __GNUC__            /* (see tthflow() in ckutio.c) */
  3573. #ifndef GNUC
  3574. #define CK_RTSCTS            /* Only if not using GNU gcc */
  3575. #endif /* __GNUC__ */
  3576. #endif /* GNUC */
  3577. #endif /* SUNOS41 */
  3578. #endif /* SUNOS4 */
  3579. #endif /* SUN4S5 */
  3580.  
  3581. #ifdef BSD44                /* And in 4.4 BSD, including BSDI */
  3582. #define CK_RTSCTS
  3583. #endif /* BSD44 */
  3584.  
  3585. #ifdef TERMIOX                /* Sys V R4 <termiox.h> */
  3586. #ifndef CK_RTSCTS
  3587. #define CK_RTSCTS
  3588. #endif /* CK_RTSCTS */
  3589. #ifndef CK_DTRCD
  3590. #define CK_DTRCD
  3591. #endif /* CK_DTRCD */
  3592. #else
  3593. #ifdef STERMIOX                /* Sys V R4 <sys/termiox.h> */
  3594. #ifndef CK_RTSCTS
  3595. #define CK_RTSCTS
  3596. #endif /* CK_RTSCTS */
  3597. #ifndef CK_DTRCD
  3598. #define CK_DTRCD
  3599. #endif /* CK_DTRCD */
  3600. #endif /* STERMIOX */
  3601. #endif /* TERMIOX */
  3602.  
  3603. #ifdef OXOS                /* Olivetti X/OS R2 struct termios */
  3604. #define CK_RTSCTS            /* Ditto. */
  3605. #define CK_DTRCD
  3606. #endif /* OXOS */
  3607.  
  3608. #ifdef AIXRS                /* RS/6000 with AIX 3.x */
  3609. #define CK_RTSCTS            /* Has its own peculiar method... */
  3610. #endif /* AIXRS */
  3611.  
  3612. #ifdef __linux__            /* Linux */
  3613. #define CK_RTSCTS
  3614. #endif /* __linux__ */
  3615. /*
  3616.   Hardware flow control is not defined in POSIX.1.  Nevertheless, a certain
  3617.   style API for hardware flow control, using tcsetattr() and the CRTSCTS
  3618.   bit(s), seems to be gaining currency on POSIX-based UNIX systems.  The
  3619.   following code defines the symbol POSIX_CRTSCTS for such systems.
  3620. */
  3621. #ifdef CK_RTSCTS
  3622. #ifdef __bsdi__                /* BSDI, a.k.a. BSD/386 */
  3623. #define POSIX_CRTSCTS
  3624. #endif /* __bsdi__ */
  3625. #ifdef __linux__            /* Linux */
  3626. #define POSIX_CRTSCTS
  3627. #endif /* __linux__ */
  3628. #ifdef __NetBSD__            /* NetBSD */
  3629. #define POSIX_CRTSCTS
  3630. #endif /* __NetBSD__ */
  3631. #ifdef BEBOX                /* BeBOX */
  3632. #define POSIX_CRTSCTS
  3633. /* BEBOX defines CRTSFL as (CTSFLOW & RTSFLOW) */
  3634. #define CRTSCTS CRTSFL
  3635. #endif /* BEBOX */
  3636. #ifdef IRIX52                /* IRIX 5.2 and later */
  3637. #define POSIX_CRTSCTS
  3638. #define CRTSCTS CNEW_RTSCTS        /* See <sys/termios.h> */
  3639. #endif /* IRIX52 */
  3640. #endif /* CK_RTSCTS */
  3641.  
  3642. /* Implementations that have implemented the ttsetflow() function. */
  3643.  
  3644. #ifndef CK_TTSETFLOW
  3645. #ifdef UNIX
  3646. #define CK_TTSETFLOW
  3647. #endif /* UNIX */
  3648. #ifdef OS2
  3649. #define CK_TTSETFLOW
  3650. #endif /* OS2 */
  3651. #endif /* CK_TTSETFLOW */
  3652.  
  3653. #ifdef CK_TTSETFLOW
  3654. _PROTOTYP( int ttsetflow, (int) );
  3655. #endif /* CK_TTSETFLOW */
  3656. /*
  3657.  Systems where we can expand tilde at the beginning of file or directory names
  3658. */
  3659. #ifdef POSIX
  3660. #ifndef DTILDE
  3661. #define DTILDE
  3662. #endif /* DTILDE */
  3663. #endif /* POSIX */
  3664. #ifdef BSD4
  3665. #ifndef DTILDE
  3666. #define DTILDE
  3667. #endif /* DTILDE */
  3668. #endif /* BSD4 */
  3669. #ifdef ATTSV
  3670. #ifndef DTILDE
  3671. #define DTILDE
  3672. #endif /* DTILDE */
  3673. #endif /* ATTSV */
  3674. #ifdef OSK
  3675. #ifndef DTILDE
  3676. #define DTILDE
  3677. #endif /* DTILDE */
  3678. #endif /* OSK */
  3679. #ifdef HPUX                /* I don't know why this is */
  3680. #ifndef DTILDE                /* necessary, since -DHPUX */
  3681. #define DTILDE                /* automatically defines ATTSV */
  3682. #endif /* DTILDE */            /* (see above) ... */
  3683. #endif /* HPUX */
  3684.  
  3685. /*
  3686.   This is mainly for the benefit of ckufio.c (UNIX and OS/2 file support).
  3687.   Systems that have an atomic rename() function, so we don't have to use
  3688.   link() and unlink().
  3689. */
  3690. #ifdef POSIX
  3691. #ifndef RENAME
  3692. #define RENAME
  3693. #endif /* RENAME */
  3694. #endif /* POSIX */
  3695.  
  3696. #ifdef OS2
  3697. #ifndef RENAME
  3698. #define RENAME
  3699. #endif /* RENAME */
  3700. #endif /* OS2 */
  3701.  
  3702. #ifdef SUNOS41
  3703. #ifndef RENAME
  3704. #define RENAME
  3705. #endif /* RENAME */
  3706. #endif /* SUNOS41 */
  3707.  
  3708. #ifdef SVR4
  3709. #ifndef RENAME
  3710. #define RENAME
  3711. #endif /* RENAME */
  3712. #endif /* SVR4 */
  3713.  
  3714. #ifdef AIXRS
  3715. #ifndef RENAME
  3716. #define RENAME
  3717. #endif /* RENAME */
  3718. #endif /* AIXRS */
  3719.  
  3720. #ifdef BSD44
  3721. #ifndef RENAME
  3722. #define RENAME
  3723. #endif /* RENAME */
  3724. #endif /* BSD44 */
  3725.  
  3726. #ifdef NORENAME                /* Allow for compile-time override */
  3727. #ifdef RENAME
  3728. #undef RENAME
  3729. #endif /* RENAME */
  3730. #endif /* NORENAME */
  3731.  
  3732. #ifdef STRATUS                /* Stratus VOS */
  3733. #ifndef RENAME
  3734. #define RENAME
  3735. #endif /* RENAME */
  3736. #endif /* STRATUS */
  3737.  
  3738. /* Line delimiter for text files */
  3739.  
  3740. /*
  3741.  If the system uses a single character for text file line delimitation,
  3742.  define NLCHAR to the value of that character.  For text files, that
  3743.  character will be converted to CRLF upon output, and CRLF will be converted
  3744.  to that character on input during text-mode (default) packet operations.
  3745. */
  3746. #ifdef MAC                              /* Macintosh */
  3747. #define NLCHAR 015
  3748. #else
  3749. #ifdef OSK                /* OS-9/68K */
  3750. #define NLCHAR 015
  3751. #else                                   /* All Unix-like systems */
  3752. #define NLCHAR 012
  3753. #endif /* OSK */
  3754. #endif /* MAC */
  3755.  
  3756. /*
  3757.  At this point, if there's a system that uses ordinary CRLF line
  3758.  delimitation AND the C compiler actually returns both the CR and
  3759.  the LF when doing input from a file, then #undef NLCHAR.
  3760. */
  3761. #ifdef OS2                /* OS/2 */
  3762. #undef NLCHAR
  3763. #endif /* OS2 */
  3764.  
  3765. #ifdef GEMDOS                /* Atari ST */
  3766. #undef NLCHAR
  3767. #endif /* GEMDOS */
  3768.  
  3769. /*
  3770.   VMS file formats are so complicated we need to do all the conversion
  3771.   work in the CKVFIO module, so we tell the rest of C-Kermit not to fiddle
  3772.   with the bytes.
  3773. */
  3774.  
  3775. #ifdef vms
  3776. #undef NLCHAR
  3777. #endif /* vms */
  3778.  
  3779. /* The device name of a job's controlling terminal */
  3780. /* Special for VMS, same for all Unixes (?), not used by Macintosh */
  3781.  
  3782. #ifdef vms
  3783. #define CTTNAM "TT:"
  3784. #else
  3785. #ifdef datageneral
  3786. #define CTTNAM "@output"
  3787. #else
  3788. #ifdef OSK
  3789. extern char myttystr[];
  3790. #define CTTNAM myttystr
  3791. #else
  3792. #ifdef OS2
  3793. #define CTTNAM "con"
  3794. #else
  3795. #ifdef UNIX
  3796. #define CTTNAM "/dev/tty"
  3797. #else
  3798. #ifdef GEMDOS
  3799. #define CTTNAM "aux:"
  3800. #else
  3801. #ifdef STRATUS
  3802. extern char myttystr[];
  3803. #define CTTNAM myttystr
  3804. #else /* Anyone else... */
  3805. #define CTTNAM "stdout"            /* This is a kludge used by Mac */
  3806. #endif /* STRATUS */
  3807. #endif /* GEMDOS */
  3808. #endif /* UNIX */
  3809. #endif /* OS2 */
  3810. #endif /* OSK */
  3811. #endif /* datageneral */
  3812. #endif /* vms */
  3813.  
  3814. #ifndef HAVECTTNAM
  3815. #ifdef UNIX
  3816. #define HAVECTTNAM
  3817. #else
  3818. #ifdef VMS
  3819. #define HAVECTTNAM
  3820. #endif /* VMS */
  3821. #endif /* UNIX */
  3822. #endif /* HAVECTTNAM */
  3823.  
  3824. #ifndef ZFCDAT                /* zfcdat() function available? */
  3825. #ifdef UNIX
  3826. #define  ZFCDAT
  3827. #else
  3828. #ifdef STRATUS
  3829. #define  ZFCDAT
  3830. #else
  3831. #ifdef GEMDOS
  3832. #define  ZFCDAT
  3833. #else
  3834. #ifdef AMIGA
  3835. #define  ZFCDAT
  3836. #else
  3837. #ifdef OS2
  3838. #define  ZFCDAT
  3839. #else
  3840. #ifdef datageneral
  3841. #define  ZFCDAT
  3842. #else
  3843. #ifdef VMS
  3844. #define  ZFCDAT
  3845. #endif /* VMS */
  3846. #endif /* datageneral */
  3847. #endif /* OS2 */
  3848. #endif /* AMIGA */
  3849. #endif /* GEMDOS */
  3850. #endif /* STRATUS */
  3851. #endif /* UNIX */
  3852. #endif /* ZFCDAT */
  3853.  
  3854. #ifdef SUNS4S5
  3855. #define tolower _tolower
  3856. #define toupper _toupper
  3857. #endif /* SUNS4S5 */
  3858.  
  3859. /* Error number */
  3860.  
  3861. #ifdef _CRAY
  3862. #ifdef _CRAYCOM                /* Cray Computer Corp. */
  3863. extern int errno;
  3864. #else /* _CRAYCOM */
  3865. #include <errno.h>            /* Cray Research UNICOS defines */
  3866.                     /* errno as a function. */
  3867. #endif /* _CRAYCOM */            /* OK for UNICOS 6.1 and 7.0. */
  3868. #else /* _CRAY */
  3869. #ifdef STRATUS                /* Stratus VOS */
  3870. #include <errno.h>
  3871. #else /* not STRATUS */
  3872. #ifndef VMS
  3873. #ifndef OS2
  3874. /*
  3875.   The following declaration causes problems for VMS and OS/2, in which
  3876.   errno is an "extern volatile int noshare"...
  3877. */
  3878. extern int errno;            /* Needed by most modules. */
  3879. #endif /* OS2 */
  3880. #endif /* VMS */
  3881. #endif /* STRATUS */
  3882. #endif /* _CRAY */
  3883.  
  3884. #ifndef NOBIGBUF
  3885. #ifndef BIGBUFOK            /* Platforms with lots of memory */
  3886.  
  3887. #ifdef BSD44
  3888. #define BIGBUFOK
  3889. #endif /* BSD44 */
  3890.  
  3891. #ifdef STRATUS                /* Stratus VOS */
  3892. #define BIGBUFOK
  3893. #endif /* STRATUS */
  3894.  
  3895. #ifdef sparc                /* SPARC processors */
  3896. #define BIGBUFOK
  3897. #endif /* sparc */
  3898.  
  3899. #ifdef mips                /* MIPS processors */
  3900. #define BIGBUFOK
  3901. #endif /* mips */
  3902.  
  3903. #ifdef HPUX9                /* HP-UX 9.x */
  3904. #define BIGBUFOK
  3905. #endif /* HPUX9 */
  3906.  
  3907. #ifdef HPUX10                /* HP-UX 10.0 PA-RISC */
  3908. #define BIGBUFOK
  3909. #endif /* HPUX10 */
  3910.  
  3911. #ifdef NEXT                /* NeXTSTEP */
  3912. #ifdef mc68000                /* on NEXT platforms... */
  3913. #define BIGBUFOK
  3914. #endif /* mc68000 */
  3915. #endif /* NEXT */
  3916.  
  3917. #ifdef LINUX                /* Linux in 1998 should be OK */
  3918. #ifndef BIGBUFOK
  3919. #define BIGBUFOK
  3920. #endif /* BIGBUFOK */
  3921. #endif /* LINUX */
  3922.  
  3923. #ifdef OS2                /* 32-bit OS/2 2.x and above */
  3924. #ifdef __32BIT__
  3925. #define BIGBUFOK
  3926. #endif /* __32BIT__ */
  3927. #ifdef NT
  3928. #define BIGBUFOK
  3929. #endif /* NT */
  3930. #endif /* OS2 */
  3931.  
  3932. #ifdef Plan9                /* Plan 9 is OK */
  3933. #define BIGBUFOK
  3934. #endif /* Plan9 */
  3935.  
  3936. #ifdef VMS                /* Any VMS is OK */
  3937. #ifndef BIGBUFOK
  3938. #define BIGBUFOK
  3939. #endif /* BIGBUFOK */
  3940. #endif /* VMS */
  3941.  
  3942. #ifdef __alpha                /* DEC 64-bit Alpha, e.g. OSF/1 */
  3943. #ifndef BIGBUFOK            /* Might already be defined for VMS */
  3944. #define BIGBUFOK
  3945. #endif /* BIGBUFOK */
  3946. #endif /* __alpha */
  3947.  
  3948. #ifdef sgi                /* SGI with IRIX 4.0 or later */
  3949. #ifndef BIGBUFOK
  3950. #define BIGBUFOK
  3951. #endif /* BIGBUFOK */
  3952. #endif /* sgi */
  3953.  
  3954. #ifdef AIXRS                /* AIX on RISC */
  3955. #define BIGBUFOK
  3956. #endif /* AIXRS */
  3957.  
  3958. #ifdef CK_SCOV5                /* SCO OSR5 */
  3959. #ifndef BIGBUFOK
  3960. #define BIGBUFOK
  3961. #endif /* BIGBUFOK */
  3962. #endif /* CK_SCOV5 */
  3963.  
  3964. #endif /* BIGBUFOK */
  3965. #endif /* NOBIGBUF */
  3966.  
  3967. #ifdef CK_SMALL
  3968. #ifdef BIGBUFOK
  3969. #undef BIGBUFOK
  3970. #endif /* BIGBUFOK */
  3971. #endif /* CK_SMALL */
  3972.  
  3973. /* If "memory is no problem" then this improves performance */
  3974.  
  3975. #ifdef DEBUG
  3976. #ifdef BIGBUFOK
  3977. #ifndef IFDEBUG
  3978. #define IFDEBUG
  3979. #endif /* IFDEBUG */
  3980. #endif /* IFDEBUG */
  3981. #endif /* DEBUG */
  3982.  
  3983. /* File System Defaults */
  3984.  
  3985. #ifndef UIDBUFLEN            /* Length of User ID */
  3986. #ifdef OS2
  3987. #define UIDBUFLEN 256
  3988. #else /* OS2 */
  3989. #ifdef BIGBUFOK
  3990. #define UIDBUFLEN 256
  3991. #else
  3992. #define UIDBUFLEN 64
  3993. #endif /* BIGBUFOK */
  3994. #endif /* OS2 */
  3995. #endif /* UIDBUFLEN */
  3996.  
  3997. #ifdef UNIX
  3998. #ifdef PROVX1
  3999. #define MAXWLD 50
  4000. #else
  4001. #ifdef pdp11
  4002. #define MAXWLD 50
  4003. #else
  4004. #ifdef BIGBUFOK
  4005. #define MAXWLD 102400
  4006. #else
  4007. #define MAXWLD 1024
  4008. #endif /* BIGBUFOK */
  4009. #endif /* pdp11 */
  4010. #endif /* PROVX1 */
  4011. #else
  4012. #ifdef VMS
  4013. #define MAXWLD 102400            /* Maximum wildcard filenames */
  4014. #else
  4015. #ifdef datageneral
  4016. #define MAXWLD 500
  4017. #else
  4018. #ifdef STRATUS
  4019. #define MAXWLD 5000
  4020. #endif /* STRATUS */
  4021. #endif /* datageneral */
  4022. #endif /* VMS */
  4023. #endif /* UNIX */
  4024.  
  4025. #ifdef VMS
  4026. #define DBLKSIZ 512
  4027. #define DLRECL 512
  4028. #else
  4029. #define DBLKSIZ 0
  4030. #define DLRECL 0
  4031. #endif /* VMS */
  4032.  
  4033. /* Communication device / network host name length */
  4034.  
  4035. #ifdef BIGBUFOK
  4036. #define TTNAMLEN 512
  4037. #else
  4038. #ifdef MAC
  4039. #define TTNAMLEN 256
  4040. #else
  4041. #ifndef CK_SMALL
  4042. #define TTNAMLEN 128
  4043. #else
  4044. #define TTNAMLEN 80
  4045. #endif /* CK_SMALL */
  4046. #endif /* MAC */
  4047. #endif /* BIGBUFOK */
  4048.  
  4049. /* Program return codes for DECUS C and UNIX (VMS uses UNIX codes) */
  4050.  
  4051. #ifdef decus
  4052. #define GOOD_EXIT   IO_NORMAL
  4053. #define BAD_EXIT    IO_ERROR
  4054. #else
  4055. #define GOOD_EXIT   0
  4056. #define BAD_EXIT    1
  4057. #endif /* decus */
  4058.  
  4059. /* Special hack for Fortune, which doesn't have <sys/file.h>... */
  4060.  
  4061. #ifdef FT18
  4062. #define FREAD 0x01
  4063. #define FWRITE 0x10
  4064. #endif /* FT18 */
  4065.  
  4066. /* Special hack for OS-9/68k */
  4067. #ifdef OSK
  4068. #ifndef _UCC
  4069. #define SIGALRM 30            /* May always cancel I/O */
  4070. #endif /* _UCC */
  4071. #define SIGARB    1234            /* Arbitrary for I/O */
  4072. SIGTYP (*signal())();
  4073. #endif /* OSK */
  4074.  
  4075. #ifdef OS2
  4076. #ifdef putchar                  /* MSC 5.1 simply uses a macro which causes */
  4077. #undef putchar                  /* no problems. */
  4078. #endif /* putchar */
  4079. #endif /* OS2 */
  4080.  
  4081. #ifdef MINIX
  4082. #ifdef putchar
  4083. #undef putchar
  4084. #endif /* putchar */
  4085. #define putchar(c) (putc(c,stdout)!=EOF)&&fflush(stdout)
  4086. #endif /* MINIX */
  4087.  
  4088. #ifdef datageneral            /* Data General AOS/VS */
  4089. #ifdef putchar
  4090. #undef putchar
  4091. #endif /* putchar */
  4092. #define putchar(c) conoc(c)
  4093. #endif /* datageneral */
  4094.  
  4095. /* Escape/quote character used by the command parser */
  4096.  
  4097. #define CMDQ '\\'
  4098.  
  4099. /* Symbols for RS-232 modem signals */
  4100.  
  4101. #define KM_FG    1            /* Frame ground */
  4102. #define KM_TXD   2            /* Transmit */
  4103. #define KM_RXD   3            /* Receive */
  4104. #define KM_RTS   4            /* Request to Send */
  4105. #define KM_CTS   5            /* Clear to Send */
  4106. #define KM_DSR   6            /* Data Set Ready */
  4107. #define KM_SG    7            /* Signal ground */
  4108. #define KM_DCD   8            /* Carrier Detect */
  4109. #define KM_DTR  20            /* Data Terminal Ready */
  4110. #define KM_RI   22            /* Ring Indication */
  4111.  
  4112. /* Bit mask values for modem signals */
  4113.  
  4114. #define BM_CTS   0001            /* Clear to send       (From DCE) */
  4115. #define BM_DSR   0002            /* Dataset ready       (From DCE) */
  4116. #define BM_DCD   0004            /* Carrier             (From DCE) */
  4117. #define BM_RNG   0010            /* Ring Indicator      (From DCE) */
  4118. #define BM_DTR   0020            /* Data Terminal Ready (From DTE) */
  4119. #define BM_RTS   0040            /* Request to Send     (From DTE) */
  4120.  
  4121. /* Codes for full duplex flow control */
  4122.  
  4123. #define FLO_NONE 0            /* None */
  4124. #define FLO_XONX 1            /* Xon/Xoff (soft) */
  4125. #define FLO_RTSC 2            /* RTS/CTS (hard) */
  4126. #define FLO_DTRC 3            /* DTR/CD (hard) */
  4127. #define FLO_ETXA 4            /* ETX/ACK (soft) */
  4128. #define FLO_STRG 5            /* String-based (soft) */
  4129. #define FLO_DIAL 6            /* DIALing kludge */
  4130. #define FLO_DIAX 7            /* Cancel dialing kludge */
  4131. #define FLO_DTRT 8            /* DTR/CTS (hard) */
  4132. #define FLO_KEEP 9            /* Keep, i.e. don't touch or change */
  4133. #define FLO_AUTO 10            /* Figure out automatically */
  4134.  
  4135. /* Types of connections */
  4136.  
  4137. #define CXT_REMOTE  0            /* Remote mode - no connection */
  4138. #define CXT_DIRECT  1            /* Direct serial connection */
  4139. #define CXT_MODEM   2            /* Modem dialout */
  4140. #define CXT_TCPIP   3            /* TCP/IP - Telnet, Rlogin, etc */
  4141. #define CXT_X25     4            /* X.25 peer-to-peer */
  4142. #define CXT_DECNET  5            /* DECnet (CTERM, etc) */
  4143. #define CXT_LAT     6            /* LAT */
  4144. #define CXT_NETBIOS 7            /* NETBIOS */
  4145. #define CXT_NPIPE   8            /* Named Pipe */
  4146. #define CXT_SSH     9            /* SSH */
  4147. #define CXT_PIPE   10            /* Pipe, Command, PTY, DLL, etc */
  4148. #define CXT_MAX    10            /* Highest connection type */
  4149.  
  4150. /* Autodownload Detection Options */
  4151.  
  4152. #define ADL_PACK 0            /* Auto-Download detect packet */
  4153. #define ADL_STR  1            /* Auto-Download detect string */
  4154.  
  4155. /* And finally... */
  4156.  
  4157. #ifdef COMMENT                /* Make sure this is NOT defined! */
  4158. #undef COMMENT
  4159. #endif /* COMMENT */
  4160.  
  4161. /* Structure definitions for Kermit file attributes */
  4162. /* All strings come as pointer and length combinations */
  4163. /* Empty string (or for numeric variables, -1) = unused attribute. */
  4164.  
  4165. struct zstr {             /* string format */
  4166.     int len;              /* length */
  4167.     char *val;            /* value */
  4168. };
  4169. struct zattr {            /* Kermit File Attribute structure */
  4170.     long lengthk;         /* (!) file length in K */
  4171.     struct zstr type;     /* (") file type (text or binary) */
  4172.     struct zstr date;     /* (#) file creation date yyyymmdd[ hh:mm[:ss]] */
  4173.     struct zstr creator;  /* ($) file creator id */
  4174.     struct zstr account;  /* (%) file account */
  4175.     struct zstr area;     /* (&) area (e.g. directory) for file */
  4176.     struct zstr password; /* (') password for area */
  4177.     long blksize;         /* (() file blocksize */
  4178.     struct zstr xaccess;  /* ()) file access: new, supersede, append, warn */
  4179.     struct zstr encoding; /* (*) encoding (transfer syntax) */
  4180.     struct zstr disp;     /* (+) disposition (mail, message, print, etc) */
  4181.     struct zstr lprotect; /* (,) protection (local syntax) */
  4182.     struct zstr gprotect; /* (-) protection (generic syntax) */
  4183.     struct zstr systemid; /* (.) ID for system of origin */
  4184.     struct zstr recfm;    /* (/) record format */
  4185.     struct zstr sysparam; /* (0) system-dependent parameter string */
  4186.     long length;          /* (1) exact length on system of origin */
  4187.     struct zstr charset;  /* (2) transfer syntax character set */
  4188. #ifdef OS2
  4189.     struct zstr longname; /* OS/2 longname if applicable */
  4190. #endif /* OS2 */
  4191.     struct zstr reply;    /* This goes last, used for attribute reply */
  4192. };
  4193.  
  4194. /* Kermit file information structure */
  4195.  
  4196. struct filinfo {
  4197.   int bs;                /* Blocksize */
  4198.   int cs;                /* Character set */
  4199.   long rl;                /* Record length */
  4200.   int org;                /* Organization */
  4201.   int fmt;                /* Record format */
  4202.   int cc;                /* Carriage control */
  4203.   int typ;                /* Type (text/binary) */
  4204.   int dsp;                /* Disposition */
  4205.   char *os_specific;            /* OS-specific attributes */
  4206. #ifdef OS2
  4207.   unsigned long int lblopts; /* LABELED FILE options bitmask */
  4208. #else
  4209.   int lblopts;
  4210. #endif /* OS2 */
  4211. };
  4212.  
  4213. #ifndef ZFNQFP                /* Versions that have zfnqfp() */
  4214. #ifdef UNIX
  4215. #define ZFNQFP
  4216. #else
  4217. #ifdef VMS
  4218. #define ZFNQFP
  4219. #else
  4220. #ifdef OS2
  4221. #define ZFNQFP
  4222. #else
  4223. #ifdef datageneral
  4224. #define ZFNQFP
  4225. #else
  4226. #ifdef STRATUS
  4227. #define ZFNQFP
  4228. #endif /* STRATUS */
  4229. #endif /* datageneral */
  4230. #endif /* OS2 */
  4231. #endif /* VMS */
  4232. #endif /* UNIX */
  4233. struct zfnfp {
  4234.    int len;
  4235.    char * fpath;
  4236.    char * fname;
  4237. };
  4238. #endif /* ZFNQFP */
  4239.  
  4240. /* Systems that support FILE TYPE LABELED */
  4241.  
  4242. #ifdef VMS
  4243. #define CK_LABELED
  4244. #else
  4245. #ifdef OS2
  4246. #ifdef __32BIT__
  4247. #ifndef NT
  4248. #define CK_LABELED
  4249. #endif /* NT */
  4250. #endif /* __32BIT__ */
  4251. #endif /* OS2 */
  4252. #endif /* VMS */
  4253.  
  4254. /* LABELED FILE options bitmask */
  4255.  
  4256. #ifdef VMS                /* For VMS */
  4257. #define LBL_NAM  1            /* Ignore incoming name if set */
  4258. #define LBL_PTH  2            /* Use complete path if set */
  4259. #define LBL_ACL  4            /* Preserve ACLs if set */
  4260. #define LBL_BCK  8            /* Preserve backup date if set */
  4261. #define LBL_OWN 16            /* Preserve ownership if set */
  4262.  
  4263. #else
  4264.  
  4265. #ifdef OS2                /* Ditto for OS/2 */
  4266. #define LBL_NOR  0x0000            /* Normal file */
  4267. #define LBL_ARC  0x0020            /* Archive */
  4268. #define LBL_DIR  0x0010            /* Directory */
  4269. #define LBL_HID  0x0002            /* Hidden file */
  4270. #define LBL_RO   0x0001            /* Read only file */
  4271. #define LBL_SYS  0x0004            /* System file */
  4272. #define LBL_EXT  0x0040            /* Extended */
  4273. #endif /* OS2 */
  4274. #endif /* VMS */
  4275.  
  4276. /*
  4277.   Data types.  First the header file for data types so we can pick up the
  4278.   types used for pids, uids, and gids.  Override this section by putting
  4279.   -DCKTYP_H=xxx on the command line to specify the header file where your
  4280.   system defines these types.
  4281. */
  4282. #ifndef STRATUS
  4283. #ifdef __ALPHA
  4284. #ifdef MULTINET
  4285. #define CK_TGV_AXP
  4286. #endif /* MULTINET */
  4287. #endif /* __ALPHA */
  4288.  
  4289. #ifdef CK_TGV_AXP            /* Alpha, VMS, MultiNet */
  4290. /*
  4291.   Starting in DECC 5.0, <stdlib.h> no longer includes <types.h>.
  4292.   But before that an elaborate workaround is required, which results in
  4293.   including <types.h> sometimes but not others, evidently depending on whether
  4294.   <types.h> protects itself against multiple inclusion, which in turn probably
  4295.   differentiates between DECC <types.h> and TGV <types.h>.  Unfortunately I
  4296.   don't remember the details.  (fdc, 25 Oct 96)
  4297. */
  4298. #ifdef COMMENT
  4299. /*
  4300.   Previously the test here was for DEC version prior to 4.0, but since the
  4301.   test involved an "#if" statement, it was not portable and broke some non-VMS
  4302.   builds.  In any case, condition was never satisfied, so the result of
  4303.   commenting this section out is the same as the previous "#if" condition.
  4304. */
  4305. #ifndef __TYPES_LOADED
  4306. #define __TYPES_LOADED            /* Work around bug in .h files */
  4307. #endif /* __TYPES_LOADED */
  4308. #endif /* COMMENT */
  4309. #include <sys/types.h>
  4310. #ifdef IF_DOT_H
  4311. #ifndef MULTINET
  4312. #include <if.h>                /* Needed to put up u_int typedef */
  4313. #endif /* MULTINET */
  4314. #else
  4315. #ifdef NEEDUINT
  4316. typedef unsigned int u_int;
  4317. #endif /* NEEDUINT */
  4318. #endif /* IF_DOT_H */
  4319. #else                    /* !CK_TGV_AXP */
  4320. #ifdef OSK                /* OS-9 */
  4321. #include <types.h>
  4322. #else                    /* General case, not OS-9 */
  4323. #ifndef CKTYP_H
  4324. #ifndef VMS
  4325. #ifndef MAC
  4326. #ifndef AMIGA
  4327. #define CKTYP_H <sys/types.h>
  4328. #endif /* AMIGA */
  4329. #endif /* MAC */
  4330. #endif /* VMS */
  4331. #endif /* CKTYP_H */
  4332.  
  4333. #ifdef GEMDOS
  4334. #undef CKTYP_H
  4335. #include <types.h>
  4336. #endif /* GEMDOS */
  4337.  
  4338. #ifdef OS2
  4339. #undef CKTYP_H
  4340. #include <sys/types.h>
  4341. #endif /* OS2 */
  4342.  
  4343. #ifdef CKTYP_H                /* Include it. */
  4344. #ifdef COHERENT                /* Except for COHERENT */
  4345. #include <unistd.h>
  4346. #include <sys/types.h>
  4347. #else
  4348. #ifdef datageneral            /* AOS/VS */
  4349. #include <sys/types.h>
  4350. #else  /* All others */
  4351. #ifdef __bsdi__                /* BSDI */
  4352. #ifdef POSIX
  4353. #undef _POSIX_SOURCE
  4354. #endif /* POSIX */
  4355. #endif /* __bsdi__ */
  4356. #include CKTYP_H
  4357. #ifdef __bsdi__
  4358. #ifdef POSIX
  4359. #define _POSIX_SOURCE
  4360. #endif /* POSIX */
  4361. #endif /* __bsdi__ */
  4362. #endif /* datageneral */
  4363. #endif /* COHERENT */
  4364. #endif /* CKTYP_H */
  4365.  
  4366. #endif /* OSK */
  4367. #endif /* CK_TGV_AXP */
  4368. #endif /* STRATUS */            /* End of types.h section */
  4369.  
  4370. /*
  4371.   Data type for pids.  If your system uses a different type, put something
  4372.   like -DPID_T=pid_t on command line, or override here.
  4373. */
  4374. #ifndef PID_T
  4375. #define PID_T int
  4376. #endif /* PID_T */
  4377. /*
  4378.   Data types for uids and gids.  Same deal as for pids.
  4379.   Wouldn't be nice if there was a preprocessor test to find out if a
  4380.   typedef existed?
  4381. */
  4382. #ifdef VMS
  4383. /* Not used in VMS so who cares */
  4384. #define UID_T int
  4385. #define GID_T int
  4386. #endif /* VMS */
  4387.  
  4388. #ifdef POSIX
  4389. /* Or would it be better (or worse?) to use _POSIX_SOURCE here? */
  4390. #ifndef UID_T
  4391. #define UID_T uid_t
  4392. #endif /* UID_T */
  4393. #ifndef GID_T
  4394. #define GID_T gid_t
  4395. #endif /* GID_T */
  4396. #else /* Not POSIX */
  4397. #ifdef SVR4
  4398. /* SVR4 and later have uid_t and gid_t. */
  4399. /* SVR3 and earlier use int, or unsigned short, or.... */
  4400. #ifndef UID_T
  4401. #define UID_T uid_t
  4402. #endif /* UID_T */
  4403. #ifndef GID_T
  4404. #define GID_T gid_t
  4405. #endif /* GID_T */
  4406. #else /* Not SVR4 */
  4407. #ifdef BSD43
  4408. #ifndef UID_T
  4409. #define UID_T uid_t
  4410. #endif /* UID_T */
  4411. #ifndef GID_T
  4412. #define GID_T gid_t
  4413. #endif /* GID_T */
  4414. #else /* Not BSD43 */
  4415. /* Default these to int for older UNIX versions */
  4416. #ifndef UID_T
  4417. #define UID_T int
  4418. #endif /* UID_T */
  4419. #ifndef GID_T
  4420. #define GID_T int
  4421. #endif /* GID_T */
  4422. #endif /* BSD43 */
  4423. #endif /* SVR4  */
  4424. #endif /* POSIX */
  4425.  
  4426. /*
  4427.   getpwuid() arg type, which is not necessarily the same as UID_T,
  4428.   e.g. in SCO UNIX SVR3, it's int.
  4429. */
  4430. #ifndef PWID_T
  4431. #define PWID_T UID_T
  4432. #endif /* PWID_T */
  4433.  
  4434. #ifdef CK_REDIR
  4435. #ifdef NEXT
  4436. #define MACHWAIT
  4437. #else
  4438. #ifdef MACH
  4439. #define MACHWAIT
  4440. #endif /* MACH */
  4441. #endif /* NEXT */
  4442.  
  4443. #ifdef MACHWAIT                /* WAIT_T argument for wait() */
  4444. #include <sys/wait.h>
  4445. #define CK_WAIT_H
  4446. typedef union wait WAIT_T;
  4447. #else
  4448. #ifdef POSIX
  4449. #include <sys/wait.h>
  4450. #define CK_WAIT_H
  4451. #ifndef WAIT_T
  4452. typedef int WAIT_T;
  4453. #endif /* WAIT_T */
  4454. #else /* !POSIX */
  4455. typedef int WAIT_T;
  4456. #endif /* POSIX */
  4457. #endif /* MACHWAIT */
  4458. #else
  4459. typedef int WAIT_T;
  4460. #endif /* CK_REDIR */
  4461.  
  4462. /* Assorted other blah_t's handled here... */
  4463.  
  4464. #ifndef SIZE_T
  4465. #define SIZE_T size_t
  4466. #endif /* SIZE_T */
  4467.  
  4468. /* Forward declarations of system-dependent functions callable from all */
  4469. /* C-Kermit modules. */
  4470.  
  4471. /* File-related functions from system-dependent file i/o module */
  4472.  
  4473. #ifndef CKVFIO_C
  4474. /* For some reason, this does not agree with DEC C */
  4475. _PROTOTYP( int zkself, (void) );
  4476. #endif /* CKVFIO_C */
  4477. _PROTOTYP( int zopeni, (int, char *) );
  4478. _PROTOTYP( int zopeno, (int, char *, struct zattr *, struct filinfo *) );
  4479. _PROTOTYP( int zclose, (int) );
  4480. #ifndef MAC
  4481. _PROTOTYP( int zchin, (int, int *) );
  4482. #endif /* MAC */
  4483. _PROTOTYP( int zsinl, (int, char *, int) );
  4484. _PROTOTYP( int zinfill, (void) );
  4485. _PROTOTYP( int zsout, (int, char*) );
  4486. _PROTOTYP( int zsoutl, (int, char*) );
  4487. _PROTOTYP( int zsoutx, (int, char*, int) );
  4488. _PROTOTYP( int zchout, (int, char) );
  4489. _PROTOTYP( int zoutdump, (void) );
  4490. _PROTOTYP( int zsyscmd, (char *) );
  4491. _PROTOTYP( int zshcmd, (char *) );
  4492. #ifdef CKEXEC
  4493. _PROTOTYP( VOID z_exec, (char *, char **, int) );
  4494. #endif /* CKEXEC */
  4495. _PROTOTYP( int chkfn, (int) );
  4496. _PROTOTYP( long zchki, (char *) );
  4497. #ifdef VMSORUNIX
  4498. _PROTOTYP( long zgetfs, (char *) );
  4499. #else
  4500. #ifdef OS2
  4501. #else
  4502. _PROTOTYP( long zgetfs, (char *) );
  4503. #define zgetfs(a) zchki(a)
  4504. #endif /* OS2 */
  4505. #endif /* VMSORUNIX */
  4506. _PROTOTYP( int iswild, (char *) );
  4507. _PROTOTYP( int isdir, (char *) );
  4508. _PROTOTYP( int zchko, (char *) );
  4509. _PROTOTYP( int zdelet, (char *) );
  4510. _PROTOTYP( VOID zrtol, (char *,char *) );
  4511. _PROTOTYP( VOID zltor, (char *,char *) );
  4512. _PROTOTYP( VOID zstrip, (char *,char **) );
  4513. #ifdef VMS
  4514. _PROTOTYP( char * zrelname, (char *, char *) );
  4515. #endif /* VMS */
  4516. _PROTOTYP( int zchdir, (char *) );
  4517. _PROTOTYP( char * zhome, (void) );
  4518. _PROTOTYP( char * zgtdir, (void) );
  4519. _PROTOTYP( int zxcmd, (int, char *) );
  4520. #ifndef MAC
  4521. _PROTOTYP( int zclosf, (int) );
  4522. #endif /* MAC */
  4523. #ifdef NZXPAND
  4524. _PROTOTYP( int nzxpand, (char *, int) );
  4525. #else /* NZXPAND */
  4526. _PROTOTYP( int zxpand, (char *) );
  4527. #endif /* NZXPAND */
  4528. _PROTOTYP( int znext, (char *) );
  4529. #ifdef ZXREWIND
  4530. _PROTOTYP( int zxrewind, (void) );
  4531. #endif /* ZXREWIND */
  4532. _PROTOTYP( int zchkspa, (char *, long) );
  4533. _PROTOTYP( VOID znewn, (char *, char **) );
  4534. _PROTOTYP( int zrename, (char *, char *) );
  4535. _PROTOTYP( int zcopy, (char *, char *) );
  4536. _PROTOTYP( int zsattr, (struct zattr *) );
  4537. _PROTOTYP( int zfree, (char *) );
  4538. _PROTOTYP( char * zfcdat, (char *) );
  4539. #ifdef HPUX10
  4540. #ifdef CK_ANSIC
  4541. _PROTOTYP( int zstime, (const char *, struct zattr *, int) );
  4542. #else
  4543. _PROTOTYP( int zstime, (char *, struct zattr *, int) );
  4544. #endif /* CK_ANSIC */
  4545. #else
  4546. _PROTOTYP( int zstime, (char *, struct zattr *, int) );
  4547. #endif /* HPUX10 */
  4548. #ifdef CK_PERMS
  4549. _PROTOTYP( char * zgperm, (char *) );
  4550. _PROTOTYP( char * ziperm, (char *) );
  4551. #endif /* CK_PERMS */
  4552. _PROTOTYP( int zmail, (char *, char *) );
  4553. _PROTOTYP( int zprint, (char *, char *) );
  4554. _PROTOTYP( char * tilde_expand, (char *) );
  4555. _PROTOTYP( int zmkdir, (char *) ) ;
  4556. _PROTOTYP( int zfseek, (long) ) ;
  4557. #ifdef ZFNQFP
  4558. _PROTOTYP( struct zfnfp * zfnqfp, (char *, int, char * ) ) ;
  4559. #else
  4560. #define zfnqfp(a,b,c) ckstrncpy(c,a,b)
  4561. #endif /* ZFNQFP */
  4562. _PROTOTYP( int zvuser, (char *) ) ;
  4563. _PROTOTYP( int zvpass, (char *) ) ;
  4564. _PROTOTYP( VOID zvlogout, (void) ) ;
  4565. #ifdef OS2
  4566. _PROTOTYP( int os2setlongname, ( char * fn, char * ln ) ) ;
  4567. _PROTOTYP( int os2getlongname, ( char * fn, char ** ln ) ) ;
  4568. _PROTOTYP( int os2rexx, ( char *, char *, int ) ) ;
  4569. _PROTOTYP( int os2rexxfile, ( char *, char *, char *, int) ) ;
  4570. _PROTOTYP( int os2geteas, (char *) ) ;
  4571. _PROTOTYP( int os2seteas, (char *) ) ;
  4572. _PROTOTYP( char * get_os2_vers, (void) ) ;
  4573. _PROTOTYP( int do_label_send, (char *) ) ;
  4574. _PROTOTYP( int do_label_recv, (void) ) ;
  4575. #ifdef OS2MOUSE
  4576. _PROTOTYP( unsigned long os2_mouseon, (void) );
  4577. _PROTOTYP( unsigned long os2_mousehide, (void) );
  4578. _PROTOTYP( unsigned long os2_mouseshow, (void) );
  4579. _PROTOTYP( unsigned long os2_mouseoff, (void) );
  4580. _PROTOTYP( void os2_mouseevt, (void *) );
  4581. #endif /* OS2MOUSE */
  4582. #endif /* OS2 */
  4583.  
  4584. /* Functions from system-dependent terminal i/o module */
  4585.  
  4586. _PROTOTYP( int ttopen, (char *, int *, int, int) );  /* tty functions */
  4587. #ifndef MAC
  4588. _PROTOTYP( int ttclos, (int) );
  4589. #endif /* MAC */
  4590. _PROTOTYP( int tthang, (void) );
  4591. _PROTOTYP( int ttres, (void) );
  4592. _PROTOTYP( int ttpkt, (long, int, int) );
  4593. #ifndef MAC
  4594. _PROTOTYP( int ttvt, (long, int) );
  4595. #endif /* MAC */
  4596. _PROTOTYP( int ttsspd, (int) );
  4597. _PROTOTYP( long ttgspd, (void) );
  4598. _PROTOTYP( int ttflui, (void) );
  4599. _PROTOTYP( int ttfluo, (void) );
  4600. _PROTOTYP( int ttpushback, (CHAR *, int) );
  4601. _PROTOTYP( int ttpeek, (void) );
  4602. _PROTOTYP( int ttgwsiz, (void) );
  4603. _PROTOTYP( int ttchk, (void) );
  4604. _PROTOTYP( int ttxin, (int, CHAR *) );
  4605. _PROTOTYP( int ttxout, (CHAR *, int) );
  4606. _PROTOTYP( int ttol, (CHAR *, int) );
  4607. _PROTOTYP( int ttoc, (char) );
  4608. _PROTOTYP( int ttinc, (int) );
  4609. _PROTOTYP( int ttscarr, (int) );
  4610. _PROTOTYP( int ttgmdm, (void) );
  4611. _PROTOTYP( int ttsndb, (void) );
  4612. _PROTOTYP( int ttsndlb, (void) );
  4613. #ifdef PARSENSE
  4614. #ifdef UNIX
  4615. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4616. #else
  4617. #ifdef VMS
  4618. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4619. #else
  4620. #ifdef STRATUS
  4621. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4622. #else
  4623. #ifdef OS2
  4624. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4625. #else
  4626. #ifdef OSK
  4627. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4628. #else
  4629. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR) );
  4630. #endif /* OSK */
  4631. #endif /* OS2 */
  4632. #endif /* STRATUS */
  4633. #endif /* VMS */
  4634. #endif /* UNIX */
  4635. #else /* ! PARSENSE */
  4636. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR) );
  4637. #endif /* PARSENSE */
  4638.  
  4639. /* XYZMODEM support */
  4640.  
  4641. /*
  4642.   CK_XYZ enables the various commands and data structures.
  4643.   XYZ_INTERNAL means these protocols are built-in; if not defined,
  4644.   then they are external.  XYZ_DLL is used to indicate a separate
  4645.   loadable library containing the XYZmodem protocol code.
  4646. */
  4647. #ifdef pdp11                /* No room for this in PDP-11 */
  4648. #define NOCKXYZ
  4649. #endif /* pdp11 */
  4650.  
  4651. #ifndef NOCKXYZ                /* Alternative protocols */
  4652. #ifndef CK_XYZ
  4653. #ifdef UNIX
  4654. #define CK_XYZ
  4655. #else
  4656. #ifdef OS2
  4657. #define CK_XYZ
  4658. #ifndef NOXYZDLL
  4659. #define XYZ_INTERNAL            /* Internal and DLL */
  4660. #define XYZ_DLL
  4661. #endif /* NOXYZDLL */
  4662. #endif /* OS2 */
  4663. #endif /* UNIX */
  4664. #endif /* CK_XYZ */
  4665. #endif /* NOCKXYZ */
  4666.  
  4667. #ifdef XYZ_INTERNAL            /* This ensures that XYZ_INTERNAL */
  4668. #ifndef CK_XYZ                /* is defined only if CK_XYZ is too */
  4669. #undef XYZ_INTERNAL
  4670. #endif /* CK_XYZ */
  4671. #endif /* XYZ_INTERNAL */
  4672. #ifdef XYZ_DLL                /* This ensures XYZ_DLL is defined */
  4673. #ifndef XYZ_INTERNAL            /* only if XYZ_INTERNAL is too */
  4674. #undef XYZ_DLL
  4675. #endif /* XYZ_INTERNAL */
  4676. #endif /* XYZ_DLL */
  4677.  
  4678. /* Console functions */
  4679.  
  4680. _PROTOTYP( int congm, (void) );
  4681. #ifdef COMMENT
  4682. _PROTOTYP( VOID conint, (SIGTYP (*)(int, int), SIGTYP (*)(int, int)) );
  4683. #else
  4684. _PROTOTYP( VOID conint, (SIGTYP (*)(int), SIGTYP (*)(int)) );
  4685. #endif /* COMMENT */
  4686. _PROTOTYP( VOID connoi, (void) );
  4687. _PROTOTYP( int concb, (char) );
  4688. #ifdef CONGSPD
  4689. _PROTOTYP( long congspd, (void) );
  4690. #endif /* CONGSPD */
  4691. _PROTOTYP( int conbin, (char) );
  4692. _PROTOTYP( int conres, (void) );
  4693. _PROTOTYP( int conoc, (char) );
  4694. _PROTOTYP( int conxo, (int, char *) );
  4695. _PROTOTYP( int conol, (char *) );
  4696. _PROTOTYP( int conola, (char *[]) );
  4697. _PROTOTYP( int conoll, (char *) );
  4698. _PROTOTYP( int conchk, (void) );
  4699. _PROTOTYP( int coninc, (int) );
  4700. _PROTOTYP( char * conkbg, (void) );
  4701. _PROTOTYP( int psuspend, (int) );
  4702. _PROTOTYP( int priv_ini, (void) );
  4703. _PROTOTYP( int priv_on, (void) );
  4704. _PROTOTYP( int priv_off, (void) );
  4705. _PROTOTYP( int priv_can, (void) );
  4706. _PROTOTYP( int priv_chk, (void) );
  4707. _PROTOTYP( int priv_opn, (char *, int) );
  4708.  
  4709. _PROTOTYP( int sysinit, (void) );    /* Misc Kermit functions */
  4710. _PROTOTYP( int syscleanup, (void) );
  4711. _PROTOTYP( int msleep, (int) );
  4712. _PROTOTYP( VOID rtimer, (void) );
  4713. _PROTOTYP( int gtimer, (void) );
  4714. #ifdef GFTIMER
  4715. _PROTOTYP( VOID rftimer, (void) );
  4716. _PROTOTYP( CKFLOAT gftimer, (void) );
  4717. #endif /* GFTIMER */
  4718. _PROTOTYP( VOID ttimoff, (void) );
  4719. _PROTOTYP( VOID ztime, (char **) );
  4720. _PROTOTYP( int parchk, (CHAR *, CHAR, int) );
  4721. _PROTOTYP( VOID doexit, (int, int) );
  4722. _PROTOTYP( int askmore, (void) );
  4723. _PROTOTYP( VOID fatal, (char *) );
  4724. _PROTOTYP( VOID fatal2, (char *, char *) );
  4725. #ifdef VMS
  4726. _PROTOTYP( int ck_cancio, (void) );
  4727. #endif /* VMS */
  4728.  
  4729. /* Key mapping support */
  4730.  
  4731. #ifdef NOICP
  4732. #ifndef NOSETKEY
  4733. #define NOSETKEY
  4734. #endif /* NOSETKEY */
  4735. #endif /* NOICP */
  4736.  
  4737. #ifdef MAC
  4738. #ifndef NOSETKEY
  4739. #define NOSETKEY
  4740. #endif /* NOSETKEY */
  4741. #endif /* MAC */
  4742.  
  4743. _PROTOTYP( int congks, (int) );
  4744. #ifndef NOSETKEY
  4745. #ifdef OS2
  4746. #define KMSIZE 8916
  4747. typedef ULONG KEY;
  4748. typedef CHAR *MACRO;
  4749. extern int wideresult;
  4750. #else /* Not OS2 */
  4751. /*
  4752.   Catch-all for systems where we don't know how to read keyboard scan
  4753.   codes > 255.  Note: CHAR (i.e. unsigned char) is very important here.
  4754. */
  4755. #define KMSIZE 256
  4756. typedef CHAR KEY;
  4757. typedef CHAR * MACRO;
  4758. #define congks coninc
  4759. #endif /* OS2 */
  4760. #endif /* NOSETKEY */
  4761.  
  4762. #ifndef NOKVERBS            /* No \Kverbs unless... */
  4763. #define NOKVERBS
  4764. #endif /* NOKVERBS */
  4765.  
  4766. #ifdef OS2                /* \Kverbs are supported in OS/2 */
  4767. #undef NOKVERBS
  4768. /*
  4769.   Note: this value chosen to be bigger than PC BIOS key modifier bits,
  4770.   but still fit in 16 bits without affecting sign.
  4771.  
  4772.   As of K95 1.1.5, this no longer fits in 16 bits, good thing we are 32 bit.
  4773. */
  4774. #define F_MACRO 0x2000          /* Bit indicating a macro indice */
  4775. #define IS_MACRO(x) (x & F_MACRO)
  4776. #define F_KVERB 0x4000            /* Bit indicating a keyboard verb */
  4777. #define IS_KVERB(x) (x & F_KVERB)    /* Test this bit */
  4778. #endif /* OS2 */
  4779.  
  4780. #define F_ESC   0x8000        /* Bit indicating ESC char combination */
  4781. #define IS_ESC(x) (x & F_ESC)
  4782. #define F_CSI   0x10000        /* Bit indicating CSI char combination */
  4783. #define IS_CSI(x) (x & F_CSI)
  4784.  
  4785. #ifdef NOSPL                /* This might be overkill.. */
  4786. #ifndef NOKVERBS            /* Not all \Kverbs require */
  4787. #define NOKVERBS            /* the script programming language. */
  4788. #endif /* NOKVERBS */
  4789. #ifndef NOTAKEARGS
  4790. #define NOTAKEARGS
  4791. #endif /* NOTAKEARGS */
  4792. #endif /* NOSPL */
  4793.  
  4794. /*
  4795.   Function prototypes for system and library functions.
  4796. */
  4797. #ifdef _POSIX_SOURCE
  4798. #ifndef VMS
  4799. #ifndef MAC
  4800. #define CK_ANSILIBS
  4801. #endif /* MAC */
  4802. #endif /* VMS */
  4803. #endif /* _POSIX_SOURCE */
  4804.  
  4805. #ifdef NEXT
  4806. #define CK_ANSILIBS
  4807. #endif /* NEXT */
  4808.  
  4809. #ifdef SVR4
  4810. #define CK_ANSILIBS
  4811. #endif /* SVR4 */
  4812.  
  4813. #ifdef STRATUS                /* Stratus VOS uses ANSI libraries */
  4814. #define CK_ANSILIBS
  4815. #endif /* STRATUS */
  4816.  
  4817. #ifdef OS2
  4818. #define CK_ANSILIBS
  4819. #ifndef NOCURSES
  4820. #define MYCURSES
  4821. #endif /* NOCURSES */
  4822. #define CK_RTSCTS
  4823. #ifdef __IBMC__
  4824. #define S_IFMT 0xF000
  4825. #define timezone _timezone
  4826. #endif /* __IBMC__ */
  4827. #include <fcntl.h>
  4828. #include <io.h>
  4829. #ifdef __EMX__
  4830. #ifndef __32BIT__
  4831. #define __32BIT__
  4832. #endif /* __32BIT__ */
  4833. #include <sys/timeb.h>
  4834. #else
  4835. #include <direct.h>
  4836. #ifdef OS2
  4837. #undef SIGALRM
  4838. #endif /* OS2 */
  4839. #ifndef SIGUSR1
  4840. #define SIGUSR1 7
  4841. #endif /* SIGUSR1 */
  4842. #define SIGALRM SIGUSR1
  4843. _PROTOTYP( unsigned alarm, (unsigned) );
  4844. _PROTOTYP( unsigned sleep, (unsigned) );
  4845. #endif /* __EMX__ */
  4846. #ifdef OS2
  4847. _PROTOTYP( unsigned long zdskspace, (int) );
  4848. #else
  4849. _PROTOTYP( long zdskspace, (int) );
  4850. #endif /* OS2 */
  4851. _PROTOTYP( int zchdsk, (int) );
  4852. _PROTOTYP( int conincraw, (int) );
  4853. _PROTOTYP( int ttiscom, (int f) );
  4854. _PROTOTYP( int IsFileNameValid, (char *) );
  4855. _PROTOTYP( void ChangeNameForFAT, (char *) );
  4856. _PROTOTYP( char *GetLoadPath, (void) );
  4857. #endif /* OS2 */
  4858.  
  4859. /* Fullscreen file transfer display items... */
  4860.  
  4861. #ifndef NOCURSES
  4862. #ifdef CK_NCURSES            /* CK_NCURSES implies CK_CURSES */
  4863. #ifndef CK_CURSES
  4864. #define CK_CURSES
  4865. #endif /* CK_CURSES */
  4866. #endif /* CK_NCURSES */
  4867.  
  4868. #ifdef MYCURSES                /* MYCURSES implies CK_CURSES */
  4869. #ifndef CK_CURSES
  4870. #define CK_CURSES
  4871. #endif /* CK_CURSES */
  4872. #endif /* MYCURSES */
  4873. #endif /* NOCURSES */
  4874.  
  4875. #ifdef NOCURSES
  4876. #ifdef CK_CURSES
  4877. #undef CK_CURSES
  4878. #endif /* CK_CURSES */
  4879. #ifndef NODISPLAY
  4880. #define NODISPLAY
  4881. #endif /* NODISPLAY */
  4882. #endif /* NOCURSES */
  4883.  
  4884. #ifdef CK_CURSES
  4885. /*
  4886.   The CK_WREFRESH symbol is defined if the curses library provides
  4887.   clearok() and wrefresh() functions, which are used in repainting
  4888.   the screen.
  4889. */
  4890. #ifdef NOWREFRESH            /* Override CK_WREFRESH */
  4891.  
  4892. #ifdef CK_WREFRESH            /* If this is defined, */
  4893. #undef CK_WREFRESH            /* undefine it. */
  4894. #endif /* CK_WREFRESH */
  4895.  
  4896. #else /* !NOWREFRESH */            /* No override... */
  4897.  
  4898. #ifndef CK_WREFRESH            /* If CK_WREFRESH not defined */
  4899. /*
  4900.   Automatically define it for systems known to have it ...
  4901. */
  4902. #ifdef VMS                /* DEC (Open)VMS has it */
  4903. #define CK_WREFRESH
  4904. #else
  4905. #ifdef ultrix                /* DEC ULTRIX has it */
  4906. #else
  4907. #ifdef SVR3                /* System V has it */
  4908. #define CK_WREFRESH
  4909. #else
  4910. #ifdef BSD44                /* 4.4 BSD has it */
  4911. #define CK_WREFRESH
  4912. #else
  4913. #ifdef NEXT                /* Define it for NeXTSTEP */
  4914. #define CK_WREFRESH
  4915. #else
  4916. #ifdef SUNOS4                /* SunOS 4.x... */
  4917. #define CK_WREFRESH
  4918. #else
  4919. #ifdef SOLARIS25            /* Solaris 2.5 and later */
  4920. #define CK_WREFRESH
  4921. #else
  4922. #ifdef AIXRS                /* RS/6000 AIX ... */
  4923. #define CK_WREFRESH
  4924. #else
  4925. #ifdef RTAIX                /* RT PC AIX ... */
  4926. #define CK_WREFRESH
  4927. #else
  4928. #ifdef OSF                /* DEC OSF/1 ... */
  4929. #define CK_WREFRESH
  4930.  
  4931. /* Add more here, or just define CK_WREFRESH on the CC command line... */
  4932.  
  4933. #endif /* OSF */
  4934. #endif /* RTAIX */
  4935. #endif /* AIXRS */
  4936. #endif /* SOLARIS25 */
  4937. #endif /* SUNOS4 */
  4938. #endif /* NEXT */
  4939. #endif /* BSD44 */
  4940. #endif /* SVR3 */
  4941. #endif /* ultrix */
  4942. #endif /* VMS */
  4943.  
  4944. #else /* CK_WREFRESH is defined */
  4945.  
  4946. #ifndef CK_CURSES            /* CK_WREFRESH implies CK_CURSES */
  4947. #define CK_CURSES
  4948. #endif /* CK_CURSES */
  4949.  
  4950. #endif /* CK_WREFRESH */
  4951. #endif /* NOWREFRESH */
  4952.  
  4953. #ifndef TRMBUFL
  4954. #ifdef BIGBUFOK
  4955. #define TRMBUFL 16384
  4956. #else
  4957. #ifdef DYNAMIC
  4958. #define TRMBUFL 8192
  4959. #else
  4960. #define TRMBUFL 1024
  4961. #endif /* BIGBUFOK */
  4962. #endif /* DYNAMIC */
  4963. #endif /* TRMBUFL */
  4964. #endif /* CK_CURSES */
  4965.  
  4966. /*
  4967.   Whether to use ckmatch() in all its glory for pretty much full regexes.
  4968.   If CKREGEX is NOT defined, all but * and ? matching are removed from
  4969.   ckmatch().  NOTE: Defining CKREGEX does not necessarily mean that ckmatch()
  4970.   regexes are used for filename matching.  That depends on whether zxpand()
  4971.   in ck?fio.c calls ckmatch().
  4972. */
  4973. #ifndef NOCKREGEX
  4974. #ifndef CKREGEX
  4975. #define CKREGEX
  4976. #endif /* CKREGEX */
  4977. #endif /* NOCKREGEX */
  4978.  
  4979. #ifdef CK_ANSILIBS
  4980. /*
  4981.   String library functions.
  4982.   For ANSI C, get prototypes from <string.h>.
  4983.   Otherwise, skip the prototypes.
  4984. */
  4985. #include <string.h>
  4986.  
  4987. /*
  4988.   Prototypes for other commonly used library functions, such as
  4989.   malloc, free, getenv, atol, atoi, and exit.  Otherwise, no prototypes.
  4990. */
  4991. #include <stdlib.h>
  4992. #ifdef DIAB /* DIAB DS90 */
  4993. /* #include <commonC.h>  */
  4994. #include <sys/wait.h>
  4995. #define CK_WAIT_H
  4996. #ifdef COMMENT
  4997. extern void exit(int status);
  4998. extern void _exit(int status);
  4999. extern int uname(struct utsname *name);
  5000. #endif /* COMMENT */
  5001. extern int chmod(char *path, int mode);
  5002. extern int ioctl(int fildes, int request, ...);
  5003. extern int rdchk(int ttyfd);
  5004. extern int nap(int m);
  5005. #ifdef COMMENT
  5006. extern int getppid(void);
  5007. #endif /* COMMENT */
  5008. extern int _filbuf(FILE *stream);
  5009. extern int _flsbuf(char c,FILE *stream);
  5010. #endif /* DIAB */
  5011.  
  5012. /*
  5013.   Prototypes for UNIX functions like access, alarm, chdir, sleep, fork,
  5014.   and pause.  Otherwise, no prototypes.
  5015. */
  5016. #ifdef VMS
  5017. #include <unixio.h>
  5018. #endif /* VMS */
  5019.  
  5020. #ifdef NEXT
  5021. #ifndef NEXT33
  5022. #include <libc.h>
  5023. #endif /* NEXT33 */
  5024. #else  /* NoT NeXT */
  5025. #ifndef AMIGA
  5026. #ifndef OS2
  5027. #ifdef STRATUS
  5028. #include <c_utilities.h>
  5029. #else /* !STRATUS */
  5030. #include <unistd.h>
  5031. #ifdef HAVE_CRYPT_H
  5032. #include <crypt.h>
  5033. #endif /* HAVE_CRYPT_H */
  5034. #endif /* STRATUS */
  5035. #endif /* OS2 */
  5036. #endif /* AMIGA */
  5037. #endif /* NEXT */
  5038.  
  5039. #else /* Not ANSI libs... */
  5040.  
  5041. #ifdef MAC
  5042. #include <String.h>
  5043. #include <StdLib.h>
  5044. #endif /* MAC */
  5045.  
  5046. #ifdef HPUX
  5047. #ifndef HPUXPRE65
  5048. #include <unistd.h>
  5049. #endif /* HPUXPRE65 */
  5050. #endif /* HPUX */
  5051.  
  5052. #ifdef SUNOS41
  5053. #include <unistd.h>
  5054. #include <stdlib.h>
  5055. #else
  5056. #ifndef MAC
  5057. /*
  5058.   It is essential that these are declared correctly!
  5059.   Which is not always easy.  Take malloc() for instance ...
  5060. */
  5061. #ifdef PYRAMID
  5062. #ifdef SVR4
  5063. #ifdef __STDC__
  5064. #define SIZE_T_MALLOC
  5065. #endif /* __STDC__ */
  5066. #endif /* SVR4 */
  5067. #endif /* PYRAMID */
  5068. /*
  5069.   Maybe some other environments need the same treatment for malloc.
  5070.   If so, define SIZE_T_MALLOC for them here or in compiler CFLAGS.
  5071. */
  5072. #ifdef SIZE_T_MALLOC
  5073. _PROTOTYP( void * malloc, (size_t) );
  5074. #else
  5075. _PROTOTYP( char * malloc, (unsigned int) );
  5076. #endif /* SIZE_T_MALLOC */
  5077.  
  5078. _PROTOTYP( char * getenv, (char *) );
  5079. _PROTOTYP( long atol, (char *) );
  5080. #endif /* !MAC */
  5081. #endif /* SUNOS41 */
  5082. #endif /* CK_ANSILIBS */
  5083.  
  5084. #ifndef NULL                /* In case NULL is still not defined */
  5085. #define NULL 0L
  5086. /* or #define NULL 0 */
  5087. /* or #define NULL ((char *) 0) */
  5088. /* or #define NULL ((void *) 0) */
  5089. #endif /* NULL */
  5090.  
  5091. /* Maximum length for a fully qualified filename, not counting \0 at end. */
  5092. /*
  5093.   This is a rough cut, and errs on the side of being too big.  We don't
  5094.   want to pull in hundreds of header files looking for many and varied
  5095.   symbols, for fear of introducing unnecessary conflicts.
  5096. */
  5097. #ifndef CKMAXPATH
  5098. #ifdef MAXPATHLEN            /* (it probably isn't) */
  5099. #define CKMAXPATH MAXPATHLEN
  5100. #else
  5101. #ifdef MAC
  5102. #define CKMAXPATH 63
  5103. #else
  5104. #ifdef pdp11
  5105. #define CKMAXPATH 255
  5106. #else
  5107. #ifdef UNIX                /* Even though some are way less... */
  5108. #define CKMAXPATH 1023
  5109. #else
  5110. #ifdef VMS
  5111. #define CKMAXPATH 675            /* (derivation is complicated...) */
  5112. #else
  5113. #ifdef STRATUS
  5114. #define CKMAXPATH 256            /* == $MXPL from PARU.H */
  5115. #else
  5116. #ifdef datageneral
  5117. #define CKMAXPATH 256            /* == $MXPL from PARU.H */
  5118. #else
  5119. #define CKMAXPATH 255
  5120. #endif /* STRATUS */
  5121. #endif /* datageneral */
  5122. #endif /* VMS */
  5123. #endif /* UNIX */
  5124. #endif /* pdp11 */
  5125. #endif /* MAC */
  5126. #endif /* MAXPATHLEN */
  5127. #endif /* CKMAXPATH */
  5128.  
  5129. #ifndef CKMAXOPEN
  5130. #ifdef QNX
  5131. #define CKMAXOPEN 390
  5132. #else
  5133. #ifdef VMS
  5134. #define CKMAXOPEN 64
  5135. #else
  5136. #ifdef OPEN_MAX
  5137. #define CKMAXOPEN OPEN_MAX
  5138. #else
  5139. #ifdef FOPEN_MAX
  5140. #define CKMAXOPEN FOPEN_MAX
  5141. #else
  5142. #define CKMAXOPEN 64
  5143. #endif /* FOPEN_MAX */
  5144. #endif /* OPEN_MAX */
  5145. #endif /* VMS */
  5146. #endif /* QNX */
  5147. #endif /* CKMAXOPEN */
  5148.  
  5149. /* Maximum channels for FOPEN = CKMAXOPEN minus logs, stdio, etc */
  5150.  
  5151. #ifndef Z_MINCHAN
  5152. #define Z_MINCHAN 16
  5153. #endif /* Z_MINCHAN */
  5154.  
  5155. #ifndef Z_MAXCHAN
  5156. #define Z_MAXCHAN (CKMAXOPEN-ZNFILS-5)
  5157. #endif /* Z_MAXCHAN */
  5158.  
  5159. /* New-format nzltor() and nzrtol() functions that handle pathnames */
  5160.  
  5161. #ifndef NZLTOR
  5162. #ifdef UNIX
  5163. #define NZLTOR
  5164. #else
  5165. #ifdef VMS
  5166. #define NZLTOR
  5167. #else
  5168. #ifdef OS2
  5169. #define NZLTOR
  5170. #else
  5171. #ifdef STRATUS
  5172. #define NZLTOR
  5173. #endif /* STRATUS */
  5174. #endif /* OS2 */
  5175. #endif /* VMS */
  5176. #endif /* UNIX */
  5177. #endif /* NZLTOR */
  5178.  
  5179. #ifdef NZLTOR
  5180. _PROTOTYP( VOID nzltor, (char *, char *, int, int, int) );
  5181. _PROTOTYP( VOID nzrtol, (char *, char *, int, int, int) );
  5182. #endif /* NZLTOR */
  5183.  
  5184. /* Implementations with a zrmdir() function */
  5185.  
  5186. #ifndef ZRMDIR
  5187. #ifdef OS2
  5188. #define ZRMDIR
  5189. #else /* OS2 */
  5190. #ifdef UNIX
  5191. #define ZRMDIR
  5192. #else
  5193. #ifdef VMS
  5194. #define ZRMDIR
  5195. #else /* VMS */
  5196. #ifdef STRATUS
  5197. #define ZRMDIR
  5198. #endif /* STRATUS */
  5199. #endif /* VMS */
  5200. #endif /* UNIX */
  5201. #endif /* OS2 */
  5202. #endif /* ZRMDIR */
  5203.  
  5204. #ifdef ZRMDIR
  5205. _PROTOTYP( int zrmdir, (char *) );
  5206. #endif /* ZRMDIR */
  5207.  
  5208. #ifndef FILECASE
  5209. #ifdef UNIXOROSK
  5210. #define FILECASE 1
  5211. #else
  5212. #define FILECASE 0
  5213. #endif /* UNIXOROSK */
  5214. #ifndef CKCMAI
  5215. extern int filecase;
  5216. #endif /* CKCMAI */
  5217. #endif /* FILECASE */
  5218.  
  5219. /* Funny names for library functions department... */
  5220.  
  5221. #ifdef ZILOG
  5222. #define setjmp setret
  5223. #define longjmp longret
  5224. #define jmp_buf ret_buf
  5225. #define getcwd curdir
  5226. #endif /* ZILOG */
  5227.  
  5228. #ifdef STRATUS
  5229. /* The C-runtime conflicts with things we do in Stratus VOS ckltio.c ... */
  5230. #define printf vosprtf
  5231. _PROTOTYP( int vosprtf, (char *fmt, ...) );
  5232. #define perror(txt) printf("%s\n", txt)
  5233. /* char_varying is a string type from PL/I that VOS uses extensively */
  5234. #define CV char_varying
  5235. #endif /* STRATUS */
  5236.  
  5237. #ifdef NT
  5238. extern int OSVer;
  5239. #define isWin95() (OSVer==VER_PLATFORM_WIN32_WINDOWS)
  5240. #else
  5241. #define isWin95() (0)
  5242. #endif /* NT */
  5243.  
  5244. #ifndef BPRINT
  5245. #ifdef OS2
  5246. #define BPRINT
  5247. #endif /* OS2 */
  5248. #endif /* BPRINT */
  5249.  
  5250. #ifndef SESLIMIT
  5251. #ifdef OS2
  5252. #define SESLIMIT
  5253. #endif /* OS2 */
  5254. #endif /* SESLIMIT */
  5255.  
  5256. #ifndef PCTERM
  5257. #ifdef NT
  5258. #define PCTERM
  5259. #endif /* NT */
  5260. #endif /* PCTERM */
  5261.  
  5262. #ifdef BEBOX
  5263. #define query ckquery
  5264. #endif /* BEBOX */
  5265.  
  5266. #ifdef NETCONN                /* Special "network" types... */
  5267. #ifdef OS2
  5268. #ifndef NETFILE
  5269. #define NETFILE
  5270. #endif /* NETFILE */
  5271. #ifndef NOPUSH
  5272. #ifndef NETCMD
  5273. #define NETCMD
  5274. #endif /* NETCMD */
  5275. #endif /* NOPUSH */
  5276. #ifdef NT
  5277. #ifndef NETDLL
  5278. #define NETDLL
  5279. #endif /* NETDLL */
  5280. #ifndef SSH
  5281. #define SSH
  5282. #endif /* SSH */
  5283. #endif /* NT */
  5284. #endif /* OS2 */
  5285. #endif /* NETCONN */
  5286.  
  5287. #ifndef PTYORPIPE            /* NETCMD and/or NETPTY defined */
  5288. #ifdef NETCMD
  5289. #define PTYORPIPE
  5290. #else
  5291. #ifdef NETPTY
  5292. #define PTYORPIPE
  5293. #endif /* NETPTY */
  5294. #endif /* NETCMD */
  5295. #endif /* PTYORPIPE */
  5296.  
  5297. /* Platforms that have memcpy() -- only after all headers included */
  5298.  
  5299. #ifndef USE_MEMCPY
  5300. #ifdef VMS
  5301. #define USE_MEMCPY
  5302. #else
  5303. #ifdef NEXT
  5304. #define USE_MEMCPY
  5305. #else
  5306. #ifdef OS2
  5307. #define USE_MEMCPY
  5308. #else
  5309. #ifdef __linux__
  5310. #define USE_MEMCPY
  5311. #else
  5312. #ifdef SOLARIS
  5313. #define USE_MEMCPY
  5314. #else
  5315. #ifdef SUNOS4
  5316. #define USE_MEMCPY
  5317. #else
  5318. #ifdef AIXRS
  5319. #define USE_MEMCPY
  5320. #else
  5321. #ifdef HPUX
  5322. #define USE_MEMCPY
  5323. #else
  5324. #ifdef POSIX
  5325. #define USE_MEMCPY
  5326. #else
  5327. #ifdef SVR4
  5328. #define USE_MEMCPY
  5329. #else
  5330. #ifdef OSF
  5331. #define USE_MEMCPY
  5332. #else
  5333. #ifdef datageneral
  5334. #define USE_MEMCPY
  5335. #else
  5336. #ifdef STRATUS
  5337. #define USE_MEMCPY
  5338. #endif /* STRATUS */
  5339. #endif /* datageneral */
  5340. #endif /* SVR4 */
  5341. #endif /* OSF */
  5342. #endif /* POSIX */
  5343. #endif /* HPUX */
  5344. #endif /* AIXRS */
  5345. #endif /* SUNOS */
  5346. #endif /* SOLARIS */
  5347. #endif /* __linux__ */
  5348. #endif /* OS2 */
  5349. #endif /* NEXT */
  5350. #endif /* VMS */
  5351. #endif /* USE_MEMCPY */
  5352.  
  5353. #ifndef USE_MEMCPY
  5354. #define memcpy(a,b,c) ckmemcpy((a),(b),(c))
  5355. #endif /* USE_MEMCPY */
  5356.  
  5357. /* User authentication for IKS -- So far K95 and UNIX only */
  5358.  
  5359. #ifdef NOICP
  5360. #ifndef NOLOGIN
  5361. #define NOLOGIN
  5362. #endif /* NOLOGIN */
  5363. #endif /* NOICP */
  5364.  
  5365. #ifndef NOLOGIN
  5366. #ifdef OS2ORUNIX
  5367. #define CK_LOGIN
  5368. #ifdef NT
  5369. #define NTCREATETOKEN
  5370. #endif /* NT */
  5371. #endif /* UNIX */
  5372. #endif /* NOLOGIN */
  5373.  
  5374. #ifdef OS2
  5375. #define CKSPINNER
  5376. #endif /* OS2 */
  5377.  
  5378. #ifdef CK_LOGIN                /* Telnet protocol required */
  5379. #ifndef TNCODE                /* for login to IKSD. */
  5380. #define TNCODE
  5381. #endif /* TNCODE */
  5382. #endif /* CK_LOGIN */
  5383.  
  5384. #ifdef CK_AUTHENTICATION
  5385. #ifdef NOSENDUID
  5386. #undef NOSENDUID
  5387. #endif /* NOSENDUID */
  5388. #endif /* CK_AUTHENTICAITON */
  5389.  
  5390. #ifdef TNCODE                /* Should TELNET send user ID? */
  5391. #ifndef NOSENDUID
  5392. #ifndef CKSENDUID
  5393. #define CKSENDUID
  5394. #endif /* CKSENDUID */
  5395. #endif /* NOSENDUID */
  5396. #endif /* TNCODE */
  5397.  
  5398. /* UNIX platforms that don't have getusershell() */
  5399.  
  5400. #ifdef UNIX
  5401. #ifndef NOGETUSERSHELL
  5402. #ifdef IRIX
  5403. #define NOGETUSERSHELL
  5404. #else
  5405. #ifdef PTX
  5406. #define NOGETUSERSHELL
  5407. #else
  5408. #ifdef AIXRS
  5409. #define NOGETUSERSHELL
  5410. #else
  5411. #ifdef SINIX
  5412. #define NOGETUSERSHELL
  5413. #else
  5414. #ifdef UNIXWARE
  5415. #define NOGETUSERSHELL
  5416. #else
  5417. #ifdef COHERENT
  5418. #define NOGETUSERSHELL
  5419. #endif /* COHERENT */
  5420. #endif /* UNIXWARE */
  5421. #endif /* SINIX */
  5422. #endif /* AIXRX */
  5423. #endif /* PTX */
  5424. #endif /* IRIX */
  5425. #endif /* NOGETUSERSHELL */
  5426. #endif /* UNIX */
  5427.  
  5428. #ifdef CK_LOGIN
  5429. #ifdef NT
  5430. #ifndef NOSYSLOG
  5431. #ifndef CKSYSLOG
  5432. #define CKSYSLOG
  5433. #endif /* CKSYSLOG */
  5434. #endif /* NOSYSLOG */
  5435. #endif /* NT */
  5436. #ifdef UNIX
  5437. #ifndef NOSYSLOG
  5438. #ifndef CKSYSLOG
  5439. #define CKSYSLOG
  5440. #endif /* CKSYSLOG */
  5441. #endif /* NOSYSLOG */
  5442. #ifndef NOWTMP
  5443. #ifndef CKWTMP
  5444. #define CKWTMP
  5445. #endif /* CKWTMP */
  5446. #endif /* NOWTMP */
  5447. #ifndef NOGETUSERSHELL
  5448. #ifndef GETUSERSHELL
  5449. #define GETUSERSHELL
  5450. #endif /* GETUSERSHELL */
  5451. #endif /* NOGETUSERSHELL */
  5452. #endif /* UNIX */
  5453. _PROTOTYP( int ckxlogin, (CHAR *, CHAR *, CHAR *, int));
  5454. _PROTOTYP( int ckxlogout, (VOID));
  5455. #endif /* CK_LOGIN */
  5456.  
  5457. #ifdef CKSYSLOG                /* Syslogging levels */
  5458. #define SYSLG_NO 0            /* No logging */
  5459. #define SYSLG_LI 1            /* Login/out */
  5460. #define SYSLG_DI 2            /* Dialing out */
  5461. #define SYSLG_AC 3            /* Making any kind of connection */
  5462. #define SYSLG_PR 4                      /* Protocol Operations */
  5463. #define SYSLG_FC 5            /* File creation */
  5464. #define SYSLG_FA 6            /* File reading */
  5465. #define SYSLG_CM 7            /* Top-level commands */
  5466. #define SYSLG_CX 8            /* All commands */
  5467. #define SYSLG_DB 9            /* Debug */
  5468. #define SYSLGMAX 9            /* Highest level */
  5469. #define SYSLG_DF SYSLG_FA        /* Default level */
  5470. /* Logging function */
  5471. _PROTOTYP(VOID cksyslog,(int, int, char *, char *, char *));
  5472. #endif /* CKSYSLOG */
  5473. #ifndef CKCMAI
  5474. extern int ckxlogging, ckxsyslog, ikdbopen;
  5475. #endif /* CKCMAI */
  5476.  
  5477. #ifndef CK_KEYTAB
  5478. #define CK_KEYTAB
  5479. /* Keyword Table Template */
  5480.  
  5481. /* Note: formerly defined in ckucmd.h but now more widely used */
  5482.  
  5483. struct keytab {                /* Keyword table */
  5484.     char *kwd;                /* Pointer to keyword string */
  5485.     int kwval;                /* Associated value */
  5486.     int flgs;                /* Flags (as defined above) */
  5487. };
  5488. #endif /* CK_KEYTAB */
  5489.  
  5490. /* Local Echo Buffer prototypes */
  5491. _PROTOTYP( VOID le_init, (void) );
  5492. _PROTOTYP( VOID le_clean, (void));
  5493. _PROTOTYP( int le_inbuf, (void));
  5494. _PROTOTYP( int le_putstr, (CHAR *));
  5495. _PROTOTYP( int le_puts, (CHAR *, int));
  5496. _PROTOTYP( int le_putchar, (CHAR));
  5497. _PROTOTYP( int le_getchar, (CHAR *));
  5498.  
  5499. #ifndef NOHTTP
  5500. #ifndef NOCMDATE2TM
  5501. #ifndef CMDATE2TM
  5502. #ifdef OS2ORUNIX
  5503. #define CMDATE2TM
  5504. #endif /* OS2ORUNIX */
  5505. #endif /* CMDATE2TM */
  5506. #endif /* NOCMDATE2TM */
  5507.  
  5508. #ifdef CMDATE2TM
  5509. _PROTOTYP( struct tm * cmdate2tm, (char *,int));
  5510. #endif /* CMDATE2TM */
  5511. #endif /* NOHTTP */
  5512.  
  5513. _PROTOTYP( int readpass, (char *, char *, int));
  5514. _PROTOTYP( int readtext, (char *, char *, int));
  5515.  
  5516. #include "ckclib.h"
  5517.  
  5518. #endif /* CKCDEB_H */
  5519.  
  5520. /* End of ckcdeb.h */
  5521.