home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / cku201.zip / ckcdeb.h < prev    next >
C/C++ Source or Header  |  2002-02-12  |  141KB  |  6,294 lines

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