home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv197.zip / ckcdeb.h < prev    next >
C/C++ Source or Header  |  2000-02-05  |  125KB  |  5,555 lines

  1. /*  C K C D E B . H  */
  2.  
  3. /*
  4.   Thu Dec 30 10:49:22 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. #else
  1347. #ifdef STRATUS
  1348. #define ZXREWIND
  1349. #endif /* STRATUS */
  1350. #endif /* OSK */
  1351. #endif /* datageneral */
  1352. #endif /* VMS */
  1353. #endif /* OS2ORUNIX */
  1354. #endif /* ZXREWIND */
  1355. #else
  1356. #ifdef ZXREWIND
  1357. #undef ZXREWIND
  1358. #endif /* ZXREWIND */
  1359. #endif /* NOZXREWIND */
  1360.  
  1361. /* Temporary-directory-for-RECEIVE feature ... */
  1362. /* This says whether we have the isdir() function defined. */
  1363.  
  1364. #ifdef UNIX                /* UNIX has it */
  1365. #ifndef CK_TMPDIR
  1366. #ifndef pdp11
  1367. #define CK_TMPDIR
  1368. #define TMPDIRLEN 256
  1369. #endif /* pdp11 */
  1370. #endif /* CK_TMPDIR */
  1371. #endif /* UNIX */
  1372.  
  1373. #ifdef VMS                /* VMS too */
  1374. #ifndef CK_TMPDIR
  1375. #define CK_TMPDIR
  1376. #define TMPDIRLEN 256
  1377. #endif /* CK_TMPDIR */
  1378. #endif /* VMS */
  1379.  
  1380. #ifdef OS2                /* OS two too */
  1381. #ifndef CK_TMPDIR
  1382. #define CK_TMPDIR
  1383. #define TMPDIRLEN 129
  1384. #endif /* CK_TMPDIR */
  1385. #endif /* OS2 */
  1386.  
  1387. #ifdef STRATUS                /* Stratus VOS too. */
  1388. #ifndef CK_TMPDIR
  1389. #define CK_TMPDIR
  1390. #define TMPDIRLEN 256
  1391. #endif /* CK_TMPDIR */
  1392. #endif /* STRATUS */
  1393.  
  1394. #ifdef OSK                /* OS-9 too */
  1395. #ifndef CK_TMPDIR
  1396. #define CK_TMPDIR
  1397. #define TMPDIRLEN 256
  1398. #endif /* CK_TMPDIR */
  1399. #endif /* OSK */
  1400.  
  1401. #ifdef datageneral            /* AOS/VS too */
  1402. #ifndef CK_TMPDIR
  1403. #define CK_TMPDIR
  1404. #define TMPDIRLEN 256
  1405. #endif /* CK_TMPDIR */
  1406. #endif /* datageneral */
  1407.  
  1408. #ifdef CK_TMPDIR            /* Needs command parser */
  1409. #ifdef NOICP
  1410. #undef CK_TMPDIR
  1411. #endif /* NOICP */
  1412. #endif /* CK_TMPDIR */
  1413.  
  1414. /* Whether to include <sys/time.h> */
  1415.  
  1416. #ifndef NOTIMEH                /* <time.h> */
  1417. #ifndef TIMEH
  1418. #define TIMEH
  1419. #endif /* TIMEH */
  1420. #endif /* NOTIMEH */
  1421.  
  1422. #ifndef NOSYSTIMEH            /* <sys/time.h> */
  1423. #ifndef SYSTIMEH
  1424. #ifdef UNIX                /* UNIX */
  1425. #ifdef SVORPOSIX            /* System V or POSIX... */
  1426. #ifdef M_UNIX
  1427. #define SYSTIMEH
  1428. #else
  1429. #ifdef SCO_32V4
  1430. #define SYSTIMEH
  1431. #else
  1432. #ifdef OXOS
  1433. #define SYSTIMEH
  1434. #else
  1435. #ifdef BSD44
  1436. #define SYSTIMEH
  1437. #else
  1438. #ifdef __linux__
  1439. #define SYSTIMEH
  1440. #else
  1441. #ifdef AIXRS
  1442. #ifndef AIX41
  1443. #define SYSTIMEH
  1444. #endif /* AIX41 */
  1445. #else
  1446. #ifdef IRIX60
  1447. #define SYSTIMEH
  1448. #else
  1449. #ifdef I386IX
  1450. #define SYSTIMEH
  1451. #else
  1452. #ifdef SV68R3V6
  1453. #define SYSTIMEH
  1454. #endif /* SV68R3V6 */
  1455. #endif /* I386IX */
  1456. #endif /* IRIX60 */
  1457. #endif /* AIXRS */
  1458. #endif /* __linux__ */
  1459. #endif /* BSD44 */
  1460. #endif /* OXOS */
  1461. #endif /* SCO_32V4 */
  1462. #endif /* M_UNIX */
  1463.  
  1464. #else  /* Not SVORPOSIX */
  1465.  
  1466. #ifndef BELLV10                /* All but these... */
  1467. #ifndef PROVX1
  1468. #ifndef V7
  1469. #ifndef BSD41
  1470. #ifndef COHERENT
  1471. #define SYSTIMEH
  1472. #endif /* COHERENT */
  1473. #endif /* BSD41 */
  1474. #endif /* V7 */
  1475. #endif /* PROVX1 */
  1476. #endif /* BELLV10 */
  1477. #endif /* SVORPOSIX */
  1478. #endif /* UNIX */
  1479. #endif /* SYSTIMEH */
  1480. #endif /* NOSYSTIMEH */
  1481.  
  1482. #ifndef NOSYSTIMEBH            /* <sys/timeb.h> */
  1483. #ifndef SYSTIMEBH
  1484. #ifdef OSF
  1485. #define SYSTIMEBH
  1486. #else
  1487. #ifdef COHERENT
  1488. #define SYSTIMEBH
  1489. #else
  1490. #ifdef BSD41
  1491. #define SYSTIMEBH
  1492. #else
  1493. #ifdef BSD29
  1494. #define SYSTIMEBH
  1495. #else
  1496. #ifdef TOWER1
  1497. #define SYSTIMEBH
  1498. #else
  1499. #ifdef FT21
  1500. #define SYSTIMEBH
  1501. #else
  1502. #ifdef BELLV10
  1503. #define SYSTIMEBH
  1504. #endif /* BELLV10 */
  1505. #endif /* FT21 */
  1506. #endif /* TOWER1 */
  1507. #endif /* BSD29 */
  1508. #endif /* BSD41 */
  1509. #endif /* COHERENT */
  1510. #endif /* OSF */
  1511. #endif /* SYSTIMEBH */
  1512. #endif /* NOSYSTIMEBH */
  1513.  
  1514. /*
  1515.  Debug and transaction logging is included automatically unless you define
  1516.  NODEBUG or NOTLOG.  Do this if you want to save the space and overhead.
  1517.  (Note, in version 4F these definitions changed from "{}" to the null string
  1518.  to avoid problems with semicolons after braces, as in: "if (x) tlog(this);
  1519.  else tlog(that);"
  1520. */
  1521. #ifndef NODEBUG
  1522. #ifndef DEBUG
  1523. #define DEBUG
  1524. #endif /* DEBUG */
  1525. #else
  1526. #ifdef DEBUG
  1527. #undef DEBUG
  1528. #endif /* DEBUG */
  1529. #endif /* NODEBUG */
  1530.  
  1531. #ifndef NOTLOG
  1532. #ifndef TLOG
  1533. #define TLOG
  1534. #endif /* TLOG */
  1535. #endif /* NOTLOG */
  1536.  
  1537. /* debug() macro style selection. */
  1538.  
  1539. #ifdef VMS
  1540. #ifndef IFDEBUG
  1541. #define IFDEBUG
  1542. #endif /* IFDEBUG */
  1543. #endif /* VMS */
  1544.  
  1545. #ifdef MAC
  1546. #ifndef IFDEBUG
  1547. #define IFDEBUG
  1548. #endif /* IFDEBUG */
  1549. #endif /* MAC */
  1550.  
  1551. #ifdef OS2
  1552. #ifndef IFDEBUG
  1553. #define IFDEBUG
  1554. #endif /* IFDEBUG */
  1555. #endif /* OS2 */
  1556.  
  1557. #ifdef OXOS                /* tst is faster than jsr */
  1558. #ifndef IFDEBUG
  1559. #define IFDEBUG
  1560. #endif /* IFDEBUG */
  1561. #endif /* OXOS */
  1562.  
  1563. #ifndef CKCMAI
  1564. extern int deblog;
  1565. extern int matchdot;
  1566. extern int tt_bell;
  1567. #endif /* CKCMAI */
  1568.  
  1569. #ifdef OS2
  1570. _PROTOTYP( void bleep, (short) );
  1571. #else /* OS2 */
  1572. #define bleep(x) if(tt_bell)putchar('\07')
  1573. #endif /* OS2 */
  1574.  
  1575. #ifndef DEBUG
  1576. /* Compile all the debug() statements away.  Saves a lot of space and time. */
  1577. #define debug(a,b,c,d)
  1578. #define hexdump(a,b,c)
  1579. /* Now define the debug() macro. */
  1580. #else
  1581. #ifdef IFDEBUG
  1582. /* Use this form to avoid function calls: */
  1583. #define debug(a,b,c,d) if (deblog) dodebug(a,b,(char *)(c),(long)d)
  1584. #define hexdump(a,b,c) if (deblog) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  1585. #else
  1586. /* Use this form to save space: */
  1587. #define debug(a,b,c,d) dodebug(a,b,(char *)(c),(long)d)
  1588. #define hexdump(a,b,c) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  1589. #endif /* DEBUG */
  1590.  
  1591. #ifndef BEOSORBEBOX
  1592. #ifdef BEBOX                /* This was used only for DR7 */
  1593. #define BEOSORBEBOX
  1594. #else
  1595. #ifdef BEOS                /* This is used for BeOS 4.x */
  1596. #define BEOSORBEBOX
  1597. #endif /* BEOS */
  1598. #endif /* BEBOX */
  1599. #endif /* BEOSORBEBOX */
  1600.  
  1601. _PROTOTYP(int dodebug,(int, char *, char *, long));
  1602. _PROTOTYP(VOID dohexdump,(CHAR *, CHAR *, int));
  1603. #endif /* DEBUG */
  1604.  
  1605. #ifdef NOICP
  1606. #ifdef TLOG
  1607. #undef TLOG
  1608. #endif /* TLOG */
  1609. #endif /* NOICP */
  1610.  
  1611. #ifndef TLOG
  1612. #define tlog(a,b,c,d)
  1613. #else
  1614. #ifndef CKCMAI
  1615. /* Debugging included.  Declare debug log flag in main program only. */
  1616. extern int tralog, tlogfmt;
  1617. #endif /* CKCMAI */
  1618. _PROTOTYP(VOID dotlog,(int, char *, char *, long));
  1619. #define tlog(a,b,c,d) if (tralog && tlogfmt) dotlog(a,b,c,d)
  1620. _PROTOTYP(VOID doxlog,(int, char *, long, int, int, char *));
  1621. #endif /* TLOG */
  1622.  
  1623. /* Formats for debug() and tlog() */
  1624.  
  1625. #define F000 0
  1626. #define F001 1
  1627. #define F010 2
  1628. #define F011 3
  1629. #define F100 4
  1630. #define F101 5
  1631. #define F110 6
  1632. #define F111 7
  1633.  
  1634. #ifdef __linux__
  1635. #ifndef LINUX
  1636. #define LINUX
  1637. #endif /* LINUX */
  1638. #endif /* __linux__ */
  1639.  
  1640. /* Platforms where small size is needed */
  1641.  
  1642. #ifdef pdp11
  1643. #define CK_SMALL
  1644. #endif /* pdp11 */
  1645.  
  1646. #ifdef SUNOS4                /* "built in makefile entry" */
  1647. #ifndef NOSETBUF            /* for SunOS 4.x */
  1648. #define NOSETBUF
  1649. #endif /* NOSETBUF */
  1650. #ifndef DIRENT
  1651. #define DIRENT
  1652. #endif /* DIRENT */
  1653. #ifndef NONET
  1654. #ifndef TCPSOCKET
  1655. #define TCPSOCKET
  1656. #endif /* TCPSOCKET */
  1657. #endif /* NONET */
  1658. #ifndef SAVEDUID
  1659. #define SAVEDUID
  1660. #endif /* SAVEDUID */
  1661. #ifndef DYNAMIC
  1662. #define DYNAMIC
  1663. #endif /* DYNAMIC */
  1664. #endif /* SUNOS4 */
  1665.  
  1666. #ifdef SOLARIS                /* "built in makefile entry" */
  1667. #ifndef NOSETBUF            /* for Solaris 2.x */
  1668. #define NOSETBUF
  1669. #endif /* NOSETBUF */
  1670. #ifndef NOCURSES
  1671. #ifndef CK_CURSES
  1672. #define CK_CURSES
  1673. #endif /* CK_CURSES */
  1674. #endif /* NOCURSES */
  1675. #ifndef CK_NEWTERM
  1676. #define CK_NEWTERM
  1677. #endif /* CK_NEWTERM */
  1678. #ifndef DIRENT
  1679. #define DIRENT
  1680. #endif /* DIRENT */
  1681. #ifndef TCPSOCKET
  1682. #define TCPSOCKET
  1683. #endif /* TCPSOCKET */
  1684. #ifndef SVR4
  1685. #define SVR4
  1686. #endif /* SVR4 */
  1687. #ifndef HADDRLIST
  1688. #define HADDRLIST
  1689. #endif /* HADDRLIST */
  1690. #ifndef STERMIOX
  1691. #define STERMIOX
  1692. #endif /* STERMIOX */
  1693. #ifndef SELECT
  1694. #define SELECT
  1695. #endif /* SELECT */
  1696. #ifndef DYNAMIC
  1697. #define DYNAMIC
  1698. #endif /* DYNAMIC */
  1699. #ifndef NOUUCP
  1700. #ifndef HDBUUCP
  1701. #define HDBUUCP
  1702. #endif /* HDBUUCP */
  1703. #endif /* NOUUCP */
  1704. #endif /* SOLARIS */
  1705.  
  1706. /* Can we use realpath()? */
  1707.  
  1708. #ifndef NOREALPATH
  1709. #ifdef pdp11
  1710. #define NOREALPATH
  1711. #endif /* pdp11 */
  1712. #endif /* NOREALPATH */
  1713.  
  1714. #ifndef NOREALPATH
  1715. #ifdef UNIX
  1716. #ifdef HPUX5
  1717. #define NOREALPATH
  1718. #else
  1719. #ifdef HPUX6
  1720. #define NOREALPATH
  1721. #else
  1722. #ifdef HPUX7
  1723. #define NOREALPATH
  1724. #else
  1725. #ifdef HPUX8
  1726. #define NOREALPATH
  1727. #else
  1728. #ifdef SV68R3V6
  1729. #define NOREALPATH
  1730. #else
  1731. #ifdef XENIX
  1732. #define NOREALPATH
  1733. #else
  1734. #ifdef CK_SCO32V4
  1735. #define NOREALPATH
  1736. #else
  1737. #ifdef CK_SCOV5
  1738. #define NOREALPATH
  1739. #else
  1740. #ifdef OSF32
  1741. #define NOREALPATH
  1742. #else
  1743. #ifdef OSF30
  1744. #define NOREALPATH
  1745. #else
  1746. #ifdef ultrix
  1747. #define NOREALPATH
  1748. #else
  1749. #ifdef COHERENT
  1750. #define NOREALPATH
  1751. #endif /* COHERENT */
  1752. #endif /* ultrix */
  1753. #endif /* OSF30 */
  1754. #endif /* OSF32 */
  1755. #endif /* CK_SCOV5 */
  1756. #endif /* CK_SCO32V4 */
  1757. #endif /* XENIX */
  1758. #endif /* SV68R3V6 */
  1759. #endif /* HPUX8 */
  1760. #endif /* HPUX7 */
  1761. #endif /* HPUX6 */
  1762. #endif /* HPUX5 */
  1763. #endif /* NOREALPATH */
  1764.  
  1765. #ifndef NOREALPATH
  1766. #ifndef CKREALPATH
  1767. #define CKREALPATH
  1768. #endif /* NOREALPATH */
  1769. #endif /* CKREALPATH */
  1770. #endif /* UNIX */
  1771.  
  1772. /* CKSYMLINK should be set only if we can use readlink() */
  1773.  
  1774. #ifdef UNIX
  1775. #ifndef NOSYMLINK
  1776. #ifndef CKSYMLINK
  1777. #define CKSYMLINK
  1778. #endif /* NOSYMLINK */
  1779. #endif /* CKSYMLINK */
  1780. #endif /* UNIX */
  1781.  
  1782. /* Platforms where we can use lstat() instead of stat() (for symlinks) */
  1783. /* This should be set only if both lstat() and readlink() are available */
  1784.  
  1785. #ifndef NOLSTAT
  1786. #ifndef NOSYMLINK
  1787. #ifndef USE_LSTAT
  1788. #ifdef UNIX
  1789. #ifdef CKSYMLINK
  1790. #ifdef SVR4                /* SVR4 has lstat() */
  1791. #define USE_LSTAT
  1792. #else
  1793. #ifdef BSD42                /* 4.2BSD and 4.3BSD have it */
  1794. #define USE_LSTAT            /* This should include old HPUXs */
  1795. #else
  1796. #ifdef BSD44                /* 4.4BSD has it */
  1797. #define USE_LSTAT
  1798. #else
  1799. #ifdef LINUX                /* LINUX has it */
  1800. #define USE_LSTAT
  1801. #else
  1802. #ifdef SUNOS4                /* SunOS has it */
  1803. #define USE_LSTAT
  1804. #endif /* SUNOS4 */
  1805. #endif /* LINUX */
  1806. #endif /* BSD44 */
  1807. #endif /* BSD42 */
  1808. #endif /* SVR4 */
  1809. #endif /* CKSYMLINK */
  1810. #endif /* UNIX */
  1811. #endif /* USE_LSTAT */
  1812. #endif /* NOSYMLINK */
  1813. #endif /* NOLSTAT */
  1814.  
  1815. #ifdef NOLSTAT
  1816. #ifdef USE_LSTAT
  1817. #undef USE_LSTAT
  1818. #endif /* USE_LSTAT */
  1819. #endif /* NOLSTAT */
  1820.  
  1821. #ifndef NOTTYLOCK            /* UNIX systems that have ttylock() */
  1822. #ifndef USETTYLOCK
  1823. #ifdef AIXRS                /* AIX 3.1 and later */
  1824. #define USETTYLOCK
  1825. #else
  1826. #ifdef USE_UU_LOCK            /* FreeBSD or other with uu_lock() */
  1827. #define USETTYLOCK
  1828. #endif /* USE_UU_LOCK */
  1829. #endif /* AIXRS */
  1830. #endif /* USETTYLOCK */
  1831. #endif /* NOTTYLOCK */
  1832.  
  1833. /* Kermit feature selection */
  1834.  
  1835. #ifndef NOSPL
  1836. #ifndef NOCHANNELIO            /* Channel-based file i/o package */
  1837. #ifndef CKCHANNELIO
  1838. #ifdef UNIX
  1839. #define CKCHANNELIO
  1840. #else
  1841. #ifdef OS2
  1842. #define CKCHANNELIO
  1843. #else
  1844. #ifdef VMS
  1845. #define CKCHANNELIO
  1846. #else
  1847. #ifdef STRATUS
  1848. #define CKCHANNELIO
  1849. #endif /* STRATUS */
  1850. #endif /* VMS */
  1851. #endif /* OS2 */
  1852. #endif /* UNIX */
  1853. #endif /* CKCHANNELIO */
  1854. #endif /* NOCHANNELIO */
  1855. #endif /* NOSPL */
  1856.  
  1857. #ifndef NOCKEXEC            /* EXEC command */
  1858. #ifndef NOPUSH
  1859. #ifndef CKEXEC
  1860. #ifdef UNIX                /* UNIX can do it */
  1861. #define CKEXEC
  1862. #endif /* UNIX */
  1863. #endif /* CKEXEC */
  1864. #endif /* NOPUSH */
  1865. #endif /* NOCKEXEC */
  1866.  
  1867. #ifndef NOFAST                /* Fast Kermit protocol by default */
  1868. #ifndef CK_FAST
  1869. #ifdef UNIX
  1870. #define CK_FAST
  1871. #else
  1872. #ifdef VMS
  1873. #define CK_FAST
  1874. #else
  1875. #ifdef OS2
  1876. #define CK_FAST
  1877. #endif /* OS2 */
  1878. #endif /* VMS */
  1879. #endif /* UNIX */
  1880. #endif /* CK_FAST */
  1881. #endif /* NOFAST */
  1882.  
  1883. #ifdef UNIX                /* Transparent print */
  1884. #ifndef NOXPRINT
  1885. #ifndef XPRINT
  1886. #define XPRINT
  1887. #endif /* XPRINT */
  1888. #endif /* NOXPRINT */
  1889. #endif /* UNIX */
  1890.  
  1891. #ifndef NOHWPARITY            /* Hardware parity */
  1892. #ifndef HWPARITY
  1893. #ifdef SVORPOSIX            /* System V or POSIX can have it */
  1894. #define HWPARITY
  1895. #else
  1896. #ifdef OS2                /* K95 can have it */
  1897. #define HWPARITY
  1898. #endif /* OS2 */
  1899. #endif /* SVORPOSIX */
  1900. #endif /* HWPARITY */
  1901. #endif /* NOHWPARITY */
  1902.  
  1903. #ifdef UNIX
  1904. #ifndef NETCMD                /* Can SET NETWORK TYPE COMMAND */
  1905. #define NETCMD
  1906. #endif /* NETCMD */
  1907. #endif /* UNIX */
  1908.  
  1909. /* Pty support, nonportable, available on a case-by-case basis */
  1910.  
  1911. #ifndef NOPTY
  1912. #ifdef NEXT                /* NeXTSTEP (tested on 3.1)*/
  1913. #define NETPTY
  1914. #else
  1915. #ifdef CK_SCOV5                /* SCO OSR5 (tested on 5.0.5)*/
  1916. #define NETPTY
  1917. #else
  1918. #ifdef QNX                /* QNX (tested on 4.25) */
  1919. #define NETPTY
  1920. #else
  1921. #ifdef SINIX                            /* Sinix (tested on 5.42) */
  1922. #define NETPTY
  1923. #else
  1924. #ifdef DGUX540                /* DG/UX 5.4++ (tested on 5.4R4.11) */
  1925. #define NETPTY
  1926. #else
  1927. #ifdef OSF32                /* Digital Unix 3.2 */
  1928. #define NETPTY
  1929. #else
  1930. #ifdef OSF40                /* Digital Unix 4.0 / Tru64 */
  1931. #define NETPTY
  1932. #else
  1933. #ifdef IRIX60                /* IRIX 6.0 (not earlier) */
  1934. #define NETPTY
  1935. #else
  1936. #ifdef HPUX10                /* HPUX 10.00 or later */
  1937. #define NETPTY
  1938. #ifndef HAVE_PTYTRAP
  1939. #define HAVE_PTYTRAP
  1940. #endif /* HAVE_PTYTRAP */
  1941. #else
  1942. #ifdef HPUX9                /* HPUX 9.00 (not earlier) */
  1943. #define NETPTY
  1944. #ifndef HAVE_PTYTRAP
  1945. #define HAVE_PTYTRAP
  1946. #endif /* HAVE_PTYTRAP */
  1947. #else
  1948. #ifdef BSD44                /* BSD44, {Net,Free,Open}BSD */
  1949. #define NETPTY
  1950. #else
  1951. #ifdef BSDI                /* BSDI/OS (tested in 4) */
  1952. #define NETPTY
  1953. #else
  1954. #ifdef SOLARIS                /* Solaris (tested in 2.5) */
  1955. #define NETPTY
  1956. #else
  1957. #ifdef UW7                /* Unixware 7 */
  1958. #define NETPTY
  1959. #else
  1960. #ifdef SUNOS41                /* SunOS (tested in 4.1.3) */
  1961. #define NETPTY
  1962. #else
  1963. #ifdef AIX41                /* AIX 4.1 and later */
  1964. #define NETPTY
  1965. #else
  1966. #ifdef LINUX                /* Linux */
  1967. #define NETPTY
  1968. #endif /* LINUX */
  1969. #endif /* AIX41 */
  1970. #endif /* SUNOS41 */
  1971. #endif /* UW7 */
  1972. #endif /* SOLARIS */
  1973. #endif /* BSDI */
  1974. #endif /* BSD44 */
  1975. #endif /* HPUX9 */
  1976. #endif /* HPUX10 */
  1977. #endif /* IRIX60 */
  1978. #endif /* OSF40 */
  1979. #endif /* OSF32 */
  1980. #endif /* DGUX540 */
  1981. #endif /* SINIX */
  1982. #endif /* QNX */
  1983. #endif /* CK_SCOV5 */
  1984. #endif /* NEXT */
  1985.  
  1986. #else /* NOPTY */
  1987.  
  1988. #ifdef NETPTY
  1989. #undef NETPTY
  1990. #endif /* NETPTY */
  1991. #endif /* NOPTY */
  1992.  
  1993. #ifdef NETPTY                           /* NETCMD required for NETPTY */
  1994. #ifndef NETCMD
  1995. #define NETCMD
  1996. #endif /* NETCMD */
  1997. #endif /* NETPTY */
  1998.  
  1999. #ifndef CK_UTSNAME            /* Can we call uname()? */
  2000. #ifdef VMS
  2001. #define CK_UTSNAME
  2002. #else
  2003. #ifdef OS2
  2004. #define CK_UTSNAME
  2005. #else
  2006. #ifdef POSIX                /* It's in POSIX.1 */
  2007. #define CK_UTSNAME
  2008. #else
  2009. #ifdef SUNOS41                /* It's in SunOS 4.1 */
  2010. #define CK_UTSNAME
  2011. #else
  2012. #ifdef AIXRS                /* It's in AIX */
  2013. #define CK_UTSNAME
  2014. #else
  2015. #ifdef SVR4                /* It's in SVR4 (but not SVR3) */
  2016. #define CK_UTSNAME
  2017. #else
  2018. #ifdef HPUX                /* It's in HP-UX 5.00 and later */
  2019. #define CK_UTSNAME
  2020. #else
  2021. #ifdef OSF                /* It's in OSF/1 / Digital UNIX */
  2022. #define CK_UTSNAME
  2023. #else
  2024. #ifdef CK_SCOV5
  2025. #define CK_UTSNAME
  2026. #endif /* CK_SCOV5 */
  2027. #endif /* OSF */
  2028. #endif /* HPUX */
  2029. #endif /* SVR4 */
  2030. #endif /* AIXRS */
  2031. #endif /* SUNOS41 */
  2032. #endif /* POSIX */
  2033. #endif /* OS2 */
  2034. #endif /* VMS */
  2035. #endif /* CK_UTSNAME */
  2036.  
  2037. /* This section for anything that might use floating-point */
  2038.  
  2039. /* If the following causes trouble use -DFLOAT=float on the command line */
  2040.  
  2041. #ifndef NOFLOAT
  2042.  
  2043. #ifndef CKFLOAT
  2044. #ifdef __alpha
  2045. /* Don't use double on 64-bit platforms -- bad things happen */
  2046. #define CKFLOAT float
  2047. #define CKFLOAT_S "float"
  2048. #else
  2049. #define CKFLOAT double
  2050. #define CKFLOAT_S "double"
  2051. #endif /* __alpha */
  2052. #endif /* CKFLOAT */
  2053.  
  2054. #ifndef NOGFTIMER            /* Floating-point timers */
  2055. #ifndef GFTIMER
  2056. #ifdef UNIX                /* For UNIX */
  2057. #define GFTIMER
  2058. #endif /* UNIX */
  2059. #ifdef VMS                /* VMS */
  2060. #ifndef OLD_VMS                /* 5.0 and later */
  2061. #define GFTIMER
  2062. #endif /* OLD_VMS */
  2063. #endif /* VMS */
  2064. #ifdef OS2                /* And K95 */
  2065. #define GFTIMER
  2066. #endif /* OS2 */
  2067. #ifdef STRATUS                /* And Stratus VOS */
  2068. #define GFTIMER
  2069. #endif /* STRATUS */
  2070. #endif /* GFTIMER */
  2071. #endif /* NOGFTIMER */
  2072.  
  2073. #ifdef NOSPL
  2074. #ifdef FNFLOAT
  2075. #undef FNFLOAT
  2076. #endif /* FNFLOAT */
  2077. #endif /* NOSPL */
  2078.  
  2079. #ifndef NOSPL
  2080. #ifndef FNFLOAT                /* Floating-point math functions */
  2081. #ifdef VMS                /* defined by default in VMS */
  2082. #define FNFLOAT
  2083. #else
  2084. #ifdef OS2                /* and K95 */
  2085. #define FNFLOAT
  2086. #endif /* OS2 */
  2087. #endif /* VMS */
  2088. #endif /* FNFLOAT */
  2089. #endif /* NOSPL */
  2090.  
  2091. #else  /* NOFLOAT is defined */
  2092.  
  2093. #ifdef CKFLOAT
  2094. #undef CKFLOAT
  2095. #endif /* CKFLOAT */
  2096.  
  2097. #ifdef GFTIMER
  2098. #undef GFTIMER
  2099. #endif /* GFTIMER */
  2100.  
  2101. #ifdef FNFLOAT
  2102. #undef FNFLOAT
  2103. #endif /* FNFLOAT */
  2104.  
  2105. #endif /* NOFLOAT */
  2106.  
  2107. #ifdef GFTIMER                /* Fraction of second to use when */
  2108. #ifndef GFMINTIME            /* elapsed time is <= 0 */
  2109. #define GFMINTIME 0.005
  2110. #endif /* GFMINTIME */
  2111. #endif /* GFTIMER */
  2112.  
  2113. #ifndef CKCMAI
  2114. extern long ztmsec, ztusec;        /* Fraction of sec of current time */
  2115. #endif /* CKCMAI */
  2116.  
  2117. #ifndef NOUNPREFIXZERO            /* Allow unprefixing of  NUL (0) */
  2118. #ifndef UNPREFIXZERO            /* in file-transfer packets */
  2119. #define UNPREFIXZERO
  2120. #endif /* UNPREFIXZERO */
  2121. #endif /* NOUNPREFIXZERO */
  2122.  
  2123. #ifdef CK_SMALL
  2124. #define NOCAL                /* Calibrate */
  2125. #endif /* CK_SMALL */
  2126.  
  2127. #ifndef NOPATTERNS            /* Filetype matching patterns */
  2128. #ifndef PATTERNS
  2129. #ifndef VMS
  2130. #ifndef CK_SMALL
  2131. #define PATTERNS
  2132. #endif /* CK_SMALL */
  2133. #endif /* VMS */
  2134. #endif /* PATTERNS */
  2135. #endif /* NOPATTERNS */
  2136.  
  2137. #ifndef NOCAL
  2138. #ifndef CALIBRATE
  2139. #define CALIBRATE
  2140. #endif /* CALIBRATE */
  2141. #else
  2142. #ifdef CALIBRATE
  2143. #undef CALIBRATE
  2144. #endif /* CALIBRATE */
  2145. #endif /* NOCAL */
  2146.  
  2147. #ifndef NORECURSE            /* Recursive directory traversal */
  2148. #ifndef RECURSIVE
  2149. #ifdef VMS
  2150. #define RECURSIVE
  2151. #else
  2152. #ifdef OS2ORUNIX
  2153. #ifndef CK_SMALL
  2154. #define RECURSIVE
  2155. #endif /* CK_SMALL */
  2156. #else
  2157. #ifdef STRATUS
  2158. #define RECURSIVE
  2159. #else
  2160. #ifdef OSK
  2161. #define RECURSIVE
  2162. #endif /* OSK */
  2163. #endif /* STRATUS */
  2164. #endif /* OS2ORUNIX */
  2165. #endif /* VMS */
  2166. #endif /* RECURSIVE */
  2167. #endif /* NORECURSE */
  2168.  
  2169. #ifndef CK_SMALL            /* Enable file-transfer tuning code */
  2170. #ifndef CKTUNING            /* in which more code is added */
  2171. #ifndef NOTUNING            /* to avoid function calls, etc */
  2172. #define CKTUNING
  2173. #endif /* NOTUNING */
  2174. #endif /* CKTUNING */
  2175. #endif /* CK_SMALL */
  2176.  
  2177. #ifndef NOURL                /* Parse URLs in SET HOST, etc */
  2178. #define CK_URL
  2179. #endif /* NOURL */
  2180.  
  2181. #ifndef NOTRIGGER
  2182. #ifndef CK_TRIGGER            /* Trigger string to exit CONNECT */
  2183. #ifdef OS2ORUNIX            /* OK for UNIX and K95 */
  2184. #define CK_TRIGGER
  2185. #else
  2186. #ifdef VMS                /* and VMS */
  2187. #define CK_TRIGGER
  2188. #else
  2189. #ifdef datageneral            /* and AOS/VS */
  2190. #define CK_TRIGGER
  2191. #endif /* datageneral */
  2192. #endif /* OS2ORUNIX */
  2193. #endif /* VMS */
  2194. #endif /* CK_TRIGGER */
  2195. #endif /* NOTRIGGER */
  2196.  
  2197. #ifdef CK_TRIGGER
  2198. #define TRIGGERS 8            /* How many triggers allowed */
  2199. #endif /* CK_TRIGGER */
  2200.  
  2201. #ifndef XLIMITS                /* CONNECT limits */
  2202. #ifdef OS2
  2203. #define XLIMITS
  2204. #endif /* OS2 */
  2205. #endif /* XLIMITS */
  2206.  
  2207. #ifdef NOFRILLS
  2208. #ifndef NOBROWSER
  2209. #define NOBROWSER
  2210. #endif /* NOBROWSER */
  2211. #endif /* NOFRILLS */
  2212.  
  2213. #ifndef NOHTTP                /* HTTP features need... */
  2214. #ifdef NOICP                /* an interactive command parser */
  2215. #define NOHTTP
  2216. #endif /* NOICP */
  2217. #ifndef OS2ORUNIX            /* K95 or UNIX (because of */
  2218. #define NOHTTP                /* time functions, time_t, etc) */
  2219. #endif /* OS2ORUNIX */
  2220. #endif /* NOHTTP */
  2221.  
  2222. /* The HTTP code is not very portable, so it must be asked for with -DCKHTTP */
  2223. #ifndef NONET
  2224. #ifdef TCPSOCKET
  2225. #ifndef NOHTTP
  2226. #ifndef CKHTTP
  2227. #ifdef SUNOS4                /* We can use it in SunOS */
  2228. #define CKHTTP
  2229. #endif /* SUNOS4 */
  2230. #ifdef SOLARIS                /* And in Solaris */
  2231. #define CKHTTP
  2232. #endif /* SOLARIS */
  2233. #ifdef LINUX                /* And Linux */
  2234. #define CKHTTP
  2235. #endif /* LINUX */
  2236. #ifdef HPUX10                /* And HP-UX 10 and above */
  2237. #define CKHTTP
  2238. #endif /* HPUX10 */
  2239. #ifdef OS2                /* And in K-95 */
  2240. #define CKHTTP
  2241. #endif /* OS2 */
  2242. #ifdef AIX41                /* In AIX 4.1 and higher */
  2243. #define CKHTTP
  2244. #endif /* AIX41 */
  2245. #ifdef UNIXWARE                /* In Unixware 2.1 and higher */
  2246. #define CKHTTP                /* and probably also in 1.x and 2.0 */
  2247. #endif /* UNIXWARE */
  2248. /* Add more here... */
  2249. #endif /* CKHTTP */
  2250. #ifndef CKHTTP                /* If CKHTTP not defined yet */
  2251. #define NOHTTP                /* then define HOHTTP */
  2252. #endif /* CKHTTP */
  2253. #endif /* NOHTTP */
  2254.  
  2255. #ifndef NOBROWSER
  2256. #ifdef UNIX
  2257. #ifndef BROWSER
  2258. #ifndef NOPUSH
  2259. #define BROWSER
  2260. #endif /* NOPUSH */
  2261. #endif /* BROWSER */
  2262. #endif /* UNIX */
  2263. #ifdef OS2
  2264. #ifndef BROWSER
  2265. #ifndef NOPUSH
  2266. #define BROWSER
  2267. #endif /* NOPUSH */
  2268. #endif /* BROWSER */
  2269. #endif /* OS2 */
  2270. #else
  2271. #ifdef BROWSER
  2272. #undef BROWSER
  2273. #endif /* BROWSER */
  2274. #endif /* NOBROWSER */
  2275. #endif /* TCPSOCKET */
  2276. #endif /* NONET */
  2277.  
  2278. #ifdef TCPSOCKET
  2279. #ifdef CK_SOCKS5            /* CK_SOCKS5 implies CK_SOCKS */
  2280. #ifndef CK_SOCKS
  2281. #define CK_SOCKS
  2282. #endif /* CK_SOCKS */
  2283. #endif /* CK_SOCKS5 */
  2284.  
  2285. #ifndef CK_AUTHENTICATION
  2286. #ifdef OS2
  2287. #ifdef OS2ONLY
  2288. #define NO_KERBEROS
  2289. #endif /* OS2ONLY */
  2290. #ifndef NO_KERBEROS
  2291. #define CK_KERBEROS
  2292. #define KRB4
  2293. #define KRB5
  2294. #endif /* NO_KERBEROS */
  2295. #ifndef _M_PPC
  2296. #ifndef _M_ALPHA
  2297. #ifndef NO_ENCRYPTION
  2298. #ifndef NO_SSL
  2299. #define CK_SSL
  2300. #define SSLDLL
  2301. #endif /* NO_SSL */
  2302. #endif /* NO_ENCRYPTION */
  2303. #endif /* _M_ALPHA */
  2304. #endif /* _M_PPC */
  2305. #ifndef NO_SRP
  2306. #define CK_SRP
  2307. #endif /* NO_SRP */
  2308. #define CK_AUTHENTICATION
  2309. #endif /* OS2 */
  2310. #endif /* CK_AUTHENTICATION */
  2311.  
  2312. #ifdef CK_AUTHENTICATION        /* Encryption must have Auth */
  2313. #ifndef CK_ENCRYPTION
  2314. #ifndef NO_ENCRYPTION
  2315. #ifdef OS2
  2316. #define CK_ENCRYPTION
  2317. #endif /* OS2 */
  2318. #endif /* NO_ENCRYPTION */
  2319. #endif /* CK_ENCRYPTION */
  2320. #endif /* CK_AUTHENTICATION */
  2321.  
  2322. #ifdef COMMENT
  2323. #ifndef NO_KERBEROS
  2324. #ifndef CK_KERBEROS            /* Temporary: for testing */
  2325. #ifdef UNIX                /* This enables only parsing */
  2326. #define CK_KERBEROS
  2327. #endif /* UNIX */
  2328. #endif /* CK_KERBEROS */
  2329. #endif /* NO_KERBEROS */
  2330. #endif /* COMMENT */
  2331.  
  2332. #ifdef NO_AUTHENTICATION                /* Allow authentication to be */
  2333. #ifdef CK_AUTHENTICATION                /* disabled in NT and OS/2    */
  2334. #undef CK_AUTHENTICATION
  2335. #endif /* CK_AUTHENTICATION */
  2336. #ifdef CK_KERBEROS
  2337. #undef CK_KERBEROS
  2338. #endif /* CK_KERBEROS */
  2339. #ifdef CK_SRP
  2340. #undef CK_SRP
  2341. #endif /* CK_SRP */
  2342. #ifdef CK_ENCRYPTION
  2343. #undef CK_ENCRYPTION
  2344. #endif /* CK_ENCRYPTION */
  2345. #endif /* NO_AUTHENTICATION */
  2346.  
  2347. #ifdef NO_ENCRYPTION                    /* Allow encryption to be */
  2348. #ifdef CK_ENCRYPTION                    /* disabled in NT and OS/2 */
  2349. #undef CK_ENCRYPTION
  2350. #endif /* CK_ENCRYPTION */
  2351. #endif /* NO_ENCRYPTION */
  2352.  
  2353. #ifndef OS2ORUNIX
  2354. #ifndef NOPUTENV
  2355. #define NOPUTENV
  2356. #endif /* NOPUTENV */
  2357. #endif /* OS2ORUNIX */
  2358.  
  2359. #ifndef CK_ENVIRONMENT
  2360. #ifdef OS2
  2361. #define CK_ENVIRONMENT
  2362. #else
  2363. #ifdef UNIX
  2364. #define CK_ENVIRONMENT
  2365. #else
  2366. #ifdef STRATUS
  2367. #define CK_ENVIRONMENT
  2368. #else
  2369. #ifdef VMS
  2370. #define CK_ENVIRONMENT
  2371. #endif /* VMS */
  2372. #endif /* STRATUS */
  2373. #endif /* UNIX */
  2374. #endif /* OS2 */
  2375. #endif /* CK_ENVIRONMENT */
  2376. #ifndef NOSNDLOC            /* RFC 779 SEND LOCATION */
  2377. #ifndef CK_SNDLOC
  2378. #define CK_SNDLOC
  2379. #endif /* CK_SNDLOC */
  2380. #endif /* NOSNDLOC */
  2381. #ifndef NOXDISPLOC            /* RFC 1096 XDISPLOC */
  2382. #ifndef CK_XDISPLOC
  2383. #define CK_XDISPLOC
  2384. #endif /* CK_XDISPLOC */
  2385. #endif /* NOXDISPLOC */
  2386. #ifndef NOFORWARDX
  2387. #ifndef NOPUTENV
  2388. #ifndef NOSELECT
  2389. #ifndef CK_FORWARD_X
  2390. #ifdef NT                /* EXPERIMENTAL */
  2391. #define CK_FORWARD_X
  2392. #endif /* NT */
  2393. #endif /* CK_FORWARD_X */
  2394. #endif /* NOSELECT */
  2395. #endif /* NOPUTENV */
  2396. #endif /* NOFORWARDX */
  2397. #endif /* TCPSOCKET */
  2398.  
  2399. #ifndef NOCTRLZ                /* Allow SET FILE EOF CTRL-Z */
  2400. #ifndef CK_CTRLZ
  2401. #ifdef OS2
  2402. #define CK_CTRLZ
  2403. #endif /* OS2 */
  2404. #endif /* CK_CTRLZ */
  2405. #endif /* NOCTRLZ */
  2406.  
  2407. #ifndef NOPERMS                /* File permissions in A packets */
  2408. #ifndef CK_PERMS
  2409. #ifdef UNIX
  2410. #define CK_PERMS
  2411. #else
  2412. #ifdef VMS
  2413. #define CK_PERMS
  2414. #endif /* VMS */
  2415. #endif /* UNIX */
  2416. #endif /* CK_PERMS */
  2417. #endif /* NOPERMS */
  2418. #ifdef CK_PERMS
  2419. #define CK_PERMLEN 24            /* Max length of sys-dependent perms */
  2420. #endif /* CK_PERMS */
  2421.  
  2422. #ifdef UNIX                /* NOSETBUF for everybody */
  2423. #ifndef NOSETBUF
  2424. #ifndef USE_SETBUF            /* This is the escape clause */
  2425. #define NOSETBUF
  2426. #endif /* USE_SETBUF */
  2427. #endif /* NOSETBUF */
  2428. #endif /* UNIX */
  2429.  
  2430. #ifndef USE_STRERROR            /* Whether to use strerror() */
  2431. #ifdef pdp11
  2432. #define USE_STRERROR
  2433. #endif /* pdp11 */
  2434. #endif /* USE_STRERROR */
  2435.  
  2436. #ifdef VMS                /* Features for all VMS builds */
  2437. #ifndef NOJC
  2438. #define NOJC
  2439. #endif /* NOJC */
  2440. #ifndef NOSETBUF
  2441. #define NOSETBUF
  2442. #endif /* NOSETBUF */
  2443. #ifndef DYNAMIC
  2444. #define DYNAMIC
  2445. #endif /* DYNAMIC */
  2446. #ifndef NOCURSES
  2447. #ifndef CK_CURSES
  2448. #define CK_CURSES
  2449. #endif /* CK_CURSES */
  2450. #endif /* NOCURSES */
  2451. #endif /* VMS */
  2452.  
  2453. #ifndef NOCKTIMERS            /* Dynamic timeouts */
  2454. #ifndef CK_TIMERS
  2455. #define CK_TIMERS
  2456. #endif /* CK_TIMERS */
  2457. #endif /* NOCKTIMERS */
  2458.  
  2459. #define CK_SPEED            /* Control-prefix removal */
  2460. #ifdef NOCKSPEED
  2461. #undef CK_SPEED
  2462. #endif /* NOCKSPEED */
  2463.  
  2464. #ifndef NOCKXXCHAR
  2465. #ifndef CKXXCHAR
  2466. #ifdef UNIX
  2467. #define CKXXCHAR
  2468. #else
  2469. #ifdef OS2
  2470. #define CKXXCHAR
  2471. #endif /* OS2 */
  2472. #endif /* UNIX */
  2473. #endif /* CKXXCHAR */
  2474. #endif /* NOCKXXCHAR */
  2475.  
  2476. #ifdef MAC                /* For Macintosh, no escape */
  2477. #define NOPUSH                /* to operating system */
  2478. #endif /* MAC */
  2479.  
  2480. /* Systems where we can call zmkdir() to create directories. */
  2481.  
  2482. #ifndef CK_MKDIR
  2483. #ifndef NOMKDIR
  2484.  
  2485. #ifdef UNIX
  2486. #ifndef pdp11
  2487. #define CK_MKDIR
  2488. #endif /* pdp11 */
  2489. #endif /* UNIX */
  2490.  
  2491. #ifdef OS2
  2492. #define CK_MKDIR
  2493. #endif /* OS2 */
  2494.  
  2495. #ifdef VMS
  2496. #define CK_MKDIR
  2497. #endif /* VMS */
  2498.  
  2499. #ifdef STRATUS
  2500. #define CK_MKDIR
  2501. #endif /* STRATUS */
  2502.  
  2503. #ifdef OSK
  2504. #define CK_MKDIR
  2505. #endif /* OSK */
  2506.  
  2507. #ifdef datageneral
  2508. #define CK_MKDIR
  2509. #endif /* datageneral */
  2510.  
  2511. #endif /* CK_MKDIR */
  2512. #endif /* NOMKDIR */
  2513.  
  2514. #ifdef NOMKDIR                /* Allow for command-line override */
  2515. #ifdef CK_MKDIR
  2516. #undef CK_MKDIR
  2517. #endif /* CK_MKDIR */
  2518. #endif /* NOMKDIR */
  2519.  
  2520. /* Systems for which we can enable the REDIRECT command automatically */
  2521. /*   As of 6.0.193, it should work for all UNIX... */
  2522.  
  2523. #ifndef NOREDIRECT
  2524. #ifndef CK_REDIR
  2525. #ifdef UNIX
  2526. #define CK_REDIR
  2527. #endif /* UNIX */
  2528. #ifdef OS2                /* As well as OS/2 and friends... */
  2529. #define CK_REDIR
  2530. #endif /* OS2 */
  2531. #endif /* CK_REDIR */
  2532. #endif /* NOREDIRECT */
  2533.  
  2534. #ifdef NOPUSH                /* But... REDIRECT command is not */
  2535. #ifdef CK_REDIR                /*  allowed if NOPUSH is defined. */
  2536. #undef CK_REDIR
  2537. #endif /* CK_REDIR */
  2538. #ifdef NETCMD                /* Nor is SET NET COMMAND */
  2539. #undef NETCMD
  2540. #endif /* NETCMD */
  2541. #ifdef NETPTY
  2542. #undef NETPTY
  2543. #endif /* NETPTY */
  2544. #endif /* NOPUSH */
  2545.  
  2546. #ifndef PEXITSTAT            /* \v(pexitstat) variable defined */
  2547. #ifdef OS2ORUNIX
  2548. #define PEXITSTAT
  2549. #else
  2550. #ifdef VMS
  2551. #define PEXITSTAT
  2552. #endif /* VMS */
  2553. #endif /* OS2ORUNIX */
  2554. #endif /* PEXITSTAT */
  2555.  
  2556. /* The following allows automatic enabling of REDIRECT to be overridden... */
  2557.  
  2558. #ifdef NOREDIRECT
  2559. #ifdef NETCMD
  2560. #undef NETCMD
  2561. #endif /* NETCMD */
  2562. #ifdef NETPTY
  2563. #undef NETPTY
  2564. #endif /* NETPTY */
  2565. #ifdef CK_REDIR
  2566. #undef CK_REDIR
  2567. #endif /* CK_REDIR */
  2568. #endif /* NOREDIRECT */
  2569.  
  2570. #ifdef NONETCMD
  2571. #ifdef NETCMD
  2572. #undef NETCMD
  2573. #endif /* NETCMD */
  2574. #ifdef NETPTY
  2575. #undef NETPTY
  2576. #endif /* NETPTY */
  2577. #endif /* NONETCMD */
  2578.  
  2579. #ifdef CK_REDIR
  2580. _PROTOTYP( int ttruncmd, (char *) );
  2581. #endif /* CK_REDIR */
  2582.  
  2583. /* Use built-in DIRECTORY command */
  2584.  
  2585. #ifndef NOMYDIR
  2586. #ifndef DOMYDIR
  2587. #ifdef UNIXOROSK
  2588. #define DOMYDIR
  2589. #else
  2590. #ifdef OS2
  2591. #define DOMYDIR
  2592. #else
  2593. #ifdef VMS
  2594. #define DOMYDIR
  2595. #endif /* VMS */
  2596. #endif /* OS2 */
  2597. #endif /* UNIXOROSK */
  2598. #endif /* DOMYDIR */
  2599. #endif /* NOMYDIR */
  2600.  
  2601. /* Sending from and receiving to commands/pipes */
  2602.  
  2603. #ifndef PIPESEND
  2604. #ifdef UNIX
  2605. #define PIPESEND
  2606. #endif /* UNIX */
  2607. #ifdef OS2
  2608. #define PIPESEND
  2609. #endif /* OS2 */
  2610. #endif /* PIPESEND */
  2611.  
  2612. #ifdef PIPESEND
  2613. #ifdef NOPIPESEND
  2614. #undef PIPESEND
  2615. #endif /* NOPIPESEND */
  2616. #ifdef NOPUSH
  2617. #undef PIPESEND
  2618. #endif /* NOPUSH */
  2619. #endif /* PIPESEND */
  2620.  
  2621. #ifdef NOPUSH
  2622. #ifdef BROWSER
  2623. #undef BROWSER
  2624. #endif /* BROWSER */
  2625. #endif /* NOPUSH */
  2626.  
  2627. /* Versions where we support the RESEND command */
  2628.  
  2629. #ifndef NORESEND
  2630. #ifndef CK_RESEND
  2631. #ifdef UNIX
  2632. #ifndef pdp11
  2633. #define CK_RESEND
  2634. #endif /* pdp11 */
  2635. #endif /* UNIX */
  2636.  
  2637. #ifdef VMS
  2638. #define CK_RESEND
  2639. #endif /* VMS */
  2640.  
  2641. #ifdef OS2
  2642. #define CK_RESEND
  2643. #endif /* OS2 */
  2644.  
  2645. #ifdef AMIGA
  2646. #define CK_RESEND
  2647. #endif /* AMIGA */
  2648.  
  2649. #ifdef datageneral
  2650. #define CK_RESEND
  2651. #endif /* datageneral */
  2652.  
  2653. #ifdef STRATUS
  2654. #define CK_RESEND
  2655. #endif /* STRATUS */
  2656.  
  2657. #ifdef OSK
  2658. #define CK_RESEND
  2659. #endif /* OSK */
  2660.  
  2661. #endif /* CK_RESEND */
  2662. #endif /* NORESEND */
  2663.  
  2664. /* Systems implementing "Doomsday Kermit" protocol ... */
  2665.  
  2666. #ifndef DOOMSDAY
  2667. #ifdef UNIX
  2668. #define DOOMSDAY
  2669. #else
  2670. #ifdef VMS
  2671. #define DOOMSDAY
  2672. #else
  2673. #ifdef OS2
  2674. #define DOOMSDAY
  2675. #else
  2676. #ifdef STRATUS
  2677. #define DOOMSDAY
  2678. #endif /* STRATUS */
  2679. #endif /* OS2 */
  2680. #endif /* VMS */
  2681. #endif /* UNIX */
  2682. #endif /* DOOMSDAY */
  2683.  
  2684. /* Systems where we want the Thermometer to be used for fullscreen */
  2685.  
  2686. #ifdef OS2
  2687. #ifndef CK_PCT_BAR
  2688. #define CK_PCT_BAR
  2689. #endif /* CK_PCT_BAR */
  2690. #endif /* OS2 */
  2691.  
  2692. /* Systems where we have a REXX command */
  2693.  
  2694. #ifdef OS2
  2695. #ifdef __32BIT__
  2696. #ifndef NOREXX
  2697. #define CK_REXX
  2698. #endif /* NOREXX */
  2699. #endif /* __32BIT__ */
  2700. #endif /* OS2 */
  2701.  
  2702. /* Platforms that have a ZCHKPID function */
  2703.  
  2704. #ifdef OS2ORUNIX
  2705. #define ZCHKPID
  2706. #endif /* OS2ORUNIX */
  2707.  
  2708. #ifndef ZCHKPID
  2709. /* If we can't check pids then we have treat all pids as active & valid. */
  2710. #define zchkpid(x) 1
  2711. #endif /* ZCHKPID */
  2712.  
  2713. /* Systems that have a ZRENAME function */
  2714.  
  2715. #define ZRENAME                /* They all do */
  2716.  
  2717. /* Systems that have a ZCOPY function */
  2718.  
  2719. #ifndef ZCOPY
  2720. #ifdef VMS
  2721. #define ZCOPY
  2722. #else
  2723. #ifdef OS2
  2724. #define ZCOPY
  2725. #else
  2726. #ifdef UNIX
  2727. #define ZCOPY
  2728. #else
  2729. #ifdef STRATUS
  2730. #define ZCOPY
  2731. #endif /* STRATUS */
  2732. #endif /* UNIX */
  2733. #endif /* OS2 */
  2734. #endif /* VMS */
  2735. #endif /* ZCOPY */
  2736.  
  2737. /* Systems that have ttgwsiz() (they all should but they don't) */
  2738.  
  2739. #ifndef NOTTGWSIZ
  2740. #ifndef CK_TTGWSIZ
  2741. #ifdef UNIX
  2742. #define CK_TTGWSIZ
  2743. #else
  2744. #ifdef VMS
  2745. #define CK_TTGWSIZ
  2746. #else
  2747. #ifdef OS2
  2748. #define CK_TTGWSIZ
  2749. #else
  2750. #ifdef OSK
  2751. #define CK_TTGWSIZ
  2752. #endif /* OSK */
  2753. #endif /* OS2 */
  2754. #endif /* VMS */
  2755. #endif /* UNIX */
  2756. #endif /* CK_TTGWSIZ */
  2757. #endif /* NOTTGWSIZ */
  2758.  
  2759. #ifdef NOTTGWSIZ
  2760. #ifdef CK_TTGWSIZ
  2761. #undef CK_TTGWSIZ
  2762. #endif /* CK_TTGWSIZ */
  2763. #endif /* NOTTGWSIZ */
  2764.  
  2765. /* OS/2 C-Kermit features not available in 16-bit version... */
  2766.  
  2767. #ifdef OS2
  2768. #ifndef __32BIT__
  2769. #ifdef PCFONTS                /* PC Font support */
  2770. #undef PCFONTS
  2771. #endif /* PCFONTS */
  2772. #ifdef NPIPE                /* Named Pipes communication */
  2773. #undef NPIPE
  2774. #endif /* NPIPE */
  2775. #ifdef CK_NETBIOS            /* NETBIOS communication */
  2776. #undef CK_NETBIOS
  2777. #endif /* CK_NETBIOS */
  2778. #ifdef OS2MOUSE                /* Mouse */
  2779. #undef OS2MOUSE
  2780. #endif /* OS2MOUSE */
  2781. #ifdef OS2PM                /* Presentation Manager */
  2782. #undef OS2PM
  2783. #endif /* OS2PM */
  2784. #ifdef CK_REXX                /* Rexx */
  2785. #undef CK_REXX
  2786. #endif /* CK_REXX */
  2787. #endif /* __32BIT__ */
  2788. #endif /* OS2 */
  2789.  
  2790. /* OS/2 C-Kermit features not available in Windows NT version... */
  2791.  
  2792. #ifdef OS2
  2793. #ifdef NT
  2794. #ifdef PCFONTS                /* PC Font support */
  2795. #undef PCFONTS
  2796. #endif /* PCFONTS */
  2797. #ifdef NPIPE                /* Named Pipes communication */
  2798. #undef NPIPE
  2799. #endif /* NPIPE */
  2800. #ifdef OS2PM                /* Presentation Manager */
  2801. #undef OS2PM
  2802. #endif /* OS2PM */
  2803. #ifdef CK_REXX                /* Rexx */
  2804. #undef CK_REXX
  2805. #endif /* CK_REXX */
  2806. #endif /* NT */
  2807. #endif /* OS2 */
  2808.  
  2809. /*
  2810.   Systems that have select().
  2811.   This is used for both msleep() and for read-buffer checking in in_chk().
  2812. */
  2813. #define CK_SLEEPINT 250 /* milliseconds - set this to something that
  2814.                            divides evenly into 1000 */
  2815. #ifndef SELECT
  2816. #ifndef NOSELECT
  2817. #ifdef __linux__
  2818. #define SELECT
  2819. #else
  2820. #ifdef SUNOS4
  2821. #define SELECT
  2822. #else
  2823. #ifdef NEXT
  2824. #define SELECT
  2825. #else
  2826. #ifdef HPUX
  2827. /*
  2828.   Not really.  I think it's only in HP-UX 7.0 and later, except it's also
  2829.   in earlier versions that have TCP/IP installed.  Override this default
  2830.   in particular HP-UX makefile entries by adding -DNOSELECT, as in (e.g.)
  2831.   the HP-UX 6.5 ones.
  2832. */
  2833. #define SELECT
  2834. #else
  2835. #ifdef AIXRS
  2836. #define SELECT
  2837. #else
  2838. #ifdef BSD44
  2839. #define SELECT
  2840. #else
  2841. #ifdef BSD4
  2842. #define SELECT
  2843. #else
  2844. #ifdef OXOS
  2845. #define SELECT
  2846. #else
  2847. #ifdef OS2
  2848. #define SELECT
  2849. #else
  2850. #ifdef BEBOX
  2851. #define SELECT
  2852. #endif /* BEBOX */
  2853. #endif /* OS2 */
  2854. #endif /* OXOS */
  2855. #endif /* BSD4 */
  2856. #endif /* BSD44 */
  2857. #endif /* AIXRS */
  2858. #endif /* HPUX */
  2859. #endif /* NEXT */
  2860. #endif /* __linux__ */
  2861. #endif /* SUNOS4 */
  2862. #endif /* NOSELECT */
  2863. #endif /* SELECT */
  2864.  
  2865. /*
  2866.   The following section moved here from ckcnet.h in 6.1 because select()
  2867.   is now used for non-networking purposes.
  2868. */
  2869.  
  2870. /* On HP-9000/500 HP-UX 5.21 this stuff is not defined in any header file */
  2871.  
  2872. #ifdef hp9000s500
  2873. #ifndef NEEDSELECTDEFS
  2874. #define NEEDSELECTDEFS
  2875. #endif /* NEEDSELECTDEFS */
  2876. #endif /* hp9000s500 */
  2877.  
  2878. #ifdef NEEDSELECTDEFS
  2879. typedef long fd_mask;
  2880. #ifndef NBBY
  2881. #define NBBY 8
  2882. #endif /* NBBY */
  2883. #ifndef FD_SETSIZE
  2884. #define FD_SETSIZE 32
  2885. #endif /* FD_SETSIZE */
  2886. #ifndef NFDBITS
  2887. #define NFDBITS (sizeof(fd_mask) * NBBY)
  2888. #endif /* NFDBITS */
  2889. #ifndef howmany
  2890. #define howmany(x,y) (((x)+((y)-1))/(y))
  2891. #endif /* howmany */
  2892. typedef struct fd_set {
  2893.     fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  2894. } fd_set;
  2895. #ifndef FD_SET
  2896. #define FD_SET(n,p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  2897. #endif /* FD_SET */
  2898. #ifndef FD_CLR
  2899. #define FD_CLR(n,p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  2900. #endif /* FD_CLR */
  2901. #ifndef FD_ISSET
  2902. #define FD_ISSET(n,p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  2903. #endif /* FD_ISSET */
  2904. #ifndef FD_COPY
  2905. #define FD_COPY(f,t) (bcopy(f,t,sizeof(*(f)))
  2906. #endif /* FD_COPY */
  2907. #ifndef FD_ZERO
  2908. #define FD_ZERO(p) bzero((char *)(p),sizeof(*(p)))
  2909. #endif /* FD_ZERO */
  2910. #endif /* NEEDSELECTDEFS */
  2911.  
  2912. /*
  2913.   CK_NEED_SIG is defined if the system cannot check the console to
  2914.   to see if characters are waiting.  This is used during local-mode file
  2915.   transfer to interrupt the transfer, refresh the screen display, etc.
  2916.   If CK_NEED_SIG is defined, then file-transfer interruption characters
  2917.   have to be preceded a special character, e.g. the SIGQUIT character.
  2918.   CK_NEED_SIG should be defined if the conchk() function is not operational.
  2919. */
  2920. #ifdef NOPOLL                /* For overriding CK_POLL definition */
  2921. #ifdef CK_POLL
  2922. #undef CK_POLL
  2923. #endif /* CK_POLL */
  2924. #endif /* NOPOLL */
  2925.  
  2926. #ifndef CK_POLL                /* If we don't have poll() */
  2927. #ifndef RDCHK                /* And we don't have rdchk() */
  2928. #ifndef SELECT                /* And we don't have select() */
  2929. #ifdef ATTSV
  2930. #ifndef aegis
  2931. #ifndef datageneral
  2932. #ifndef OXOS
  2933. #define CK_NEED_SIG
  2934. #endif /* OXOS */
  2935. #endif /* datageneral */
  2936. #endif /* aegis */
  2937. #endif /* ATTSV */
  2938. #ifdef POSIX
  2939. #ifndef CK_NEED_SIG
  2940. #define CK_NEED_SIG
  2941. #endif /* CK_NEED_SIG */
  2942. #endif /* POSIX */
  2943. #endif /* SELECT */
  2944. #endif /* RDCHK */
  2945. #endif /* CK_POLL */
  2946.  
  2947. #ifdef HPUX                /* HP-UX has select() */
  2948. #ifdef CK_NEED_SIG
  2949. #undef CK_NEED_SIG
  2950. #endif /* CK_NEED_SIG */
  2951. #endif /* HPUX */
  2952.  
  2953. #ifdef AIXRS                /* AIX has select() */
  2954. #ifdef CK_NEED_SIG
  2955. #undef CK_NEED_SIG
  2956. #endif /* CK_NEED_SIG */
  2957. #endif /* AIXRS */
  2958.  
  2959. #ifdef BSD44                /* 4.4BSD has FIONREAD */
  2960. #ifdef CK_NEED_SIG
  2961. #undef CK_NEED_SIG
  2962. #endif /* CK_NEED_SIG */
  2963. #endif /* BSD44 */
  2964.  
  2965. #ifdef QNX                /* QNX has FIONREAD and select() */
  2966. #ifdef CK_NEED_SIG
  2967. #undef CK_NEED_SIG
  2968. #endif /* CK_NEED_SIG */
  2969. #endif /* QNX */
  2970.  
  2971. #ifdef COHERENT
  2972. #ifndef NOTIMEZONE
  2973. #define NOTIMEZONE
  2974. #endif /* NOTIMEZONE */
  2975. #endif /* COHERENT */
  2976.  
  2977. #ifdef UNIX
  2978. #ifndef HAVE_TZ                /* Can we use struct timezone? */
  2979. #ifndef NOTIMEZONE
  2980. #ifdef PTX
  2981. #define NOTIMEZONE
  2982. #else
  2983. #ifndef SELECT
  2984. #ifdef COHERENT
  2985. #define NOTIMEZONE
  2986. #else
  2987. #ifdef BELLV10
  2988. #define NOTIMEZONE
  2989. #endif /* BELLV10 */
  2990. #endif /* COHERENT */
  2991. #endif /* SELECT */
  2992. #endif /* PTX */
  2993. #endif /* NOTIMEZONE */
  2994. #endif /* HAVE_TZ */
  2995. #ifndef NOTIMEVAL            /* Can we use struct timeval? */
  2996. #ifndef HAVE_TV
  2997. #define HAVE_TV
  2998. #endif /* HAVE_TV */
  2999. #endif /* NOTIMEVAL */
  3000. #ifndef NOTIMEZONE
  3001. #ifndef HAVE_TZ
  3002. #define HAVE_TZ
  3003. #endif /* HAVE_TZ */
  3004. #endif /* NOTIMEZONE */
  3005. #endif /* UNIX */
  3006.  
  3007. #ifdef SCO32
  3008. #ifdef HAVE_TV
  3009. #undef HAVE_TV
  3010. #endif /* HAVE_TV */
  3011. #ifdef HAVE_TZ
  3012. #undef HAVE_TZ
  3013. #endif /* HAVE_TZ */
  3014. #ifndef NOTIMEVAL
  3015. #define NOTIMEVAL
  3016. #endif /* NOTIMEVAL */
  3017. #ifndef NOTIMEZONE
  3018. #define NOTIMEZONE
  3019. #endif /* NOTIMEZONE */
  3020. #endif /* SCO32 */
  3021.  
  3022. #ifdef ATT7300
  3023. #ifdef HAVE_TV
  3024. #undef HAVE_TV
  3025. #endif /* HAVE_TV */
  3026. #ifdef HAVE_TZ
  3027. #undef HAVE_TZ
  3028. #endif /* HAVE_TZ */
  3029. #ifndef NOTIMEVAL
  3030. #define NOTIMEVAL
  3031. #endif /* NOTIMEVAL */
  3032. #ifndef NOTIMEZONE
  3033. #define NOTIMEZONE
  3034. #endif /* NOTIMEZONE */
  3035. #endif /* ATT7300 */
  3036.  
  3037. /*
  3038.   Automatic parity detection.
  3039.   This actually implies a lot more now: length-driven packet reading,
  3040.   "Doomsday Kermit" IBM Mainframe file transfer through 3270 data streams, etc.
  3041. */
  3042. #ifdef UNIX                /* For Unix */
  3043. #ifndef NOPARSEN
  3044. #define PARSENSE
  3045. #endif /* NOPARSEN */
  3046. #endif /* UNIX */
  3047.  
  3048. #ifdef VMS                /* ... and VMS */
  3049. #ifndef NOPARSEN
  3050. #define PARSENSE
  3051. #endif /* NOPARSEN */
  3052. #ifdef __GNUC__
  3053. #define VMSGCC
  3054. #endif /* __GNUC__ */
  3055. #endif /* VMS */
  3056.  
  3057. #ifdef MAC                /* and Macintosh */
  3058. #ifndef NOPARSEN
  3059. #define PARSENSE
  3060. #endif /* NOPARSEN */
  3061. #endif /* MAC */
  3062.  
  3063. #ifdef STRATUS                /* and Stratus VOS */
  3064. #ifndef NOPARSEN
  3065. #define PARSENSE
  3066. #endif /* NOPARSEN */
  3067. #endif /* STRATUS */
  3068.  
  3069. #ifdef OS2                /* and OS/2, finally */
  3070. #ifndef NOPARSEN
  3071. #define PARSENSE
  3072. #endif /* NOPARSEN */
  3073. #endif /* OS2 */
  3074.  
  3075. #ifndef NODYNAMIC            /* DYNAMIC is default for UNIX */
  3076. #ifndef DYNAMIC                /* as of C-Kermit 7.0 */
  3077. #ifdef UNIX
  3078. #define DYNAMIC
  3079. #endif /* UNIX */
  3080. #endif /* DYNAMIC */
  3081. #endif /* NODYNAMIC */
  3082.  
  3083. #ifdef DYNAMIC                /* If DYNAMIC is defined */
  3084. #define DCMDBUF                /* then also define this. */
  3085. #endif /* DYNAMIC */
  3086.  
  3087. #ifndef CK_LBRK                /* Can send Long BREAK */
  3088.  
  3089. #ifdef UNIX                /* (everybody but OS-9) */
  3090. #define CK_LBRK
  3091. #endif /* UNIX */
  3092. #ifdef VMS
  3093. #define CK_LBRK
  3094. #endif /* VMS */
  3095. #ifdef datageneral
  3096. #define CK_LBRK
  3097. #endif /* datageneral */
  3098. #ifdef GEMDOS
  3099. #define CK_LBRK
  3100. #endif /* GEMDOS */
  3101. #ifdef OS2
  3102. #define CK_LBRK
  3103. #endif /* OS2 */
  3104. #ifdef AMIGA
  3105. #define CK_LBRK
  3106. #endif /* AMIGA */
  3107. #ifdef STRATUS
  3108. #define CK_LBRK
  3109. #endif /* STRATUS */
  3110.  
  3111. #endif /* CK_LBRK */
  3112.  
  3113. /* Carrier treatment */
  3114. /* These are defined here because they are shared by the system dependent */
  3115. /* and the system independent modules. */
  3116.  
  3117. #define  CAR_OFF 0    /* Off: ignore carrier always. */
  3118. #define  CAR_ON  1      /* On: heed carrier always, except during DIAL. */
  3119. #define  CAR_AUT 2      /* Auto: heed carrier, but only if line is declared */
  3120.             /* to be a modem line, and only during CONNECT. */
  3121.  
  3122. /* And more generically (for use with any ON/OFF/AUTO feature) */
  3123. #define  CK_OFF  0
  3124. #define  CK_ON   1
  3125. #define  CK_AUTO 2
  3126.  
  3127. #ifndef NOLOCAL
  3128. /*
  3129.   Serial interface speeds available.
  3130.  
  3131.   As of C-Kermit 6.1 there is a new method to get the supported
  3132.   speeds, which obviates the need for all the craziness below.  At runtime,
  3133.   just call the new ttspdlist() routine to get a list of supported speeds.
  3134.   Then the user interface module can build a keyword table or menu from it.
  3135. */
  3136. #ifndef TTSPDLIST
  3137. #ifdef UNIX                /* For now, only for UNIX */
  3138. #ifndef OLINUXHISPEED            /* But not systems with hacks for */
  3139. #ifndef MINIX                /* high speeds, like 110 = 115200 */
  3140. #define TTSPDLIST
  3141. #endif /* MINIX */
  3142. #endif /* OLINUXHISPEED */
  3143. #else
  3144. #ifdef VMS
  3145. #define TTSPDLIST            /* VMS gets it too */
  3146. #endif /* VMS */
  3147. #endif /* UNIX */
  3148. #endif /* TTSPDLIST */
  3149.  
  3150. #ifndef NODIAL                /* Hangup by modem command */
  3151. #ifndef NOMDMHUP
  3152. #ifndef MDMHUP
  3153. #define MDMHUP
  3154. #endif /* MDMHUP */
  3155. #endif /* NOMDMHUP */
  3156. #endif /* NODIAL */
  3157.  
  3158. #ifdef NOSPL
  3159. #ifndef NOLOGDIAL            /* Connection log needs mjd(), etc. */
  3160. #define NOLOGDIAL
  3161. #endif /* NOLOGDIAL */
  3162. #endif /* NOSPL */
  3163.  
  3164. #ifdef pdp11
  3165. #define NOLOGDIAL
  3166. #endif /* pdp11 */
  3167.  
  3168. #ifndef NOLOGDIAL            /* Connection log */
  3169. #ifndef CXLOGFILE
  3170. #define CXLOGFILE "CX.LOG"        /* Default connection log file name */
  3171. #endif /* CXLOGFILE */
  3172. #ifndef CKLOGDIAL
  3173. #ifndef CK_SMALL
  3174. #define CKLOGDIAL
  3175. #define CXLOGBUFL 1024            /* Connection log record buffer size */
  3176. #endif /* CK_SMALL */
  3177. #endif /* NOLOGDIAL */
  3178. #endif /* CKLOGDIAL */
  3179.  
  3180. #endif /* NOLOCAL */
  3181.  
  3182. #ifdef NOTTSPDLIST            /* Except if NOTTSPDLIST is defined */
  3183. #ifdef TTSPDLIST
  3184. #undef TTSPDLIST
  3185. #endif /* TTSPDLIST */
  3186. #endif /* NOTTSPDLIST */
  3187.  
  3188. #ifdef TTSPDLIST
  3189.  
  3190. _PROTOTYP( long * ttspdlist, (void) );
  3191.  
  3192. #else /* TTSPDLIST not defined */
  3193. /*
  3194.   We must use a long and convoluted series of #ifdefs that have to be kept in
  3195.   sync with the code in the ck?tio.c module.
  3196.  
  3197.   We assume that everybody supports: 0, 110, 300, 600, 1200, 2400, 4800, and
  3198.   9600 bps.  Symbols for other speeds are defined here.  You can also add
  3199.   definitions on the CC command lines.  These definitions affect the SET SPEED
  3200.   keyword table, and are not necessarily usable in the system-dependent
  3201.   speed-setting code in the ck?tio.c modules, which depends on system-specific
  3202.   symbols like (in UNIX) B19200.  In other words, just defining it doesn't
  3203.   mean it'll work -- you also have to supply the supporting code in ttsspd()
  3204.   and ttgspd() in ck?tio.c.
  3205.  
  3206.   The symbols have the form BPS_xxxx, where xxxx is the speed in bits per
  3207.   second, or (for bps values larger than 9999) thousands of bps followed by K.
  3208.   The total symbol length should be 8 characters or less.  Some values are
  3209.   enabled automatically below.  You can disable a particular value by defining
  3210.   NOB_xxxx on the CC command line. */
  3211. #ifndef NOB_50
  3212. #define BPS_50                /* 50 bps */
  3213. #endif
  3214.  
  3215. #ifndef NOB_75
  3216. #define BPS_75                /* 75 bps */
  3217. #endif
  3218.  
  3219. #ifndef NOB7512
  3220. #ifdef ANYBSD
  3221. #define BPS_7512            /* 75/1200 Split Speed */
  3222. #endif /* ANYBSD */
  3223. #endif /* NOB7512 */
  3224.  
  3225. #ifndef NOB134
  3226. #ifdef SOLARIS25
  3227. #define BPS_134
  3228. #else
  3229. #undef BPS_134                /* 134.5 bps (IBM 2741) */
  3230. #endif /* BPS_134 */
  3231. #endif /* NOB134 */
  3232.  
  3233. #ifndef NOB_150
  3234. #define BPS_150                /* 150 bps */
  3235. #endif
  3236.  
  3237. #ifndef NOB_200
  3238. #define BPS_200                /* 200 bps */
  3239. #endif
  3240.  
  3241. #ifndef NOB_1800
  3242. #ifdef MAC
  3243. #define BPS_1800            /* 1800 bps */
  3244. #else
  3245. #ifdef SOLARIS25
  3246. #define BPS_1800
  3247. #endif
  3248. #endif
  3249. #endif
  3250.  
  3251. #ifndef NOB_3600
  3252. #ifndef SOLARIS25
  3253. #define BPS_3600            /* 3600 bps */
  3254. #endif
  3255. #endif
  3256.  
  3257. #ifndef NOB_7200
  3258. #ifndef SOLARIS25
  3259. #define BPS_7200            /* 7200 bps */
  3260. #endif /* SOLARIS25 */
  3261. #endif
  3262.  
  3263. #ifndef NOB_14K
  3264. #ifdef BSD44
  3265. #define BPS_14K                /* 14400 bps */
  3266. #else
  3267. #ifdef OS2
  3268. #define BPS_14K
  3269. #else
  3270. #ifdef NEXT
  3271. #define BPS_14K
  3272. #else
  3273. #ifdef MAC
  3274. #define BPS_14K
  3275. #else
  3276. #ifdef AMIGA
  3277. #define BPS_14K
  3278. #endif /* AMIGA */
  3279. #endif /* MAC */
  3280. #endif /* NEXT */
  3281. #endif /* OS2 */
  3282. #endif /* BSD44 */
  3283. #endif /* NOB_14K */
  3284.  
  3285. #ifndef NOB_19K
  3286. #define BPS_19K                /* 19200 bps */
  3287. #endif
  3288.  
  3289. #ifndef NOB_28K
  3290. #ifdef BSD44
  3291. #define BPS_28K
  3292. #else
  3293. #ifdef OS2
  3294. #define BPS_28K
  3295. #else
  3296. #ifdef NEXT
  3297. #define BPS_28K                /* 28800 bps */
  3298. #else
  3299. #ifdef MAC
  3300. #define BPS_28K                /* 28800 bps */
  3301. #endif /* MAC */
  3302. #endif /* NEXT */
  3303. #endif /* OS2 */
  3304. #endif /* BSD44 */
  3305. #endif /* NOB_28K */
  3306.  
  3307. #ifndef NOB_38K
  3308. #define BPS_38K                /* 38400 bps */
  3309. #endif
  3310.  
  3311. #ifndef NOB_57K
  3312. #ifdef Plan9
  3313. #define BPS_57K
  3314. #else
  3315. #ifdef SOLARIS25
  3316. #define BPS_57K
  3317. #else
  3318. #ifdef VMS
  3319. #define BPS_57K                /* 57600 bps */
  3320. #else
  3321. #ifdef OS2
  3322. #define BPS_57K
  3323. #else
  3324. #ifdef __linux__
  3325. #define BPS_57K
  3326. #else
  3327. #ifdef HPUX
  3328. #define BPS_57K
  3329. #else
  3330. #ifdef NEXT
  3331. #define BPS_57K
  3332. #else
  3333. #ifdef __386BSD__
  3334. #define BPS_57K
  3335. #else
  3336. #ifdef __FreeBSD__
  3337. #define BPS_57K
  3338. #else
  3339. #ifdef __NetBSD__
  3340. #define BPS_57K
  3341. #else
  3342. #ifdef MAC
  3343. #define BPS_57K
  3344. #else
  3345. #ifdef QNX
  3346. #define BPS_57K
  3347. #else
  3348. #ifdef BEOSORBEBOX
  3349. #define BPS_57K
  3350. #else
  3351. #ifdef IRIX62
  3352. #define BPS_57K
  3353. #else
  3354. #ifdef SCO_OSR504
  3355. #define BPS_57K
  3356. #else
  3357. #ifdef BSDI2
  3358. #define BPS_57K
  3359. #endif /* BSDI2 */
  3360. #endif /* SCO_OSR504 */
  3361. #endif /* IRIX62 */
  3362. #endif /* BEOSORBEBOX */
  3363. #endif /* QNX */
  3364. #endif /* MAC */
  3365. #endif /* __NetBSD__ */
  3366. #endif /* __FreeBSD__ */
  3367. #endif /* __386BSD__ */
  3368. #endif /* NEXT */
  3369. #endif /* HPUX */
  3370. #endif /* __linux__ */
  3371. #endif /* OS2 */
  3372. #endif /* VMS */
  3373. #endif /* SOLARIS25 */
  3374. #endif /* Plan9 */
  3375. #endif /* NOB_57K */
  3376.  
  3377. #ifndef NOB_76K
  3378. #ifdef BSDI2
  3379. #define BPS_76K
  3380. #endif /* BSDI2 */
  3381. #ifdef Plan9
  3382. #define BPS_76K
  3383. #endif /* Plan9 */
  3384. #ifdef SOLARIS25
  3385. #define BPS_76K
  3386. #endif /* SOLARIS25 */
  3387. #ifdef VMS
  3388. #define BPS_76K                /* 76800 bps */
  3389. #endif /* VMS */
  3390. #ifdef OS2
  3391. #ifdef __32BIT__
  3392. #define BPS_76K
  3393. #endif /* __32BIT__ */
  3394. #endif /* OS2 */
  3395. #ifdef QNX
  3396. #define BPS_76K
  3397. #endif /* QNX */
  3398. #ifdef IRIX62
  3399. #define BPS_76K
  3400. #endif /* IRIX62 */
  3401. #ifdef SCO_OSR504
  3402. #define BPS_76K
  3403. #endif /* SCO_OSR504 */
  3404. #endif /* NOB_76K */
  3405.  
  3406. #ifndef NOB_115K
  3407. #ifdef BSDI2
  3408. #define BPS_115K
  3409. #endif /* BSDI2 */
  3410. #ifdef Plan9
  3411. #define BPS_115K
  3412. #endif /* Plan9 */
  3413. #ifdef SOLARIS25
  3414. #define BPS_115K
  3415. #endif /* SOLARIS25 */
  3416. #ifdef VMS
  3417. #define BPS_115K            /* 115200 bps */
  3418. #else
  3419. #ifdef QNX
  3420. #define BPS_115K
  3421. #else
  3422. #ifdef HPUX
  3423. #define BPS_115K
  3424. #else
  3425. #ifdef __linux__
  3426. #define BPS_115K
  3427. #else
  3428. #ifdef __386BSD__
  3429. #define BPS_115K
  3430. #else
  3431. #ifdef __FreeBSD__
  3432. #define BPS_115K
  3433. #else
  3434. #ifdef __NetBSD__
  3435. #define BPS_115K
  3436. #else
  3437. #ifdef OS2
  3438. #ifdef __32BIT__
  3439. #define BPS_115K
  3440. #endif /* __32BIT__ */
  3441. #else
  3442. #ifdef BEOSORBEBOX
  3443. #define BPS_115K
  3444. #else
  3445. #ifdef IRIX62
  3446. #define BPS_115K
  3447. #else
  3448. #ifdef SCO_OSR504
  3449. #define BPS_115K
  3450. #endif /* SCO_OSR504 */
  3451. #endif /* IRIX62 */
  3452. #endif /* BEOSORBEBOX */
  3453. #endif /* OS2 */
  3454. #endif /* __NetBSD__ */
  3455. #endif /* __FreeBSD__ */
  3456. #endif /* __386BSD__ */
  3457. #endif /* __linux__ */
  3458. #endif /* HPUX */
  3459. #endif /* QNX */
  3460. #endif /* VMS */
  3461. #endif /* NOB_115K */
  3462.  
  3463. #ifndef NOB_230K            /* 230400 bps */
  3464. #ifdef BSDI2
  3465. #define BPS_230K
  3466. #else
  3467. #ifdef SCO_OSR504
  3468. #define BPS_230K
  3469. #else
  3470. #ifdef __linux__
  3471. #define BPS_230K
  3472. #else
  3473. #ifdef SOLARIS25
  3474. #define BPS_230K
  3475. #else
  3476. #ifdef OS2
  3477. #ifdef __32BIT__
  3478. #define BPS_230K
  3479. #endif /* __32BIT__ */
  3480. #else
  3481. #undef BPS_230K
  3482. #endif /* OS2 */
  3483. #endif /* SOLARIS25 */
  3484. #endif /* __linux__ */
  3485. #endif /* SCO_OSR504 */
  3486. #endif /* BSDI2 */
  3487. #endif /* NOB_230K */
  3488.  
  3489. #ifndef NOB_460K            /* 460800 bps */
  3490. #ifdef SCO_OSR504
  3491. #define BPS_460K
  3492. #else
  3493. #ifdef __linux__
  3494. #define BPS_460K
  3495. #else
  3496. #ifdef OS2
  3497. #ifdef __32BIT__
  3498. #define BPS_460K
  3499. #endif /* __32BIT__ */
  3500. #else
  3501. #undef BPS_460K
  3502. #endif /* __linux__ */
  3503. #endif /* SCO_OSR504 */
  3504. #endif /* OS2 */
  3505. #endif /* NOB_460K */
  3506.  
  3507. #ifndef NOB_921K            /* 921600 bps */
  3508. #ifdef SCO_OSR504
  3509. #define BPS_921K
  3510. #endif /* SCO_OSR504 */
  3511. #endif /* NOB_921K */
  3512.  
  3513. #ifdef BPS_921K                /* Maximum speed defined */
  3514. #define MAX_SPD 921600L
  3515. #else
  3516. #ifdef BPS_460K
  3517. #define MAX_SPD 460800L
  3518. #else
  3519. #ifdef BPS_230K
  3520. #define MAX_SPD 230400L
  3521. #else
  3522. #ifdef BPS_115K
  3523. #define MAX_SPD 115200L
  3524. #else
  3525. #ifdef BPS_76K
  3526. #define MAX_SPD 76800L
  3527. #else
  3528. #ifdef BPS_57K
  3529. #define MAX_SPD 57600L
  3530. #else
  3531. #ifdef BPS_38K
  3532. #define MAX_SPD 38400L
  3533. #else
  3534. #ifdef BPS_28K
  3535. #define MAX_SPD 28800L
  3536. #else
  3537. #ifdef BPS_19K
  3538. #define MAX_SPD 19200L
  3539. #else
  3540. #ifdef BPS_14K
  3541. #define MAX_SPD 14400L
  3542. #else
  3543. #define MAX_SPD 9600L
  3544. #endif
  3545. #endif
  3546. #endif
  3547. #endif
  3548. #endif
  3549. #endif
  3550. #endif
  3551. #endif
  3552. #endif
  3553. #endif
  3554. #endif /* TTSPDLIST */
  3555.  
  3556. #ifndef CONGSPD                /* Systems that can call congspd() */
  3557. #ifdef UNIX
  3558. #define CONGSPD
  3559. #endif /* UNIX */
  3560. #ifdef VMS
  3561. #define CONGSPD
  3562. #endif /* VMS */
  3563. #ifdef STRATUS
  3564. #define CONGSPD
  3565. #endif /* STRATUS */
  3566. #endif /* CONGSPD */
  3567.  
  3568. /* Types of flow control available */
  3569.  
  3570. #define CK_XONXOFF            /* Everybody can do this, right? */
  3571.  
  3572. #ifdef AMIGA                /* Commodore Amiga */
  3573. #define CK_RTSCTS            /* has RTS/CTS */
  3574. #endif /* AMIGA */
  3575.  
  3576. #ifdef SUN4S5                /* SunOS in System V environment */
  3577. #define CK_RTSCTS
  3578. #else                    /* SunOS 4.0/4.1 in BSD environment */
  3579. #ifdef SUNOS4                /* SunOS 4.0+later supports RTS/CTS */
  3580. #ifdef SUNOS41                /* Easy in 4.1 and later */
  3581. #define CK_RTSCTS
  3582. #else                    /* Harder in 4.0 */
  3583. #ifndef __GNUC__            /* (see tthflow() in ckutio.c) */
  3584. #ifndef GNUC
  3585. #define CK_RTSCTS            /* Only if not using GNU gcc */
  3586. #endif /* __GNUC__ */
  3587. #endif /* GNUC */
  3588. #endif /* SUNOS41 */
  3589. #endif /* SUNOS4 */
  3590. #endif /* SUN4S5 */
  3591.  
  3592. #ifdef BSD44                /* And in 4.4 BSD, including BSDI */
  3593. #define CK_RTSCTS
  3594. #endif /* BSD44 */
  3595.  
  3596. #ifdef TERMIOX                /* Sys V R4 <termiox.h> */
  3597. #ifndef CK_RTSCTS
  3598. #define CK_RTSCTS
  3599. #endif /* CK_RTSCTS */
  3600. #ifndef CK_DTRCD
  3601. #define CK_DTRCD
  3602. #endif /* CK_DTRCD */
  3603. #else
  3604. #ifdef STERMIOX                /* Sys V R4 <sys/termiox.h> */
  3605. #ifndef CK_RTSCTS
  3606. #define CK_RTSCTS
  3607. #endif /* CK_RTSCTS */
  3608. #ifndef CK_DTRCD
  3609. #define CK_DTRCD
  3610. #endif /* CK_DTRCD */
  3611. #endif /* STERMIOX */
  3612. #endif /* TERMIOX */
  3613.  
  3614. #ifdef OXOS                /* Olivetti X/OS R2 struct termios */
  3615. #define CK_RTSCTS            /* Ditto. */
  3616. #define CK_DTRCD
  3617. #endif /* OXOS */
  3618.  
  3619. #ifdef AIXRS                /* RS/6000 with AIX 3.x */
  3620. #define CK_RTSCTS            /* Has its own peculiar method... */
  3621. #endif /* AIXRS */
  3622.  
  3623. #ifdef __linux__            /* Linux */
  3624. #define CK_RTSCTS
  3625. #endif /* __linux__ */
  3626. /*
  3627.   Hardware flow control is not defined in POSIX.1.  Nevertheless, a certain
  3628.   style API for hardware flow control, using tcsetattr() and the CRTSCTS
  3629.   bit(s), seems to be gaining currency on POSIX-based UNIX systems.  The
  3630.   following code defines the symbol POSIX_CRTSCTS for such systems.
  3631. */
  3632. #ifdef CK_RTSCTS
  3633. #ifdef __bsdi__                /* BSDI, a.k.a. BSD/386 */
  3634. #define POSIX_CRTSCTS
  3635. #endif /* __bsdi__ */
  3636. #ifdef __linux__            /* Linux */
  3637. #define POSIX_CRTSCTS
  3638. #endif /* __linux__ */
  3639. #ifdef __NetBSD__            /* NetBSD */
  3640. #define POSIX_CRTSCTS
  3641. #endif /* __NetBSD__ */
  3642. #ifdef BEOSORBEBOX            /* BeBOX */
  3643. #define POSIX_CRTSCTS
  3644. /* BEBOX defines CRTSFL as (CTSFLOW & RTSFLOW) */
  3645. #define CRTSCTS CRTSFL
  3646. #endif /* BEOSORBEBOX */
  3647. #ifdef IRIX52                /* IRIX 5.2 and later */
  3648. #define POSIX_CRTSCTS
  3649. #define CRTSCTS CNEW_RTSCTS        /* See <sys/termios.h> */
  3650. #endif /* IRIX52 */
  3651. #endif /* CK_RTSCTS */
  3652.  
  3653. /* Implementations that have implemented the ttsetflow() function. */
  3654.  
  3655. #ifndef CK_TTSETFLOW
  3656. #ifdef UNIX
  3657. #define CK_TTSETFLOW
  3658. #endif /* UNIX */
  3659. #ifdef OS2
  3660. #define CK_TTSETFLOW
  3661. #endif /* OS2 */
  3662. #endif /* CK_TTSETFLOW */
  3663.  
  3664. #ifdef CK_TTSETFLOW
  3665. _PROTOTYP( int ttsetflow, (int) );
  3666. #endif /* CK_TTSETFLOW */
  3667. /*
  3668.  Systems where we can expand tilde at the beginning of file or directory names
  3669. */
  3670. #ifdef POSIX
  3671. #ifndef DTILDE
  3672. #define DTILDE
  3673. #endif /* DTILDE */
  3674. #endif /* POSIX */
  3675. #ifdef BSD4
  3676. #ifndef DTILDE
  3677. #define DTILDE
  3678. #endif /* DTILDE */
  3679. #endif /* BSD4 */
  3680. #ifdef ATTSV
  3681. #ifndef DTILDE
  3682. #define DTILDE
  3683. #endif /* DTILDE */
  3684. #endif /* ATTSV */
  3685. #ifdef OSK
  3686. #ifndef DTILDE
  3687. #define DTILDE
  3688. #endif /* DTILDE */
  3689. #endif /* OSK */
  3690. #ifdef HPUX                /* I don't know why this is */
  3691. #ifndef DTILDE                /* necessary, since -DHPUX */
  3692. #define DTILDE                /* automatically defines ATTSV */
  3693. #endif /* DTILDE */            /* (see above) ... */
  3694. #endif /* HPUX */
  3695.  
  3696. /*
  3697.   This is mainly for the benefit of ckufio.c (UNIX and OS/2 file support).
  3698.   Systems that have an atomic rename() function, so we don't have to use
  3699.   link() and unlink().
  3700. */
  3701. #ifdef POSIX
  3702. #ifndef RENAME
  3703. #define RENAME
  3704. #endif /* RENAME */
  3705. #endif /* POSIX */
  3706.  
  3707. #ifdef OS2
  3708. #ifndef RENAME
  3709. #define RENAME
  3710. #endif /* RENAME */
  3711. #endif /* OS2 */
  3712.  
  3713. #ifdef SUNOS41
  3714. #ifndef RENAME
  3715. #define RENAME
  3716. #endif /* RENAME */
  3717. #endif /* SUNOS41 */
  3718.  
  3719. #ifdef SVR4
  3720. #ifndef RENAME
  3721. #define RENAME
  3722. #endif /* RENAME */
  3723. #endif /* SVR4 */
  3724.  
  3725. #ifdef AIXRS
  3726. #ifndef RENAME
  3727. #define RENAME
  3728. #endif /* RENAME */
  3729. #endif /* AIXRS */
  3730.  
  3731. #ifdef BSD44
  3732. #ifndef RENAME
  3733. #define RENAME
  3734. #endif /* RENAME */
  3735. #endif /* BSD44 */
  3736.  
  3737. #ifdef NORENAME                /* Allow for compile-time override */
  3738. #ifdef RENAME
  3739. #undef RENAME
  3740. #endif /* RENAME */
  3741. #endif /* NORENAME */
  3742.  
  3743. #ifdef STRATUS                /* Stratus VOS */
  3744. #ifndef RENAME
  3745. #define RENAME
  3746. #endif /* RENAME */
  3747. #endif /* STRATUS */
  3748.  
  3749. /* Line delimiter for text files */
  3750.  
  3751. /*
  3752.  If the system uses a single character for text file line delimitation,
  3753.  define NLCHAR to the value of that character.  For text files, that
  3754.  character will be converted to CRLF upon output, and CRLF will be converted
  3755.  to that character on input during text-mode (default) packet operations.
  3756. */
  3757. #ifdef MAC                              /* Macintosh */
  3758. #define NLCHAR 015
  3759. #else
  3760. #ifdef OSK                /* OS-9/68K */
  3761. #define NLCHAR 015
  3762. #else                                   /* All Unix-like systems */
  3763. #define NLCHAR 012
  3764. #endif /* OSK */
  3765. #endif /* MAC */
  3766.  
  3767. /*
  3768.  At this point, if there's a system that uses ordinary CRLF line
  3769.  delimitation AND the C compiler actually returns both the CR and
  3770.  the LF when doing input from a file, then #undef NLCHAR.
  3771. */
  3772. #ifdef OS2                /* OS/2 */
  3773. #undef NLCHAR
  3774. #endif /* OS2 */
  3775.  
  3776. #ifdef GEMDOS                /* Atari ST */
  3777. #undef NLCHAR
  3778. #endif /* GEMDOS */
  3779.  
  3780. /*
  3781.   VMS file formats are so complicated we need to do all the conversion
  3782.   work in the CKVFIO module, so we tell the rest of C-Kermit not to fiddle
  3783.   with the bytes.
  3784. */
  3785.  
  3786. #ifdef vms
  3787. #undef NLCHAR
  3788. #endif /* vms */
  3789.  
  3790. /* The device name of a job's controlling terminal */
  3791. /* Special for VMS, same for all Unixes (?), not used by Macintosh */
  3792.  
  3793. #ifdef BEOS
  3794. #define CTTNAM dftty
  3795. #else
  3796. #ifdef vms
  3797. #define CTTNAM "TT:"
  3798. #else
  3799. #ifdef datageneral
  3800. #define CTTNAM "@output"
  3801. #else
  3802. #ifdef OSK
  3803. extern char myttystr[];
  3804. #define CTTNAM myttystr
  3805. #else
  3806. #ifdef OS2
  3807. #define CTTNAM "con"
  3808. #else
  3809. #ifdef UNIX
  3810. #define CTTNAM "/dev/tty"
  3811. #else
  3812. #ifdef GEMDOS
  3813. #define CTTNAM "aux:"
  3814. #else
  3815. #ifdef STRATUS
  3816. extern char myttystr[];
  3817. #define CTTNAM myttystr
  3818. #else /* Anyone else... */
  3819. #define CTTNAM "stdout"            /* This is a kludge used by Mac */
  3820. #endif /* STRATUS */
  3821. #endif /* GEMDOS */
  3822. #endif /* UNIX */
  3823. #endif /* OS2 */
  3824. #endif /* OSK */
  3825. #endif /* datageneral */
  3826. #endif /* vms */
  3827. #endif /* BEOS */
  3828.  
  3829. #ifndef HAVECTTNAM
  3830. #ifdef UNIX
  3831. #define HAVECTTNAM
  3832. #else
  3833. #ifdef VMS
  3834. #define HAVECTTNAM
  3835. #endif /* VMS */
  3836. #endif /* UNIX */
  3837. #endif /* HAVECTTNAM */
  3838.  
  3839. #ifndef ZFCDAT                /* zfcdat() function available? */
  3840. #ifdef UNIX
  3841. #define  ZFCDAT
  3842. #else
  3843. #ifdef STRATUS
  3844. #define  ZFCDAT
  3845. #else
  3846. #ifdef GEMDOS
  3847. #define  ZFCDAT
  3848. #else
  3849. #ifdef AMIGA
  3850. #define  ZFCDAT
  3851. #else
  3852. #ifdef OS2
  3853. #define  ZFCDAT
  3854. #else
  3855. #ifdef datageneral
  3856. #define  ZFCDAT
  3857. #else
  3858. #ifdef VMS
  3859. #define  ZFCDAT
  3860. #endif /* VMS */
  3861. #endif /* datageneral */
  3862. #endif /* OS2 */
  3863. #endif /* AMIGA */
  3864. #endif /* GEMDOS */
  3865. #endif /* STRATUS */
  3866. #endif /* UNIX */
  3867. #endif /* ZFCDAT */
  3868.  
  3869. #ifdef SUNS4S5
  3870. #define tolower _tolower
  3871. #define toupper _toupper
  3872. #endif /* SUNS4S5 */
  3873.  
  3874. /* Error number */
  3875.  
  3876. #ifdef _CRAY
  3877. #ifdef _CRAYCOM                /* Cray Computer Corp. */
  3878. extern int errno;
  3879. #else /* _CRAYCOM */
  3880. #include <errno.h>            /* Cray Research UNICOS defines */
  3881.                     /* errno as a function. */
  3882. #endif /* _CRAYCOM */            /* OK for UNICOS 6.1 and 7.0. */
  3883. #else /* _CRAY */
  3884. #ifdef STRATUS                /* Stratus VOS */
  3885. #include <errno.h>
  3886. #else /* not STRATUS */
  3887. #ifndef VMS
  3888. #ifndef OS2
  3889. /*
  3890.   The following declaration causes problems for VMS and OS/2, in which
  3891.   errno is an "extern volatile int noshare"...
  3892. */
  3893. extern int errno;            /* Needed by most modules. */
  3894. #endif /* OS2 */
  3895. #endif /* VMS */
  3896. #endif /* STRATUS */
  3897. #endif /* _CRAY */
  3898.  
  3899. #ifdef pdp11                /* Try to make some space on PDP-11 */
  3900. #ifndef NODIAL
  3901. #define NODIAL
  3902. #endif /* NODIAL */
  3903. #ifndef NOCURSES
  3904. #define NOCURSES
  3905. #endif /* NOCURSES */
  3906. #ifndef NOBIGBUF
  3907. #define NOBIGBUF
  3908. #endif /* NOBIGBUF */
  3909. #endif /* pdp11 */
  3910.  
  3911. #ifndef NOBIGBUF
  3912. #ifndef BIGBUFOK            /* Platforms with lots of memory */
  3913.  
  3914. #ifdef BSD44
  3915. #define BIGBUFOK
  3916. #endif /* BSD44 */
  3917.  
  3918. #ifdef STRATUS                /* Stratus VOS */
  3919. #define BIGBUFOK
  3920. #endif /* STRATUS */
  3921.  
  3922. #ifdef sparc                /* SPARC processors */
  3923. #define BIGBUFOK
  3924. #endif /* sparc */
  3925.  
  3926. #ifdef mips                /* MIPS processors */
  3927. #define BIGBUFOK
  3928. #endif /* mips */
  3929.  
  3930. #ifdef HPUX9                /* HP-UX 9.x */
  3931. #define BIGBUFOK
  3932. #endif /* HPUX9 */
  3933.  
  3934. #ifdef HPUX10                /* HP-UX 10.0 PA-RISC */
  3935. #define BIGBUFOK
  3936. #endif /* HPUX10 */
  3937.  
  3938. #ifdef NEXT                /* NeXTSTEP */
  3939. #ifdef mc68000                /* on NEXT platforms... */
  3940. #define BIGBUFOK
  3941. #endif /* mc68000 */
  3942. #endif /* NEXT */
  3943.  
  3944. #ifdef LINUX                /* Linux in 1998 should be OK */
  3945. #ifndef BIGBUFOK
  3946. #define BIGBUFOK
  3947. #endif /* BIGBUFOK */
  3948. #endif /* LINUX */
  3949.  
  3950. #ifdef OS2                /* 32-bit OS/2 2.x and above */
  3951. #ifdef __32BIT__
  3952. #define BIGBUFOK
  3953. #endif /* __32BIT__ */
  3954. #ifdef NT
  3955. #define BIGBUFOK
  3956. #endif /* NT */
  3957. #endif /* OS2 */
  3958.  
  3959. #ifdef Plan9                /* Plan 9 is OK */
  3960. #define BIGBUFOK
  3961. #endif /* Plan9 */
  3962.  
  3963. #ifdef VMS                /* Any VMS is OK */
  3964. #ifndef BIGBUFOK
  3965. #define BIGBUFOK
  3966. #endif /* BIGBUFOK */
  3967. #endif /* VMS */
  3968.  
  3969. #ifdef __alpha                /* DEC 64-bit Alpha, e.g. OSF/1 */
  3970. #ifndef BIGBUFOK            /* Might already be defined for VMS */
  3971. #define BIGBUFOK
  3972. #endif /* BIGBUFOK */
  3973. #endif /* __alpha */
  3974.  
  3975. #ifdef sgi                /* SGI with IRIX 4.0 or later */
  3976. #ifndef BIGBUFOK
  3977. #define BIGBUFOK
  3978. #endif /* BIGBUFOK */
  3979. #endif /* sgi */
  3980.  
  3981. #ifdef AIXRS                /* AIX on RISC */
  3982. #define BIGBUFOK
  3983. #endif /* AIXRS */
  3984.  
  3985. #ifdef CK_SCOV5                /* SCO OSR5 */
  3986. #ifndef BIGBUFOK
  3987. #define BIGBUFOK
  3988. #endif /* BIGBUFOK */
  3989. #endif /* CK_SCOV5 */
  3990.  
  3991. #endif /* BIGBUFOK */
  3992. #endif /* NOBIGBUF */
  3993.  
  3994. #ifdef CK_SMALL
  3995. #ifdef BIGBUFOK
  3996. #undef BIGBUFOK
  3997. #endif /* BIGBUFOK */
  3998. #endif /* CK_SMALL */
  3999.  
  4000. /* If "memory is no problem" then this improves performance */
  4001.  
  4002. #ifdef DEBUG
  4003. #ifdef BIGBUFOK
  4004. #ifndef IFDEBUG
  4005. #define IFDEBUG
  4006. #endif /* IFDEBUG */
  4007. #endif /* IFDEBUG */
  4008. #endif /* DEBUG */
  4009.  
  4010. /* File System Defaults */
  4011.  
  4012. #ifndef UIDBUFLEN            /* Length of User ID */
  4013. #ifdef OS2
  4014. #define UIDBUFLEN 256
  4015. #else /* OS2 */
  4016. #ifdef BIGBUFOK
  4017. #define UIDBUFLEN 256
  4018. #else
  4019. #define UIDBUFLEN 64
  4020. #endif /* BIGBUFOK */
  4021. #endif /* OS2 */
  4022. #endif /* UIDBUFLEN */
  4023.  
  4024. #ifdef UNIX
  4025. #ifdef PROVX1
  4026. #define MAXWLD 50
  4027. #else
  4028. #ifdef pdp11
  4029. #define MAXWLD 50
  4030. #else
  4031. #ifdef BIGBUFOK
  4032. #define MAXWLD 102400
  4033. #else
  4034. #define MAXWLD 1024
  4035. #endif /* BIGBUFOK */
  4036. #endif /* pdp11 */
  4037. #endif /* PROVX1 */
  4038. #else
  4039. #ifdef VMS
  4040. #define MAXWLD 102400            /* Maximum wildcard filenames */
  4041. #else
  4042. #ifdef datageneral
  4043. #define MAXWLD 500
  4044. #else
  4045. #ifdef STRATUS
  4046. #define MAXWLD 5000
  4047. #endif /* STRATUS */
  4048. #endif /* datageneral */
  4049. #endif /* VMS */
  4050. #endif /* UNIX */
  4051.  
  4052. #ifdef VMS
  4053. #define DBLKSIZ 512
  4054. #define DLRECL 512
  4055. #else
  4056. #define DBLKSIZ 0
  4057. #define DLRECL 0
  4058. #endif /* VMS */
  4059.  
  4060. /* Communication device / network host name length */
  4061.  
  4062. #ifdef BIGBUFOK
  4063. #define TTNAMLEN 512
  4064. #else
  4065. #ifdef MAC
  4066. #define TTNAMLEN 256
  4067. #else
  4068. #ifndef CK_SMALL
  4069. #define TTNAMLEN 128
  4070. #else
  4071. #define TTNAMLEN 80
  4072. #endif /* CK_SMALL */
  4073. #endif /* MAC */
  4074. #endif /* BIGBUFOK */
  4075.  
  4076. /* Program return codes for DECUS C and UNIX (VMS uses UNIX codes) */
  4077.  
  4078. #ifdef decus
  4079. #define GOOD_EXIT   IO_NORMAL
  4080. #define BAD_EXIT    IO_ERROR
  4081. #else
  4082. #define GOOD_EXIT   0
  4083. #define BAD_EXIT    1
  4084. #endif /* decus */
  4085.  
  4086. /* Special hack for Fortune, which doesn't have <sys/file.h>... */
  4087.  
  4088. #ifdef FT18
  4089. #define FREAD 0x01
  4090. #define FWRITE 0x10
  4091. #endif /* FT18 */
  4092.  
  4093. /* Special hack for OS-9/68k */
  4094. #ifdef OSK
  4095. #ifndef _UCC
  4096. #define SIGALRM 30            /* May always cancel I/O */
  4097. #endif /* _UCC */
  4098. #define SIGARB    1234            /* Arbitrary for I/O */
  4099. SIGTYP (*signal())();
  4100. #endif /* OSK */
  4101.  
  4102. #ifdef OS2
  4103. #ifdef putchar                  /* MSC 5.1 simply uses a macro which causes */
  4104. #undef putchar                  /* no problems. */
  4105. #endif /* putchar */
  4106. #endif /* OS2 */
  4107.  
  4108. #ifdef MINIX
  4109. #ifdef putchar
  4110. #undef putchar
  4111. #endif /* putchar */
  4112. #define putchar(c) (putc(c,stdout)!=EOF)&&fflush(stdout)
  4113. #endif /* MINIX */
  4114.  
  4115. #ifdef datageneral            /* Data General AOS/VS */
  4116. #ifdef putchar
  4117. #undef putchar
  4118. #endif /* putchar */
  4119. #define putchar(c) conoc(c)
  4120. #endif /* datageneral */
  4121.  
  4122. /* Escape/quote character used by the command parser */
  4123.  
  4124. #define CMDQ '\\'
  4125.  
  4126. /* Symbols for RS-232 modem signals */
  4127.  
  4128. #define KM_FG    1            /* Frame ground */
  4129. #define KM_TXD   2            /* Transmit */
  4130. #define KM_RXD   3            /* Receive */
  4131. #define KM_RTS   4            /* Request to Send */
  4132. #define KM_CTS   5            /* Clear to Send */
  4133. #define KM_DSR   6            /* Data Set Ready */
  4134. #define KM_SG    7            /* Signal ground */
  4135. #define KM_DCD   8            /* Carrier Detect */
  4136. #define KM_DTR  20            /* Data Terminal Ready */
  4137. #define KM_RI   22            /* Ring Indication */
  4138.  
  4139. /* Bit mask values for modem signals */
  4140.  
  4141. #define BM_CTS   0001            /* Clear to send       (From DCE) */
  4142. #define BM_DSR   0002            /* Dataset ready       (From DCE) */
  4143. #define BM_DCD   0004            /* Carrier             (From DCE) */
  4144. #define BM_RNG   0010            /* Ring Indicator      (From DCE) */
  4145. #define BM_DTR   0020            /* Data Terminal Ready (From DTE) */
  4146. #define BM_RTS   0040            /* Request to Send     (From DTE) */
  4147.  
  4148. /* Codes for full duplex flow control */
  4149.  
  4150. #define FLO_NONE 0            /* None */
  4151. #define FLO_XONX 1            /* Xon/Xoff (soft) */
  4152. #define FLO_RTSC 2            /* RTS/CTS (hard) */
  4153. #define FLO_DTRC 3            /* DTR/CD (hard) */
  4154. #define FLO_ETXA 4            /* ETX/ACK (soft) */
  4155. #define FLO_STRG 5            /* String-based (soft) */
  4156. #define FLO_DIAL 6            /* DIALing kludge */
  4157. #define FLO_DIAX 7            /* Cancel dialing kludge */
  4158. #define FLO_DTRT 8            /* DTR/CTS (hard) */
  4159. #define FLO_KEEP 9            /* Keep, i.e. don't touch or change */
  4160. #define FLO_AUTO 10            /* Figure out automatically */
  4161.  
  4162. /* Types of connections */
  4163.  
  4164. #define CXT_REMOTE  0            /* Remote mode - no connection */
  4165. #define CXT_DIRECT  1            /* Direct serial connection */
  4166. #define CXT_MODEM   2            /* Modem dialout */
  4167. #define CXT_TCPIP   3            /* TCP/IP - Telnet, Rlogin, etc */
  4168. #define CXT_X25     4            /* X.25 peer-to-peer */
  4169. #define CXT_DECNET  5            /* DECnet (CTERM, etc) */
  4170. #define CXT_LAT     6            /* LAT */
  4171. #define CXT_NETBIOS 7            /* NETBIOS */
  4172. #define CXT_NPIPE   8            /* Named Pipe */
  4173. #define CXT_SSH     9            /* SSH */
  4174. #define CXT_PIPE   10            /* Pipe, Command, PTY, DLL, etc */
  4175. #define CXT_MAX    10            /* Highest connection type */
  4176.  
  4177. /* Autodownload Detection Options */
  4178.  
  4179. #define ADL_PACK 0            /* Auto-Download detect packet */
  4180. #define ADL_STR  1            /* Auto-Download detect string */
  4181.  
  4182. /* And finally... */
  4183.  
  4184. #ifdef COMMENT                /* Make sure this is NOT defined! */
  4185. #undef COMMENT
  4186. #endif /* COMMENT */
  4187.  
  4188. /* Structure definitions for Kermit file attributes */
  4189. /* All strings come as pointer and length combinations */
  4190. /* Empty string (or for numeric variables, -1) = unused attribute. */
  4191.  
  4192. struct zstr {             /* string format */
  4193.     int len;              /* length */
  4194.     char *val;            /* value */
  4195. };
  4196. struct zattr {            /* Kermit File Attribute structure */
  4197.     long lengthk;         /* (!) file length in K */
  4198.     struct zstr type;     /* (") file type (text or binary) */
  4199.     struct zstr date;     /* (#) file creation date yyyymmdd[ hh:mm[:ss]] */
  4200.     struct zstr creator;  /* ($) file creator id */
  4201.     struct zstr account;  /* (%) file account */
  4202.     struct zstr area;     /* (&) area (e.g. directory) for file */
  4203.     struct zstr password; /* (') password for area */
  4204.     long blksize;         /* (() file blocksize */
  4205.     struct zstr xaccess;  /* ()) file access: new, supersede, append, warn */
  4206.     struct zstr encoding; /* (*) encoding (transfer syntax) */
  4207.     struct zstr disp;     /* (+) disposition (mail, message, print, etc) */
  4208.     struct zstr lprotect; /* (,) protection (local syntax) */
  4209.     struct zstr gprotect; /* (-) protection (generic syntax) */
  4210.     struct zstr systemid; /* (.) ID for system of origin */
  4211.     struct zstr recfm;    /* (/) record format */
  4212.     struct zstr sysparam; /* (0) system-dependent parameter string */
  4213.     long length;          /* (1) exact length on system of origin */
  4214.     struct zstr charset;  /* (2) transfer syntax character set */
  4215. #ifdef OS2
  4216.     struct zstr longname; /* OS/2 longname if applicable */
  4217. #endif /* OS2 */
  4218.     struct zstr reply;    /* This goes last, used for attribute reply */
  4219. };
  4220.  
  4221. /* Kermit file information structure */
  4222.  
  4223. struct filinfo {
  4224.   int bs;                /* Blocksize */
  4225.   int cs;                /* Character set */
  4226.   long rl;                /* Record length */
  4227.   int org;                /* Organization */
  4228.   int fmt;                /* Record format */
  4229.   int cc;                /* Carriage control */
  4230.   int typ;                /* Type (text/binary) */
  4231.   int dsp;                /* Disposition */
  4232.   char *os_specific;            /* OS-specific attributes */
  4233. #ifdef OS2
  4234.   unsigned long int lblopts; /* LABELED FILE options bitmask */
  4235. #else
  4236.   int lblopts;
  4237. #endif /* OS2 */
  4238. };
  4239.  
  4240. #ifndef ZFNQFP                /* Versions that have zfnqfp() */
  4241. #ifdef UNIX
  4242. #define ZFNQFP
  4243. #else
  4244. #ifdef VMS
  4245. #define ZFNQFP
  4246. #else
  4247. #ifdef OS2
  4248. #define ZFNQFP
  4249. #else
  4250. #ifdef datageneral
  4251. #define ZFNQFP
  4252. #else
  4253. #ifdef STRATUS
  4254. #define ZFNQFP
  4255. #endif /* STRATUS */
  4256. #endif /* datageneral */
  4257. #endif /* OS2 */
  4258. #endif /* VMS */
  4259. #endif /* UNIX */
  4260. struct zfnfp {
  4261.    int len;
  4262.    char * fpath;
  4263.    char * fname;
  4264. };
  4265. #endif /* ZFNQFP */
  4266.  
  4267. /* Systems that support FILE TYPE LABELED */
  4268.  
  4269. #ifdef VMS
  4270. #define CK_LABELED
  4271. #else
  4272. #ifdef OS2
  4273. #ifdef __32BIT__
  4274. #ifndef NT
  4275. #define CK_LABELED
  4276. #endif /* NT */
  4277. #endif /* __32BIT__ */
  4278. #endif /* OS2 */
  4279. #endif /* VMS */
  4280.  
  4281. /* LABELED FILE options bitmask */
  4282.  
  4283. #ifdef VMS                /* For VMS */
  4284. #define LBL_NAM  1            /* Ignore incoming name if set */
  4285. #define LBL_PTH  2            /* Use complete path if set */
  4286. #define LBL_ACL  4            /* Preserve ACLs if set */
  4287. #define LBL_BCK  8            /* Preserve backup date if set */
  4288. #define LBL_OWN 16            /* Preserve ownership if set */
  4289.  
  4290. #else
  4291.  
  4292. #ifdef OS2                /* Ditto for OS/2 */
  4293. #define LBL_NOR  0x0000            /* Normal file */
  4294. #define LBL_ARC  0x0020            /* Archive */
  4295. #define LBL_DIR  0x0010            /* Directory */
  4296. #define LBL_HID  0x0002            /* Hidden file */
  4297. #define LBL_RO   0x0001            /* Read only file */
  4298. #define LBL_SYS  0x0004            /* System file */
  4299. #define LBL_EXT  0x0040            /* Extended */
  4300. #endif /* OS2 */
  4301. #endif /* VMS */
  4302.  
  4303. /*
  4304.   Data types.  First the header file for data types so we can pick up the
  4305.   types used for pids, uids, and gids.  Override this section by putting
  4306.   -DCKTYP_H=xxx on the command line to specify the header file where your
  4307.   system defines these types.
  4308. */
  4309. #ifndef STRATUS
  4310. #ifdef __ALPHA
  4311. #ifdef MULTINET
  4312. #define CK_TGV_AXP
  4313. #endif /* MULTINET */
  4314. #endif /* __ALPHA */
  4315.  
  4316. #ifdef CK_TGV_AXP            /* Alpha, VMS, MultiNet */
  4317. /*
  4318.   Starting in DECC 5.0, <stdlib.h> no longer includes <types.h>.
  4319.   But before that an elaborate workaround is required, which results in
  4320.   including <types.h> sometimes but not others, evidently depending on whether
  4321.   <types.h> protects itself against multiple inclusion, which in turn probably
  4322.   differentiates between DECC <types.h> and TGV <types.h>.  Unfortunately I
  4323.   don't remember the details.  (fdc, 25 Oct 96)
  4324. */
  4325. #ifdef COMMENT
  4326. /*
  4327.   Previously the test here was for DEC version prior to 4.0, but since the
  4328.   test involved an "#if" statement, it was not portable and broke some non-VMS
  4329.   builds.  In any case, condition was never satisfied, so the result of
  4330.   commenting this section out is the same as the previous "#if" condition.
  4331. */
  4332. #ifndef __TYPES_LOADED
  4333. #define __TYPES_LOADED            /* Work around bug in .h files */
  4334. #endif /* __TYPES_LOADED */
  4335. #endif /* COMMENT */
  4336. #include <sys/types.h>
  4337. #ifdef IF_DOT_H
  4338. #ifndef MULTINET
  4339. #include <if.h>                /* Needed to put up u_int typedef */
  4340. #endif /* MULTINET */
  4341. #else
  4342. #ifdef NEEDUINT
  4343. typedef unsigned int u_int;
  4344. #endif /* NEEDUINT */
  4345. #endif /* IF_DOT_H */
  4346. #else                    /* !CK_TGV_AXP */
  4347. #ifdef OSK                /* OS-9 */
  4348. #include <types.h>
  4349. #else                    /* General case, not OS-9 */
  4350. #ifndef CKTYP_H
  4351. #ifndef VMS
  4352. #ifndef MAC
  4353. #ifndef AMIGA
  4354. #define CKTYP_H <sys/types.h>
  4355. #endif /* AMIGA */
  4356. #endif /* MAC */
  4357. #endif /* VMS */
  4358. #endif /* CKTYP_H */
  4359.  
  4360. #ifdef GEMDOS
  4361. #undef CKTYP_H
  4362. #include <types.h>
  4363. #endif /* GEMDOS */
  4364.  
  4365. #ifdef OS2
  4366. #undef CKTYP_H
  4367. #include <sys/types.h>
  4368. #endif /* OS2 */
  4369.  
  4370. #ifdef CKTYP_H                /* Include it. */
  4371. #ifdef COHERENT                /* Except for COHERENT */
  4372. #include <unistd.h>
  4373. #include <sys/types.h>
  4374. #else
  4375. #ifdef datageneral            /* AOS/VS */
  4376. #include <sys/types.h>
  4377. #else  /* All others */
  4378. #ifdef __bsdi__                /* BSDI */
  4379. #ifdef POSIX
  4380. #undef _POSIX_SOURCE
  4381. #endif /* POSIX */
  4382. #endif /* __bsdi__ */
  4383. #include CKTYP_H
  4384. #ifdef __bsdi__
  4385. #ifdef POSIX
  4386. #define _POSIX_SOURCE
  4387. #endif /* POSIX */
  4388. #endif /* __bsdi__ */
  4389. #endif /* datageneral */
  4390. #endif /* COHERENT */
  4391. #endif /* CKTYP_H */
  4392.  
  4393. #endif /* OSK */
  4394. #endif /* CK_TGV_AXP */
  4395. #endif /* STRATUS */            /* End of types.h section */
  4396.  
  4397. /*
  4398.   Data type for pids.  If your system uses a different type, put something
  4399.   like -DPID_T=pid_t on command line, or override here.
  4400. */
  4401. #ifndef PID_T
  4402. #define PID_T int
  4403. #endif /* PID_T */
  4404. /*
  4405.   Data types for uids and gids.  Same deal as for pids.
  4406.   Wouldn't be nice if there was a preprocessor test to find out if a
  4407.   typedef existed?
  4408. */
  4409. #ifdef VMS
  4410. /* Not used in VMS so who cares */
  4411. #define UID_T int
  4412. #define GID_T int
  4413. #endif /* VMS */
  4414.  
  4415. #ifdef POSIX
  4416. /* Or would it be better (or worse?) to use _POSIX_SOURCE here? */
  4417. #ifndef UID_T
  4418. #define UID_T uid_t
  4419. #endif /* UID_T */
  4420. #ifndef GID_T
  4421. #define GID_T gid_t
  4422. #endif /* GID_T */
  4423. #else /* Not POSIX */
  4424. #ifdef SVR4
  4425. /* SVR4 and later have uid_t and gid_t. */
  4426. /* SVR3 and earlier use int, or unsigned short, or.... */
  4427. #ifndef UID_T
  4428. #define UID_T uid_t
  4429. #endif /* UID_T */
  4430. #ifndef GID_T
  4431. #define GID_T gid_t
  4432. #endif /* GID_T */
  4433. #else /* Not SVR4 */
  4434. #ifdef BSD43
  4435. #ifndef UID_T
  4436. #define UID_T uid_t
  4437. #endif /* UID_T */
  4438. #ifndef GID_T
  4439. #define GID_T gid_t
  4440. #endif /* GID_T */
  4441. #else /* Not BSD43 */
  4442. /* Default these to int for older UNIX versions */
  4443. #ifndef UID_T
  4444. #define UID_T int
  4445. #endif /* UID_T */
  4446. #ifndef GID_T
  4447. #define GID_T int
  4448. #endif /* GID_T */
  4449. #endif /* BSD43 */
  4450. #endif /* SVR4  */
  4451. #endif /* POSIX */
  4452.  
  4453. /*
  4454.   getpwuid() arg type, which is not necessarily the same as UID_T,
  4455.   e.g. in SCO UNIX SVR3, it's int.
  4456. */
  4457. #ifndef PWID_T
  4458. #define PWID_T UID_T
  4459. #endif /* PWID_T */
  4460.  
  4461. #ifdef CK_REDIR
  4462. #ifdef NEXT
  4463. #define MACHWAIT
  4464. #else
  4465. #ifdef MACH
  4466. #define MACHWAIT
  4467. #endif /* MACH */
  4468. #endif /* NEXT */
  4469.  
  4470. #ifdef MACHWAIT                /* WAIT_T argument for wait() */
  4471. #include <sys/wait.h>
  4472. #define CK_WAIT_H
  4473. typedef union wait WAIT_T;
  4474. #else
  4475. #ifdef POSIX
  4476. #include <sys/wait.h>
  4477. #define CK_WAIT_H
  4478. #ifndef WAIT_T
  4479. typedef int WAIT_T;
  4480. #endif /* WAIT_T */
  4481. #else /* !POSIX */
  4482. typedef int WAIT_T;
  4483. #endif /* POSIX */
  4484. #endif /* MACHWAIT */
  4485. #else
  4486. typedef int WAIT_T;
  4487. #endif /* CK_REDIR */
  4488.  
  4489. /* Assorted other blah_t's handled here... */
  4490.  
  4491. #ifndef SIZE_T
  4492. #define SIZE_T size_t
  4493. #endif /* SIZE_T */
  4494.  
  4495. /* Forward declarations of system-dependent functions callable from all */
  4496. /* C-Kermit modules. */
  4497.  
  4498. /* File-related functions from system-dependent file i/o module */
  4499.  
  4500. #ifndef CKVFIO_C
  4501. /* For some reason, this does not agree with DEC C */
  4502. _PROTOTYP( int zkself, (void) );
  4503. #endif /* CKVFIO_C */
  4504. _PROTOTYP( int zopeni, (int, char *) );
  4505. _PROTOTYP( int zopeno, (int, char *, struct zattr *, struct filinfo *) );
  4506. _PROTOTYP( int zclose, (int) );
  4507. #ifndef MAC
  4508. _PROTOTYP( int zchin, (int, int *) );
  4509. #endif /* MAC */
  4510. _PROTOTYP( int zsinl, (int, char *, int) );
  4511. _PROTOTYP( int zinfill, (void) );
  4512. _PROTOTYP( int zsout, (int, char*) );
  4513. _PROTOTYP( int zsoutl, (int, char*) );
  4514. _PROTOTYP( int zsoutx, (int, char*, int) );
  4515. _PROTOTYP( int zchout, (int, char) );
  4516. _PROTOTYP( int zoutdump, (void) );
  4517. _PROTOTYP( int zsyscmd, (char *) );
  4518. _PROTOTYP( int zshcmd, (char *) );
  4519. #ifdef CKEXEC
  4520. _PROTOTYP( VOID z_exec, (char *, char **, int) );
  4521. #endif /* CKEXEC */
  4522. _PROTOTYP( int chkfn, (int) );
  4523. _PROTOTYP( long zchki, (char *) );
  4524. #ifdef VMSORUNIX
  4525. _PROTOTYP( long zgetfs, (char *) );
  4526. #else
  4527. #ifdef OS2
  4528. #else
  4529. _PROTOTYP( long zgetfs, (char *) );
  4530. #define zgetfs(a) zchki(a)
  4531. #endif /* OS2 */
  4532. #endif /* VMSORUNIX */
  4533. _PROTOTYP( int iswild, (char *) );
  4534. _PROTOTYP( int isdir, (char *) );
  4535. _PROTOTYP( int zchko, (char *) );
  4536. _PROTOTYP( int zdelet, (char *) );
  4537. _PROTOTYP( VOID zrtol, (char *,char *) );
  4538. _PROTOTYP( VOID zltor, (char *,char *) );
  4539. _PROTOTYP( VOID zstrip, (char *,char **) );
  4540. #ifdef VMS
  4541. _PROTOTYP( char * zrelname, (char *, char *) );
  4542. #endif /* VMS */
  4543. _PROTOTYP( int zchdir, (char *) );
  4544. _PROTOTYP( char * zhome, (void) );
  4545. _PROTOTYP( char * zgtdir, (void) );
  4546. _PROTOTYP( int zxcmd, (int, char *) );
  4547. #ifndef MAC
  4548. _PROTOTYP( int zclosf, (int) );
  4549. #endif /* MAC */
  4550. #ifdef NZXPAND
  4551. _PROTOTYP( int nzxpand, (char *, int) );
  4552. #else /* NZXPAND */
  4553. _PROTOTYP( int zxpand, (char *) );
  4554. #endif /* NZXPAND */
  4555. _PROTOTYP( int znext, (char *) );
  4556. #ifdef ZXREWIND
  4557. _PROTOTYP( int zxrewind, (void) );
  4558. #endif /* ZXREWIND */
  4559. _PROTOTYP( int zchkspa, (char *, long) );
  4560. _PROTOTYP( VOID znewn, (char *, char **) );
  4561. _PROTOTYP( int zrename, (char *, char *) );
  4562. _PROTOTYP( int zcopy, (char *, char *) );
  4563. _PROTOTYP( int zsattr, (struct zattr *) );
  4564. _PROTOTYP( int zfree, (char *) );
  4565. _PROTOTYP( char * zfcdat, (char *) );
  4566. #ifdef HPUX10
  4567. #ifdef CK_ANSIC
  4568. _PROTOTYP( int zstime, (const char *, struct zattr *, int) );
  4569. #else
  4570. _PROTOTYP( int zstime, (char *, struct zattr *, int) );
  4571. #endif /* CK_ANSIC */
  4572. #else
  4573. _PROTOTYP( int zstime, (char *, struct zattr *, int) );
  4574. #endif /* HPUX10 */
  4575. #ifdef CK_PERMS
  4576. _PROTOTYP( char * zgperm, (char *) );
  4577. _PROTOTYP( char * ziperm, (char *) );
  4578. #endif /* CK_PERMS */
  4579. _PROTOTYP( int zmail, (char *, char *) );
  4580. _PROTOTYP( int zprint, (char *, char *) );
  4581. _PROTOTYP( char * tilde_expand, (char *) );
  4582. _PROTOTYP( int zmkdir, (char *) ) ;
  4583. _PROTOTYP( int zfseek, (long) ) ;
  4584. #ifdef ZFNQFP
  4585. _PROTOTYP( struct zfnfp * zfnqfp, (char *, int, char * ) ) ;
  4586. #else
  4587. #define zfnqfp(a,b,c) ckstrncpy(c,a,b)
  4588. #endif /* ZFNQFP */
  4589. _PROTOTYP( int zvuser, (char *) ) ;
  4590. _PROTOTYP( int zvpass, (char *) ) ;
  4591. _PROTOTYP( VOID zvlogout, (void) ) ;
  4592. #ifdef OS2
  4593. _PROTOTYP( int os2setlongname, ( char * fn, char * ln ) ) ;
  4594. _PROTOTYP( int os2getlongname, ( char * fn, char ** ln ) ) ;
  4595. _PROTOTYP( int os2rexx, ( char *, char *, int ) ) ;
  4596. _PROTOTYP( int os2rexxfile, ( char *, char *, char *, int) ) ;
  4597. _PROTOTYP( int os2geteas, (char *) ) ;
  4598. _PROTOTYP( int os2seteas, (char *) ) ;
  4599. _PROTOTYP( char * get_os2_vers, (void) ) ;
  4600. _PROTOTYP( int do_label_send, (char *) ) ;
  4601. _PROTOTYP( int do_label_recv, (void) ) ;
  4602. #ifdef OS2MOUSE
  4603. _PROTOTYP( unsigned long os2_mouseon, (void) );
  4604. _PROTOTYP( unsigned long os2_mousehide, (void) );
  4605. _PROTOTYP( unsigned long os2_mouseshow, (void) );
  4606. _PROTOTYP( unsigned long os2_mouseoff, (void) );
  4607. _PROTOTYP( void os2_mouseevt, (void *) );
  4608. #endif /* OS2MOUSE */
  4609. #endif /* OS2 */
  4610.  
  4611. /* Functions from system-dependent terminal i/o module */
  4612.  
  4613. _PROTOTYP( int ttopen, (char *, int *, int, int) );  /* tty functions */
  4614. #ifndef MAC
  4615. _PROTOTYP( int ttclos, (int) );
  4616. #endif /* MAC */
  4617. _PROTOTYP( int tthang, (void) );
  4618. _PROTOTYP( int ttres, (void) );
  4619. _PROTOTYP( int ttpkt, (long, int, int) );
  4620. #ifndef MAC
  4621. _PROTOTYP( int ttvt, (long, int) );
  4622. #endif /* MAC */
  4623. _PROTOTYP( int ttsspd, (int) );
  4624. _PROTOTYP( long ttgspd, (void) );
  4625. _PROTOTYP( int ttflui, (void) );
  4626. _PROTOTYP( int ttfluo, (void) );
  4627. _PROTOTYP( int ttpushback, (CHAR *, int) );
  4628. _PROTOTYP( int ttpeek, (void) );
  4629. _PROTOTYP( int ttgwsiz, (void) );
  4630. _PROTOTYP( int ttchk, (void) );
  4631. _PROTOTYP( int ttxin, (int, CHAR *) );
  4632. _PROTOTYP( int ttxout, (CHAR *, int) );
  4633. _PROTOTYP( int ttol, (CHAR *, int) );
  4634. _PROTOTYP( int ttoc, (char) );
  4635. _PROTOTYP( int ttinc, (int) );
  4636. _PROTOTYP( int ttscarr, (int) );
  4637. _PROTOTYP( int ttgmdm, (void) );
  4638. _PROTOTYP( int ttsndb, (void) );
  4639. _PROTOTYP( int ttsndlb, (void) );
  4640. #ifdef PARSENSE
  4641. #ifdef UNIX
  4642. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4643. #else
  4644. #ifdef VMS
  4645. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4646. #else
  4647. #ifdef STRATUS
  4648. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4649. #else
  4650. #ifdef OS2
  4651. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4652. #else
  4653. #ifdef OSK
  4654. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4655. #else
  4656. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR) );
  4657. #endif /* OSK */
  4658. #endif /* OS2 */
  4659. #endif /* STRATUS */
  4660. #endif /* VMS */
  4661. #endif /* UNIX */
  4662. #else /* ! PARSENSE */
  4663. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR) );
  4664. #endif /* PARSENSE */
  4665.  
  4666. /* XYZMODEM support */
  4667.  
  4668. /*
  4669.   CK_XYZ enables the various commands and data structures.
  4670.   XYZ_INTERNAL means these protocols are built-in; if not defined,
  4671.   then they are external.  XYZ_DLL is used to indicate a separate
  4672.   loadable library containing the XYZmodem protocol code.
  4673. */
  4674. #ifdef pdp11                /* No room for this in PDP-11 */
  4675. #define NOCKXYZ
  4676. #endif /* pdp11 */
  4677.  
  4678. #ifndef NOCKXYZ                /* Alternative protocols */
  4679. #ifndef CK_XYZ
  4680. #ifdef UNIX
  4681. #define CK_XYZ
  4682. #else
  4683. #ifdef OS2
  4684. #define CK_XYZ
  4685. #ifndef NOXYZDLL
  4686. #define XYZ_INTERNAL            /* Internal and DLL */
  4687. #define XYZ_DLL
  4688. #endif /* NOXYZDLL */
  4689. #endif /* OS2 */
  4690. #endif /* UNIX */
  4691. #endif /* CK_XYZ */
  4692. #endif /* NOCKXYZ */
  4693.  
  4694. #ifdef XYZ_INTERNAL            /* This ensures that XYZ_INTERNAL */
  4695. #ifndef CK_XYZ                /* is defined only if CK_XYZ is too */
  4696. #undef XYZ_INTERNAL
  4697. #endif /* CK_XYZ */
  4698. #endif /* XYZ_INTERNAL */
  4699. #ifdef XYZ_DLL                /* This ensures XYZ_DLL is defined */
  4700. #ifndef XYZ_INTERNAL            /* only if XYZ_INTERNAL is too */
  4701. #undef XYZ_DLL
  4702. #endif /* XYZ_INTERNAL */
  4703. #endif /* XYZ_DLL */
  4704.  
  4705. /* Console functions */
  4706.  
  4707. _PROTOTYP( int congm, (void) );
  4708. #ifdef COMMENT
  4709. _PROTOTYP( VOID conint, (SIGTYP (*)(int, int), SIGTYP (*)(int, int)) );
  4710. #else
  4711. _PROTOTYP( VOID conint, (SIGTYP (*)(int), SIGTYP (*)(int)) );
  4712. #endif /* COMMENT */
  4713. _PROTOTYP( VOID connoi, (void) );
  4714. _PROTOTYP( int concb, (char) );
  4715. #ifdef CONGSPD
  4716. _PROTOTYP( long congspd, (void) );
  4717. #endif /* CONGSPD */
  4718. _PROTOTYP( int conbin, (char) );
  4719. _PROTOTYP( int conres, (void) );
  4720. _PROTOTYP( int conoc, (char) );
  4721. _PROTOTYP( int conxo, (int, char *) );
  4722. _PROTOTYP( int conol, (char *) );
  4723. _PROTOTYP( int conola, (char *[]) );
  4724. _PROTOTYP( int conoll, (char *) );
  4725. _PROTOTYP( int conchk, (void) );
  4726. _PROTOTYP( int coninc, (int) );
  4727. _PROTOTYP( char * conkbg, (void) );
  4728. _PROTOTYP( int psuspend, (int) );
  4729. _PROTOTYP( int priv_ini, (void) );
  4730. _PROTOTYP( int priv_on, (void) );
  4731. _PROTOTYP( int priv_off, (void) );
  4732. _PROTOTYP( int priv_can, (void) );
  4733. _PROTOTYP( int priv_chk, (void) );
  4734. _PROTOTYP( int priv_opn, (char *, int) );
  4735.  
  4736. _PROTOTYP( int sysinit, (void) );    /* Misc Kermit functions */
  4737. _PROTOTYP( int syscleanup, (void) );
  4738. _PROTOTYP( int msleep, (int) );
  4739. _PROTOTYP( VOID rtimer, (void) );
  4740. _PROTOTYP( int gtimer, (void) );
  4741. #ifdef GFTIMER
  4742. _PROTOTYP( VOID rftimer, (void) );
  4743. _PROTOTYP( CKFLOAT gftimer, (void) );
  4744. #endif /* GFTIMER */
  4745. _PROTOTYP( VOID ttimoff, (void) );
  4746. _PROTOTYP( VOID ztime, (char **) );
  4747. _PROTOTYP( int parchk, (CHAR *, CHAR, int) );
  4748. _PROTOTYP( VOID doexit, (int, int) );
  4749. _PROTOTYP( int askmore, (void) );
  4750. _PROTOTYP( VOID fatal, (char *) );
  4751. _PROTOTYP( VOID fatal2, (char *, char *) );
  4752. #ifdef VMS
  4753. _PROTOTYP( int ck_cancio, (void) );
  4754. #endif /* VMS */
  4755.  
  4756. /* Key mapping support */
  4757.  
  4758. #ifdef NOICP
  4759. #ifndef NOSETKEY
  4760. #define NOSETKEY
  4761. #endif /* NOSETKEY */
  4762. #endif /* NOICP */
  4763.  
  4764. #ifdef MAC
  4765. #ifndef NOSETKEY
  4766. #define NOSETKEY
  4767. #endif /* NOSETKEY */
  4768. #endif /* MAC */
  4769.  
  4770. _PROTOTYP( int congks, (int) );
  4771. #ifndef NOSETKEY
  4772. #ifdef OS2
  4773. #define KMSIZE 8916
  4774. typedef ULONG KEY;
  4775. typedef CHAR *MACRO;
  4776. extern int wideresult;
  4777. #else /* Not OS2 */
  4778. /*
  4779.   Catch-all for systems where we don't know how to read keyboard scan
  4780.   codes > 255.  Note: CHAR (i.e. unsigned char) is very important here.
  4781. */
  4782. #define KMSIZE 256
  4783. typedef CHAR KEY;
  4784. typedef CHAR * MACRO;
  4785. #define congks coninc
  4786. #endif /* OS2 */
  4787. #endif /* NOSETKEY */
  4788.  
  4789. #ifndef NOKVERBS            /* No \Kverbs unless... */
  4790. #define NOKVERBS
  4791. #endif /* NOKVERBS */
  4792.  
  4793. #ifdef OS2                /* \Kverbs are supported in OS/2 */
  4794. #undef NOKVERBS
  4795. /*
  4796.   Note: this value chosen to be bigger than PC BIOS key modifier bits,
  4797.   but still fit in 16 bits without affecting sign.
  4798.  
  4799.   As of K95 1.1.5, this no longer fits in 16 bits, good thing we are 32 bit.
  4800. */
  4801. #define F_MACRO 0x2000          /* Bit indicating a macro indice */
  4802. #define IS_MACRO(x) (x & F_MACRO)
  4803. #define F_KVERB 0x4000            /* Bit indicating a keyboard verb */
  4804. #define IS_KVERB(x) (x & F_KVERB)    /* Test this bit */
  4805. #endif /* OS2 */
  4806.  
  4807. #define F_ESC   0x8000        /* Bit indicating ESC char combination */
  4808. #define IS_ESC(x) (x & F_ESC)
  4809. #define F_CSI   0x10000        /* Bit indicating CSI char combination */
  4810. #define IS_CSI(x) (x & F_CSI)
  4811.  
  4812. #ifdef NOSPL                /* This might be overkill.. */
  4813. #ifndef NOKVERBS            /* Not all \Kverbs require */
  4814. #define NOKVERBS            /* the script programming language. */
  4815. #endif /* NOKVERBS */
  4816. #ifndef NOTAKEARGS
  4817. #define NOTAKEARGS
  4818. #endif /* NOTAKEARGS */
  4819. #endif /* NOSPL */
  4820.  
  4821. /*
  4822.   Function prototypes for system and library functions.
  4823. */
  4824. #ifdef _POSIX_SOURCE
  4825. #ifndef VMS
  4826. #ifndef MAC
  4827. #define CK_ANSILIBS
  4828. #endif /* MAC */
  4829. #endif /* VMS */
  4830. #endif /* _POSIX_SOURCE */
  4831.  
  4832. #ifdef NEXT
  4833. #define CK_ANSILIBS
  4834. #endif /* NEXT */
  4835.  
  4836. #ifdef SVR4
  4837. #define CK_ANSILIBS
  4838. #endif /* SVR4 */
  4839.  
  4840. #ifdef STRATUS                /* Stratus VOS uses ANSI libraries */
  4841. #define CK_ANSILIBS
  4842. #endif /* STRATUS */
  4843.  
  4844. #ifdef OS2
  4845. #define CK_ANSILIBS
  4846. #ifndef NOCURSES
  4847. #define MYCURSES
  4848. #endif /* NOCURSES */
  4849. #define CK_RTSCTS
  4850. #ifdef __IBMC__
  4851. #define S_IFMT 0xF000
  4852. #define timezone _timezone
  4853. #endif /* __IBMC__ */
  4854. #include <fcntl.h>
  4855. #include <io.h>
  4856. #ifdef __EMX__
  4857. #ifndef __32BIT__
  4858. #define __32BIT__
  4859. #endif /* __32BIT__ */
  4860. #include <sys/timeb.h>
  4861. #else
  4862. #include <direct.h>
  4863. #ifdef OS2
  4864. #undef SIGALRM
  4865. #endif /* OS2 */
  4866. #ifndef SIGUSR1
  4867. #define SIGUSR1 7
  4868. #endif /* SIGUSR1 */
  4869. #define SIGALRM SIGUSR1
  4870. _PROTOTYP( unsigned alarm, (unsigned) );
  4871. _PROTOTYP( unsigned sleep, (unsigned) );
  4872. #endif /* __EMX__ */
  4873. #ifdef OS2
  4874. _PROTOTYP( unsigned long zdskspace, (int) );
  4875. #else
  4876. _PROTOTYP( long zdskspace, (int) );
  4877. #endif /* OS2 */
  4878. _PROTOTYP( int zchdsk, (int) );
  4879. _PROTOTYP( int conincraw, (int) );
  4880. _PROTOTYP( int ttiscom, (int f) );
  4881. _PROTOTYP( int IsFileNameValid, (char *) );
  4882. _PROTOTYP( void ChangeNameForFAT, (char *) );
  4883. _PROTOTYP( char *GetLoadPath, (void) );
  4884. #endif /* OS2 */
  4885.  
  4886. /* Fullscreen file transfer display items... */
  4887.  
  4888. #ifndef NOCURSES
  4889. #ifdef CK_NCURSES            /* CK_NCURSES implies CK_CURSES */
  4890. #ifndef CK_CURSES
  4891. #define CK_CURSES
  4892. #endif /* CK_CURSES */
  4893. #endif /* CK_NCURSES */
  4894.  
  4895. #ifdef MYCURSES                /* MYCURSES implies CK_CURSES */
  4896. #ifndef CK_CURSES
  4897. #define CK_CURSES
  4898. #endif /* CK_CURSES */
  4899. #endif /* MYCURSES */
  4900. #endif /* NOCURSES */
  4901.  
  4902. #ifdef NOCURSES
  4903. #ifdef CK_CURSES
  4904. #undef CK_CURSES
  4905. #endif /* CK_CURSES */
  4906. #ifndef NODISPLAY
  4907. #define NODISPLAY
  4908. #endif /* NODISPLAY */
  4909. #endif /* NOCURSES */
  4910.  
  4911. #ifdef CK_CURSES
  4912. /*
  4913.   The CK_WREFRESH symbol is defined if the curses library provides
  4914.   clearok() and wrefresh() functions, which are used in repainting
  4915.   the screen.
  4916. */
  4917. #ifdef NOWREFRESH            /* Override CK_WREFRESH */
  4918.  
  4919. #ifdef CK_WREFRESH            /* If this is defined, */
  4920. #undef CK_WREFRESH            /* undefine it. */
  4921. #endif /* CK_WREFRESH */
  4922.  
  4923. #else /* !NOWREFRESH */            /* No override... */
  4924.  
  4925. #ifndef CK_WREFRESH            /* If CK_WREFRESH not defined */
  4926. /*
  4927.   Automatically define it for systems known to have it ...
  4928. */
  4929. #ifdef VMS                /* DEC (Open)VMS has it */
  4930. #define CK_WREFRESH
  4931. #else
  4932. #ifdef ultrix                /* DEC ULTRIX has it */
  4933. #else
  4934. #ifdef SVR3                /* System V has it */
  4935. #define CK_WREFRESH
  4936. #else
  4937. #ifdef BSD44                /* 4.4 BSD has it */
  4938. #define CK_WREFRESH
  4939. #else
  4940. #ifdef NEXT                /* Define it for NeXTSTEP */
  4941. #define CK_WREFRESH
  4942. #else
  4943. #ifdef SUNOS4                /* SunOS 4.x... */
  4944. #define CK_WREFRESH
  4945. #else
  4946. #ifdef SOLARIS25            /* Solaris 2.5 and later */
  4947. #define CK_WREFRESH
  4948. #else
  4949. #ifdef AIXRS                /* RS/6000 AIX ... */
  4950. #define CK_WREFRESH
  4951. #else
  4952. #ifdef RTAIX                /* RT PC AIX ... */
  4953. #define CK_WREFRESH
  4954. #else
  4955. #ifdef OSF                /* DEC OSF/1 ... */
  4956. #define CK_WREFRESH
  4957.  
  4958. /* Add more here, or just define CK_WREFRESH on the CC command line... */
  4959.  
  4960. #endif /* OSF */
  4961. #endif /* RTAIX */
  4962. #endif /* AIXRS */
  4963. #endif /* SOLARIS25 */
  4964. #endif /* SUNOS4 */
  4965. #endif /* NEXT */
  4966. #endif /* BSD44 */
  4967. #endif /* SVR3 */
  4968. #endif /* ultrix */
  4969. #endif /* VMS */
  4970.  
  4971. #else /* CK_WREFRESH is defined */
  4972.  
  4973. #ifndef CK_CURSES            /* CK_WREFRESH implies CK_CURSES */
  4974. #define CK_CURSES
  4975. #endif /* CK_CURSES */
  4976.  
  4977. #endif /* CK_WREFRESH */
  4978. #endif /* NOWREFRESH */
  4979.  
  4980. #ifndef TRMBUFL
  4981. #ifdef BIGBUFOK
  4982. #define TRMBUFL 16384
  4983. #else
  4984. #ifdef DYNAMIC
  4985. #define TRMBUFL 8192
  4986. #else
  4987. #define TRMBUFL 1024
  4988. #endif /* BIGBUFOK */
  4989. #endif /* DYNAMIC */
  4990. #endif /* TRMBUFL */
  4991. #endif /* CK_CURSES */
  4992.  
  4993. /*
  4994.   Whether to use ckmatch() in all its glory for pretty much full regexes.
  4995.   If CKREGEX is NOT defined, all but * and ? matching are removed from
  4996.   ckmatch().  NOTE: Defining CKREGEX does not necessarily mean that ckmatch()
  4997.   regexes are used for filename matching.  That depends on whether zxpand()
  4998.   in ck?fio.c calls ckmatch().
  4999. */
  5000. #ifndef NOCKREGEX
  5001. #ifndef CKREGEX
  5002. #define CKREGEX
  5003. #endif /* CKREGEX */
  5004. #endif /* NOCKREGEX */
  5005.  
  5006. #ifdef CK_ANSILIBS
  5007. /*
  5008.   String library functions.
  5009.   For ANSI C, get prototypes from <string.h>.
  5010.   Otherwise, skip the prototypes.
  5011. */
  5012. #include <string.h>
  5013.  
  5014. /*
  5015.   Prototypes for other commonly used library functions, such as
  5016.   malloc, free, getenv, atol, atoi, and exit.  Otherwise, no prototypes.
  5017. */
  5018. #include <stdlib.h>
  5019. #ifdef DIAB /* DIAB DS90 */
  5020. /* #include <commonC.h>  */
  5021. #include <sys/wait.h>
  5022. #define CK_WAIT_H
  5023. #ifdef COMMENT
  5024. extern void exit(int status);
  5025. extern void _exit(int status);
  5026. extern int uname(struct utsname *name);
  5027. #endif /* COMMENT */
  5028. extern int chmod(char *path, int mode);
  5029. extern int ioctl(int fildes, int request, ...);
  5030. extern int rdchk(int ttyfd);
  5031. extern int nap(int m);
  5032. #ifdef COMMENT
  5033. extern int getppid(void);
  5034. #endif /* COMMENT */
  5035. extern int _filbuf(FILE *stream);
  5036. extern int _flsbuf(char c,FILE *stream);
  5037. #endif /* DIAB */
  5038.  
  5039. /*
  5040.   Prototypes for UNIX functions like access, alarm, chdir, sleep, fork,
  5041.   and pause.  Otherwise, no prototypes.
  5042. */
  5043. #ifdef VMS
  5044. #include <unixio.h>
  5045. #endif /* VMS */
  5046.  
  5047. #ifdef NEXT
  5048. #ifndef NEXT33
  5049. #include <libc.h>
  5050. #endif /* NEXT33 */
  5051. #else  /* NoT NeXT */
  5052. #ifndef AMIGA
  5053. #ifndef OS2
  5054. #ifdef STRATUS
  5055. #include <c_utilities.h>
  5056. #else /* !STRATUS */
  5057. #ifndef OSKXXC
  5058. #include <unistd.h>
  5059. #endif /* OSKXXC */
  5060. #ifdef HAVE_CRYPT_H
  5061. #include <crypt.h>
  5062. #endif /* HAVE_CRYPT_H */
  5063. #endif /* STRATUS */
  5064. #endif /* OS2 */
  5065. #endif /* AMIGA */
  5066. #endif /* NEXT */
  5067.  
  5068. #else /* Not ANSI libs... */
  5069.  
  5070. #ifdef MAC
  5071. #include <String.h>
  5072. #include <StdLib.h>
  5073. #endif /* MAC */
  5074.  
  5075. #ifdef HPUX
  5076. #ifndef HPUXPRE65
  5077. #include <unistd.h>
  5078. #endif /* HPUXPRE65 */
  5079. #endif /* HPUX */
  5080.  
  5081. #ifdef SUNOS41
  5082. #include <unistd.h>
  5083. #include <stdlib.h>
  5084. #else
  5085. #ifndef MAC
  5086. /*
  5087.   It is essential that these are declared correctly!
  5088.   Which is not always easy.  Take malloc() for instance ...
  5089. */
  5090. #ifdef PYRAMID
  5091. #ifdef SVR4
  5092. #ifdef __STDC__
  5093. #define SIZE_T_MALLOC
  5094. #endif /* __STDC__ */
  5095. #endif /* SVR4 */
  5096. #endif /* PYRAMID */
  5097. /*
  5098.   Maybe some other environments need the same treatment for malloc.
  5099.   If so, define SIZE_T_MALLOC for them here or in compiler CFLAGS.
  5100. */
  5101. #ifdef SIZE_T_MALLOC
  5102. _PROTOTYP( void * malloc, (size_t) );
  5103. #else
  5104. _PROTOTYP( char * malloc, (unsigned int) );
  5105. #endif /* SIZE_T_MALLOC */
  5106.  
  5107. _PROTOTYP( char * getenv, (char *) );
  5108. _PROTOTYP( long atol, (char *) );
  5109. #endif /* !MAC */
  5110. #endif /* SUNOS41 */
  5111. #endif /* CK_ANSILIBS */
  5112.  
  5113. #ifndef NULL                /* In case NULL is still not defined */
  5114. #define NULL 0L
  5115. /* or #define NULL 0 */
  5116. /* or #define NULL ((char *) 0) */
  5117. /* or #define NULL ((void *) 0) */
  5118. #endif /* NULL */
  5119.  
  5120. /* Maximum length for a fully qualified filename, not counting \0 at end. */
  5121. /*
  5122.   This is a rough cut, and errs on the side of being too big.  We don't
  5123.   want to pull in hundreds of header files looking for many and varied
  5124.   symbols, for fear of introducing unnecessary conflicts.
  5125. */
  5126. #ifndef CKMAXPATH
  5127. #ifdef MAXPATHLEN            /* (it probably isn't) */
  5128. #define CKMAXPATH MAXPATHLEN
  5129. #else
  5130. #ifdef MAC
  5131. #define CKMAXPATH 63
  5132. #else
  5133. #ifdef pdp11
  5134. #define CKMAXPATH 255
  5135. #else
  5136. #ifdef UNIX                /* Even though some are way less... */
  5137. #define CKMAXPATH 1023
  5138. #else
  5139. #ifdef VMS
  5140. #define CKMAXPATH 675            /* (derivation is complicated...) */
  5141. #else
  5142. #ifdef STRATUS
  5143. #define CKMAXPATH 256            /* == $MXPL from PARU.H */
  5144. #else
  5145. #ifdef datageneral
  5146. #define CKMAXPATH 256            /* == $MXPL from PARU.H */
  5147. #else
  5148. #define CKMAXPATH 255
  5149. #endif /* STRATUS */
  5150. #endif /* datageneral */
  5151. #endif /* VMS */
  5152. #endif /* UNIX */
  5153. #endif /* pdp11 */
  5154. #endif /* MAC */
  5155. #endif /* MAXPATHLEN */
  5156. #endif /* CKMAXPATH */
  5157.  
  5158. #ifdef pdp11
  5159. #define NOCHANNELIO
  5160. #else
  5161.  
  5162. #ifndef CKMAXOPEN
  5163. #ifdef QNX
  5164. #define CKMAXOPEN 390
  5165. #else
  5166. #ifdef VMS
  5167. #define CKMAXOPEN 64
  5168. #else
  5169. #ifdef OPEN_MAX
  5170. #define CKMAXOPEN OPEN_MAX
  5171. #else
  5172. #ifdef FOPEN_MAX
  5173. #define CKMAXOPEN FOPEN_MAX
  5174. #else
  5175. #define CKMAXOPEN 64
  5176. #endif /* FOPEN_MAX */
  5177. #endif /* OPEN_MAX */
  5178. #endif /* VMS */
  5179. #endif /* QNX */
  5180. #endif /* CKMAXOPEN */
  5181.  
  5182. /* Maximum channels for FOPEN = CKMAXOPEN minus logs, stdio, etc */
  5183.  
  5184. #ifndef Z_MINCHAN
  5185. #define Z_MINCHAN 16
  5186. #endif /* Z_MINCHAN */
  5187.  
  5188. #ifndef Z_MAXCHAN
  5189. #define Z_MAXCHAN (CKMAXOPEN-ZNFILS-5)
  5190. #endif /* Z_MAXCHAN */
  5191. #endif /* pdp11 */
  5192.  
  5193. /* New-format nzltor() and nzrtol() functions that handle pathnames */
  5194.  
  5195. #ifndef NZLTOR
  5196. #ifdef UNIX
  5197. #define NZLTOR
  5198. #else
  5199. #ifdef VMS
  5200. #define NZLTOR
  5201. #else
  5202. #ifdef OS2
  5203. #define NZLTOR
  5204. #else
  5205. #ifdef STRATUS
  5206. #define NZLTOR
  5207. #endif /* STRATUS */
  5208. #endif /* OS2 */
  5209. #endif /* VMS */
  5210. #endif /* UNIX */
  5211. #endif /* NZLTOR */
  5212.  
  5213. #ifdef NZLTOR
  5214. _PROTOTYP( VOID nzltor, (char *, char *, int, int, int) );
  5215. _PROTOTYP( VOID nzrtol, (char *, char *, int, int, int) );
  5216. #endif /* NZLTOR */
  5217.  
  5218. /* Implementations with a zrmdir() function */
  5219.  
  5220. #ifndef ZRMDIR
  5221. #ifdef OS2
  5222. #define ZRMDIR
  5223. #else /* OS2 */
  5224. #ifdef UNIX
  5225. #define ZRMDIR
  5226. #else
  5227. #ifdef VMS
  5228. #define ZRMDIR
  5229. #else /* VMS */
  5230. #ifdef STRATUS
  5231. #define ZRMDIR
  5232. #endif /* STRATUS */
  5233. #endif /* VMS */
  5234. #endif /* UNIX */
  5235. #endif /* OS2 */
  5236. #endif /* ZRMDIR */
  5237.  
  5238. #ifdef ZRMDIR
  5239. _PROTOTYP( int zrmdir, (char *) );
  5240. #endif /* ZRMDIR */
  5241.  
  5242. #ifndef FILECASE
  5243. #ifdef UNIXOROSK
  5244. #define FILECASE 1
  5245. #else
  5246. #define FILECASE 0
  5247. #endif /* UNIXOROSK */
  5248. #ifndef CKCMAI
  5249. extern int filecase;
  5250. #endif /* CKCMAI */
  5251. #endif /* FILECASE */
  5252.  
  5253. /* Funny names for library functions department... */
  5254.  
  5255. #ifdef ZILOG
  5256. #define setjmp setret
  5257. #define longjmp longret
  5258. #define jmp_buf ret_buf
  5259. #define getcwd curdir
  5260. #endif /* ZILOG */
  5261.  
  5262. #ifdef STRATUS
  5263. /* The C-runtime conflicts with things we do in Stratus VOS ckltio.c ... */
  5264. #define printf vosprtf
  5265. _PROTOTYP( int vosprtf, (char *fmt, ...) );
  5266. #define perror(txt) printf("%s\n", txt)
  5267. /* char_varying is a string type from PL/I that VOS uses extensively */
  5268. #define CV char_varying
  5269. #endif /* STRATUS */
  5270.  
  5271. #ifdef NT
  5272. extern int OSVer;
  5273. #define isWin95() (OSVer==VER_PLATFORM_WIN32_WINDOWS)
  5274. #else
  5275. #define isWin95() (0)
  5276. #endif /* NT */
  5277.  
  5278. #ifndef BPRINT
  5279. #ifdef OS2
  5280. #define BPRINT
  5281. #endif /* OS2 */
  5282. #endif /* BPRINT */
  5283.  
  5284. #ifndef SESLIMIT
  5285. #ifdef OS2
  5286. #define SESLIMIT
  5287. #endif /* OS2 */
  5288. #endif /* SESLIMIT */
  5289.  
  5290. #ifndef PCTERM
  5291. #ifdef NT
  5292. #define PCTERM
  5293. #endif /* NT */
  5294. #endif /* PCTERM */
  5295.  
  5296. #ifdef BEOSORBEBOX
  5297. #define query ckquery
  5298. #endif /* BEOSORBEBOX */
  5299.  
  5300. #ifdef NETCONN                /* Special "network" types... */
  5301. #ifdef OS2
  5302. #ifndef NETFILE
  5303. #define NETFILE
  5304. #endif /* NETFILE */
  5305. #ifndef NOPUSH
  5306. #ifndef NETCMD
  5307. #define NETCMD
  5308. #endif /* NETCMD */
  5309. #endif /* NOPUSH */
  5310. #ifdef NT
  5311. #ifndef NETDLL
  5312. #define NETDLL
  5313. #endif /* NETDLL */
  5314. #ifndef SSH
  5315. #define SSH
  5316. #endif /* SSH */
  5317. #endif /* NT */
  5318. #endif /* OS2 */
  5319. #endif /* NETCONN */
  5320.  
  5321. #ifndef PTYORPIPE            /* NETCMD and/or NETPTY defined */
  5322. #ifdef NETCMD
  5323. #define PTYORPIPE
  5324. #else
  5325. #ifdef NETPTY
  5326. #define PTYORPIPE
  5327. #endif /* NETPTY */
  5328. #endif /* NETCMD */
  5329. #endif /* PTYORPIPE */
  5330.  
  5331. /* Platforms that have memcpy() -- only after all headers included */
  5332.  
  5333. #ifndef USE_MEMCPY
  5334. #ifdef VMS
  5335. #define USE_MEMCPY
  5336. #else
  5337. #ifdef NEXT
  5338. #define USE_MEMCPY
  5339. #else
  5340. #ifdef OS2
  5341. #define USE_MEMCPY
  5342. #else
  5343. #ifdef __linux__
  5344. #define USE_MEMCPY
  5345. #else
  5346. #ifdef SOLARIS
  5347. #define USE_MEMCPY
  5348. #else
  5349. #ifdef SUNOS4
  5350. #define USE_MEMCPY
  5351. #else
  5352. #ifdef AIXRS
  5353. #define USE_MEMCPY
  5354. #else
  5355. #ifdef HPUX
  5356. #define USE_MEMCPY
  5357. #else
  5358. #ifdef POSIX
  5359. #define USE_MEMCPY
  5360. #else
  5361. #ifdef SVR4
  5362. #define USE_MEMCPY
  5363. #else
  5364. #ifdef OSF
  5365. #define USE_MEMCPY
  5366. #else
  5367. #ifdef datageneral
  5368. #define USE_MEMCPY
  5369. #else
  5370. #ifdef STRATUS
  5371. #define USE_MEMCPY
  5372. #endif /* STRATUS */
  5373. #endif /* datageneral */
  5374. #endif /* SVR4 */
  5375. #endif /* OSF */
  5376. #endif /* POSIX */
  5377. #endif /* HPUX */
  5378. #endif /* AIXRS */
  5379. #endif /* SUNOS */
  5380. #endif /* SOLARIS */
  5381. #endif /* __linux__ */
  5382. #endif /* OS2 */
  5383. #endif /* NEXT */
  5384. #endif /* VMS */
  5385. #endif /* USE_MEMCPY */
  5386.  
  5387. #ifndef USE_MEMCPY
  5388. #define memcpy(a,b,c) ckmemcpy((a),(b),(c))
  5389. #endif /* USE_MEMCPY */
  5390.  
  5391. /* User authentication for IKS -- So far K95 and UNIX only */
  5392.  
  5393. #ifdef NOICP
  5394. #ifndef NOLOGIN
  5395. #define NOLOGIN
  5396. #endif /* NOLOGIN */
  5397. #endif /* NOICP */
  5398.  
  5399. #ifndef NOLOGIN
  5400. #ifdef OS2ORUNIX
  5401. #define CK_LOGIN
  5402. #ifdef NT
  5403. #define NTCREATETOKEN
  5404. #endif /* NT */
  5405. #endif /* UNIX */
  5406. #endif /* NOLOGIN */
  5407.  
  5408. #ifdef OS2
  5409. #define CKSPINNER
  5410. #endif /* OS2 */
  5411.  
  5412. #ifdef CK_LOGIN                /* Telnet protocol required */
  5413. #ifndef TNCODE                /* for login to IKSD. */
  5414. #define TNCODE
  5415. #endif /* TNCODE */
  5416. #endif /* CK_LOGIN */
  5417.  
  5418. #ifdef CK_AUTHENTICATION
  5419. #ifdef NOSENDUID
  5420. #undef NOSENDUID
  5421. #endif /* NOSENDUID */
  5422. #endif /* CK_AUTHENTICAITON */
  5423.  
  5424. #ifdef TNCODE                /* Should TELNET send user ID? */
  5425. #ifndef NOSENDUID
  5426. #ifndef CKSENDUID
  5427. #define CKSENDUID
  5428. #endif /* CKSENDUID */
  5429. #endif /* NOSENDUID */
  5430. #endif /* TNCODE */
  5431.  
  5432. /* UNIX platforms that don't have getusershell() */
  5433.  
  5434. #ifdef UNIX
  5435. #ifndef NOGETUSERSHELL
  5436. #ifdef IRIX
  5437. #define NOGETUSERSHELL
  5438. #else
  5439. #ifdef PTX
  5440. #define NOGETUSERSHELL
  5441. #else
  5442. #ifdef AIXRS
  5443. #define NOGETUSERSHELL
  5444. #else
  5445. #ifdef SINIX
  5446. #define NOGETUSERSHELL
  5447. #else
  5448. #ifdef UNIXWARE
  5449. #define NOGETUSERSHELL
  5450. #else
  5451. #ifdef COHERENT
  5452. #define NOGETUSERSHELL
  5453. #endif /* COHERENT */
  5454. #endif /* UNIXWARE */
  5455. #endif /* SINIX */
  5456. #endif /* AIXRX */
  5457. #endif /* PTX */
  5458. #endif /* IRIX */
  5459. #endif /* NOGETUSERSHELL */
  5460. #endif /* UNIX */
  5461.  
  5462. #ifdef CK_LOGIN
  5463. #ifdef NT
  5464. #ifndef NOSYSLOG
  5465. #ifndef CKSYSLOG
  5466. #define CKSYSLOG
  5467. #endif /* CKSYSLOG */
  5468. #endif /* NOSYSLOG */
  5469. #endif /* NT */
  5470. #ifdef UNIX
  5471. #ifndef NOSYSLOG
  5472. #ifndef CKSYSLOG
  5473. #define CKSYSLOG
  5474. #endif /* CKSYSLOG */
  5475. #endif /* NOSYSLOG */
  5476. #ifndef NOWTMP
  5477. #ifndef CKWTMP
  5478. #define CKWTMP
  5479. #endif /* CKWTMP */
  5480. #endif /* NOWTMP */
  5481. #ifndef NOGETUSERSHELL
  5482. #ifndef GETUSERSHELL
  5483. #define GETUSERSHELL
  5484. #endif /* GETUSERSHELL */
  5485. #endif /* NOGETUSERSHELL */
  5486. #endif /* UNIX */
  5487. _PROTOTYP( int ckxlogin, (CHAR *, CHAR *, CHAR *, int));
  5488. _PROTOTYP( int ckxlogout, (VOID));
  5489. #endif /* CK_LOGIN */
  5490.  
  5491. #ifdef CKSYSLOG                /* Syslogging levels */
  5492. #define SYSLG_NO 0            /* No logging */
  5493. #define SYSLG_LI 1            /* Login/out */
  5494. #define SYSLG_DI 2            /* Dialing out */
  5495. #define SYSLG_AC 3            /* Making any kind of connection */
  5496. #define SYSLG_PR 4                      /* Protocol Operations */
  5497. #define SYSLG_FC 5            /* File creation */
  5498. #define SYSLG_FA 6            /* File reading */
  5499. #define SYSLG_CM 7            /* Top-level commands */
  5500. #define SYSLG_CX 8            /* All commands */
  5501. #define SYSLG_DB 9            /* Debug */
  5502. #define SYSLGMAX 9            /* Highest level */
  5503. #define SYSLG_DF SYSLG_FA        /* Default level */
  5504. /* Logging function */
  5505. _PROTOTYP(VOID cksyslog,(int, int, char *, char *, char *));
  5506. #endif /* CKSYSLOG */
  5507. #ifndef CKCMAI
  5508. extern int ckxlogging, ckxsyslog, ikdbopen;
  5509. #endif /* CKCMAI */
  5510.  
  5511. #ifndef CK_KEYTAB
  5512. #define CK_KEYTAB
  5513. /* Keyword Table Template */
  5514.  
  5515. /* Note: formerly defined in ckucmd.h but now more widely used */
  5516.  
  5517. struct keytab {                /* Keyword table */
  5518.     char *kwd;                /* Pointer to keyword string */
  5519.     int kwval;                /* Associated value */
  5520.     int flgs;                /* Flags (as defined above) */
  5521. };
  5522. #endif /* CK_KEYTAB */
  5523.  
  5524. /* Local Echo Buffer prototypes */
  5525. _PROTOTYP( VOID le_init, (void) );
  5526. _PROTOTYP( VOID le_clean, (void));
  5527. _PROTOTYP( int le_inbuf, (void));
  5528. _PROTOTYP( int le_putstr, (CHAR *));
  5529. _PROTOTYP( int le_puts, (CHAR *, int));
  5530. _PROTOTYP( int le_putchar, (CHAR));
  5531. _PROTOTYP( int le_getchar, (CHAR *));
  5532.  
  5533. #ifndef NOHTTP
  5534. #ifndef NOCMDATE2TM
  5535. #ifndef CMDATE2TM
  5536. #ifdef OS2ORUNIX
  5537. #define CMDATE2TM
  5538. #endif /* OS2ORUNIX */
  5539. #endif /* CMDATE2TM */
  5540. #endif /* NOCMDATE2TM */
  5541.  
  5542. #ifdef CMDATE2TM
  5543. _PROTOTYP( struct tm * cmdate2tm, (char *,int));
  5544. #endif /* CMDATE2TM */
  5545. #endif /* NOHTTP */
  5546.  
  5547. _PROTOTYP( int readpass, (char *, char *, int));
  5548. _PROTOTYP( int readtext, (char *, char *, int));
  5549.  
  5550. #include "ckclib.h"
  5551.  
  5552. #endif /* CKCDEB_H */
  5553.  
  5554. /* End of ckcdeb.h */
  5555.