home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / cku206.zip / ckcdeb.h < prev    next >
C/C++ Source or Header  |  2002-10-31  |  142KB  |  6,332 lines

  1. /*  C K C D E B . H  */
  2.  
  3. /*
  4. Thu Oct 24 16:08:26 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. #ifndef NOCKGETFQHOST
  2658. #ifdef __ia64__
  2659. #define NOCKGETFQHOST
  2660. #else  /* __ia64__ */
  2661. #ifdef SV68
  2662. #define NOCKGETFQHOST
  2663. #else
  2664. #ifdef HPUXPRE65
  2665. #define NOCKGETFQHOST
  2666. #endif /* HPUXPRE65 */
  2667. #endif /* SV68 */
  2668. #endif /* __ia64 */
  2669. #endif /* NOCKGETFQHOST */
  2670. /*
  2671.   Regarding System V/68 (SV68) (from Gerry Belanger, Oct 2002):
  2672.  
  2673.     1) The gethostbyname() appears to return the actual host IP
  2674.        address in the hostent struct, instead of the expected pointer
  2675.        to the address. Hence the bogus address in the bcopy/memcopy.
  2676.        This is despite the header agreeing with our expectations.
  2677.  
  2678.     2) the expected argument swap between bcopy and memcopy
  2679.        did not happen.  What grief this might cause, I know not.
  2680. */
  2681. #endif /* TCPSOCKET */
  2682.  
  2683. #ifdef TCPSOCKET
  2684. #ifdef OS2ONLY
  2685. #ifndef NOSOCKS
  2686. #define NOSOCKS
  2687. #endif /* NOSOCKS */
  2688. #endif /* OS2ONLY */
  2689. #ifdef NOSOCKS
  2690. #ifdef CK_SOCKS
  2691. #undef CK_SOCKS
  2692. #endif /* CK_SOCKS */
  2693. #ifdef CK_SOCKS5
  2694. #undef CK_SOCKS5
  2695. #endif /* CK_SOCKS5 */
  2696. #else /* NOSOCKS */
  2697. #ifdef NT
  2698. #ifndef CK_SOCKS
  2699. #define CK_SOCKS
  2700. #endif /* CK_SOCKS */
  2701. #endif /* NT */
  2702. #ifdef CK_SOCKS5            /* CK_SOCKS5 implies CK_SOCKS */
  2703. #ifndef CK_SOCKS
  2704. #define CK_SOCKS
  2705. #endif /* CK_SOCKS */
  2706. #endif /* CK_SOCKS5 */
  2707. #endif /* NOSOCKS */
  2708. #endif /* TCPSOCKET */
  2709.  
  2710. #ifdef TNCODE
  2711. #ifndef CK_AUTHENTICATION
  2712. #ifdef OS2
  2713. #ifdef NT
  2714. #ifndef _M_PPC
  2715. #ifndef _M_ALPHA
  2716. #define SSL_KRB5
  2717. #endif /* _M_ALPHA */
  2718. #endif /* _M_PPC */
  2719. #endif /* NT */
  2720. #ifdef _M_PPC
  2721. #define NO_KERBEROS
  2722. #define NO_SRP
  2723. #else
  2724. #ifndef NO_ENCRYPTION
  2725. #ifndef NO_SSL
  2726. #define CK_SSL
  2727. #define SSLDLL
  2728. #endif /* NO_SSL */
  2729. #endif /* NO_ENCRYPTION */
  2730. #endif /* _M_PPC */
  2731. #ifndef NO_KERBEROS
  2732. #define CK_KERBEROS
  2733. #define KRB4
  2734. #define KRB5
  2735. #define KRB524
  2736. #endif /* NO_KERBEROS */
  2737. #ifndef NO_SRP
  2738. #define CK_SRP
  2739. #endif /* NO_SRP */
  2740. #define CK_AUTHENTICATION
  2741. #endif /* OS2 */
  2742. #endif /* CK_AUTHENTICATION */
  2743.  
  2744. #ifdef CK_AUTHENTICATION        /* Encryption must have Auth */
  2745. #ifndef CK_ENCRYPTION
  2746. #ifndef NO_ENCRYPTION
  2747. #ifdef OS2
  2748. #define CK_ENCRYPTION
  2749. #endif /* OS2 */
  2750. #endif /* NO_ENCRYPTION */
  2751. #endif /* CK_ENCRYPTION */
  2752. #endif /* CK_AUTHENTICATION */
  2753.  
  2754. #ifdef NO_AUTHENTICATION                /* Allow authentication to be */
  2755. #ifdef CK_AUTHENTICATION                /* disabled in NT and OS/2    */
  2756. #undef CK_AUTHENTICATION
  2757. #endif /* CK_AUTHENTICATION */
  2758. #ifdef CK_KERBEROS
  2759. #undef CK_KERBEROS
  2760. #endif /* CK_KERBEROS */
  2761. #ifdef CK_SRP
  2762. #undef CK_SRP
  2763. #endif /* CK_SRP */
  2764. #ifdef CK_ENCRYPTION
  2765. #undef CK_ENCRYPTION
  2766. #endif /* CK_ENCRYPTION */
  2767. #endif /* NO_AUTHENTICATION */
  2768.  
  2769. #ifdef NO_ENCRYPTION                    /* Allow encryption to be */
  2770. #ifdef CK_ENCRYPTION                    /* disabled in NT and OS/2 */
  2771. #undef CK_ENCRYPTION
  2772. #endif /* CK_ENCRYPTION */
  2773. #endif /* NO_ENCRYPTION */
  2774.  
  2775. #ifdef CK_KERBEROS      /* Disable funcs not yet supported with Heimdal */
  2776. #ifdef KRB5
  2777. #ifndef HEIMDAL
  2778. #define KRB5_U2U
  2779. #endif /* HEIMDAL */
  2780. #endif /* KRB5 */
  2781. #endif /* CK_KERBEROS */
  2782.  
  2783. /*
  2784.   SSH section.  NOSSH disables any form of SSH support.
  2785.   If NOSSH is not defined (or implied by NONET, NOLOCAL, etc)
  2786.   then SSHBUILTIN is defined for K95 and SSHCMD is defined for UNIX.
  2787.   Then, if either SSHBUILTIN or SSHCMD is defined, ANYSSH is also defined.
  2788. */
  2789.  
  2790. #ifndef NOSSH
  2791. #ifndef NO_SSL
  2792. #ifdef OS2ONLY
  2793. #define NOSSH
  2794. #endif /* OS2ONLY */
  2795. #ifdef NT
  2796. #ifndef CK_SSL
  2797. #define NOSSH
  2798. #endif /* CK_SSL */
  2799. #endif /* NT */
  2800. #else /* NO_SSL */
  2801. #define NOSSH
  2802. #endif /* NO_SSL */
  2803. #endif /* NOSSH */
  2804.  
  2805. #ifdef NOSSH                /* NOSSH */
  2806. #ifdef SSHBUILTIN            /* undefines any SSH selctors */
  2807. #undef SSHBUILTIN
  2808. #endif /* SSHBUILTIN */
  2809. #ifdef SSHCMD
  2810. #undef SSHCMD
  2811. #endif /* SSHCMD */
  2812. #ifdef ANYSSH
  2813. #undef ANYSSH
  2814. #endif /* ANYSSH */
  2815. #else  /* Not NOSSH */
  2816. #ifndef NOLOCAL
  2817. #ifdef OS2
  2818. #ifndef SSHBUILTIN
  2819. #define SSHBUILTIN
  2820. #endif /* SSHBUILTIN */
  2821. #else  /* Not OS2 */
  2822. #ifdef UNIX
  2823. #ifndef SSHCMD
  2824. #ifdef NETPTY
  2825. #ifndef NOPUSH
  2826. #define SSHCMD
  2827. #endif /* NOPUSH */
  2828. #endif /* NETPTY */
  2829. #endif /* SSHCMD */
  2830. #endif /* UNIX */
  2831. #endif /* OS2 */
  2832. #ifndef ANYSSH
  2833. #ifdef SSHBUILTIN
  2834. #define ANYSSH
  2835. #ifdef SSHCMD
  2836. #undef SSHCMD
  2837. #endif /* SSHCMD */
  2838. #else  /* SSHBUILTIN */
  2839. #ifdef SSHCMD
  2840. #define ANYSSH
  2841. #endif /* SSHCMD */
  2842. #endif /* SSHBUILTIN */
  2843. #endif /* ANYSSH */
  2844. #endif /* NOLOCAL */
  2845. #endif /* NOSSH */
  2846.  
  2847. /* This is in case #ifdef SSH is used anywhere in the K95 modules */
  2848.  
  2849. #ifdef OS2
  2850. #ifdef SSHBUILTIN
  2851. #ifndef SSH
  2852. #define SSH
  2853. #endif /* SSH */
  2854. #endif /* SSHBUILTIN */
  2855. #endif /* OS2 */
  2856.  
  2857. #ifdef CK_AUTHENTICATION
  2858. #define CK_SECURITY
  2859. #else
  2860. #ifdef CK_SSL
  2861. #define CK_SECURITY
  2862. #endif /* CK_SSL */
  2863. #endif /* CK_AUTHENTICATION */
  2864.  
  2865. /* Environment stuff */
  2866.  
  2867. #ifndef OS2ORUNIX
  2868. #ifndef NOPUTENV
  2869. #define NOPUTENV
  2870. #endif /* NOPUTENV */
  2871. #endif /* OS2ORUNIX */
  2872.  
  2873. #ifndef CK_ENVIRONMENT
  2874. #ifdef OS2
  2875. #define CK_ENVIRONMENT
  2876. #else
  2877. #ifdef UNIX
  2878. #define CK_ENVIRONMENT
  2879. #else
  2880. #ifdef STRATUS
  2881. #define CK_ENVIRONMENT
  2882. #else
  2883. #ifdef VMS
  2884. #define CK_ENVIRONMENT
  2885. #endif /* VMS */
  2886. #endif /* STRATUS */
  2887. #endif /* UNIX */
  2888. #endif /* OS2 */
  2889. #endif /* CK_ENVIRONMENT */
  2890. #ifndef NOSNDLOC            /* RFC 779 SEND LOCATION */
  2891. #ifndef CK_SNDLOC
  2892. #define CK_SNDLOC
  2893. #endif /* CK_SNDLOC */
  2894. #endif /* NOSNDLOC */
  2895. #ifndef NOXDISPLOC            /* RFC 1096 XDISPLOC */
  2896. #ifndef CK_XDISPLOC
  2897. #define CK_XDISPLOC
  2898. #endif /* CK_XDISPLOC */
  2899. #endif /* NOXDISPLOC */
  2900. #ifndef NOFORWARDX
  2901. #ifndef NOPUTENV
  2902. #ifndef NOSELECT
  2903. #ifndef CK_FORWARD_X
  2904. #ifdef CK_AUTHENTICATION
  2905. #ifndef OS2ONLY
  2906. #define CK_FORWARD_X
  2907. #endif /* OS2ONLY */
  2908. #endif /* CK_AUTHENTICATION */
  2909. #endif /* CK_FORWARD_X */
  2910. #endif /* NOSELECT */
  2911. #endif /* NOPUTENV */
  2912. #endif /* NOFORWARDX */
  2913. #ifndef NO_COMPORT
  2914. #ifdef TCPSOCKET
  2915. #ifndef TN_COMPORT
  2916. #define TN_COMPORT
  2917. #endif /* TN_COMPORT */
  2918. #endif /* TCPSOCKET */
  2919. #endif /* NO_COMPORT */
  2920. #endif /* TNCODE */
  2921.  
  2922. #ifndef NOXFER
  2923. #ifndef NOCTRLZ                /* Allow SET FILE EOF CTRL-Z */
  2924. #ifndef CK_CTRLZ
  2925. #ifdef OS2ORUNIX
  2926. #define CK_CTRLZ
  2927. #endif /* OS2ORUNIX */
  2928. #endif /* CK_CTRLZ */
  2929. #endif /* NOCTRLZ */
  2930. #endif /* NOXFER */
  2931.  
  2932. #ifndef NOPERMS                /* File permissions in A packets */
  2933. #ifndef CK_PERMS
  2934. #ifdef UNIX
  2935. #define CK_PERMS
  2936. #else
  2937. #ifdef VMS
  2938. #define CK_PERMS
  2939. #endif /* VMS */
  2940. #endif /* UNIX */
  2941. #endif /* CK_PERMS */
  2942. #endif /* NOPERMS */
  2943. #ifdef CK_PERMS
  2944. #define CK_PERMLEN 24            /* Max length of sys-dependent perms */
  2945. #endif /* CK_PERMS */
  2946.  
  2947. #ifdef UNIX                /* NOSETBUF for everybody */
  2948. #ifndef NOSETBUF
  2949. #ifndef USE_SETBUF            /* This is the escape clause */
  2950. #define NOSETBUF
  2951. #endif /* USE_SETBUF */
  2952. #endif /* NOSETBUF */
  2953. #endif /* UNIX */
  2954.  
  2955. #ifndef USE_STRERROR            /* Whether to use strerror() */
  2956. #ifdef pdp11
  2957. #define USE_STRERROR
  2958. #endif /* pdp11 */
  2959. #endif /* USE_STRERROR */
  2960.  
  2961. #ifdef VMS                /* Features for all VMS builds */
  2962. #ifndef NOJC
  2963. #define NOJC
  2964. #endif /* NOJC */
  2965. #ifndef NOSETBUF
  2966. #define NOSETBUF
  2967. #endif /* NOSETBUF */
  2968. #ifndef DYNAMIC
  2969. #define DYNAMIC
  2970. #endif /* DYNAMIC */
  2971. #ifndef NOCURSES
  2972. #ifndef CK_CURSES
  2973. #define CK_CURSES
  2974. #endif /* CK_CURSES */
  2975. #endif /* NOCURSES */
  2976. #endif /* VMS */
  2977.  
  2978. #ifndef NOCKTIMERS            /* Dynamic timeouts */
  2979. #ifndef CK_TIMERS
  2980. #define CK_TIMERS
  2981. #endif /* CK_TIMERS */
  2982. #endif /* NOCKTIMERS */
  2983.  
  2984. #define CK_SPEED            /* Control-prefix removal */
  2985. #ifdef NOCKSPEED
  2986. #undef CK_SPEED
  2987. #endif /* NOCKSPEED */
  2988.  
  2989. #ifndef NOCKXXCHAR
  2990. #ifndef CKXXCHAR
  2991. #ifdef UNIX
  2992. #define CKXXCHAR
  2993. #else
  2994. #ifdef OS2
  2995. #define CKXXCHAR
  2996. #endif /* OS2 */
  2997. #endif /* UNIX */
  2998. #endif /* CKXXCHAR */
  2999. #endif /* NOCKXXCHAR */
  3000.  
  3001. #ifdef MAC                /* For Macintosh, no escape */
  3002. #define NOPUSH                /* to operating system */
  3003. #endif /* MAC */
  3004.  
  3005. /* Systems where we can call zmkdir() to create directories. */
  3006.  
  3007. #ifndef CK_MKDIR
  3008. #ifndef NOMKDIR
  3009.  
  3010. #ifdef UNIX
  3011. #ifndef pdp11
  3012. #define CK_MKDIR
  3013. #endif /* pdp11 */
  3014. #endif /* UNIX */
  3015.  
  3016. #ifdef OS2
  3017. #define CK_MKDIR
  3018. #endif /* OS2 */
  3019.  
  3020. #ifdef VMS
  3021. #define CK_MKDIR
  3022. #endif /* VMS */
  3023.  
  3024. #ifdef STRATUS
  3025. #define CK_MKDIR
  3026. #endif /* STRATUS */
  3027.  
  3028. #ifdef OSK
  3029. #define CK_MKDIR
  3030. #endif /* OSK */
  3031.  
  3032. #ifdef datageneral
  3033. #define CK_MKDIR
  3034. #endif /* datageneral */
  3035.  
  3036. #endif /* CK_MKDIR */
  3037. #endif /* NOMKDIR */
  3038.  
  3039. #ifdef NOMKDIR                /* Allow for command-line override */
  3040. #ifdef CK_MKDIR
  3041. #undef CK_MKDIR
  3042. #endif /* CK_MKDIR */
  3043. #endif /* NOMKDIR */
  3044.  
  3045. /* Systems for which we can enable the REDIRECT command automatically */
  3046. /*   As of 6.0.193, it should work for all UNIX... */
  3047.  
  3048. #ifndef NOREDIRECT
  3049. #ifndef CK_REDIR
  3050. #ifdef UNIX
  3051. #define CK_REDIR
  3052. #endif /* UNIX */
  3053. #ifdef OS2                /* As well as OS/2 and friends... */
  3054. #define CK_REDIR
  3055. #endif /* OS2 */
  3056. #endif /* CK_REDIR */
  3057. #endif /* NOREDIRECT */
  3058.  
  3059. #ifdef NOPUSH                /* But... REDIRECT command is not */
  3060. #ifdef CK_REDIR                /*  allowed if NOPUSH is defined. */
  3061. #undef CK_REDIR
  3062. #endif /* CK_REDIR */
  3063. #ifdef NETCMD                /* Nor is SET NET COMMAND */
  3064. #undef NETCMD
  3065. #endif /* NETCMD */
  3066. #ifdef NETPTY
  3067. #undef NETPTY
  3068. #endif /* NETPTY */
  3069. #endif /* NOPUSH */
  3070.  
  3071. #ifndef PEXITSTAT            /* \v(pexitstat) variable defined */
  3072. #ifdef OS2ORUNIX
  3073. #define PEXITSTAT
  3074. #else
  3075. #ifdef VMS
  3076. #define PEXITSTAT
  3077. #endif /* VMS */
  3078. #endif /* OS2ORUNIX */
  3079. #endif /* PEXITSTAT */
  3080.  
  3081. /* The following allows automatic enabling of REDIRECT to be overridden... */
  3082.  
  3083. #ifdef NOREDIRECT
  3084. #ifdef NETCMD
  3085. #undef NETCMD
  3086. #endif /* NETCMD */
  3087. #ifdef NETPTY
  3088. #undef NETPTY
  3089. #endif /* NETPTY */
  3090. #ifdef CK_REDIR
  3091. #undef CK_REDIR
  3092. #endif /* CK_REDIR */
  3093. #endif /* NOREDIRECT */
  3094.  
  3095. #ifdef NONETCMD
  3096. #ifdef NETCMD
  3097. #undef NETCMD
  3098. #endif /* NETCMD */
  3099. #ifdef NETPTY
  3100. #undef NETPTY
  3101. #endif /* NETPTY */
  3102. #endif /* NONETCMD */
  3103.  
  3104. #ifdef CK_REDIR
  3105. _PROTOTYP( int ttruncmd, (char *) );
  3106. #endif /* CK_REDIR */
  3107.  
  3108. /* Use built-in DIRECTORY command */
  3109.  
  3110. #ifndef NOMYDIR
  3111. #ifndef DOMYDIR
  3112. #ifdef UNIXOROSK
  3113. #define DOMYDIR
  3114. #else
  3115. #ifdef OS2
  3116. #define DOMYDIR
  3117. #else
  3118. #ifdef VMS
  3119. #define DOMYDIR
  3120. #endif /* VMS */
  3121. #endif /* OS2 */
  3122. #endif /* UNIXOROSK */
  3123. #endif /* DOMYDIR */
  3124. #endif /* NOMYDIR */
  3125.  
  3126. /* Sending from and receiving to commands/pipes */
  3127.  
  3128. #ifndef PIPESEND
  3129. #ifdef UNIX
  3130. #define PIPESEND
  3131. #endif /* UNIX */
  3132. #ifdef OS2
  3133. #define PIPESEND
  3134. #endif /* OS2 */
  3135. #endif /* PIPESEND */
  3136.  
  3137. #ifdef PIPESEND
  3138. #ifdef NOPIPESEND
  3139. #undef PIPESEND
  3140. #endif /* NOPIPESEND */
  3141. #ifdef NOPUSH
  3142. #undef PIPESEND
  3143. #endif /* NOPUSH */
  3144. #endif /* PIPESEND */
  3145.  
  3146. #ifdef NOPUSH
  3147. #ifdef BROWSER
  3148. #undef BROWSER
  3149. #endif /* BROWSER */
  3150. #endif /* NOPUSH */
  3151.  
  3152. /* Versions where we support the RESEND command */
  3153.  
  3154. #ifndef NOXFER
  3155. #ifndef NORESEND
  3156. #ifndef CK_RESEND
  3157. #ifdef UNIX
  3158. #ifndef pdp11
  3159. #define CK_RESEND
  3160. #endif /* pdp11 */
  3161. #endif /* UNIX */
  3162.  
  3163. #ifdef VMS
  3164. #define CK_RESEND
  3165. #endif /* VMS */
  3166.  
  3167. #ifdef OS2
  3168. #define CK_RESEND
  3169. #endif /* OS2 */
  3170.  
  3171. #ifdef AMIGA
  3172. #define CK_RESEND
  3173. #endif /* AMIGA */
  3174.  
  3175. #ifdef datageneral
  3176. #define CK_RESEND
  3177. #endif /* datageneral */
  3178.  
  3179. #ifdef STRATUS
  3180. #define CK_RESEND
  3181. #endif /* STRATUS */
  3182.  
  3183. #ifdef OSK
  3184. #define CK_RESEND
  3185. #endif /* OSK */
  3186.  
  3187. #endif /* CK_RESEND */
  3188. #endif /* NORESEND */
  3189. #endif /* NOXFER */
  3190.  
  3191. /* Systems implementing "Doomsday Kermit" protocol ... */
  3192.  
  3193. #ifndef DOOMSDAY
  3194. #ifdef UNIX
  3195. #define DOOMSDAY
  3196. #else
  3197. #ifdef VMS
  3198. #define DOOMSDAY
  3199. #else
  3200. #ifdef OS2
  3201. #define DOOMSDAY
  3202. #else
  3203. #ifdef STRATUS
  3204. #define DOOMSDAY
  3205. #endif /* STRATUS */
  3206. #endif /* OS2 */
  3207. #endif /* VMS */
  3208. #endif /* UNIX */
  3209. #endif /* DOOMSDAY */
  3210.  
  3211. /* Systems where we want the Thermometer to be used for fullscreen */
  3212.  
  3213. #ifdef OS2
  3214. #ifndef CK_PCT_BAR
  3215. #define CK_PCT_BAR
  3216. #endif /* CK_PCT_BAR */
  3217. #endif /* OS2 */
  3218.  
  3219. /* Systems where we have a REXX command */
  3220.  
  3221. #ifdef OS2
  3222. #ifdef __32BIT__
  3223. #ifndef NOREXX
  3224. #define CK_REXX
  3225. #endif /* NOREXX */
  3226. #endif /* __32BIT__ */
  3227. #endif /* OS2 */
  3228.  
  3229. /* Platforms that have a ZCHKPID function */
  3230.  
  3231. #ifdef OS2ORUNIX
  3232. #define ZCHKPID
  3233. #endif /* OS2ORUNIX */
  3234.  
  3235. #ifndef ZCHKPID
  3236. /* If we can't check pids then we have treat all pids as active & valid. */
  3237. #define zchkpid(x) 1
  3238. #endif /* ZCHKPID */
  3239.  
  3240. /* Systems that have a ZRENAME function */
  3241.  
  3242. #define ZRENAME                /* They all do */
  3243.  
  3244. /* Systems that have a ZCOPY function */
  3245.  
  3246. #ifndef ZCOPY
  3247. #ifdef VMS
  3248. #define ZCOPY
  3249. #else
  3250. #ifdef OS2
  3251. #define ZCOPY
  3252. #else
  3253. #ifdef UNIX
  3254. #define ZCOPY
  3255. #else
  3256. #ifdef STRATUS
  3257. #define ZCOPY
  3258. #endif /* STRATUS */
  3259. #endif /* UNIX */
  3260. #endif /* OS2 */
  3261. #endif /* VMS */
  3262. #endif /* ZCOPY */
  3263.  
  3264. /* Systems that have ttgwsiz() (they all should but they don't) */
  3265.  
  3266. #ifndef NOTTGWSIZ
  3267. #ifndef CK_TTGWSIZ
  3268. #ifdef UNIX
  3269. #define CK_TTGWSIZ
  3270. #else
  3271. #ifdef VMS
  3272. #define CK_TTGWSIZ
  3273. #else
  3274. #ifdef OS2
  3275. #define CK_TTGWSIZ
  3276. #else
  3277. #ifdef OSK
  3278. #define CK_TTGWSIZ
  3279. #endif /* OSK */
  3280. #endif /* OS2 */
  3281. #endif /* VMS */
  3282. #endif /* UNIX */
  3283. #endif /* CK_TTGWSIZ */
  3284. #endif /* NOTTGWSIZ */
  3285.  
  3286. #ifdef NOTTGWSIZ
  3287. #ifdef CK_TTGWSIZ
  3288. #undef CK_TTGWSIZ
  3289. #endif /* CK_TTGWSIZ */
  3290. #endif /* NOTTGWSIZ */
  3291.  
  3292. /* OS/2 C-Kermit features not available in 16-bit version... */
  3293.  
  3294. #ifdef OS2ONLY
  3295. #ifndef __32BIT__
  3296. #ifndef NOLOCAL
  3297. #ifdef PCFONTS                /* PC Font support */
  3298. #undef PCFONTS
  3299. #endif /* PCFONTS */
  3300. #ifdef NPIPE                /* Named Pipes communication */
  3301. #undef NPIPE
  3302. #endif /* NPIPE */
  3303. #ifdef CK_NETBIOS            /* NETBIOS communication */
  3304. #undef CK_NETBIOS
  3305. #endif /* CK_NETBIOS */
  3306. #ifdef OS2MOUSE                /* Mouse */
  3307. #undef OS2MOUSE
  3308. #endif /* OS2MOUSE */
  3309. #ifdef OS2PM                /* Presentation Manager */
  3310. #undef OS2PM
  3311. #endif /* OS2PM */
  3312. #endif /* NOLOCAL */
  3313. #ifdef CK_REXX                /* Rexx */
  3314. #undef CK_REXX
  3315. #endif /* CK_REXX */
  3316. #endif /* __32BIT__ */
  3317. #endif /* OS2ONLY */
  3318.  
  3319. /* OS/2 C-Kermit features not available in Windows NT version... */
  3320.  
  3321. #ifdef OS2
  3322. #ifdef NT
  3323. #ifdef PCFONTS                /* PC Font support */
  3324. #undef PCFONTS
  3325. #endif /* PCFONTS */
  3326. #ifdef NPIPE                /* Named Pipes communication */
  3327. #undef NPIPE
  3328. #endif /* NPIPE */
  3329. #ifdef OS2PM                /* Presentation Manager */
  3330. #undef OS2PM
  3331. #endif /* OS2PM */
  3332. #ifdef CK_REXX                /* Rexx */
  3333. #undef CK_REXX
  3334. #endif /* CK_REXX */
  3335. #endif /* NT */
  3336. #endif /* OS2 */
  3337.  
  3338. /*
  3339.   Systems that have select().
  3340.   This is used for both msleep() and for read-buffer checking in in_chk().
  3341. */
  3342. #define CK_SLEEPINT 250 /* milliseconds - set this to something that
  3343.                            divides evenly into 1000 */
  3344. #ifndef SELECT
  3345. #ifndef NOSELECT
  3346. #ifdef __linux__
  3347. #define SELECT
  3348. #else
  3349. #ifdef SUNOS4
  3350. #define SELECT
  3351. #else
  3352. #ifdef NEXT
  3353. #define SELECT
  3354. #else
  3355. #ifdef RTAIX
  3356. #define SELECT
  3357. #else
  3358. #ifdef HPUX
  3359. /*
  3360.   Not really.  I think it's only in HP-UX 7.0 and later, except it's also
  3361.   in earlier versions that have TCP/IP installed.  Override this default
  3362.   in particular HP-UX makefile entries by adding -DNOSELECT, as in (e.g.)
  3363.   the HP-UX 6.5 ones.
  3364. */
  3365. #define SELECT
  3366. #else
  3367. #ifdef AIXRS
  3368. #define SELECT
  3369. #else
  3370. #ifdef BSD44
  3371. #define SELECT
  3372. #else
  3373. #ifdef BSD4
  3374. #define SELECT
  3375. #else
  3376. #ifdef OXOS
  3377. #define SELECT
  3378. #else
  3379. #ifdef OS2
  3380. #define SELECT
  3381. #else
  3382. #ifdef BEBOX
  3383. #define SELECT
  3384. #endif /* BEBOX */
  3385. #endif /* OS2 */
  3386. #endif /* OXOS */
  3387. #endif /* BSD4 */
  3388. #endif /* BSD44 */
  3389. #endif /* AIXRS */
  3390. #endif /* HPUX */
  3391. #endif /* RTAIX */
  3392. #endif /* NEXT */
  3393. #endif /* __linux__ */
  3394. #endif /* SUNOS4 */
  3395. #endif /* NOSELECT */
  3396. #endif /* SELECT */
  3397.  
  3398. /*
  3399.   The following section moved here from ckcnet.h in 6.1 because select()
  3400.   is now used for non-networking purposes.
  3401. */
  3402.  
  3403. /* On HP-9000/500 HP-UX 5.21 this stuff is not defined in any header file */
  3404.  
  3405. #ifdef hp9000s500
  3406. #ifndef NEEDSELECTDEFS
  3407. #define NEEDSELECTDEFS
  3408. #endif /* NEEDSELECTDEFS */
  3409. #endif /* hp9000s500 */
  3410.  
  3411. #ifdef NEEDSELECTDEFS
  3412. typedef long fd_mask;
  3413. #ifndef NBBY
  3414. #define NBBY 8
  3415. #endif /* NBBY */
  3416. #ifndef FD_SETSIZE
  3417. #define FD_SETSIZE 32
  3418. #endif /* FD_SETSIZE */
  3419. #ifndef NFDBITS
  3420. #define NFDBITS (sizeof(fd_mask) * NBBY)
  3421. #endif /* NFDBITS */
  3422. #ifndef howmany
  3423. #define howmany(x,y) (((x)+((y)-1))/(y))
  3424. #endif /* howmany */
  3425. typedef struct fd_set {
  3426.     fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  3427. } fd_set;
  3428. #ifndef FD_SET
  3429. #define FD_SET(n,p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  3430. #endif /* FD_SET */
  3431. #ifndef FD_CLR
  3432. #define FD_CLR(n,p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  3433. #endif /* FD_CLR */
  3434. #ifndef FD_ISSET
  3435. #define FD_ISSET(n,p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  3436. #endif /* FD_ISSET */
  3437. #ifndef FD_COPY
  3438. #define FD_COPY(f,t) (bcopy(f,t,sizeof(*(f)))
  3439. #endif /* FD_COPY */
  3440. #ifndef FD_ZERO
  3441. #define FD_ZERO(p) bzero((char *)(p),sizeof(*(p)))
  3442. #endif /* FD_ZERO */
  3443. #endif /* NEEDSELECTDEFS */
  3444.  
  3445. /*
  3446.   CK_NEED_SIG is defined if the system cannot check the console to
  3447.   to see if characters are waiting.  This is used during local-mode file
  3448.   transfer to interrupt the transfer, refresh the screen display, etc.
  3449.   If CK_NEED_SIG is defined, then file-transfer interruption characters
  3450.   have to be preceded a special character, e.g. the SIGQUIT character.
  3451.   CK_NEED_SIG should be defined if the conchk() function is not operational.
  3452. */
  3453. #ifdef NOPOLL                /* For overriding CK_POLL definition */
  3454. #ifdef CK_POLL
  3455. #undef CK_POLL
  3456. #endif /* CK_POLL */
  3457. #endif /* NOPOLL */
  3458.  
  3459. #ifndef CK_POLL                /* If we don't have poll() */
  3460. #ifndef RDCHK                /* And we don't have rdchk() */
  3461. #ifndef SELECT                /* And we don't have select() */
  3462. #ifdef ATTSV
  3463. #ifndef aegis
  3464. #ifndef datageneral
  3465. #ifndef OXOS
  3466. #define CK_NEED_SIG
  3467. #endif /* OXOS */
  3468. #endif /* datageneral */
  3469. #endif /* aegis */
  3470. #endif /* ATTSV */
  3471. #ifdef POSIX
  3472. #ifndef CK_NEED_SIG
  3473. #define CK_NEED_SIG
  3474. #endif /* CK_NEED_SIG */
  3475. #endif /* POSIX */
  3476. #endif /* SELECT */
  3477. #endif /* RDCHK */
  3478. #endif /* CK_POLL */
  3479.  
  3480. #ifdef HPUX                /* HP-UX has select() */
  3481. #ifdef CK_NEED_SIG
  3482. #undef CK_NEED_SIG
  3483. #endif /* CK_NEED_SIG */
  3484. #endif /* HPUX */
  3485.  
  3486. #ifdef AIXRS                /* AIX has select() */
  3487. #ifdef CK_NEED_SIG
  3488. #undef CK_NEED_SIG
  3489. #endif /* CK_NEED_SIG */
  3490. #endif /* AIXRS */
  3491.  
  3492. #ifdef BSD44                /* 4.4BSD has FIONREAD */
  3493. #ifdef CK_NEED_SIG
  3494. #undef CK_NEED_SIG
  3495. #endif /* CK_NEED_SIG */
  3496. #endif /* BSD44 */
  3497.  
  3498. #ifdef QNX                /* QNX has FIONREAD and select() */
  3499. #ifdef CK_NEED_SIG
  3500. #undef CK_NEED_SIG
  3501. #endif /* CK_NEED_SIG */
  3502. #endif /* QNX */
  3503.  
  3504. #ifdef COHERENT
  3505. #ifndef NOTIMEZONE
  3506. #define NOTIMEZONE
  3507. #endif /* NOTIMEZONE */
  3508. #endif /* COHERENT */
  3509.  
  3510. #ifdef UNIX
  3511. #ifndef HAVE_TZ                /* Can we use struct timezone? */
  3512. #ifndef NOTIMEZONE
  3513. #ifdef PTX
  3514. #define NOTIMEZONE
  3515. #else
  3516. #ifndef SELECT
  3517. #ifdef COHERENT
  3518. #define NOTIMEZONE
  3519. #else
  3520. #ifdef BELLV10
  3521. #define NOTIMEZONE
  3522. #endif /* BELLV10 */
  3523. #endif /* COHERENT */
  3524. #endif /* SELECT */
  3525. #endif /* PTX */
  3526. #endif /* NOTIMEZONE */
  3527. #endif /* HAVE_TZ */
  3528. #ifndef NOTIMEVAL            /* Can we use struct timeval? */
  3529. #ifndef HAVE_TV
  3530. #define HAVE_TV
  3531. #endif /* HAVE_TV */
  3532. #endif /* NOTIMEVAL */
  3533. #ifndef NOTIMEZONE
  3534. #ifndef HAVE_TZ
  3535. #define HAVE_TZ
  3536. #endif /* HAVE_TZ */
  3537. #endif /* NOTIMEZONE */
  3538. #endif /* UNIX */
  3539.  
  3540. #ifdef SCO32
  3541. #ifdef HAVE_TV
  3542. #undef HAVE_TV
  3543. #endif /* HAVE_TV */
  3544. #ifdef HAVE_TZ
  3545. #undef HAVE_TZ
  3546. #endif /* HAVE_TZ */
  3547. #ifndef NOTIMEVAL
  3548. #define NOTIMEVAL
  3549. #endif /* NOTIMEVAL */
  3550. #ifndef NOTIMEZONE
  3551. #define NOTIMEZONE
  3552. #endif /* NOTIMEZONE */
  3553. #endif /* SCO32 */
  3554.  
  3555. #ifdef ATT7300
  3556. #ifdef HAVE_TV
  3557. #undef HAVE_TV
  3558. #endif /* HAVE_TV */
  3559. #ifdef HAVE_TZ
  3560. #undef HAVE_TZ
  3561. #endif /* HAVE_TZ */
  3562. #ifndef NOTIMEVAL
  3563. #define NOTIMEVAL
  3564. #endif /* NOTIMEVAL */
  3565. #ifndef NOTIMEZONE
  3566. #define NOTIMEZONE
  3567. #endif /* NOTIMEZONE */
  3568. #endif /* ATT7300 */
  3569.  
  3570. /*
  3571.   Automatic parity detection.
  3572.   This actually implies a lot more now: length-driven packet reading,
  3573.   "Doomsday Kermit" IBM Mainframe file transfer through 3270 data streams, etc.
  3574. */
  3575. #ifdef UNIX                /* For Unix */
  3576. #ifndef NOPARSEN
  3577. #define PARSENSE
  3578. #endif /* NOPARSEN */
  3579. #endif /* UNIX */
  3580.  
  3581. #ifdef VMS                /* ... and VMS */
  3582. #ifndef NOPARSEN
  3583. #define PARSENSE
  3584. #endif /* NOPARSEN */
  3585. #ifdef __GNUC__
  3586. #define VMSGCC
  3587. #endif /* __GNUC__ */
  3588. #endif /* VMS */
  3589.  
  3590. #ifdef MAC                /* and Macintosh */
  3591. #ifndef NOPARSEN
  3592. #define PARSENSE
  3593. #endif /* NOPARSEN */
  3594. #endif /* MAC */
  3595.  
  3596. #ifdef STRATUS                /* and Stratus VOS */
  3597. #ifndef NOPARSEN
  3598. #define PARSENSE
  3599. #endif /* NOPARSEN */
  3600. #endif /* STRATUS */
  3601.  
  3602. #ifdef OS2                /* and OS/2, finally */
  3603. #ifndef NOPARSEN
  3604. #define PARSENSE
  3605. #endif /* NOPARSEN */
  3606. #endif /* OS2 */
  3607.  
  3608. #ifndef NODYNAMIC            /* DYNAMIC is default for UNIX */
  3609. #ifndef DYNAMIC                /* as of C-Kermit 7.0 */
  3610. #ifdef UNIX
  3611. #define DYNAMIC
  3612. #endif /* UNIX */
  3613. #endif /* DYNAMIC */
  3614. #endif /* NODYNAMIC */
  3615.  
  3616. #ifdef DYNAMIC                /* If DYNAMIC is defined */
  3617. #define DCMDBUF                /* then also define this. */
  3618. #endif /* DYNAMIC */
  3619.  
  3620. #ifndef CK_LBRK                /* Can send Long BREAK */
  3621.  
  3622. #ifdef UNIX                /* (everybody but OS-9) */
  3623. #define CK_LBRK
  3624. #endif /* UNIX */
  3625. #ifdef VMS
  3626. #define CK_LBRK
  3627. #endif /* VMS */
  3628. #ifdef datageneral
  3629. #define CK_LBRK
  3630. #endif /* datageneral */
  3631. #ifdef GEMDOS
  3632. #define CK_LBRK
  3633. #endif /* GEMDOS */
  3634. #ifdef OS2
  3635. #define CK_LBRK
  3636. #endif /* OS2 */
  3637. #ifdef AMIGA
  3638. #define CK_LBRK
  3639. #endif /* AMIGA */
  3640. #ifdef STRATUS
  3641. #define CK_LBRK
  3642. #endif /* STRATUS */
  3643.  
  3644. #endif /* CK_LBRK */
  3645.  
  3646. /* Carrier treatment */
  3647. /* These are defined here because they are shared by the system dependent */
  3648. /* and the system independent modules. */
  3649.  
  3650. #define  CAR_OFF 0    /* Off: ignore carrier always. */
  3651. #define  CAR_ON  1      /* On: heed carrier always, except during DIAL. */
  3652. #define  CAR_AUT 2      /* Auto: heed carrier, but only if line is declared */
  3653.             /* to be a modem line, and only during CONNECT. */
  3654.  
  3655. /* And more generically (for use with any ON/OFF/AUTO feature) */
  3656. #define  CK_OFF  0
  3657. #define  CK_ON   1
  3658. #define  CK_AUTO 2
  3659.  
  3660. #ifndef NOLOCAL
  3661. /*
  3662.   Serial interface speeds available.
  3663.  
  3664.   As of C-Kermit 6.1 there is a new method to get the supported
  3665.   speeds, which obviates the need for all the craziness below.  At runtime,
  3666.   just call the new ttspdlist() routine to get a list of supported speeds.
  3667.   Then the user interface module can build a keyword table or menu from it.
  3668. */
  3669. #ifndef TTSPDLIST
  3670. #ifdef UNIX                /* For now, only for UNIX */
  3671. #ifndef OLINUXHISPEED            /* But not systems with hacks for */
  3672. #ifndef MINIX                /* high speeds, like 110 = 115200 */
  3673. #define TTSPDLIST
  3674. #endif /* MINIX */
  3675. #endif /* OLINUXHISPEED */
  3676. #else
  3677. #ifdef VMS
  3678. #define TTSPDLIST            /* VMS gets it too */
  3679. #endif /* VMS */
  3680. #endif /* UNIX */
  3681. #endif /* TTSPDLIST */
  3682.  
  3683. #ifndef NODIAL                /* Hangup by modem command */
  3684. #ifndef NOMDMHUP
  3685. #ifndef MDMHUP
  3686. #define MDMHUP
  3687. #endif /* MDMHUP */
  3688. #endif /* NOMDMHUP */
  3689. #endif /* NODIAL */
  3690.  
  3691. #ifdef NOSPL
  3692. #ifndef NOLOGDIAL            /* Connection log needs mjd(), etc. */
  3693. #define NOLOGDIAL
  3694. #endif /* NOLOGDIAL */
  3695. #endif /* NOSPL */
  3696.  
  3697. #ifdef pdp11
  3698. #define NOLOGDIAL
  3699. #endif /* pdp11 */
  3700.  
  3701. #ifndef NOLOGDIAL            /* Connection log */
  3702. #ifndef CXLOGFILE
  3703. #define CXLOGFILE "CX.LOG"        /* Default connection log file name */
  3704. #endif /* CXLOGFILE */
  3705. #ifndef CKLOGDIAL
  3706. #ifndef CK_SMALL
  3707. #define CKLOGDIAL
  3708. #define CXLOGBUFL 1024            /* Connection log record buffer size */
  3709. #endif /* CK_SMALL */
  3710. #endif /* NOLOGDIAL */
  3711. #endif /* CKLOGDIAL */
  3712.  
  3713. #endif /* NOLOCAL */
  3714.  
  3715. #ifdef NOTTSPDLIST            /* Except if NOTTSPDLIST is defined */
  3716. #ifdef TTSPDLIST
  3717. #undef TTSPDLIST
  3718. #endif /* TTSPDLIST */
  3719. #endif /* NOTTSPDLIST */
  3720.  
  3721. #ifdef TTSPDLIST
  3722.  
  3723. _PROTOTYP( long * ttspdlist, (void) );
  3724.  
  3725. #else /* TTSPDLIST not defined */
  3726. /*
  3727.   We must use a long and convoluted series of #ifdefs that have to be kept in
  3728.   sync with the code in the ck?tio.c module.
  3729.  
  3730.   We assume that everybody supports: 0, 110, 300, 600, 1200, 2400, 4800, and
  3731.   9600 bps.  Symbols for other speeds are defined here.  You can also add
  3732.   definitions on the CC command lines.  These definitions affect the SET SPEED
  3733.   keyword table, and are not necessarily usable in the system-dependent
  3734.   speed-setting code in the ck?tio.c modules, which depends on system-specific
  3735.   symbols like (in UNIX) B19200.  In other words, just defining it doesn't
  3736.   mean it'll work -- you also have to supply the supporting code in ttsspd()
  3737.   and ttgspd() in ck?tio.c.
  3738.  
  3739.   The symbols have the form BPS_xxxx, where xxxx is the speed in bits per
  3740.   second, or (for bps values larger than 9999) thousands of bps followed by K.
  3741.   The total symbol length should be 8 characters or less.  Some values are
  3742.   enabled automatically below.  You can disable a particular value by defining
  3743.   NOB_xxxx on the CC command line.
  3744.  
  3745. */
  3746.  
  3747. #ifndef NOB_50
  3748. #define BPS_50                /* 50 bps */
  3749. #endif
  3750.  
  3751. #ifndef NOB_75
  3752. #define BPS_75                /* 75 bps */
  3753. #endif
  3754.  
  3755. #ifndef NOB7512
  3756. #ifdef ANYBSD
  3757. #define BPS_7512            /* 75/1200 Split Speed */
  3758. #endif /* ANYBSD */
  3759. #endif /* NOB7512 */
  3760.  
  3761. #ifndef NOB134
  3762. #ifdef SOLARIS25
  3763. #define BPS_134
  3764. #else
  3765. #undef BPS_134                /* 134.5 bps (IBM 2741) */
  3766. #endif /* BPS_134 */
  3767. #endif /* NOB134 */
  3768.  
  3769. #ifndef NOB_150
  3770. #define BPS_150                /* 150 bps */
  3771. #endif
  3772.  
  3773. #ifndef NOB_200
  3774. #define BPS_200                /* 200 bps */
  3775. #endif
  3776.  
  3777. #ifndef NOB_1800
  3778. #ifdef MAC
  3779. #define BPS_1800            /* 1800 bps */
  3780. #else
  3781. #ifdef SOLARIS25
  3782. #define BPS_1800
  3783. #endif
  3784. #endif
  3785. #endif
  3786.  
  3787. #ifndef NOB_3600
  3788. #ifndef SOLARIS25
  3789. #define BPS_3600            /* 3600 bps */
  3790. #endif
  3791. #endif
  3792.  
  3793. #ifndef NOB_7200
  3794. #ifndef SOLARIS25
  3795. #define BPS_7200            /* 7200 bps */
  3796. #endif /* SOLARIS25 */
  3797. #endif
  3798.  
  3799. #ifndef NOB_14K
  3800. #ifdef BSD44
  3801. #define BPS_14K                /* 14400 bps */
  3802. #else
  3803. #ifdef OS2
  3804. #define BPS_14K
  3805. #else
  3806. #ifdef NEXT
  3807. #define BPS_14K
  3808. #else
  3809. #ifdef MAC
  3810. #define BPS_14K
  3811. #else
  3812. #ifdef AMIGA
  3813. #define BPS_14K
  3814. #endif /* AMIGA */
  3815. #endif /* MAC */
  3816. #endif /* NEXT */
  3817. #endif /* OS2 */
  3818. #endif /* BSD44 */
  3819. #endif /* NOB_14K */
  3820.  
  3821. #ifndef NOB_19K
  3822. #define BPS_19K                /* 19200 bps */
  3823. #endif
  3824.  
  3825. #ifndef NOB_28K
  3826. #ifdef BSD44
  3827. #define BPS_28K
  3828. #else
  3829. #ifdef OS2
  3830. #define BPS_28K
  3831. #else
  3832. #ifdef NEXT
  3833. #define BPS_28K                /* 28800 bps */
  3834. #else
  3835. #ifdef MAC
  3836. #define BPS_28K                /* 28800 bps */
  3837. #endif /* MAC */
  3838. #endif /* NEXT */
  3839. #endif /* OS2 */
  3840. #endif /* BSD44 */
  3841. #endif /* NOB_28K */
  3842.  
  3843. #ifndef NOB_38K
  3844. #define BPS_38K                /* 38400 bps */
  3845. #endif
  3846.  
  3847. #ifndef NOB_57K
  3848. #ifdef Plan9
  3849. #define BPS_57K
  3850. #else
  3851. #ifdef SOLARIS25
  3852. #define BPS_57K
  3853. #else
  3854. #ifdef VMS
  3855. #define BPS_57K                /* 57600 bps */
  3856. #else
  3857. #ifdef OS2
  3858. #define BPS_57K
  3859. #else
  3860. #ifdef __linux__
  3861. #define BPS_57K
  3862. #else
  3863. #ifdef HPUX
  3864. #define BPS_57K
  3865. #else
  3866. #ifdef NEXT
  3867. #define BPS_57K
  3868. #else
  3869. #ifdef __386BSD__
  3870. #define BPS_57K
  3871. #else
  3872. #ifdef __FreeBSD__
  3873. #define BPS_57K
  3874. #else
  3875. #ifdef __NetBSD__
  3876. #define BPS_57K
  3877. #else
  3878. #ifdef MAC
  3879. #define BPS_57K
  3880. #else
  3881. #ifdef QNX
  3882. #define BPS_57K
  3883. #else
  3884. #ifdef BEOSORBEBOX
  3885. #define BPS_57K
  3886. #else
  3887. #ifdef IRIX62
  3888. #define BPS_57K
  3889. #else
  3890. #ifdef SCO_OSR504
  3891. #define BPS_57K
  3892. #else
  3893. #ifdef BSDI2
  3894. #define BPS_57K
  3895. #endif /* BSDI2 */
  3896. #endif /* SCO_OSR504 */
  3897. #endif /* IRIX62 */
  3898. #endif /* BEOSORBEBOX */
  3899. #endif /* QNX */
  3900. #endif /* MAC */
  3901. #endif /* __NetBSD__ */
  3902. #endif /* __FreeBSD__ */
  3903. #endif /* __386BSD__ */
  3904. #endif /* NEXT */
  3905. #endif /* HPUX */
  3906. #endif /* __linux__ */
  3907. #endif /* OS2 */
  3908. #endif /* VMS */
  3909. #endif /* SOLARIS25 */
  3910. #endif /* Plan9 */
  3911. #endif /* NOB_57K */
  3912.  
  3913. #ifndef NOB_76K
  3914. #ifdef BSDI2
  3915. #define BPS_76K
  3916. #endif /* BSDI2 */
  3917. #ifdef Plan9
  3918. #define BPS_76K
  3919. #endif /* Plan9 */
  3920. #ifdef SOLARIS25
  3921. #define BPS_76K
  3922. #endif /* SOLARIS25 */
  3923. #ifdef VMS
  3924. #define BPS_76K                /* 76800 bps */
  3925. #endif /* VMS */
  3926. #ifdef OS2
  3927. #ifdef __32BIT__
  3928. #define BPS_76K
  3929. #endif /* __32BIT__ */
  3930. #endif /* OS2 */
  3931. #ifdef QNX
  3932. #define BPS_76K
  3933. #endif /* QNX */
  3934. #ifdef IRIX62
  3935. #define BPS_76K
  3936. #endif /* IRIX62 */
  3937. #ifdef SCO_OSR504
  3938. #define BPS_76K
  3939. #endif /* SCO_OSR504 */
  3940. #endif /* NOB_76K */
  3941.  
  3942. #ifndef NOB_115K
  3943. #ifdef BSDI2
  3944. #define BPS_115K
  3945. #endif /* BSDI2 */
  3946. #ifdef Plan9
  3947. #define BPS_115K
  3948. #endif /* Plan9 */
  3949. #ifdef SOLARIS25
  3950. #define BPS_115K
  3951. #endif /* SOLARIS25 */
  3952. #ifdef VMS
  3953. #define BPS_115K            /* 115200 bps */
  3954. #else
  3955. #ifdef QNX
  3956. #define BPS_115K
  3957. #else
  3958. #ifdef HPUX
  3959. #define BPS_115K
  3960. #else
  3961. #ifdef __linux__
  3962. #define BPS_115K
  3963. #else
  3964. #ifdef __386BSD__
  3965. #define BPS_115K
  3966. #else
  3967. #ifdef __FreeBSD__
  3968. #define BPS_115K
  3969. #else
  3970. #ifdef __NetBSD__
  3971. #define BPS_115K
  3972. #else
  3973. #ifdef OS2
  3974. #ifdef __32BIT__
  3975. #define BPS_115K
  3976. #endif /* __32BIT__ */
  3977. #else
  3978. #ifdef BEOSORBEBOX
  3979. #define BPS_115K
  3980. #else
  3981. #ifdef IRIX62
  3982. #define BPS_115K
  3983. #else
  3984. #ifdef SCO_OSR504
  3985. #define BPS_115K
  3986. #endif /* SCO_OSR504 */
  3987. #endif /* IRIX62 */
  3988. #endif /* BEOSORBEBOX */
  3989. #endif /* OS2 */
  3990. #endif /* __NetBSD__ */
  3991. #endif /* __FreeBSD__ */
  3992. #endif /* __386BSD__ */
  3993. #endif /* __linux__ */
  3994. #endif /* HPUX */
  3995. #endif /* QNX */
  3996. #endif /* VMS */
  3997. #endif /* NOB_115K */
  3998.  
  3999. #ifndef NOB_230K            /* 230400 bps */
  4000. #ifdef BSDI2
  4001. #define BPS_230K
  4002. #else
  4003. #ifdef SCO_OSR504
  4004. #define BPS_230K
  4005. #else
  4006. #ifdef __linux__
  4007. #define BPS_230K
  4008. #else
  4009. #ifdef SOLARIS25
  4010. #define BPS_230K
  4011. #else
  4012. #ifdef OS2
  4013. #ifdef __32BIT__
  4014. #define BPS_230K
  4015. #endif /* __32BIT__ */
  4016. #else
  4017. #undef BPS_230K
  4018. #endif /* OS2 */
  4019. #endif /* SOLARIS25 */
  4020. #endif /* __linux__ */
  4021. #endif /* SCO_OSR504 */
  4022. #endif /* BSDI2 */
  4023. #endif /* NOB_230K */
  4024.  
  4025. #ifndef NOB_460K            /* 460800 bps */
  4026. #ifdef SCO_OSR504
  4027. #define BPS_460K
  4028. #else
  4029. #ifdef __linux__
  4030. #define BPS_460K
  4031. #else
  4032. #ifdef OS2
  4033. #ifdef __32BIT__
  4034. #define BPS_460K
  4035. #endif /* __32BIT__ */
  4036. #else
  4037. #undef BPS_460K
  4038. #endif /* __linux__ */
  4039. #endif /* SCO_OSR504 */
  4040. #endif /* OS2 */
  4041. #endif /* NOB_460K */
  4042.  
  4043. #ifndef NOB_921K            /* 921600 bps */
  4044. #ifdef SCO_OSR504
  4045. #define BPS_921K
  4046. #endif /* SCO_OSR504 */
  4047. #endif /* NOB_921K */
  4048.  
  4049. #ifdef BPS_921K                /* Maximum speed defined */
  4050. #define MAX_SPD 921600L
  4051. #else
  4052. #ifdef BPS_460K
  4053. #define MAX_SPD 460800L
  4054. #else
  4055. #ifdef BPS_230K
  4056. #define MAX_SPD 230400L
  4057. #else
  4058. #ifdef BPS_115K
  4059. #define MAX_SPD 115200L
  4060. #else
  4061. #ifdef BPS_76K
  4062. #define MAX_SPD 76800L
  4063. #else
  4064. #ifdef BPS_57K
  4065. #define MAX_SPD 57600L
  4066. #else
  4067. #ifdef BPS_38K
  4068. #define MAX_SPD 38400L
  4069. #else
  4070. #ifdef BPS_28K
  4071. #define MAX_SPD 28800L
  4072. #else
  4073. #ifdef BPS_19K
  4074. #define MAX_SPD 19200L
  4075. #else
  4076. #ifdef BPS_14K
  4077. #define MAX_SPD 14400L
  4078. #else
  4079. #define MAX_SPD 9600L
  4080. #endif
  4081. #endif
  4082. #endif
  4083. #endif
  4084. #endif
  4085. #endif
  4086. #endif
  4087. #endif
  4088. #endif
  4089. #endif
  4090. #endif /* TTSPDLIST */
  4091.  
  4092. #ifndef CONGSPD                /* Systems that can call congspd() */
  4093. #ifdef UNIX
  4094. #define CONGSPD
  4095. #endif /* UNIX */
  4096. #ifdef VMS
  4097. #define CONGSPD
  4098. #endif /* VMS */
  4099. #ifdef STRATUS
  4100. #define CONGSPD
  4101. #endif /* STRATUS */
  4102. #endif /* CONGSPD */
  4103.  
  4104. /* Types of flow control available */
  4105.  
  4106. #define CK_XONXOFF            /* Everybody can do this, right? */
  4107.  
  4108. #ifdef AMIGA                /* Commodore Amiga */
  4109. #define CK_RTSCTS            /* has RTS/CTS */
  4110. #endif /* AMIGA */
  4111.  
  4112. #ifdef SUN4S5                /* SunOS in System V environment */
  4113. #define CK_RTSCTS
  4114. #else                    /* SunOS 4.0/4.1 in BSD environment */
  4115. #ifdef SUNOS4                /* SunOS 4.0+later supports RTS/CTS */
  4116. #ifdef SUNOS41                /* Easy in 4.1 and later */
  4117. #define CK_RTSCTS
  4118. #else                    /* Harder in 4.0 */
  4119. #ifndef __GNUC__            /* (see tthflow() in ckutio.c) */
  4120. #ifndef GNUC
  4121. #define CK_RTSCTS            /* Only if not using GNU gcc */
  4122. #endif /* __GNUC__ */
  4123. #endif /* GNUC */
  4124. #endif /* SUNOS41 */
  4125. #endif /* SUNOS4 */
  4126. #endif /* SUN4S5 */
  4127.  
  4128. #ifdef BSD44                /* And in 4.4 BSD, including BSDI */
  4129. #define CK_RTSCTS
  4130. #endif /* BSD44 */
  4131.  
  4132. #ifdef TERMIOX                /* Sys V R4 <termiox.h> */
  4133. #ifndef CK_RTSCTS
  4134. #define CK_RTSCTS
  4135. #endif /* CK_RTSCTS */
  4136. #ifndef CK_DTRCD
  4137. #define CK_DTRCD
  4138. #endif /* CK_DTRCD */
  4139. #else
  4140. #ifdef STERMIOX                /* Sys V R4 <sys/termiox.h> */
  4141. #ifndef CK_RTSCTS
  4142. #define CK_RTSCTS
  4143. #endif /* CK_RTSCTS */
  4144. #ifndef CK_DTRCD
  4145. #define CK_DTRCD
  4146. #endif /* CK_DTRCD */
  4147. #endif /* STERMIOX */
  4148. #endif /* TERMIOX */
  4149.  
  4150. #ifdef OXOS                /* Olivetti X/OS R2 struct termios */
  4151. #define CK_RTSCTS            /* Ditto. */
  4152. #define CK_DTRCD
  4153. #endif /* OXOS */
  4154.  
  4155. #ifdef AIXRS                /* RS/6000 with AIX 3.x */
  4156. #define CK_RTSCTS            /* Has its own peculiar method... */
  4157. #endif /* AIXRS */
  4158.  
  4159. #ifdef __linux__            /* Linux */
  4160. #define CK_RTSCTS
  4161. #endif /* __linux__ */
  4162. /*
  4163.   Hardware flow control is not defined in POSIX.1.  Nevertheless, a certain
  4164.   style API for hardware flow control, using tcsetattr() and the CRTSCTS
  4165.   bit(s), seems to be gaining currency on POSIX-based UNIX systems.  The
  4166.   following code defines the symbol POSIX_CRTSCTS for such systems.
  4167. */
  4168. #ifdef CK_RTSCTS
  4169. #ifdef __bsdi__                /* BSDI, a.k.a. BSD/386 */
  4170. #define POSIX_CRTSCTS
  4171. #endif /* __bsdi__ */
  4172. #ifdef __linux__            /* Linux */
  4173. #define POSIX_CRTSCTS
  4174. #endif /* __linux__ */
  4175. #ifdef __NetBSD__            /* NetBSD */
  4176. #define POSIX_CRTSCTS
  4177. #endif /* __NetBSD__ */
  4178. #ifdef __OpenBSD__
  4179. #define POSIX_CRTSCTS
  4180. #endif /* __OpenBSD__ */
  4181. #ifdef BEOSORBEBOX            /* BeBOX */
  4182. #define POSIX_CRTSCTS
  4183. /* BEBOX defines CRTSFL as (CTSFLOW & RTSFLOW) */
  4184. #define CRTSCTS CRTSFL
  4185. #endif /* BEOSORBEBOX */
  4186. #ifdef IRIX52                /* IRIX 5.2 and later */
  4187. #define POSIX_CRTSCTS
  4188. #define CRTSCTS CNEW_RTSCTS        /* See <sys/termios.h> */
  4189. #endif /* IRIX52 */
  4190. #endif /* CK_RTSCTS */
  4191.  
  4192. /* Implementations that have implemented the ttsetflow() function. */
  4193.  
  4194. #ifndef CK_TTSETFLOW
  4195. #ifdef UNIX
  4196. #define CK_TTSETFLOW
  4197. #endif /* UNIX */
  4198. #ifdef OS2
  4199. #define CK_TTSETFLOW
  4200. #endif /* OS2 */
  4201. #endif /* CK_TTSETFLOW */
  4202.  
  4203. #ifdef CK_TTSETFLOW
  4204. _PROTOTYP( int ttsetflow, (int) );
  4205. #endif /* CK_TTSETFLOW */
  4206. /*
  4207.  Systems where we can expand tilde at the beginning of file or directory names
  4208. */
  4209. #ifdef POSIX
  4210. #ifndef DTILDE
  4211. #define DTILDE
  4212. #endif /* DTILDE */
  4213. #endif /* POSIX */
  4214. #ifdef BSD4
  4215. #ifndef DTILDE
  4216. #define DTILDE
  4217. #endif /* DTILDE */
  4218. #endif /* BSD4 */
  4219. #ifdef ATTSV
  4220. #ifndef DTILDE
  4221. #define DTILDE
  4222. #endif /* DTILDE */
  4223. #endif /* ATTSV */
  4224. #ifdef OSK
  4225. #ifndef DTILDE
  4226. #define DTILDE
  4227. #endif /* DTILDE */
  4228. #endif /* OSK */
  4229. #ifdef HPUX                /* I don't know why this is */
  4230. #ifndef DTILDE                /* necessary, since -DHPUX */
  4231. #define DTILDE                /* automatically defines ATTSV */
  4232. #endif /* DTILDE */            /* (see above) ... */
  4233. #endif /* HPUX */
  4234.  
  4235. /*
  4236.   This is mainly for the benefit of ckufio.c (UNIX and OS/2 file support).
  4237.   Systems that have an atomic rename() function, so we don't have to use
  4238.   link() and unlink().
  4239. */
  4240. #ifdef POSIX
  4241. #ifndef RENAME
  4242. #define RENAME
  4243. #endif /* RENAME */
  4244. #endif /* POSIX */
  4245.  
  4246. #ifdef OS2
  4247. #ifndef RENAME
  4248. #define RENAME
  4249. #endif /* RENAME */
  4250. #endif /* OS2 */
  4251.  
  4252. #ifdef SUNOS41
  4253. #ifndef RENAME
  4254. #define RENAME
  4255. #endif /* RENAME */
  4256. #endif /* SUNOS41 */
  4257.  
  4258. #ifdef SVR4
  4259. #ifndef RENAME
  4260. #define RENAME
  4261. #endif /* RENAME */
  4262. #endif /* SVR4 */
  4263.  
  4264. #ifdef AIXRS
  4265. #ifndef RENAME
  4266. #define RENAME
  4267. #endif /* RENAME */
  4268. #endif /* AIXRS */
  4269.  
  4270. #ifdef BSD44
  4271. #ifndef RENAME
  4272. #define RENAME
  4273. #endif /* RENAME */
  4274. #endif /* BSD44 */
  4275.  
  4276. #ifdef NORENAME                /* Allow for compile-time override */
  4277. #ifdef RENAME
  4278. #undef RENAME
  4279. #endif /* RENAME */
  4280. #endif /* NORENAME */
  4281.  
  4282. #ifdef STRATUS                /* Stratus VOS */
  4283. #ifndef RENAME
  4284. #define RENAME
  4285. #endif /* RENAME */
  4286. #endif /* STRATUS */
  4287.  
  4288. /* Line delimiter for text files */
  4289.  
  4290. /*
  4291.  If the system uses a single character for text file line delimitation,
  4292.  define NLCHAR to the value of that character.  For text files, that
  4293.  character will be converted to CRLF upon output, and CRLF will be converted
  4294.  to that character on input during text-mode (default) packet operations.
  4295. */
  4296. #ifdef MAC                              /* Macintosh */
  4297. #define NLCHAR 015
  4298. #else
  4299. #ifdef OSK                /* OS-9/68K */
  4300. #define NLCHAR 015
  4301. #else                                   /* All Unix-like systems */
  4302. #define NLCHAR 012
  4303. #endif /* OSK */
  4304. #endif /* MAC */
  4305.  
  4306. /*
  4307.  At this point, if there's a system that uses ordinary CRLF line
  4308.  delimitation AND the C compiler actually returns both the CR and
  4309.  the LF when doing input from a file, then #undef NLCHAR.
  4310. */
  4311. #ifdef OS2                /* OS/2 */
  4312. #undef NLCHAR
  4313. #endif /* OS2 */
  4314.  
  4315. #ifdef GEMDOS                /* Atari ST */
  4316. #undef NLCHAR
  4317. #endif /* GEMDOS */
  4318.  
  4319. /*
  4320.   VMS file formats are so complicated we need to do all the conversion
  4321.   work in the CKVFIO module, so we tell the rest of C-Kermit not to fiddle
  4322.   with the bytes.
  4323. */
  4324.  
  4325. #ifdef vms
  4326. #undef NLCHAR
  4327. #endif /* vms */
  4328.  
  4329. /* The device name of a job's controlling terminal */
  4330. /* Special for VMS, same for all Unixes (?), not used by Macintosh */
  4331.  
  4332. #ifdef BEOS
  4333. #define CTTNAM dftty
  4334. #else
  4335. #ifdef vms
  4336. #define CTTNAM "SYS$INPUT:"        /* (4 Jan 2002) Was TT: */
  4337. #else
  4338. #ifdef datageneral
  4339. #define CTTNAM "@output"
  4340. #else
  4341. #ifdef OSK
  4342. extern char myttystr[];
  4343. #define CTTNAM myttystr
  4344. #else
  4345. #ifdef OS2
  4346. #define CTTNAM "con"
  4347. #else
  4348. #ifdef UNIX
  4349. #define CTTNAM "/dev/tty"
  4350. #else
  4351. #ifdef GEMDOS
  4352. #define CTTNAM "aux:"
  4353. #else
  4354. #ifdef STRATUS
  4355. extern char myttystr[];
  4356. #define CTTNAM myttystr
  4357. #else /* Anyone else... */
  4358. #define CTTNAM "stdout"            /* This is a kludge used by Mac */
  4359. #endif /* STRATUS */
  4360. #endif /* GEMDOS */
  4361. #endif /* UNIX */
  4362. #endif /* OS2 */
  4363. #endif /* OSK */
  4364. #endif /* datageneral */
  4365. #endif /* vms */
  4366. #endif /* BEOS */
  4367.  
  4368. #ifndef HAVECTTNAM
  4369. #ifdef UNIX
  4370. #define HAVECTTNAM
  4371. #else
  4372. #ifdef VMS
  4373. #define HAVECTTNAM
  4374. #endif /* VMS */
  4375. #endif /* UNIX */
  4376. #endif /* HAVECTTNAM */
  4377.  
  4378. #ifndef ZFCDAT                /* zfcdat() function available? */
  4379. #ifdef UNIX
  4380. #define  ZFCDAT
  4381. #else
  4382. #ifdef STRATUS
  4383. #define  ZFCDAT
  4384. #else
  4385. #ifdef GEMDOS
  4386. #define  ZFCDAT
  4387. #else
  4388. #ifdef AMIGA
  4389. #define  ZFCDAT
  4390. #else
  4391. #ifdef OS2
  4392. #define  ZFCDAT
  4393. #else
  4394. #ifdef datageneral
  4395. #define  ZFCDAT
  4396. #else
  4397. #ifdef VMS
  4398. #define  ZFCDAT
  4399. #endif /* VMS */
  4400. #endif /* datageneral */
  4401. #endif /* OS2 */
  4402. #endif /* AMIGA */
  4403. #endif /* GEMDOS */
  4404. #endif /* STRATUS */
  4405. #endif /* UNIX */
  4406. #endif /* ZFCDAT */
  4407.  
  4408. #ifdef SUNS4S5
  4409. #define tolower _tolower
  4410. #define toupper _toupper
  4411. #endif /* SUNS4S5 */
  4412.  
  4413. /* Error number */
  4414.  
  4415. #ifdef _CRAY
  4416. #ifdef _CRAYCOM                /* Cray Computer Corp. */
  4417. extern int errno;
  4418. #else /* _CRAYCOM */
  4419. #include <errno.h>            /* Cray Research UNICOS defines */
  4420.                     /* errno as a function. */
  4421. #endif /* _CRAYCOM */            /* OK for UNICOS 6.1 and 7.0. */
  4422. #else /* _CRAY */
  4423. #ifdef STRATUS                /* Stratus VOS */
  4424. #include <errno.h>
  4425. #else /* not STRATUS */
  4426. #ifndef VMS
  4427. #ifndef OS2
  4428. /*
  4429.   The following declaration causes problems for VMS and OS/2, in which
  4430.   errno is an "extern volatile int noshare"...
  4431. */
  4432. extern int errno;            /* Needed by most modules. */
  4433. #endif /* OS2 */
  4434. #endif /* VMS */
  4435. #endif /* STRATUS */
  4436. #endif /* _CRAY */
  4437.  
  4438. #ifdef pdp11                /* Try to make some space on PDP-11 */
  4439. #ifndef NODIAL
  4440. #define NODIAL
  4441. #endif /* NODIAL */
  4442. #ifndef NOCURSES
  4443. #define NOCURSES
  4444. #endif /* NOCURSES */
  4445. #ifndef NOBIGBUF
  4446. #define NOBIGBUF
  4447. #endif /* NOBIGBUF */
  4448. #endif /* pdp11 */
  4449.  
  4450. #ifndef NOBIGBUF
  4451. #ifndef BIGBUFOK            /* Platforms with lots of memory */
  4452.  
  4453. #ifdef QNX                /* QNX */
  4454. #ifndef QNX16                /* But not 16-bit versions */
  4455. #define BIGBUFOK
  4456. #endif /* QNX16 */
  4457. #endif /* QNX */
  4458.  
  4459. #ifdef BSD44
  4460. #define BIGBUFOK
  4461. #endif /* BSD44 */
  4462.  
  4463. #ifdef STRATUS                /* Stratus VOS */
  4464. #define BIGBUFOK
  4465. #endif /* STRATUS */
  4466.  
  4467. #ifdef sparc                /* SPARC processors */
  4468. #define BIGBUFOK
  4469. #endif /* sparc */
  4470.  
  4471. #ifdef mips                /* MIPS processors */
  4472. #define BIGBUFOK
  4473. #endif /* mips */
  4474.  
  4475. #ifdef HPUX9                /* HP-UX 9.x */
  4476. #define BIGBUFOK
  4477. #endif /* HPUX9 */
  4478.  
  4479. #ifdef HPUX10                /* HP-UX 10.0 PA-RISC */
  4480. #define BIGBUFOK
  4481. #endif /* HPUX10 */
  4482.  
  4483. #ifdef NEXT                /* NeXTSTEP */
  4484. #ifdef mc68000                /* on NEXT platforms... */
  4485. #define BIGBUFOK
  4486. #endif /* mc68000 */
  4487. #endif /* NEXT */
  4488.  
  4489. #ifdef LINUX                /* Linux in 1998 should be OK */
  4490. #ifndef BIGBUFOK
  4491. #define BIGBUFOK
  4492. #endif /* BIGBUFOK */
  4493. #endif /* LINUX */
  4494.  
  4495. #ifdef OS2                /* 32-bit OS/2 2.x and above */
  4496. #ifdef __32BIT__
  4497. #define BIGBUFOK
  4498. #endif /* __32BIT__ */
  4499. #ifdef NT
  4500. #define BIGBUFOK
  4501. #endif /* NT */
  4502. #endif /* OS2 */
  4503.  
  4504. #ifdef Plan9                /* Plan 9 is OK */
  4505. #define BIGBUFOK
  4506. #endif /* Plan9 */
  4507.  
  4508. #ifdef VMS                /* Any VMS is OK */
  4509. #ifndef BIGBUFOK
  4510. #define BIGBUFOK
  4511. #endif /* BIGBUFOK */
  4512. #endif /* VMS */
  4513.  
  4514. #ifdef __alpha                /* DEC 64-bit Alpha, e.g. OSF/1 */
  4515. #ifndef BIGBUFOK            /* Might already be defined for VMS */
  4516. #define BIGBUFOK
  4517. #endif /* BIGBUFOK */
  4518. #endif /* __alpha */
  4519.  
  4520. #ifdef sgi                /* SGI with IRIX 4.0 or later */
  4521. #ifndef BIGBUFOK
  4522. #define BIGBUFOK
  4523. #endif /* BIGBUFOK */
  4524. #endif /* sgi */
  4525.  
  4526. #ifdef AIXRS                /* AIX on RISC */
  4527. #define BIGBUFOK
  4528. #endif /* AIXRS */
  4529.  
  4530. #ifdef CK_SCOV5                /* SCO OSR5 */
  4531. #ifndef BIGBUFOK
  4532. #define BIGBUFOK
  4533. #endif /* BIGBUFOK */
  4534. #endif /* CK_SCOV5 */
  4535.  
  4536. #ifdef SOLARIS                /* Solaris x86 */
  4537. #ifndef BIGBUFOK
  4538. #define BIGBUFOK
  4539. #endif /* BIGBUFOK */
  4540. #endif /* SOLARIS */
  4541.  
  4542. #endif /* BIGBUFOK */
  4543. #endif /* NOBIGBUF */
  4544.  
  4545. #ifdef CK_SMALL
  4546. #ifdef BIGBUFOK
  4547. #undef BIGBUFOK
  4548. #endif /* BIGBUFOK */
  4549. #endif /* CK_SMALL */
  4550.  
  4551. /* If "memory is no problem" then this improves performance */
  4552.  
  4553. #ifdef DEBUG
  4554. #ifdef BIGBUFOK
  4555. #ifndef IFDEBUG
  4556. #define IFDEBUG
  4557. #endif /* IFDEBUG */
  4558. #endif /* BIGBUFOK */
  4559. #endif /* DEBUG */
  4560.  
  4561. #ifndef DEBUG
  4562. /* Compile all the debug() statements away.  Saves a lot of space and time. */
  4563. #define debug(a,b,c,d)
  4564. #define hexdump(a,b,c)
  4565. /* Now define the debug() macro. */
  4566. #else /* DEBUG */
  4567. _PROTOTYP(int dodebug,(int,char *,char *,long));
  4568. _PROTOTYP(int dohexdump,(CHAR *,CHAR *,int));
  4569. #ifdef IFDEBUG
  4570. /* Use this form to avoid function calls: */
  4571. #ifdef COMMENT
  4572. #define debug(a,b,c,d) if (deblog) dodebug(a,b,(char *)(c),(long)d)
  4573. #define hexdump(a,b,c) if (deblog) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  4574. #else
  4575. #ifdef CK_ANSIC
  4576. #define debug(a,b,c,d) ((void)(deblog?dodebug(a,b,(char *)(c),(long)d):0))
  4577. #define hexdump(a,b,c) ((void)(deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0))
  4578. #else
  4579. #define debug(a,b,c,d) (deblog?dodebug(a,b,(char *)(c),(long)d):0)
  4580. #define hexdump(a,b,c) (deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0)
  4581. #endif /* CK_ANSIC */
  4582. #endif /* COMMENT */
  4583. #else /* IFDEBUG */
  4584. /* Use this form to save space: */
  4585. #define debug(a,b,c,d) dodebug(a,b,(char *)(c),(long)d)
  4586. #define hexdump(a,b,c) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  4587. #endif /* IFDEBUG */
  4588. #endif /* DEBUG */
  4589.  
  4590. /* File System Defaults */
  4591.  
  4592. #ifndef UIDBUFLEN            /* Length of User ID */
  4593. #ifdef OS2
  4594. #define UIDBUFLEN 256
  4595. #else /* OS2 */
  4596. #ifdef BIGBUFOK
  4597. #define UIDBUFLEN 256
  4598. #else
  4599. #define UIDBUFLEN 64
  4600. #endif /* BIGBUFOK */
  4601. #endif /* OS2 */
  4602. #endif /* UIDBUFLEN */
  4603.  
  4604. #ifdef UNIX
  4605. #ifdef PROVX1
  4606. #define MAXWLD 50
  4607. #else
  4608. #ifdef pdp11
  4609. #define MAXWLD 50
  4610. #else
  4611. #ifdef BIGBUFOK
  4612. #define MAXWLD 102400
  4613. #else
  4614. #define MAXWLD 1024
  4615. #endif /* BIGBUFOK */
  4616. #endif /* pdp11 */
  4617. #endif /* PROVX1 */
  4618. #else
  4619. #ifdef VMS
  4620. #define MAXWLD 102400            /* Maximum wildcard filenames */
  4621. #else
  4622. #ifdef datageneral
  4623. #define MAXWLD 500
  4624. #else
  4625. #ifdef STRATUS
  4626. #define MAXWLD 5000
  4627. #endif /* STRATUS */
  4628. #endif /* datageneral */
  4629. #endif /* VMS */
  4630. #endif /* UNIX */
  4631.  
  4632. #ifdef VMS
  4633. #define DBLKSIZ 512
  4634. #define DLRECL 512
  4635. #else
  4636. #define DBLKSIZ 0
  4637. #define DLRECL 0
  4638. #endif /* VMS */
  4639.  
  4640. /* Communication device / network host name length */
  4641.  
  4642. #ifdef BIGBUFOK
  4643. #define TTNAMLEN 512
  4644. #else
  4645. #ifdef MAC
  4646. #define TTNAMLEN 256
  4647. #else
  4648. #ifndef CK_SMALL
  4649. #define TTNAMLEN 128
  4650. #else
  4651. #define TTNAMLEN 80
  4652. #endif /* CK_SMALL */
  4653. #endif /* MAC */
  4654. #endif /* BIGBUFOK */
  4655.  
  4656. /* Program return codes for DECUS C and UNIX (VMS uses UNIX codes) */
  4657.  
  4658. #ifdef decus
  4659. #define GOOD_EXIT   IO_NORMAL
  4660. #define BAD_EXIT    IO_ERROR
  4661. #else
  4662. #define GOOD_EXIT   0
  4663. #define BAD_EXIT    1
  4664. #endif /* decus */
  4665.  
  4666. /* Special hack for Fortune, which doesn't have <sys/file.h>... */
  4667.  
  4668. #ifdef FT18
  4669. #define FREAD 0x01
  4670. #define FWRITE 0x10
  4671. #endif /* FT18 */
  4672.  
  4673. /* Special hack for OS-9/68k */
  4674. #ifdef OSK
  4675. #ifndef _UCC
  4676. #define SIGALRM 30            /* May always cancel I/O */
  4677. #endif /* _UCC */
  4678. #define SIGARB    1234            /* Arbitrary for I/O */
  4679. SIGTYP (*signal())();
  4680. #endif /* OSK */
  4681.  
  4682. #ifdef MINIX
  4683. #ifdef putchar
  4684. #undef putchar
  4685. #endif /* putchar */
  4686. #define putchar(c) (putc(c,stdout)!=EOF)&&fflush(stdout)
  4687. #endif /* MINIX */
  4688.  
  4689. #ifdef datageneral            /* Data General AOS/VS */
  4690. #ifdef putchar
  4691. #undef putchar
  4692. #endif /* putchar */
  4693. #define putchar(c) conoc(c)
  4694. #endif /* datageneral */
  4695.  
  4696. /* Escape/quote character used by the command parser */
  4697.  
  4698. #define CMDQ '\\'
  4699.  
  4700. /* Symbols for RS-232 modem signals */
  4701.  
  4702. #define KM_FG    1            /* Frame ground */
  4703. #define KM_TXD   2            /* Transmit */
  4704. #define KM_RXD   3            /* Receive */
  4705. #define KM_RTS   4            /* Request to Send */
  4706. #define KM_CTS   5            /* Clear to Send */
  4707. #define KM_DSR   6            /* Data Set Ready */
  4708. #define KM_SG    7            /* Signal ground */
  4709. #define KM_DCD   8            /* Carrier Detect */
  4710. #define KM_DTR  20            /* Data Terminal Ready */
  4711. #define KM_RI   22            /* Ring Indication */
  4712.  
  4713. /* Bit mask values for modem signals */
  4714.  
  4715. #define BM_CTS   0001            /* Clear to send       (From DCE) */
  4716. #define BM_DSR   0002            /* Dataset ready       (From DCE) */
  4717. #define BM_DCD   0004            /* Carrier             (From DCE) */
  4718. #define BM_RNG   0010            /* Ring Indicator      (From DCE) */
  4719. #define BM_DTR   0020            /* Data Terminal Ready (From DTE) */
  4720. #define BM_RTS   0040            /* Request to Send     (From DTE) */
  4721.  
  4722. /* Codes for full duplex flow control */
  4723.  
  4724. #define FLO_NONE 0            /* None */
  4725. #define FLO_XONX 1            /* Xon/Xoff (soft) */
  4726. #define FLO_RTSC 2            /* RTS/CTS (hard) */
  4727. #define FLO_DTRC 3            /* DTR/CD (hard) */
  4728. #define FLO_ETXA 4            /* ETX/ACK (soft) */
  4729. #define FLO_STRG 5            /* String-based (soft) */
  4730. #define FLO_DIAL 6            /* DIALing kludge */
  4731. #define FLO_DIAX 7            /* Cancel dialing kludge */
  4732. #define FLO_DTRT 8            /* DTR/CTS (hard) */
  4733. #define FLO_KEEP 9            /* Keep, i.e. don't touch or change */
  4734. #define FLO_AUTO 10            /* Figure out automatically */
  4735.  
  4736. /* Types of connections */
  4737.  
  4738. #define CXT_REMOTE  0            /* Remote mode - no connection */
  4739. #define CXT_DIRECT  1            /* Direct serial connection */
  4740. #define CXT_MODEM   2            /* Modem dialout */
  4741. #define CXT_TCPIP   3            /* TCP/IP - Telnet, Rlogin, etc */
  4742. #define CXT_X25     4            /* X.25 peer-to-peer */
  4743. #define CXT_DECNET  5            /* DECnet (CTERM, etc) */
  4744. #define CXT_LAT     6            /* LAT */
  4745. #define CXT_NETBIOS 7            /* NETBIOS */
  4746. #define CXT_NPIPE   8            /* Named Pipe */
  4747. #define CXT_PIPE    9            /* Pipe, Command, PTY, DLL, etc */
  4748. #define CXT_SSH     10                  /* SSH */
  4749. #define CXT_MAX     10            /* Highest connection type */
  4750.  
  4751. /* Autodownload Detection Options */
  4752.  
  4753. #define ADL_PACK 0            /* Auto-Download detect packet */
  4754. #define ADL_STR  1            /* Auto-Download detect string */
  4755.  
  4756. /* And finally... */
  4757.  
  4758. #ifdef COMMENT                /* Make sure this is NOT defined! */
  4759. #undef COMMENT
  4760. #endif /* COMMENT */
  4761.  
  4762. /* zstr zattr filinfo were here (moved to top for DECC 5 Jun 2000) */
  4763.  
  4764. #ifndef ZFNQFP                /* Versions that have zfnqfp() */
  4765. #ifdef UNIX
  4766. #define ZFNQFP
  4767. #else
  4768. #ifdef VMS
  4769. #define ZFNQFP
  4770. #else
  4771. #ifdef OS2
  4772. #define ZFNQFP
  4773. #else
  4774. #ifdef datageneral
  4775. #define ZFNQFP
  4776. #else
  4777. #ifdef STRATUS
  4778. #define ZFNQFP
  4779. #endif /* STRATUS */
  4780. #endif /* datageneral */
  4781. #endif /* OS2 */
  4782. #endif /* VMS */
  4783. #endif /* UNIX */
  4784. struct zfnfp {
  4785.    int len;                /* Length of full pathname */
  4786.    char * fpath;            /* Pointer to full pathname */
  4787.    char * fname;            /* Pointer to name part */
  4788. };
  4789. #endif /* ZFNQFP */
  4790.  
  4791. /* Systems that support FILE TYPE LABELED */
  4792.  
  4793. #ifdef VMS
  4794. #define CK_LABELED
  4795. #else
  4796. #ifdef OS2
  4797. #ifdef __32BIT__
  4798. #ifndef NT
  4799. #define CK_LABELED
  4800. #endif /* NT */
  4801. #endif /* __32BIT__ */
  4802. #endif /* OS2 */
  4803. #endif /* VMS */
  4804.  
  4805. /* LABELED FILE options bitmask */
  4806.  
  4807. #ifdef VMS                /* For VMS */
  4808. #define LBL_NAM  1            /* Ignore incoming name if set */
  4809. #define LBL_PTH  2            /* Use complete path if set */
  4810. #define LBL_ACL  4            /* Preserve ACLs if set */
  4811. #define LBL_BCK  8            /* Preserve backup date if set */
  4812. #define LBL_OWN 16            /* Preserve ownership if set */
  4813.  
  4814. #else
  4815.  
  4816. #ifdef OS2                /* Ditto for OS/2 */
  4817. #define LBL_NOR  0x0000            /* Normal file */
  4818. #define LBL_ARC  0x0020            /* Archive */
  4819. #define LBL_DIR  0x0010            /* Directory */
  4820. #define LBL_HID  0x0002            /* Hidden file */
  4821. #define LBL_RO   0x0001            /* Read only file */
  4822. #define LBL_SYS  0x0004            /* System file */
  4823. #define LBL_EXT  0x0040            /* Extended */
  4824. #endif /* OS2 */
  4825. #endif /* VMS */
  4826.  
  4827. /*
  4828.   Data types.  First the header file for data types so we can pick up the
  4829.   types used for pids, uids, and gids.  Override this section by putting
  4830.   -DCKTYP_H=xxx on the command line to specify the header file where your
  4831.   system defines these types.
  4832. */
  4833. #ifndef STRATUS
  4834. #ifdef __ALPHA
  4835. #ifdef MULTINET
  4836. #define CK_TGV_AXP
  4837. #endif /* MULTINET */
  4838. #endif /* __ALPHA */
  4839.  
  4840. #ifdef CK_TGV_AXP            /* Alpha, VMS, MultiNet */
  4841. /*
  4842.   Starting in DECC 5.0, <stdlib.h> no longer includes <types.h>.
  4843.   But before that an elaborate workaround is required, which results in
  4844.   including <types.h> sometimes but not others, evidently depending on whether
  4845.   <types.h> protects itself against multiple inclusion, which in turn probably
  4846.   differentiates between DECC <types.h> and TGV <types.h>.  Unfortunately I
  4847.   don't remember the details.  (fdc, 25 Oct 96)
  4848. */
  4849. #ifdef COMMENT
  4850. /*
  4851.   Previously the test here was for DEC version prior to 4.0, but since the
  4852.   test involved an "#if" statement, it was not portable and broke some non-VMS
  4853.   builds.  In any case, condition was never satisfied, so the result of
  4854.   commenting this section out is the same as the previous "#if" condition.
  4855. */
  4856. #ifndef __TYPES_LOADED
  4857. #define __TYPES_LOADED            /* Work around bug in .h files */
  4858. #endif /* __TYPES_LOADED */
  4859. #endif /* COMMENT */
  4860. #include <sys/types.h>
  4861. #ifdef IF_DOT_H
  4862. #ifndef MULTINET
  4863. #include <if.h>                /* Needed to put up u_int typedef */
  4864. #endif /* MULTINET */
  4865. #else /* IF_DOT_H */
  4866. #ifdef NEEDUINT
  4867. typedef unsigned int u_int;
  4868. #endif /* NEEDUINT */
  4869. #endif /* IF_DOT_H */
  4870. #else                    /* !CK_TGV_AXP */
  4871. #ifdef OSK                /* OS-9 */
  4872. #include <types.h>
  4873. #else                    /* General case, not OS-9 */
  4874. #ifndef CKTYP_H
  4875. #ifndef VMS
  4876. #ifndef MAC
  4877. #ifndef AMIGA
  4878. #define CKTYP_H <sys/types.h>
  4879. #endif /* AMIGA */
  4880. #endif /* MAC */
  4881. #endif /* VMS */
  4882. #endif /* CKTYP_H */
  4883.  
  4884. #ifdef GEMDOS
  4885. #undef CKTYP_H
  4886. #include <types.h>
  4887. #endif /* GEMDOS */
  4888.  
  4889. #ifdef OS2
  4890. #undef CKTYP_H
  4891. #include <sys/types.h>
  4892. #endif /* OS2 */
  4893.  
  4894. #ifdef CKTYP_H                /* Include it. */
  4895. #ifdef COHERENT                /* Except for COHERENT */
  4896. #include <unistd.h>
  4897. #include <sys/types.h>
  4898. #else
  4899. #ifdef datageneral            /* AOS/VS */
  4900. #include <sys/types.h>
  4901. #else  /* All others */
  4902. #ifdef __bsdi__                /* BSDI */
  4903. #ifdef POSIX
  4904. #undef _POSIX_SOURCE
  4905. #endif /* POSIX */
  4906. #endif /* __bsdi__ */
  4907. #include CKTYP_H
  4908. #ifdef __bsdi__
  4909. #ifdef POSIX
  4910. #define _POSIX_SOURCE
  4911. #endif /* POSIX */
  4912. #endif /* __bsdi__ */
  4913. #endif /* datageneral */
  4914. #endif /* COHERENT */
  4915. #endif /* CKTYP_H */
  4916.  
  4917. #endif /* OSK */
  4918. #endif /* CK_TGV_AXP */
  4919. #endif /* STRATUS */            /* End of types.h section */
  4920.  
  4921. /*
  4922.   Data type for pids.  If your system uses a different type, put something
  4923.   like -DPID_T=pid_t on command line, or override here.
  4924. */
  4925. #ifndef PID_T
  4926. #define PID_T int
  4927. #endif /* PID_T */
  4928. /*
  4929.   Data types for uids and gids.  Same deal as for pids.
  4930.   Wouldn't be nice if there was a preprocessor test to find out if a
  4931.   typedef existed?
  4932. */
  4933. #ifdef VMS
  4934. /* Not used in VMS so who cares */
  4935. #define UID_T int
  4936. #define GID_T int
  4937. #endif /* VMS */
  4938.  
  4939. #ifdef POSIX
  4940. /* Or would it be better (or worse?) to use _POSIX_SOURCE here? */
  4941. #ifndef UID_T
  4942. #define UID_T uid_t
  4943. #endif /* UID_T */
  4944. #ifndef GID_T
  4945. #define GID_T gid_t
  4946. #endif /* GID_T */
  4947. #else /* Not POSIX */
  4948. #ifdef SVR4
  4949. /* SVR4 and later have uid_t and gid_t. */
  4950. /* SVR3 and earlier use int, or unsigned short, or.... */
  4951. #ifndef UID_T
  4952. #define UID_T uid_t
  4953. #endif /* UID_T */
  4954. #ifndef GID_T
  4955. #define GID_T gid_t
  4956. #endif /* GID_T */
  4957. #else /* Not SVR4 */
  4958. #ifdef BSD43
  4959. #ifndef UID_T
  4960. #define UID_T uid_t
  4961. #endif /* UID_T */
  4962. #ifndef GID_T
  4963. #define GID_T gid_t
  4964. #endif /* GID_T */
  4965. #else /* Not BSD43 */
  4966. /* Default these to int for older UNIX versions */
  4967. #ifndef UID_T
  4968. #define UID_T int
  4969. #endif /* UID_T */
  4970. #ifndef GID_T
  4971. #define GID_T int
  4972. #endif /* GID_T */
  4973. #endif /* BSD43 */
  4974. #endif /* SVR4  */
  4975. #endif /* POSIX */
  4976.  
  4977. /*
  4978.   getpwuid() arg type, which is not necessarily the same as UID_T,
  4979.   e.g. in SCO UNIX SVR3, it's int.
  4980. */
  4981. #ifndef PWID_T
  4982. #define PWID_T UID_T
  4983. #endif /* PWID_T */
  4984.  
  4985. #ifdef CK_REDIR
  4986. #ifdef NEXT
  4987. #define MACHWAIT
  4988. #else
  4989. #ifdef MACH
  4990. #define MACHWAIT
  4991. #endif /* MACH */
  4992. #endif /* NEXT */
  4993.  
  4994. #ifdef MACHWAIT                /* WAIT_T argument for wait() */
  4995. #include <sys/wait.h>
  4996. #define CK_WAIT_H
  4997. typedef union wait WAIT_T;
  4998. #else
  4999. #ifdef POSIX
  5000. #ifdef OSF
  5001. /* OSF wait.h defines BSD wait if _BSD is defined so  hide _BSD from wait.h */
  5002. #ifdef _BSD
  5003. #define CK_OSF_BSD
  5004. #undef  _BSD
  5005. #endif /* _BSD */
  5006. #endif /* OSF */
  5007. #include <sys/wait.h>
  5008. #define CK_WAIT_H
  5009. #ifndef WAIT_T
  5010. typedef int WAIT_T;
  5011. #endif /* WAIT_T */
  5012. #ifdef CK_OSF_BSD            /* OSF/1: Restore  _BSD definition */
  5013. #define _BSD
  5014. #undef CK_OSF_BSD
  5015. #endif /* CK_OSF_BSD */
  5016. #else /* !POSIX */
  5017. typedef int WAIT_T;
  5018. #endif /* POSIX */
  5019. #endif /* MACHWAIT */
  5020. #else
  5021. typedef int WAIT_T;
  5022. #endif /* CK_REDIR */
  5023.  
  5024. /* Assorted other blah_t's handled here... */
  5025.  
  5026. #ifndef SIZE_T
  5027. #define SIZE_T size_t
  5028. #endif /* SIZE_T */
  5029.  
  5030. /* Forward declarations of system-dependent functions callable from all */
  5031. /* C-Kermit modules. */
  5032.  
  5033. /* File-related functions from system-dependent file i/o module */
  5034.  
  5035. #ifndef CKVFIO_C
  5036. /* For some reason, this does not agree with DEC C */
  5037. _PROTOTYP( int zkself, (void) );
  5038. #endif /* CKVFIO_C */
  5039. _PROTOTYP( int zopeni, (int, char *) );
  5040. _PROTOTYP( int zopeno, (int, char *, struct zattr *, struct filinfo *) );
  5041. _PROTOTYP( int zclose, (int) );
  5042. #ifndef MAC
  5043. _PROTOTYP( int zchin, (int, int *) );
  5044. #endif /* MAC */
  5045. _PROTOTYP( int zxin, (int, char *, int) );
  5046. _PROTOTYP( int zsinl, (int, char *, int) );
  5047. _PROTOTYP( int zinfill, (void) );
  5048. _PROTOTYP( int zsout, (int, char*) );
  5049. _PROTOTYP( int zsoutl, (int, char*) );
  5050. _PROTOTYP( int zsoutx, (int, char*, int) );
  5051. _PROTOTYP( int zchout, (int, char) );
  5052. _PROTOTYP( int zoutdump, (void) );
  5053. _PROTOTYP( int zsyscmd, (char *) );
  5054. _PROTOTYP( int zshcmd, (char *) );
  5055. #ifdef CKEXEC
  5056. _PROTOTYP( VOID z_exec, (char *, char **, int) );
  5057. #endif /* CKEXEC */
  5058. _PROTOTYP( int chkfn, (int) );
  5059. _PROTOTYP( long zchki, (char *) );
  5060. #ifdef VMSORUNIX
  5061. _PROTOTYP( long zgetfs, (char *) );
  5062. #else
  5063. #ifdef OS2
  5064. _PROTOTYP( long zgetfs, (char *) );
  5065. #else
  5066. #define zgetfs(a) zchki(a)
  5067. #endif /* OS2 */
  5068. #endif /* VMSORUNIX */
  5069. _PROTOTYP( int iswild, (char *) );
  5070. _PROTOTYP( int isdir, (char *) );
  5071. _PROTOTYP( int zchko, (char *) );
  5072. _PROTOTYP( int zdelet, (char *) );
  5073. _PROTOTYP( VOID zrtol, (char *,char *) );
  5074. _PROTOTYP( VOID zltor, (char *,char *) );
  5075. _PROTOTYP( VOID zstrip, (char *,char **) );
  5076. #ifdef VMS
  5077. _PROTOTYP( char * zrelname, (char *, char *) );
  5078. #endif /* VMS */
  5079. _PROTOTYP( int zchdir, (char *) );
  5080. _PROTOTYP( char * zhome, (void) );
  5081. _PROTOTYP( char * zgtdir, (void) );
  5082. _PROTOTYP( int zxcmd, (int, char *) );
  5083. #ifndef MAC
  5084. _PROTOTYP( int zclosf, (int) );
  5085. #endif /* MAC */
  5086. #ifdef NZXPAND
  5087. _PROTOTYP( int nzxpand, (char *, int) );
  5088. #else /* NZXPAND */
  5089. _PROTOTYP( int zxpand, (char *) );
  5090. #endif /* NZXPAND */
  5091. _PROTOTYP( int znext, (char *) );
  5092. #ifdef ZXREWIND
  5093. _PROTOTYP( int zxrewind, (void) );
  5094. #endif /* ZXREWIND */
  5095. _PROTOTYP( int zchkspa, (char *, long) );
  5096. _PROTOTYP( VOID znewn, (char *, char **) );
  5097. _PROTOTYP( int zrename, (char *, char *) );
  5098. _PROTOTYP( int zcopy, (char *, char *) );
  5099. _PROTOTYP( int zsattr, (struct zattr *) );
  5100. _PROTOTYP( int zfree, (char *) );
  5101. _PROTOTYP( char * zfcdat, (char *) );
  5102. _PROTOTYP( int zstime, (char *, struct zattr *, int) );
  5103. #ifdef CK_PERMS
  5104. _PROTOTYP( char * zgperm, (char *) );
  5105. _PROTOTYP( char * ziperm, (char *) );
  5106. #endif /* CK_PERMS */
  5107. _PROTOTYP( int zmail, (char *, char *) );
  5108. _PROTOTYP( int zprint, (char *, char *) );
  5109. _PROTOTYP( char * tilde_expand, (char *) );
  5110. _PROTOTYP( int zmkdir, (char *) ) ;
  5111. _PROTOTYP( int zfseek, (long) ) ;
  5112. #ifdef ZFNQFP
  5113. _PROTOTYP( struct zfnfp * zfnqfp, (char *, int, char * ) ) ;
  5114. #else
  5115. #define zfnqfp(a,b,c) ckstrncpy(c,a,b)
  5116. #endif /* ZFNQFP */
  5117. _PROTOTYP( int zvuser, (char *) ) ;
  5118. _PROTOTYP( int zvpass, (char *) ) ;
  5119. _PROTOTYP( VOID zvlogout, (void) ) ;
  5120. #ifdef OS2
  5121. _PROTOTYP( int os2setlongname, ( char * fn, char * ln ) ) ;
  5122. _PROTOTYP( int os2getlongname, ( char * fn, char ** ln ) ) ;
  5123. _PROTOTYP( int os2rexx, ( char *, char *, int ) ) ;
  5124. _PROTOTYP( int os2rexxfile, ( char *, char *, char *, int) ) ;
  5125. _PROTOTYP( int os2geteas, (char *) ) ;
  5126. _PROTOTYP( int os2seteas, (char *) ) ;
  5127. _PROTOTYP( char * get_os2_vers, (void) ) ;
  5128. _PROTOTYP( int do_label_send, (char *) ) ;
  5129. _PROTOTYP( int do_label_recv, (void) ) ;
  5130. #ifdef OS2MOUSE
  5131. _PROTOTYP( unsigned long os2_mouseon, (void) );
  5132. _PROTOTYP( unsigned long os2_mousehide, (void) );
  5133. _PROTOTYP( unsigned long os2_mouseshow, (void) );
  5134. _PROTOTYP( unsigned long os2_mouseoff, (void) );
  5135. _PROTOTYP( void os2_mouseevt, (void *) );
  5136. _PROTOTYP( int mousebuttoncount, (void));
  5137. #endif /* OS2MOUSE */
  5138. #endif /* OS2 */
  5139.  
  5140. /* Functions from system-dependent terminal i/o module */
  5141.  
  5142. _PROTOTYP( int ttopen, (char *, int *, int, int) );  /* tty functions */
  5143. #ifndef MAC
  5144. _PROTOTYP( int ttclos, (int) );
  5145. #endif /* MAC */
  5146. _PROTOTYP( int tthang, (void) );
  5147. _PROTOTYP( int ttres, (void) );
  5148. _PROTOTYP( int ttpkt, (long, int, int) );
  5149. #ifndef MAC
  5150. _PROTOTYP( int ttvt, (long, int) );
  5151. #endif /* MAC */
  5152. _PROTOTYP( int ttsspd, (int) );
  5153. _PROTOTYP( long ttgspd, (void) );
  5154. _PROTOTYP( int ttflui, (void) );
  5155. _PROTOTYP( int ttfluo, (void) );
  5156. _PROTOTYP( int ttpushback, (CHAR *, int) );
  5157. _PROTOTYP( int ttpeek, (void) );
  5158. _PROTOTYP( int ttgwsiz, (void) );
  5159. _PROTOTYP( int ttchk, (void) );
  5160. _PROTOTYP( int ttxin, (int, CHAR *) );
  5161. _PROTOTYP( int ttxout, (CHAR *, int) );
  5162. _PROTOTYP( int ttol, (CHAR *, int) );
  5163. _PROTOTYP( int ttoc, (char) );
  5164. _PROTOTYP( int ttinc, (int) );
  5165. _PROTOTYP( int ttscarr, (int) );
  5166. _PROTOTYP( int ttgmdm, (void) );
  5167. _PROTOTYP( int ttsndb, (void) );
  5168. _PROTOTYP( int ttsndlb, (void) );
  5169. #ifdef UNIX
  5170. _PROTOTYP( char * ttglckdir, (void) );
  5171. #endif /* UNIX */
  5172. #ifdef PARSENSE
  5173. #ifdef UNIX
  5174. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  5175. #else
  5176. #ifdef VMS
  5177. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  5178. #else
  5179. #ifdef STRATUS
  5180. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  5181. #else
  5182. #ifdef OS2
  5183. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  5184. #else
  5185. #ifdef OSK
  5186. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  5187. #else
  5188. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR) );
  5189. #endif /* OSK */
  5190. #endif /* OS2 */
  5191. #endif /* STRATUS */
  5192. #endif /* VMS */
  5193. #endif /* UNIX */
  5194. #else /* ! PARSENSE */
  5195. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR) );
  5196. #endif /* PARSENSE */
  5197.  
  5198. /* XYZMODEM support */
  5199.  
  5200. /*
  5201.   CK_XYZ enables the various commands and data structures.
  5202.   XYZ_INTERNAL means these protocols are built-in; if not defined,
  5203.   then they are external.  XYZ_DLL is used to indicate a separate
  5204.   loadable library containing the XYZmodem protocol code.
  5205. */
  5206. #ifdef pdp11                /* No room for this in PDP-11 */
  5207. #define NOCKXYZ
  5208. #endif /* pdp11 */
  5209.  
  5210. #ifndef NOCKXYZ                /* Alternative protocols */
  5211. #ifndef CK_XYZ
  5212. #ifdef UNIX
  5213. #define CK_XYZ
  5214. #else
  5215. #ifdef OS2
  5216. #define CK_XYZ
  5217. #ifndef NOXYZDLL
  5218. #define XYZ_INTERNAL            /* Internal and DLL */
  5219. #define XYZ_DLL
  5220. #endif /* NOXYZDLL */
  5221. #endif /* OS2 */
  5222. #endif /* UNIX */
  5223. #endif /* CK_XYZ */
  5224. #endif /* NOCKXYZ */
  5225.  
  5226. #ifdef XYZ_INTERNAL            /* This ensures that XYZ_INTERNAL */
  5227. #ifndef CK_XYZ                /* is defined only if CK_XYZ is too */
  5228. #undef XYZ_INTERNAL
  5229. #endif /* CK_XYZ */
  5230. #endif /* XYZ_INTERNAL */
  5231. #ifdef XYZ_DLL                /* This ensures XYZ_DLL is defined */
  5232. #ifndef XYZ_INTERNAL            /* only if XYZ_INTERNAL is too */
  5233. #undef XYZ_DLL
  5234. #endif /* XYZ_INTERNAL */
  5235. #endif /* XYZ_DLL */
  5236.  
  5237. /* Console functions */
  5238.  
  5239. _PROTOTYP( int congm, (void) );
  5240. #ifdef COMMENT
  5241. _PROTOTYP( VOID conint, (SIGTYP (*)(int, int), SIGTYP (*)(int, int)) );
  5242. #else
  5243. _PROTOTYP( VOID conint, (SIGTYP (*)(int), SIGTYP (*)(int)) );
  5244. #endif /* COMMENT */
  5245. _PROTOTYP( VOID connoi, (void) );
  5246. _PROTOTYP( int concb, (char) );
  5247. #ifdef CONGSPD
  5248. _PROTOTYP( long congspd, (void) );
  5249. #endif /* CONGSPD */
  5250. _PROTOTYP( int conbin, (char) );
  5251. _PROTOTYP( int conres, (void) );
  5252. _PROTOTYP( int conoc, (char) );
  5253. _PROTOTYP( int conxo, (int, char *) );
  5254. _PROTOTYP( int conol, (char *) );
  5255. _PROTOTYP( int conola, (char *[]) );
  5256. _PROTOTYP( int conoll, (char *) );
  5257. _PROTOTYP( int conchk, (void) );
  5258. _PROTOTYP( int coninc, (int) );
  5259. _PROTOTYP( char * conkbg, (void) );
  5260. _PROTOTYP( int psuspend, (int) );
  5261. _PROTOTYP( int priv_ini, (void) );
  5262. _PROTOTYP( int priv_on, (void) );
  5263. _PROTOTYP( int priv_off, (void) );
  5264. _PROTOTYP( int priv_can, (void) );
  5265. _PROTOTYP( int priv_chk, (void) );
  5266. _PROTOTYP( int priv_opn, (char *, int) );
  5267.  
  5268. _PROTOTYP( int sysinit, (void) );    /* Misc Kermit functions */
  5269. _PROTOTYP( int syscleanup, (void) );
  5270. _PROTOTYP( int msleep, (int) );
  5271. _PROTOTYP( VOID rtimer, (void) );
  5272. _PROTOTYP( int gtimer, (void) );
  5273. #ifdef GFTIMER
  5274. _PROTOTYP( VOID rftimer, (void) );
  5275. _PROTOTYP( CKFLOAT gftimer, (void) );
  5276. #endif /* GFTIMER */
  5277. _PROTOTYP( VOID ttimoff, (void) );
  5278. _PROTOTYP( VOID ztime, (char **) );
  5279. _PROTOTYP( int parchk, (CHAR *, CHAR, int) );
  5280. _PROTOTYP( VOID doexit, (int, int) );
  5281. _PROTOTYP( int askmore, (void) );
  5282. _PROTOTYP( VOID fatal, (char *) );
  5283. _PROTOTYP( VOID fatal2, (char *, char *) );
  5284. #ifdef VMS
  5285. _PROTOTYP( int ck_cancio, (void) );
  5286. #endif /* VMS */
  5287.  
  5288. /* Key mapping support */
  5289.  
  5290. #ifdef NOICP
  5291. #ifndef NOSETKEY
  5292. #define NOSETKEY
  5293. #endif /* NOSETKEY */
  5294. #endif /* NOICP */
  5295.  
  5296. #ifdef MAC
  5297. #ifndef NOSETKEY
  5298. #define NOSETKEY
  5299. #endif /* NOSETKEY */
  5300. #endif /* MAC */
  5301.  
  5302. _PROTOTYP( int congks, (int) );
  5303. #ifdef OS2
  5304. /* OS2 requires these definitions even if SET KEY is not being supported */
  5305. #define KMSIZE 8916
  5306. typedef ULONG KEY;
  5307. typedef CHAR *MACRO;
  5308. extern int wideresult;
  5309. #else /* Not OS2 */
  5310. #ifndef NOSETKEY
  5311. /*
  5312.   Catch-all for systems where we don't know how to read keyboard scan
  5313.   codes > 255.
  5314. */
  5315. #define KMSIZE 256
  5316. /* Note: CHAR (i.e. unsigned char) is very important here. */
  5317. typedef CHAR KEY;
  5318. typedef CHAR * MACRO;
  5319. #define congks coninc
  5320. #endif /* NOSETKEY */
  5321. #endif /* OS2 */
  5322.  
  5323. #ifndef OS2
  5324. #ifndef NOKVERBS            /* No \Kverbs unless... */
  5325. #define NOKVERBS
  5326. #endif /* NOKVERBS */
  5327. #endif /* OS2 */
  5328.  
  5329. #ifndef NOKVERBS
  5330. #ifdef OS2
  5331. /*
  5332.   Note: this value chosen to be bigger than PC BIOS key modifier bits,
  5333.   but still fit in 16 bits without affecting sign.
  5334.  
  5335.   As of K95 1.1.5, this no longer fits in 16 bits, good thing we are 32 bit.
  5336. */
  5337. #define F_MACRO 0x2000          /* Bit indicating a macro indice */
  5338. #define IS_MACRO(x) (x & F_MACRO)
  5339. #define F_KVERB 0x4000            /* Bit indicating a keyboard verb */
  5340. #define IS_KVERB(x) (x & F_KVERB)    /* Test this bit */
  5341. #endif /* OS2 */
  5342. #endif /* NOKVERBS */
  5343.  
  5344. #define F_ESC   0x8000        /* Bit indicating ESC char combination */
  5345. #define IS_ESC(x) (x & F_ESC)
  5346. #define F_CSI   0x10000        /* Bit indicating CSI char combination */
  5347. #define IS_CSI(x) (x & F_CSI)
  5348.  
  5349. #ifdef NOSPL                /* This might be overkill.. */
  5350. #ifndef NOKVERBS            /* Not all \Kverbs require */
  5351. #define NOKVERBS            /* the script programming language. */
  5352. #endif /* NOKVERBS */
  5353. #ifndef NOTAKEARGS
  5354. #define NOTAKEARGS
  5355. #endif /* NOTAKEARGS */
  5356. #endif /* NOSPL */
  5357.  
  5358. /*
  5359.   Function prototypes for system and library functions.
  5360. */
  5361. #ifdef _POSIX_SOURCE
  5362. #ifndef VMS
  5363. #ifndef MAC
  5364. #define CK_ANSILIBS
  5365. #endif /* MAC */
  5366. #endif /* VMS */
  5367. #endif /* _POSIX_SOURCE */
  5368.  
  5369. #ifdef NEXT
  5370. #define CK_ANSILIBS
  5371. #endif /* NEXT */
  5372.  
  5373. #ifdef SVR4
  5374. #define CK_ANSILIBS
  5375. #endif /* SVR4 */
  5376.  
  5377. #ifdef STRATUS                /* Stratus VOS uses ANSI libraries */
  5378. #define CK_ANSILIBS
  5379. #endif /* STRATUS */
  5380.  
  5381. #ifdef OS2
  5382. #define CK_ANSILIBS
  5383. #ifndef NOCURSES
  5384. #define MYCURSES
  5385. #endif /* NOCURSES */
  5386. #define CK_RTSCTS
  5387. #ifdef __IBMC__
  5388. #define S_IFMT 0xF000
  5389. #define timezone _timezone
  5390. #endif /* __IBMC__ */
  5391. #include <fcntl.h>
  5392. #include <io.h>
  5393. #ifdef __EMX__
  5394. #ifndef __32BIT__
  5395. #define __32BIT__
  5396. #endif /* __32BIT__ */
  5397. #include <sys/timeb.h>
  5398. #else /* __EMX__ */
  5399. #include <direct.h>
  5400. #undef SIGALRM
  5401. #ifndef SIGUSR1
  5402. #define SIGUSR1 7
  5403. #endif /* SIGUSR1 */
  5404. #define SIGALRM SIGUSR1
  5405. _PROTOTYP( unsigned alarm, (unsigned) );
  5406. _PROTOTYP( unsigned sleep, (unsigned) );
  5407. #endif /* __EMX__ */
  5408. _PROTOTYP( unsigned long zdskspace, (int) );
  5409. _PROTOTYP( int zchdsk, (int) );
  5410. _PROTOTYP( int conincraw, (int) );
  5411. _PROTOTYP( int ttiscom, (int f) );
  5412. _PROTOTYP( int IsFileNameValid, (char *) );
  5413. _PROTOTYP( void ChangeNameForFAT, (char *) );
  5414. _PROTOTYP( char *GetLoadPath, (void) );
  5415. #endif /* OS2 */
  5416.  
  5417. /* Fullscreen file transfer display items... */
  5418.  
  5419. #ifndef NOCURSES
  5420. #ifdef CK_NCURSES            /* CK_NCURSES implies CK_CURSES */
  5421. #ifndef CK_CURSES
  5422. #define CK_CURSES
  5423. #endif /* CK_CURSES */
  5424. #endif /* CK_NCURSES */
  5425.  
  5426. #ifdef MYCURSES                /* MYCURSES implies CK_CURSES */
  5427. #ifndef CK_CURSES
  5428. #define CK_CURSES
  5429. #endif /* CK_CURSES */
  5430. #endif /* MYCURSES */
  5431. #endif /* NOCURSES */
  5432.  
  5433. #ifdef NOCURSES
  5434. #ifdef CK_CURSES
  5435. #undef CK_CURSES
  5436. #endif /* CK_CURSES */
  5437. #ifndef NODISPLAY
  5438. #define NODISPLAY
  5439. #endif /* NODISPLAY */
  5440. #endif /* NOCURSES */
  5441.  
  5442. #ifdef CK_CURSES
  5443. /*
  5444.   The CK_WREFRESH symbol is defined if the curses library provides
  5445.   clearok() and wrefresh() functions, which are used in repainting
  5446.   the screen.
  5447. */
  5448. #ifdef NOWREFRESH            /* Override CK_WREFRESH */
  5449.  
  5450. #ifdef CK_WREFRESH            /* If this is defined, */
  5451. #undef CK_WREFRESH            /* undefine it. */
  5452. #endif /* CK_WREFRESH */
  5453.  
  5454. #else /* !NOWREFRESH */            /* No override... */
  5455.  
  5456. #ifndef CK_WREFRESH            /* If CK_WREFRESH not defined */
  5457. /*
  5458.   Automatically define it for systems known to have it ...
  5459. */
  5460. #ifdef VMS                /* DEC (Open)VMS has it */
  5461. #define CK_WREFRESH
  5462. #else
  5463. #ifdef ultrix                /* DEC ULTRIX has it */
  5464. #else
  5465. #ifdef SVR3                /* System V has it */
  5466. #define CK_WREFRESH
  5467. #else
  5468. #ifdef BSD44                /* 4.4 BSD has it */
  5469. #define CK_WREFRESH
  5470. #else
  5471. #ifdef NEXT                /* Define it for NeXTSTEP */
  5472. #define CK_WREFRESH
  5473. #else
  5474. #ifdef SUNOS4                /* SunOS 4.x... */
  5475. #define CK_WREFRESH
  5476. #else
  5477. #ifdef SOLARIS25            /* Solaris 2.5 and later */
  5478. #define CK_WREFRESH
  5479. #else
  5480. #ifdef AIXRS                /* RS/6000 AIX ... */
  5481. #define CK_WREFRESH
  5482. #else
  5483. #ifdef RTAIX                /* RT PC AIX ... */
  5484. #define CK_WREFRESH
  5485. #else
  5486. #ifdef OSF                /* DEC OSF/1 ... */
  5487. #define CK_WREFRESH
  5488.  
  5489. /* Add more here, or just define CK_WREFRESH on the CC command line... */
  5490.  
  5491. #endif /* OSF */
  5492. #endif /* RTAIX */
  5493. #endif /* AIXRS */
  5494. #endif /* SOLARIS25 */
  5495. #endif /* SUNOS4 */
  5496. #endif /* NEXT */
  5497. #endif /* BSD44 */
  5498. #endif /* SVR3 */
  5499. #endif /* ultrix */
  5500. #endif /* VMS */
  5501.  
  5502. #else /* CK_WREFRESH is defined */
  5503.  
  5504. /* This is within an ifdef CK_CURSES block.  The following is not needed */
  5505.  
  5506. #ifndef CK_CURSES            /* CK_WREFRESH implies CK_CURSES */
  5507. #define CK_CURSES
  5508. #endif /* CK_CURSES */
  5509.  
  5510. #endif /* CK_WREFRESH */
  5511. #endif /* NOWREFRESH */
  5512.  
  5513. #ifndef TRMBUFL
  5514. #ifdef BIGBUFOK
  5515. #define TRMBUFL 16384
  5516. #else
  5517. #ifdef DYNAMIC
  5518. #define TRMBUFL 8192
  5519. #else
  5520. #define TRMBUFL 1024
  5521. #endif /* BIGBUFOK */
  5522. #endif /* DYNAMIC */
  5523. #endif /* TRMBUFL */
  5524. #endif /* CK_CURSES */
  5525.  
  5526. /*
  5527.   Whether to use ckmatch() in all its glory for C-Shell-like patterns.
  5528.   If CKREGEX is NOT defined, all but * and ? matching are removed from
  5529.   ckmatch().  NOTE: Defining CKREGEX does not necessarily mean that ckmatch()
  5530.   regexes are used for filename matching.  That depends on whether zxpand()
  5531.   in ck?fio.c calls ckmatch().  NOTE 2: REGEX is a misnomer -- these are not
  5532.   regular expressions in the computer-science sense (in which, e.g. "a*b"
  5533.   matches 0 or more 'a' characters followed by 'b') but patterns (in which
  5534.   "a*b" matches 'a' followed by 0 or more non-b characters, followed by b).
  5535. */
  5536. #ifndef NOCKREGEX
  5537. #ifndef CKREGEX
  5538. #define CKREGEX
  5539. #endif /* CKREGEX */
  5540. #endif /* NOCKREGEX */
  5541.  
  5542. /* Learned-script feature */
  5543.  
  5544. #ifndef NOLEARN
  5545. #ifdef NOSPL
  5546. #define NOLEARN
  5547. #else
  5548. #ifdef NOLOCAL
  5549. #define NOLEARN
  5550. #endif /* NOLOCAL */
  5551. #endif /* NOSPL */
  5552. #endif /* NOLEARN */
  5553.  
  5554. #ifdef NOLEARN
  5555. #ifdef CKLEARN
  5556. #undef CKLEARN
  5557. #endif /* CKLEARN */
  5558. #else  /* !NOLEARN */
  5559. #ifndef CKLEARN
  5560. #ifdef OS2ORUNIX
  5561. /* In UNIX this can work only with ckucns.c builds */
  5562. #define CKLEARN
  5563. #else
  5564. #ifdef VMS
  5565. #define CKLEARN
  5566. #endif /* VMS */
  5567. #endif /* OS2ORUNIX */
  5568. #endif /* CKLEARN */
  5569. #endif /* NOLEARN */
  5570.  
  5571. #ifdef CKLEARN
  5572. #ifndef LEARNBUFSIZ
  5573. #define LEARNBUFSIZ 128
  5574. #endif /* LEARNBUFSIZ */
  5575. #endif /* CKLEARN */
  5576.  
  5577. #ifndef IKSDONLY
  5578. #ifndef CKTIDLE                /* Pseudo-keepalive in CONNECT */
  5579. #ifdef OS2                /* In K95 */
  5580. #define CKTIDLE
  5581. #else
  5582. #ifdef UNIX                /* In UNIX but only ckucns versions */
  5583. #ifndef NOLEARN
  5584. #ifndef NOSELECT
  5585. #define CKTIDLE
  5586. #endif /* NOSELECT */
  5587. #endif /* NOLEARN */
  5588. #endif /* UNIX */
  5589. #endif /* OS2 */
  5590. #endif /* CKTIDLE */
  5591. #endif /* IKSDONLY */
  5592.  
  5593. #ifdef CK_ANSILIBS
  5594. /*
  5595.   String library functions.
  5596.   For ANSI C, get prototypes from <string.h>.
  5597.   Otherwise, skip the prototypes.
  5598. */
  5599. #include <string.h>
  5600.  
  5601. /*
  5602.   Prototypes for other commonly used library functions, such as
  5603.   malloc, free, getenv, atol, atoi, and exit.  Otherwise, no prototypes.
  5604. */
  5605. #include <stdlib.h>
  5606. #ifdef DIAB /* DIAB DS90 */
  5607. /* #include <commonC.h>  */
  5608. #include <sys/wait.h>
  5609. #define CK_WAIT_H
  5610. #ifdef COMMENT
  5611. extern void exit(int status);
  5612. extern void _exit(int status);
  5613. extern int uname(struct utsname *name);
  5614. #endif /* COMMENT */
  5615. extern int chmod(char *path, int mode);
  5616. extern int ioctl(int fildes, int request, ...);
  5617. extern int rdchk(int ttyfd);
  5618. extern int nap(int m);
  5619. #ifdef COMMENT
  5620. extern int getppid(void);
  5621. #endif /* COMMENT */
  5622. extern int _filbuf(FILE *stream);
  5623. extern int _flsbuf(char c,FILE *stream);
  5624. #endif /* DIAB */
  5625.  
  5626. /*
  5627.   Prototypes for UNIX functions like access, alarm, chdir, sleep, fork,
  5628.   and pause.  Otherwise, no prototypes.
  5629. */
  5630. #ifdef VMS
  5631. #include <unixio.h>
  5632. #endif /* VMS */
  5633.  
  5634. #ifdef NEXT
  5635. #ifndef NEXT33
  5636. #include <libc.h>
  5637. #endif /* NEXT33 */
  5638. #else  /* NoT NeXT */
  5639. #ifndef AMIGA
  5640. #ifndef OS2
  5641. #ifdef STRATUS
  5642. #include <c_utilities.h>
  5643. #else /* !STRATUS */
  5644. #ifndef OSKXXC
  5645. #include <unistd.h>
  5646. #endif /* OSKXXC */
  5647. #ifdef HAVE_CRYPT_H
  5648. #include <crypt.h>
  5649. #endif /* HAVE_CRYPT_H */
  5650. #endif /* STRATUS */
  5651. #endif /* OS2 */
  5652. #endif /* AMIGA */
  5653. #endif /* NEXT */
  5654.  
  5655. #else /* Not ANSI libs... */
  5656.  
  5657. #ifdef MAC
  5658. #include <String.h>
  5659. #include <StdLib.h>
  5660. #endif /* MAC */
  5661.  
  5662. #ifdef HPUX
  5663. #ifndef HPUXPRE65
  5664. #include <unistd.h>
  5665. #endif /* HPUXPRE65 */
  5666. #endif /* HPUX */
  5667.  
  5668. #ifdef SUNOS41
  5669. #include <unistd.h>
  5670. #include <stdlib.h>
  5671. #else
  5672. #ifndef MAC
  5673. /*
  5674.   It is essential that these are declared correctly!
  5675.   Which is not always easy.  Take malloc() for instance ...
  5676. */
  5677. #ifdef PYRAMID
  5678. #ifdef SVR4
  5679. #ifdef __STDC__
  5680. #define SIZE_T_MALLOC
  5681. #endif /* __STDC__ */
  5682. #endif /* SVR4 */
  5683. #endif /* PYRAMID */
  5684. /*
  5685.   Maybe some other environments need the same treatment for malloc.
  5686.   If so, define SIZE_T_MALLOC for them here or in compiler CFLAGS.
  5687. */
  5688. #ifdef SIZE_T_MALLOC
  5689. _PROTOTYP( void * malloc, (size_t) );
  5690. #else
  5691. _PROTOTYP( char * malloc, (unsigned int) );
  5692. #endif /* SIZE_T_MALLOC */
  5693.  
  5694. _PROTOTYP( char * getenv, (char *) );
  5695. _PROTOTYP( long atol, (char *) );
  5696. #endif /* !MAC */
  5697. #endif /* SUNOS41 */
  5698. #endif /* CK_ANSILIBS */
  5699.  
  5700. /*
  5701.   <sys/param.h> generally picks up NULL, MAXPATHLEN, and MAXNAMLEN
  5702.   and seems to present on all Unixes going back at least to SCO Xenix
  5703.   with the exception(s) noted.
  5704. */
  5705. #ifndef NO_PARAM_H            /* 2001-11-03 */
  5706. #ifndef UNIX                /* Non-Unixes don't have it */
  5707. #define NO_PARAM_H
  5708. #else
  5709. #ifdef TRS16                /* Tandy Xenix doesn't have it */
  5710. #define NO_PARAM_H
  5711. #endif /* TRS16 */
  5712. #endif /* UNIX */
  5713. #endif /* NO_PARAM_H */
  5714.  
  5715. #ifndef NO_PARAM_H
  5716. #ifndef INCL_PARAM_H
  5717. #define INCL_PARAM_H
  5718. #endif /* INCL_PARAM_H */
  5719. #include <sys/param.h>
  5720. #endif /* NO_PARAM_H */
  5721.  
  5722. #ifndef NULL                /* In case NULL is still not defined */
  5723. #define NULL 0L
  5724. /* or #define NULL 0 */
  5725. /* or #define NULL ((char *) 0) */
  5726. /* or #define NULL ((void *) 0) */
  5727. #endif /* NULL */
  5728.  
  5729. /* Maximum length for a fully qualified filename, not counting \0 at end. */
  5730. /*
  5731.   This is a rough cut, and errs on the side of being too big.  We don't
  5732.   want to pull in hundreds of header files looking for many and varied
  5733.   symbols, for fear of introducing unnecessary conflicts.
  5734. */
  5735. #ifndef CKMAXPATH
  5736. #ifdef MAXPATHLEN            /* (it probably isn't) */
  5737. #define CKMAXPATH MAXPATHLEN
  5738. #else
  5739. #ifdef PATH_MAX                /* POSIX */
  5740. #define CKMAXPATH PATH_MAX
  5741. #else
  5742. #ifdef MAC
  5743. #define CKMAXPATH 63
  5744. #else
  5745. #ifdef pdp11
  5746. #define CKMAXPATH 255
  5747. #else
  5748. #ifdef UNIX                /* Even though some are way less... */
  5749. #define CKMAXPATH 1024
  5750. #else
  5751. #ifdef VMS
  5752. #define CKMAXPATH 675            /* (derivation is complicated...) */
  5753. #else
  5754. #ifdef STRATUS
  5755. #define CKMAXPATH 256            /* == $MXPL from PARU.H */
  5756. #else
  5757. #ifdef datageneral
  5758. #define CKMAXPATH 256            /* == $MXPL from PARU.H */
  5759. #else
  5760. #define CKMAXPATH 255
  5761. #endif /* STRATUS */
  5762. #endif /* datageneral */
  5763. #endif /* VMS */
  5764. #endif /* UNIX */
  5765. #endif /* pdp11 */
  5766. #endif /* MAC */
  5767. #endif /* PATH_MAX */
  5768. #endif /* MAXPATHLEN */
  5769. #endif /* CKMAXPATH */
  5770.  
  5771. /* Maximum length for the name of a tty device */
  5772.  
  5773. #ifndef DEVNAMLEN
  5774. #define DEVNAMLEN CKMAXPATH
  5775. #endif /* DEVNAMLEN */
  5776.  
  5777. /* Directory (path segment) separator */
  5778. /* Not fully general - Tricky for VMS, Amiga, ... */
  5779.  
  5780. #ifndef DIRSEP
  5781. #ifdef UNIX
  5782. #define DIRSEP '/'
  5783. #define ISDIRSEP(c) ((c)=='/')
  5784. #else
  5785. #ifdef OS2
  5786. #define DIRSEP '/'
  5787. #define ISDIRSEP(c) ((c)=='/'||(c)=='\\')
  5788. #else
  5789. #ifdef datageneral
  5790. #define DIRSEP ':'
  5791. #define ISDIRSEP(c) (((c)==':')||((c)=='^')||((c)=='='))
  5792. #else
  5793. #ifdef STRATUS
  5794. #define DIRSEP '>'
  5795. #define ISDIRSEP(c) ((c)=='>')
  5796. #else
  5797. #ifdef VMS
  5798. #define DIRSEP ']'            /* (not really) */
  5799. #define ISDIRSEP(c) ((c)==']'||(c)==':')
  5800. #else
  5801. #ifdef MAC
  5802. #define DIRSEP ':'
  5803. #define ISDIRSEP(c) ((c)==':')
  5804. #else
  5805. #ifdef AMIGA
  5806. #define DIRSEP '/'
  5807. #define ISDIRSEP(c) ((c)=='/'||(c)==':')
  5808. #else
  5809. #ifdef GEMDOS
  5810. #define DIRSEP '\\'
  5811. #define ISDIRSEP(c) ((c)=='\\'||(c)==':')
  5812. #else
  5813. #define DIRSEP '/'
  5814. #define ISDIRSEP(c) ((c)=='/')
  5815. #endif /* GEMDOS */
  5816. #endif /* AMIGA */
  5817. #endif /* MAC */
  5818. #endif /* VMS */
  5819. #endif /* STRATUS */
  5820. #endif /* datageneral */
  5821. #endif /* OS2 */
  5822. #endif /* UNIX */
  5823. #endif /* DIRSEP */
  5824.  
  5825. /* FILE package parameters */
  5826.  
  5827. #ifdef pdp11
  5828. #define NOCHANNELIO
  5829. #else
  5830.  
  5831. #ifndef CKMAXOPEN
  5832. #ifdef QNX
  5833. #define CKMAXOPEN 390
  5834. #else
  5835. #ifdef VMS
  5836. #define CKMAXOPEN 64
  5837. #else
  5838. #ifdef OPEN_MAX
  5839. #define CKMAXOPEN OPEN_MAX
  5840. #else
  5841. #ifdef FOPEN_MAX
  5842. #define CKMAXOPEN FOPEN_MAX
  5843. #else
  5844. #define CKMAXOPEN 64
  5845. #endif /* FOPEN_MAX */
  5846. #endif /* OPEN_MAX */
  5847. #endif /* VMS */
  5848. #endif /* QNX */
  5849. #endif /* CKMAXOPEN */
  5850.  
  5851. /* Maximum channels for FOPEN = CKMAXOPEN minus logs, stdio, etc */
  5852.  
  5853. #ifndef Z_MINCHAN
  5854. #define Z_MINCHAN 16
  5855. #endif /* Z_MINCHAN */
  5856.  
  5857. #ifndef Z_MAXCHAN
  5858. #define Z_MAXCHAN (CKMAXOPEN-ZNFILS-5)
  5859. #endif /* Z_MAXCHAN */
  5860. #endif /* pdp11 */
  5861.  
  5862. /* New-format nzltor() and nzrtol() functions that handle pathnames */
  5863.  
  5864. #ifndef NZLTOR
  5865. #ifdef UNIX
  5866. #define NZLTOR
  5867. #else
  5868. #ifdef VMS
  5869. #define NZLTOR
  5870. #else
  5871. #ifdef OS2
  5872. #define NZLTOR
  5873. #else
  5874. #ifdef STRATUS
  5875. #define NZLTOR
  5876. #endif /* STRATUS */
  5877. #endif /* OS2 */
  5878. #endif /* VMS */
  5879. #endif /* UNIX */
  5880. #endif /* NZLTOR */
  5881.  
  5882. #ifdef NZLTOR
  5883. _PROTOTYP( VOID nzltor, (char *, char *, int, int, int) );
  5884. _PROTOTYP( VOID nzrtol, (char *, char *, int, int, int) );
  5885. #endif /* NZLTOR */
  5886.  
  5887. /* Implementations with a zrmdir() function */
  5888.  
  5889. #ifndef ZRMDIR
  5890. #ifdef OS2
  5891. #define ZRMDIR
  5892. #else /* OS2 */
  5893. #ifdef UNIX
  5894. #define ZRMDIR
  5895. #else
  5896. #ifdef VMS
  5897. #define ZRMDIR
  5898. #else /* VMS */
  5899. #ifdef STRATUS
  5900. #define ZRMDIR
  5901. #endif /* STRATUS */
  5902. #endif /* VMS */
  5903. #endif /* UNIX */
  5904. #endif /* OS2 */
  5905. #endif /* ZRMDIR */
  5906.  
  5907. #ifdef ZRMDIR
  5908. _PROTOTYP( int zrmdir, (char *) );
  5909. #endif /* ZRMDIR */
  5910.  
  5911. #ifndef FILECASE
  5912. #ifdef UNIXOROSK
  5913. #define FILECASE 1
  5914. #else
  5915. #define FILECASE 0
  5916. #endif /* UNIXOROSK */
  5917. #ifndef CKCMAI
  5918. extern int filecase;
  5919. #endif /* CKCMAI */
  5920. #endif /* FILECASE */
  5921.  
  5922. /* Funny names for library functions department... */
  5923.  
  5924. #ifdef ZILOG
  5925. #define setjmp setret
  5926. #define longjmp longret
  5927. #define jmp_buf ret_buf
  5928. #define getcwd curdir
  5929. #endif /* ZILOG */
  5930.  
  5931. #ifdef STRATUS
  5932. /* The C-runtime conflicts with things we do in Stratus VOS ckltio.c ... */
  5933. #define printf vosprtf
  5934. _PROTOTYP( int vosprtf, (char *fmt, ...) );
  5935. #define perror(txt) printf("%s\n", txt)
  5936. /* char_varying is a string type from PL/I that VOS uses extensively */
  5937. #define CV char_varying
  5938. #endif /* STRATUS */
  5939.  
  5940. #ifdef NT
  5941. extern int OSVer;
  5942. #define isWin95() (OSVer==VER_PLATFORM_WIN32_WINDOWS)
  5943. #else
  5944. #define isWin95() (0)
  5945. #endif /* NT */
  5946.  
  5947. #ifndef BPRINT
  5948. #ifdef OS2
  5949. #define BPRINT
  5950. #endif /* OS2 */
  5951. #endif /* BPRINT */
  5952.  
  5953. #ifndef SESLIMIT
  5954. #ifdef OS2
  5955. #define SESLIMIT
  5956. #endif /* OS2 */
  5957. #endif /* SESLIMIT */
  5958.  
  5959. #ifndef NOTERM
  5960. #ifndef PCTERM
  5961. #ifdef NT
  5962. #define PCTERM
  5963. #endif /* NT */
  5964. #endif /* PCTERM */
  5965. #endif /* NOTERM */
  5966.  
  5967. #ifdef BEOSORBEBOX
  5968. #define query ckquery
  5969. #endif /* BEOSORBEBOX */
  5970.  
  5971. #ifndef PTYORPIPE            /* NETCMD and/or NETPTY defined */
  5972. #ifdef NETCMD
  5973. #define PTYORPIPE
  5974. #else
  5975. #ifdef NETPTY
  5976. #define PTYORPIPE
  5977. #endif /* NETPTY */
  5978. #endif /* NETCMD */
  5979. #endif /* PTYORPIPE */
  5980.  
  5981. /* mktemp() and mkstemp() */
  5982.  
  5983. #ifndef NOMKTEMP
  5984. #ifndef MKTEMP
  5985. #ifdef OS2ORUNIX
  5986. #define MKTEMP
  5987. #endif /* OS2ORUNIX */
  5988. #endif /* MKTEMP */
  5989.  
  5990. #ifdef MKTEMP
  5991. #ifndef NOMKSTEMP
  5992. #ifndef MKSTEMP
  5993. #ifdef BSD44
  5994. #define MKSTEMP
  5995. #else
  5996. #ifdef __linux__
  5997. #define MKSTEMP
  5998. #endif /* __linux__ */
  5999. #endif /* BSD44 */
  6000. #endif /* MKSTEMP */
  6001. #endif /* NOMKSTEMP */
  6002. #endif /* MKTEMP */
  6003. #endif /* NOMKTEMP */
  6004.  
  6005. /* Platforms that have memcpy() -- only after all headers included */
  6006.  
  6007. #ifndef USE_MEMCPY
  6008. #ifdef VMS
  6009. #define USE_MEMCPY
  6010. #else
  6011. #ifdef NEXT
  6012. #define USE_MEMCPY
  6013. #else
  6014. #ifdef OS2
  6015. #define USE_MEMCPY
  6016. #else
  6017. #ifdef __linux__
  6018. #define USE_MEMCPY
  6019. #else
  6020. #ifdef SOLARIS
  6021. #define USE_MEMCPY
  6022. #else
  6023. #ifdef SUNOS4
  6024. #define USE_MEMCPY
  6025. #else
  6026. #ifdef AIXRS
  6027. #define USE_MEMCPY
  6028. #else
  6029. #ifdef HPUX
  6030. #define USE_MEMCPY
  6031. #else
  6032. #ifdef POSIX
  6033. #define USE_MEMCPY
  6034. #else
  6035. #ifdef SVR4
  6036. #define USE_MEMCPY
  6037. #else
  6038. #ifdef OSF
  6039. #define USE_MEMCPY
  6040. #else
  6041. #ifdef datageneral
  6042. #define USE_MEMCPY
  6043. #else
  6044. #ifdef STRATUS
  6045. #define USE_MEMCPY
  6046. #endif /* STRATUS */
  6047. #endif /* datageneral */
  6048. #endif /* OSF */
  6049. #endif /* SVR4 */
  6050. #endif /* POSIX */
  6051. #endif /* HPUX */
  6052. #endif /* AIXRS */
  6053. #endif /* SUNOS4 */
  6054. #endif /* SOLARIS */
  6055. #endif /* __linux__ */
  6056. #endif /* OS2 */
  6057. #endif /* NEXT */
  6058. #endif /* VMS */
  6059. #endif /* USE_MEMCPY */
  6060.  
  6061. #ifndef USE_MEMCPY
  6062. #define memcpy(a,b,c) ckmemcpy((a),(b),(c))
  6063. #else
  6064. #ifdef CK_SCO32V4
  6065. /* Because the prototype isn't picked up in the normal header files */
  6066. _PROTOTYP( void *memcpy, (void *, const void *, size_t));
  6067. #endif /* CK_SCO32V4 */
  6068. #endif /* USE_MEMCPY */
  6069.  
  6070. /* User authentication for IKS -- So far K95 and UNIX only */
  6071.  
  6072. #ifdef NOICP
  6073. #ifndef NOLOGIN
  6074. #define NOLOGIN
  6075. #endif /* NOLOGIN */
  6076. #endif /* NOICP */
  6077.  
  6078. #ifndef NOLOGIN
  6079. #ifdef OS2ORUNIX
  6080. #ifndef CK_LOGIN
  6081. #define CK_LOGIN
  6082. #ifndef NOSHADOW
  6083. #ifdef CK_SCOV5
  6084. #define CK_SHADOW
  6085. #endif /* CK_SCOV5 */
  6086. #endif /* NOSHADOW */
  6087. #endif /* CK_LOGIN */
  6088. #ifdef NT
  6089. #define NTCREATETOKEN
  6090. #endif /* NT */
  6091. #endif /* OS2ORUNIX */
  6092. #else /* NOLOGIN */
  6093. #ifdef CK_LOGIN
  6094. #undef CK_LOGIN
  6095. #endif /* CK_LOGIN */
  6096. #endif /* NOLOGIN */
  6097.  
  6098. #ifdef OS2
  6099. #define CKSPINNER
  6100. #endif /* OS2 */
  6101.  
  6102. #ifdef CK_LOGIN                /* Telnet protocol required */
  6103. #ifndef TNCODE                /* for login to IKSD. */
  6104. #define TNCODE
  6105. #endif /* TNCODE */
  6106. #endif /* CK_LOGIN */
  6107.  
  6108. #ifdef CK_AUTHENTICATION
  6109. #ifdef NOSENDUID
  6110. #undef NOSENDUID
  6111. #endif /* NOSENDUID */
  6112. #endif /* CK_AUTHENTICATION */
  6113.  
  6114. #ifdef TNCODE                /* Should TELNET send user ID? */
  6115. #ifndef NOSENDUID
  6116. #ifndef CKSENDUID
  6117. #define CKSENDUID
  6118. #endif /* CKSENDUID */
  6119. #endif /* NOSENDUID */
  6120. #endif /* TNCODE */
  6121.  
  6122. /* UNIX platforms that don't have getusershell() */
  6123.  
  6124. #ifdef UNIX
  6125. #ifndef NOGETUSERSHELL
  6126. #ifdef IRIX
  6127. #define NOGETUSERSHELL
  6128. #else
  6129. #ifdef PTX
  6130. #define NOGETUSERSHELL
  6131. #else
  6132. #ifdef AIXRS
  6133. #define NOGETUSERSHELL
  6134. #else
  6135. #ifdef SINIX
  6136. #define NOGETUSERSHELL
  6137. #else
  6138. #ifdef UNIXWARE
  6139. #define NOGETUSERSHELL
  6140. #else
  6141. #ifdef COHERENT
  6142. #define NOGETUSERSHELL
  6143. #endif /* COHERENT */
  6144. #endif /* UNIXWARE */
  6145. #endif /* SINIX */
  6146. #endif /* AIXRS */
  6147. #endif /* PTX */
  6148. #endif /* IRIX */
  6149. #endif /* NOGETUSERSHELL */
  6150. #endif /* UNIX */
  6151.  
  6152. #ifdef CK_LOGIN
  6153. #ifdef NT
  6154. #ifndef NOSYSLOG
  6155. #ifndef CKSYSLOG
  6156. #define CKSYSLOG
  6157. #endif /* CKSYSLOG */
  6158. #endif /* NOSYSLOG */
  6159. #endif /* NT */
  6160. #ifdef UNIX
  6161. #ifndef NOSYSLOG
  6162. #ifndef CKSYSLOG
  6163. #define CKSYSLOG
  6164. #endif /* CKSYSLOG */
  6165. #endif /* NOSYSLOG */
  6166. #ifndef NOWTMP
  6167. #ifndef CKWTMP
  6168. #define CKWTMP
  6169. #endif /* CKWTMP */
  6170. #endif /* NOWTMP */
  6171. #ifndef NOGETUSERSHELL
  6172. #ifndef GETUSERSHELL
  6173. #define GETUSERSHELL
  6174. #endif /* GETUSERSHELL */
  6175. #endif /* NOGETUSERSHELL */
  6176. #endif /* UNIX */
  6177. _PROTOTYP( int ckxlogin, (CHAR *, CHAR *, CHAR *, int));
  6178. _PROTOTYP( int ckxlogout, (VOID));
  6179. #endif /* CK_LOGIN */
  6180.  
  6181. #ifndef NOZLOCALTIME            /* zlocaltime() available. */
  6182. #ifdef OS2ORUNIX
  6183. #define ZLOCALTIME
  6184. _PROTOTYP( char * zlocaltime, (char *) );
  6185. #endif /* OS2ORUNIX */
  6186. #endif /* NOZLOCALTIME */
  6187.  
  6188. #ifdef CKSYSLOG                /* Syslogging levels */
  6189. #define SYSLG_NO 0            /* No logging */
  6190. #define SYSLG_LI 1            /* Login/out */
  6191. #define SYSLG_DI 2            /* Dialing out */
  6192. #define SYSLG_AC 3            /* Making any kind of connection */
  6193. #define SYSLG_PR 4                      /* Protocol Operations */
  6194. #define SYSLG_FC 5            /* File creation */
  6195. #define SYSLG_FA 6            /* File reading */
  6196. #define SYSLG_CM 7            /* Top-level commands */
  6197. #define SYSLG_CX 8            /* All commands */
  6198. #define SYSLG_DB 9            /* Debug */
  6199. #define SYSLGMAX 9            /* Highest level */
  6200. #define SYSLG_DF SYSLG_FA        /* Default level */
  6201. /* Logging function */
  6202. _PROTOTYP(VOID cksyslog,(int, int, char *, char *, char *));
  6203. #endif /* CKSYSLOG */
  6204. #ifndef CKCMAI
  6205. extern int ckxlogging, ckxsyslog, ikdbopen;
  6206. #endif /* CKCMAI */
  6207.  
  6208. #ifndef CK_KEYTAB
  6209. #define CK_KEYTAB
  6210. /* Keyword Table Template */
  6211.  
  6212. /* Note: formerly defined in ckucmd.h but now more widely used */
  6213.  
  6214. struct keytab {                /* Keyword table */
  6215.     char *kwd;                /* Pointer to keyword string */
  6216.     int kwval;                /* Associated value */
  6217.     int flgs;                /* Flags (as defined above) */
  6218. };
  6219. #endif /* CK_KEYTAB */
  6220.  
  6221. #ifdef NETPTY
  6222. _PROTOTYP( int do_pty, (char *));
  6223. _PROTOTYP( VOID end_pty, (void));
  6224. #endif /* NETPTY */
  6225.  
  6226. #ifdef CKROOT
  6227. _PROTOTYP( int zsetroot, (char *) );
  6228. _PROTOTYP( char * zgetroot, (void) );
  6229. _PROTOTYP( int zinroot, (char *) );
  6230. #endif /* CKROOT */
  6231.  
  6232. /* Local Echo Buffer prototypes */
  6233. _PROTOTYP( VOID le_init, (void) );
  6234. _PROTOTYP( VOID le_clean, (void));
  6235. _PROTOTYP( int le_inbuf, (void));
  6236. _PROTOTYP( int le_putstr, (CHAR *));
  6237. _PROTOTYP( int le_puts, (CHAR *, int));
  6238. _PROTOTYP( int le_putchar, (CHAR));
  6239. _PROTOTYP( int le_getchar, (CHAR *));
  6240.  
  6241. /* #ifndef NOHTTP */
  6242. #ifndef NOCMDATE2TM
  6243. #ifndef CMDATE2TM
  6244. #ifdef OS2ORUNIX
  6245. #define CMDATE2TM
  6246. #endif /* OS2ORUNIX */
  6247. #endif /* CMDATE2TM */
  6248. #endif /* NOCMDATE2TM */
  6249.  
  6250. #ifdef CMDATE2TM
  6251. _PROTOTYP( struct tm * cmdate2tm, (char *,int));
  6252. #endif /* CMDATE2TM */
  6253. /* #endif */ /* NOHTTP */
  6254.  
  6255. #ifndef NOSETTIME            /* This would be set in CFLAGS */
  6256. #ifdef SVR4ORPOSIX            /* Defined in IEEE 1003.1-1996 */
  6257. #ifndef UTIMEH                /* and in SVID for SVR4 */
  6258. #define UTIMEH
  6259. #endif /* UTIMEH */
  6260. #else  /* SVR4ORPOSIX */
  6261. #ifdef OSF                /* Verified by Lucas Hart */
  6262. #ifndef UTIMEH
  6263. #define UTIMEH
  6264. #endif /* UTIMEH */
  6265. #else  /* OSF */
  6266. #ifdef SUNOS41                /* Verified by Lucas Hart */
  6267. #ifndef UTIMEH
  6268. #define UTIMEH
  6269. #endif /* UTIMEH */
  6270. #else  /* SUNOS41 */
  6271. #ifdef OS2
  6272. #ifndef SYSUTIMEH
  6273. #define SYSUTIMEH
  6274. #endif /* SYSUTIMEH */
  6275. #endif /* OS2 */
  6276. #endif /* SUNOS41 */
  6277. #endif /* OSF */
  6278. #endif /* SVR4ORPOSIX */
  6279. #endif /* NOSETTIME */
  6280.  
  6281. #ifdef NEWFTP
  6282. _PROTOTYP( int ftpisconnected, (void));
  6283. _PROTOTYP( int ftpisloggedin, (void));
  6284. _PROTOTYP( int ftpissecure, (void));
  6285. #endif /* NEWFTP */
  6286.  
  6287. _PROTOTYP( int readpass, (char *, char *, int));
  6288. _PROTOTYP( int readtext, (char *, char *, int));
  6289.  
  6290. #ifdef OS2
  6291. _PROTOTYP(int ck_auth_loaddll, (VOID));
  6292. _PROTOTYP(int ck_auth_unloaddll, (VOID));
  6293. #endif /* OS2 */
  6294.  
  6295. #ifdef NT
  6296. _PROTOTYP(DWORD ckGetLongPathname,(LPCSTR lpFileName, 
  6297.                                    LPSTR lpBuffer, DWORD cchBuffer));
  6298. #endif /* NT */
  6299.  
  6300. #include "ckclib.h"
  6301.  
  6302. #ifdef NT
  6303. #ifdef __STDC__
  6304. #define stricmp _stricmp
  6305. #define putenv _putenv
  6306. #define sopen _sopen
  6307. #define strupr _strupr
  6308. #define close _close
  6309. #define stat _stat
  6310. #define fileno _fileno
  6311. #define sys_errlist _sys_errlist
  6312. #define unlink _unlink
  6313. #define write _write
  6314. #define creat _creat
  6315. #define getpid _getpid
  6316. #define isascii __isascii
  6317. #define utime _utime
  6318. #define mktemp _mktemp
  6319. #define strnicmp _strnicmp
  6320. #define read _read
  6321. #define open _open
  6322. #define access _access
  6323. #define wcsdup _wcsdup
  6324. #define chmod _chmod
  6325. #define fstat _fstat
  6326. #define ftime _ftime
  6327. #endif /* __STDC__ */
  6328. #endif /* NT */
  6329. #endif /* CKCDEB_H */
  6330.  
  6331. /* End of ckcdeb.h */
  6332.