home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95source / ckcdeb.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  139KB  |  6,458 lines

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