home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / cku200.zip / ckcdeb.h < prev    next >
C/C++ Source or Header  |  2001-12-08  |  139KB  |  6,232 lines

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