home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckx201.tar.gz / x.tar / ckcdeb.h < prev    next >
C/C++ Source or Header  |  2002-06-09  |  135KB  |  6,300 lines

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