4 Tue Apr 6 14:00:16 2004
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.
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.
26 Author: Frank da Cruz <fdc@columbia.edu>,
27 Columbia University Academic Information Systems, New York City.
29 Copyright (C) 1985, 2004,
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.
36 Etymology: The name of this file means "C-Kermit Common-C-Language Debugging
37 Header", because originally it contained only the formats (F000-F111) for
38 the debug() and tlog() functions. Since then it has grown to inlcude all
39 material required by all other C-Kermit modules, including the non-Kermit
43 #ifndef CKCDEB_H /* Don't include me more than once. */
49 /* Unsigned numbers */
52 #define USHORT unsigned short
56 #define UINT unsigned int
60 #define ULONG unsigned long
64 /* Structure definitions for Kermit file attributes */
65 /* All strings come as pointer and length combinations */
66 /* Empty string (or for numeric variables, -1) = unused attribute. */
68 struct zstr { /* string format */
70 char *val; /* value */
72 struct zattr { /* Kermit File Attribute structure */
73 long lengthk; /* (!) file length in K */
74 struct zstr type; /* (") file type (text or binary) */
75 struct zstr date; /* (#) file creation date yyyymmdd[ hh:mm[:ss]] */
76 struct zstr creator; /* ($) file creator id */
77 struct zstr account; /* (%) file account */
78 struct zstr area; /* (&) area (e.g. directory) for file */
79 struct zstr password; /* (') password for area */
80 long blksize; /* (() file blocksize */
81 struct zstr xaccess; /* ()) file access: new, supersede, append, warn */
82 struct zstr encoding; /* (*) encoding (transfer syntax) */
83 struct zstr disp; /* (+) disposition (mail, message, print, etc) */
84 struct zstr lprotect; /* (,) protection (local syntax) */
85 struct zstr gprotect; /* (-) protection (generic syntax) */
86 struct zstr systemid; /* (.) ID for system of origin */
87 struct zstr recfm; /* (/) record format */
88 struct zstr sysparam; /* (0) system-dependent parameter string */
89 long length; /* (1) exact length on system of origin */
90 struct zstr charset; /* (2) transfer syntax character set */
92 struct zstr longname; /* OS/2 longname if applicable */
94 struct zstr reply; /* This goes last, used for attribute reply */
97 /* Kermit file information structure */
100 int bs; /* Blocksize */
101 int cs; /* Character set */
102 long rl; /* Record length */
103 int org; /* Organization */
104 int fmt; /* Record format */
105 int cc; /* Carriage control */
106 int typ; /* Type (text/binary) */
107 int dsp; /* Disposition */
108 char *os_specific; /* OS-specific attributes */
110 unsigned long int lblopts; /* LABELED FILE options bitmask */
116 #ifdef MACOSX10 /* Mac OS X 1.0 */
117 #ifndef MACOSX /* implies Mac OS X */
120 #endif /* MACOSX10 */
122 #ifdef MACOSX /* Mac OS X */
123 #ifndef BSD44 /* implies 4.4 BSD */
128 #ifdef SCO_OSR505 /* SCO 3.2v5.0.5 */
129 #ifndef SCO_OSR504 /* implies SCO 3.2v5.0.4 */
131 #endif /* SCO_OSR504 */
132 #endif /* SCO_OSR505 */
134 #ifdef SCO_OSR504 /* SCO 3.2v5.0.4 */
135 #ifndef CK_SCOV5 /* implies SCO 3.2v5.0 */
137 #endif /* CK_SCOV5 */
138 #include <sys/types.h> /* To sidestep header-file mess */
139 #endif /* SCO_OSR504 */
145 #endif /* CK_SCOV5 */
151 #endif /* UNIXWARE */
153 #ifdef CK_SCO32V4 /* SCO 3.2v4 */
174 #endif /* CK_RTSCTS */
181 #endif /* CK_SCO32V4 */
183 #ifdef NOICP /* If no command parser */
184 #ifndef NOSPL /* Then no script language either */
187 #ifndef NOCSETS /* Or characer sets */
190 #ifndef NOFTP /* Or FTP client */
195 /* Built-in makefile entries */
197 #ifdef SOLARIS9 /* Solaris 9 implies 8 */
200 #endif /* SOLARIS8 */
201 #endif /* SOLARIS9 */
203 #ifdef SOLARIS8 /* Solaris 8 implies 7 */
206 #endif /* SOLARIS7 */
207 #endif /* SOLARIS8 */
209 #ifdef SOLARIS7 /* Solaris 7 implies 2.6 */
212 #endif /* SOLARIS26 */
213 #endif /* SOLARIS7 */
215 #ifdef SOLARIS26 /* Solaris 2.6 implies 2.5 */
218 #endif /* SOLARIS25 */
219 #endif /* SOLARIS26 */
221 #ifdef SOLARIS25 /* Solaris 2.5 implies Solaris */
225 #ifndef POSIX /* And POSIX */
228 #ifndef CK_WREFRESH /* And this (curses) */
230 #endif /* CK_WREFRESH */
231 #endif /* SOLARIS25 */
233 #ifdef SOLARIS24 /* Solaris 2.4 implies Solaris */
237 #endif /* SOLARIS24 */
239 #ifdef SOLARIS /* Solaris gets "POSIX" RTS/CTS API */
241 #ifndef POSIX_CRTSCTS
242 #define POSIX_CRTSCTS
243 #endif /* POSIX_CRTSCTS */
247 #ifdef SUN4S5 /* Sun-4 System V environment */
248 #ifndef SVR3 /* implies System V R3 or later */
252 #ifdef SUNOS41 /* SUNOS41 implies SUNOS4 */
258 #ifdef SUN4S5 /* Sun-4 System V environment */
259 #ifndef SVR3 /* implies System V R3 or later */
264 #ifdef SUNOS41 /* SUNOS41 implies SUNOS4 */
270 #ifdef SUNOS4 /* Built-in SUNOS4 makefile entry */
279 #endif /* NOSETBUF */
286 #endif /* TCPSOCKET */
290 #endif /* SAVEDUID */
296 #ifdef SOLARIS /* Built in makefile entry */
297 #ifndef NOSETBUF /* for Solaris 2.x */
299 #endif /* NOSETBUF */
303 #endif /* CK_CURSES */
304 #endif /* NOCURSES */
307 #endif /* CK_NEWTERM */
314 #endif /* TCPSOCKET */
324 #endif /* HADDRLIST */
327 #endif /* STERMIOX */
341 /* Features that can be eliminated from a no-file-transfer version */
348 #ifndef NOCURSES /* Fullscreen file-transfer display */
350 #endif /* NOCURSES */
352 #ifndef NOCKXYZ /* XYZMODEM support */
355 #ifndef NOCKSPEED /* Ctrl-char unprefixing */
357 #endif /* NOCKSPEED */
358 #ifndef NOSERVER /* Server mode */
360 #endif /* NOSERVER */
361 #ifndef NOCKTIMERS /* Dynamic packet timers */
363 #endif /* NOCKTIMERS */
364 #ifndef NOPATTERNS /* File-type patterns */
366 #endif /* NOPATTERNS */
367 #ifndef NOSTREAMING /* Streaming */
369 #endif /* NOSTREAMING */
370 #ifndef NOIKSD /* Internet Kermit Service */
373 #ifndef NOPIPESEND /* Sending from pipes */
375 #endif /* NOPIPESEND */
376 #ifndef NOAUTODL /* Autodownload */
378 #endif /* NOAUTODL */
379 #ifndef NOMSEND /* MSEND */
382 #ifndef NOTLOG /* Transaction logging */
385 #ifndef NOCKXXCHAR /* Packet character doubling */
387 #endif /* NOCKXXCHAR */
390 #ifdef NOICP /* No Interactive Command Parser */
391 #ifndef NODIAL /* Implies No DIAL command */
394 #ifndef NOCKXYZ /* and no external protocols */
415 #endif /* TCPSOCKET */
427 #endif /* STRATUSX25 */
430 #endif /* CK_NETBIOS */
433 #endif /* SUPERLAT */
448 #endif /* RLOGCODE */
457 #endif /* NOFORWARDX */
460 #endif /* NOBROWSER */
469 #endif /* NO_COMPORT */
470 #endif /* IKSDONLY */
473 /* Features that can be eliminated from a remote-only version */
488 #ifndef NOCURSES /* Fullscreen file-transfer display */
490 #endif /* NOCURSES */
496 #endif /* NOSCRIPT */
499 #endif /* NOSETKEY */
502 #endif /* NOKVERBS */
508 #endif /* CK_CURSES */
516 #endif /* IKSDONLY */
525 #endif /* TCPSOCKET */
528 #endif /* NOTCPOPTS */
537 #endif /* STRATUSX25 */
540 #endif /* CK_NETBIOS */
543 #endif /* SUPERLAT */
558 #endif /* RLOGCODE */
573 #endif /* NOBROWSER */
576 #endif /* NOFORWARDX */
588 #endif /* STRATUSX25 */
591 #endif /* CK_NETBIOS */
594 #endif /* SUPERLAT */
609 #endif /* RLOGCODE */
621 #endif /* NOBROWSER */
622 #endif /* IKSDONLY */
624 Note that none of the above precludes TNCODE, which can be defined in
625 the absence of TCPSOCKET, etc, to enable server-side Telnet negotation.
627 #ifndef TNCODE /* This is for the benefit of */
628 #ifdef TCPSOCKET /* modules that might need TNCODE */
629 #define TNCODE /* not all of ckcnet.h... */
630 #endif /* TCPSOCKET */
636 #endif /* TCPSOCKET */
639 #ifndef DEFPAR /* Default parity */
640 #define DEFPAR 0 /* Must be here because it is used */
641 #endif /* DEFPAR */ /* by all classes of modules */
646 #endif /* OS2ORWIN32 */
652 #ifdef OS2 /* For OS/2 debugging */
655 #endif /* OS2ORWIN32 */
666 #endif /* OS2ORUNIX */
669 #endif /* OS2ORVMS */
672 #include <stdio.h> /* Begin by including this. */
673 #include <ctype.h> /* and this. */
675 /* System-type compilation switches */
677 #ifdef FT21 /* Fortune For:Pro 2.1 implies 1.8 */
687 #endif /* __bsdi__ */
689 #ifdef AIXPS2 /* AIXPS2 implies AIX370 */
695 #ifdef AIX370 /* AIX PS/2 or 370 implies BSD4 */
701 #ifdef AIXESA /* AIX/ESA implies BSD4.4 */
707 #ifdef AIX53 /* AIX53 implies AIX52 */
713 #ifdef AIX52 /* AIX52 implies AIX51 */
719 #ifdef AIX51 /* AIX51 implies AIX50 */
725 #ifdef AIX50 /* AIX50 implies AIX45 */
731 #ifdef AIX45 /* AIX45 implies AIX44 */
737 #ifdef AIX44 /* AIX44 implies AIX43 */
743 #ifdef AIX43 /* AIX43 implies AIX42 */
749 #ifdef AIX42 /* AIX42 implies AIX41 */
755 #ifdef SV68R3V6 /* System V/68 R32V6 implies SVR3 */
759 #endif /* SV68R3V6 */
761 #ifdef SV88R32 /* System V/88 R32 implies SVR3 */
767 #ifdef DGUX540 /* DG UX 5.40 implies Sys V R 4 */
774 #ifdef DGUX540 /* DG/UX 5.40 implies DGUX */
777 #ifdef DGUX430 /* So does DG/UX 4.30 */
783 #ifdef IRIX65 /* IRIX 6.5 implies IRIX 6.4 */
789 #ifdef IRIX64 /* IRIX 6.4 implies IRIX 6.2 */
791 #define BSD44ORPOSIX /* for ckutio's benefit */
792 #endif /* BSD44ORPOSIX */
798 #ifdef IRIX62 /* IRIX 6.2 implies IRIX 6.0 */
804 #ifdef IRIX60 /* IRIX 6.0 implies IRIX 5.1 */
808 #ifndef IRIX52 /* And IRIX 5.2 (for hwfc) */
813 #ifndef IRIX /* IRIX 4.0 or greater implies IRIX */
835 #ifdef MIPS /* MIPS System V environment */
836 #ifndef SVR3 /* implies System V R3 or later */
841 #ifdef HPUX9 /* HP-UX 9.x */
850 #endif /* HPUX9PLUS */
853 #ifdef HPUX10 /* HP-UX 10.x */
854 #ifndef HPUX1010 /* If anything higher is defined */
855 #ifdef HPUX1020 /* define HPUX1010 too. */
857 #endif /* HPUX1020 */
860 #endif /* HPUX1030 */
861 #endif /* HPUX1010 */
863 #ifdef HPUX1100 /* HP-UX 11.00 implies 10.10 */
866 #endif /* HPUX1010 */
867 #endif /* HPUX1100 */
877 #endif /* HPUX9PLUS */
880 #ifdef QNX /* QNX Software Systems Inc */
881 #ifndef POSIX /* QNX 4.0 or later is POSIX */
884 #ifndef __386__ /* Comes in 16-bit and 32-bit */
894 4.4BSD is a mixture of System V R4, POSIX, and 4.3BSD.
896 #ifdef BSD44 /* 4.4 BSD */
897 #ifndef SVR4 /* BSD44 implies SVR4 */
900 #ifndef NOSETBUF /* NOSETBUF is safe */
902 #endif /* NOSETBUF */
903 #ifndef DIRENT /* Uses <dirent.h> */
908 #ifdef OPENBSD /* OpenBSD might or might not */
909 #ifndef __OpenBSD__ /* have this defined... */
911 #endif /* __OpenBSD__ */
914 #ifdef SVR3 /* SVR3 implies ATTSV */
920 #ifdef SVR4 /* SVR4 implies ATTSV */
924 #ifndef SVR3 /* ...as well as SVR3 */
931 #define ATTSV /* OXOS implies ATTSV */
933 #define SW_ACC_ID /* access() wants privs on */
934 #define kill priv_kill /* kill() wants privs on */
936 #define NOSETBUF /* NOSETBUF is safe */
937 #endif /* ! NOSETBUF */
940 #ifdef UTSV /* UTSV implies ATTSV */
946 #ifdef XENIX /* XENIX implies ATTSV */
952 #ifdef AUX /* AUX implies ATTSV */
958 #ifdef ATT7300 /* ATT7300 implies ATTSV */
964 #ifdef ATT6300 /* ATT6300 implies ATTSV */
970 #ifdef HPUX /* HPUX implies ATTSV */
976 #ifdef ISIII /* ISIII implies ATTSV */
982 #ifdef NEXT33 /* NEXT33 implies NEXT */
988 #ifdef NEXT /* NEXT implies BSD4 */
994 #ifdef BSD41 /* BSD41 implies BSD4 */
1000 #ifdef BSD43 /* BSD43 implies BSD4 */
1006 #ifdef BSD4 /* BSD4 implies ANYBSD */
1012 #ifdef BSD29 /* BSD29 implies ANYBSD */
1018 #ifdef ATTSV /* ATTSV implies UNIX */
1024 #ifdef ANYBSD /* ANYBSD implies UNIX */
1030 #ifdef POSIX /* POSIX implies UNIX */
1034 #ifndef DIRENT /* and DIRENT, i.e. <dirent.h> */
1037 #endif /* SDIRENT */
1039 #ifndef NOFILEH /* POSIX doesn't use <sys/file.h> */
1041 #endif /* NOFILEH */
1057 #endif /* NOCURSES */
1058 #endif /* COMMENT */
1059 #endif /* COHERENT */
1067 The symbol SVORPOSIX is defined for both AT&T and POSIX compilations
1068 to make it easier to select items that System V and POSIX have in common,
1069 but which BSD, V7, etc, do not have.
1074 #endif /* SVORPOSIX */
1080 #endif /* SVORPOSIX */
1084 The symbol SVR4ORPOSIX is defined for both AT&T System V R4 and POSIX
1085 compilations to make it easier to select items that System V R4 and POSIX
1086 have in common, but which BSD, V7, and System V R3 and earlier, etc, do
1092 #endif /* SVR4ORPOSIX */
1097 #endif /* SVR4ORPOSIX */
1101 The symbol BSD44ORPOSIX is defined for both 4.4BSD and POSIX compilations
1102 to make it easier to select items that 4.4BSD and POSIX have in common,
1103 but which System V, BSD, V7, etc, do not have.
1106 #ifndef BSD44ORPOSIX
1107 #define BSD44ORPOSIX
1108 #endif /* BSD44ORPOSIX */
1112 #ifndef BSD44ORPOSIX
1113 #define BSD44ORPOSIX
1114 #endif /* BSD44ORPOSIX */
1117 #ifdef UNIX /* For items common to OS/2 and UNIX */
1120 #endif /* OS2ORUNIX */
1123 #ifdef UNIX /* For items common to VMS and UNIX */
1130 #endif /* OS2ORVMS */
1134 #ifndef UNIXOROSK /* UNIX or OS-9 (or OS-9000) */
1142 #endif /* UNIXOROSK */
1147 #endif /* UNIXOROSK */
1148 #endif /* OSKORUNIX */
1151 #define CK_ANSIC /* OS/2 supports ANSIC and more extensions */
1154 #ifdef OSF50 /* Newer OSF/1 versions imply older ones */
1184 #ifdef __DECC /* For DEC Alpha VMS or OSF/1 */
1186 #define CK_ANSIC /* Even with /stand=vaxc, need ansi */
1187 #endif /* CKANSIC */
1189 #define SIG_V /* and signal type is VOID */
1192 #define CK_ANSILIBS /* (Martin Zinser, Feb 1995) */
1193 #endif /* CK_ANSILIBS */
1194 #ifndef _POSIX_C_SOURCE
1195 #define _POSIX_C_SOURCE 1
1196 #endif /* _POSIX_C_SOURCE */
1200 #ifdef __ia64 /* VMS on Itanium */
1205 #ifndef VMS64BIT /* 64-bit VMS on Itanium or Alpha */
1212 #endif /* __ALPHA */
1213 #endif /* VMS64BIT */
1216 #ifdef apollo /* May be ANSI-C, check further */
1218 #define CK_ANSIC /* Yes, this is real ANSI-C */
1221 #define NOANSI /* Nope, not ANSI */
1222 #undef __STDC__ /* Even though it say it is! */
1224 #endif /* __STDCPP__ */
1227 #ifdef POSIX /* -DPOSIX on cc command line */
1228 #ifndef _POSIX_SOURCE /* Implies _POSIX_SOURCE */
1229 #define _POSIX_SOURCE
1230 #endif /* _POSIX_SOURCE */
1234 ANSI C? That is, do we have function prototypes, new-style
1235 function declarations, and parameter type checking and coercion?
1237 #ifdef MAC /* MPW C is ANSI */
1241 #endif /* CK_ANSIC */
1245 #ifdef STRATUS /* Stratus VOS */
1248 #endif /* CK_ANSIC */
1252 #endif /* STRATUS */
1255 #ifdef __STDC__ /* __STDC__ means ANSI C */
1258 #endif /* CK_ANSIC */
1259 #endif /* __STDC__ */
1262 _PROTOTYP() is used for forward declarations of functions so we can have
1263 parameter and return value type checking if the compiler offers it.
1264 __STDC__ should be defined by the compiler only if function prototypes are
1265 allowed. Otherwise, we get old-style forward declarations. Our own private
1266 CK_ANSIC symbol tells whether we use ANSI C prototypes. To force use of
1267 ANSI prototypes, include -DCK_ANSIC on the cc command line. To disable the
1268 use of ANSI prototypes, include -DNOANSI.
1271 #define _PROTOTYP( func, parms ) func parms
1272 #else /* Not ANSI C */
1273 #define _PROTOTYP( func, parms ) func()
1274 #endif /* CK_ANSIC */
1277 #ifdef NOLOGIN /* NOLOGIN implies NOIKSD */
1281 #endif /* NOLOGIN */
1284 #ifdef NOIKSD /* Internet Kermit Service Daemon */
1286 #ifndef NOPRINTFSUBST
1287 #define NOPRINTFSUBST
1288 #endif /* NOPRINTFSUBST */
1292 #endif /* NOLOGIN */
1295 #endif /* NOSYSLOG */
1301 #ifdef OS2ORUNIX /* Platforms where IKSD is supported */
1303 #endif /* OS2ORUNIX */
1307 #ifdef IKSD /* IKSD options... */
1308 #ifndef IKSDCONF /* IKSD configuration file */
1310 #define IKSDCONF "/etc/iksd.conf"
1313 #define IKSDCONF "iksd.ksc"
1316 #endif /* IKSDCONF */
1318 #ifndef IKSDB /* IKSD database */
1321 #define IK_LCKTRIES 16 /* How many times to try to get lock */
1322 #define IK_LCKSLEEP 1 /* How long to sleep between tries */
1323 #define IK_LOCKFILE "iksd.lck" /* Database lockfilename */
1324 #define IK_DBASEDIR "/var/log/" /* Database directory */
1325 #define IK_DBASEFIL "iksd.db" /* Database filename */
1329 #ifndef NOFTRUNCATE /* ftruncate() not available */
1331 #endif /* NOFTRUNCATE */
1332 #define IK_LCKTRIES 16 /* How many times to try to get lock */
1333 #define IK_LCKSLEEP 1 /* How long to sleep between tries */
1334 #define IK_LOCKFILE "iksd.lck" /* DB lockfilename (in systemroot) */
1335 #define IK_DBASEFIL "iksd.db" /* Database filename */
1339 #endif /* NOIKSDB */
1342 Substitutes for printf() and friends used in IKS to compensate for
1343 lack of a terminal driver, mainly to supply CR after LF.
1345 #ifndef NOPRINTFSUBST
1348 * The MAC doesn't use standard stdio routines.
1351 #define getchar() mac_getchar()
1353 #define putchar(c) mac_putchar(c)
1354 #define printf mac_printf
1355 #define perror mac_perror
1356 #define puts mac_puts
1357 extern int mac_putchar (int c);
1358 extern int mac_puts (const char *string);
1359 extern int mac_printf(const char *, ...);
1360 extern int mac_getchar (void);
1364 #define printf Vscrnprintf
1365 #define fprintf Vscrnfprintf
1366 extern int Vscrnprintf(const char *, ...);
1367 extern int Vscrnprintw(const char *, ...);
1368 extern int Vscrnfprintf(FILE *, const char *, ...);
1371 #endif /* putchar */
1372 #define putchar(x) Vscrnprintf("%c",x)
1373 #define perror(x) Vscrnperror(x)
1381 #endif /* CKXPRINTF */
1384 #endif /* CKWART_C */
1385 #endif /* NOPRINTFSUBST */
1388 #define printf ckxprintf
1389 #define fprintf ckxfprintf
1391 _PROTOTYP(int ckxprintf,(const char *, ...));
1393 _PROTOTYP(void ckxperror,(const char *));
1396 _PROTOTYP(void ckxperror,(const char *));
1398 _PROTOTYP(int ckxperror,(const char *));
1399 #endif /* CK_SCOV5 */
1401 _PROTOTYP(int ckxfprintf,(FILE *, const char *, ...));
1402 #endif /* CK_ANSIC */
1405 #endif /* putchar */
1406 #define putchar(x) ckxprintf("%c",x)
1410 #define putc(a,b) ckxfprintf(b,"%c",a)
1411 #define perror(x) ckxperror(x)
1412 #endif /* CKXPRINTF */
1415 Altos-specific items: 486, 586, 986 models...
1424 /* Signal handling */
1427 #ifndef CK_POSIX_SIG
1428 #define CK_POSIX_SIG
1429 #endif /* CK_POSIX_SIG */
1434 #ifndef VOID /* Used throughout all C-Kermit */
1435 #ifdef CK_ANSIC /* modules... */
1439 #endif /* CK_ANSIC */
1459 #endif /* CK_ANSIC */
1460 #endif /* CK_SCO32V4 */
1466 #ifndef SIG_V /* signal() type, if not def'd yet */
1474 #ifdef SVR3 /* System V R3 and later */
1477 #ifdef SUNOS4 /* SUNOS V 4.0 and later */
1484 #ifdef NEXT /* NeXT */
1490 #define SIGTYP __SIGVOID /* AIX370 */
1492 #ifdef STRATUS /* Stratus VOS */
1505 #else /* Everything else */
1508 #endif /* STRATUS */
1519 #define SIGRETURN return(0)
1526 #define SIGRETURN return
1543 #define SIGRETURN return(0)
1544 #endif /* SIGRETURN */
1547 /* This does not work, so don't use it. */
1548 #define signal ckntsignal
1549 SIGTYP (*ckntsignal(int type, SIGTYP (*)(int)))(int);
1550 #endif /* CKNTSIG */
1552 /* We want all characters to be unsigned if the compiler supports it */
1558 #define CHAR unsigned char
1562 /* typedef long LONG; */
1566 typedef unsigned char CHAR;
1573 /* typedef long LONG; */
1577 /* typedef long LONG; */
1580 #define CHAR unsigned char /* 3.22 compiler */
1583 #define CHAR unsigned char
1587 #define CHAR unsigned char
1592 typedef unsigned char CHAR;
1596 typedef unsigned char CHAR;
1601 typedef unsigned char CHAR;
1605 #endif /* datageneral */
1613 union ck_short { /* Mainly for Unicode */
1618 #ifdef MAC /* Macintosh file routines */
1619 #ifndef CKWART_C /* But not in "wart"... */
1623 #define feof mac_feof
1624 #define rewind mac_rewind
1625 #define fgets mac_fgets
1626 #define fopen mac_fopen
1627 #define fclose mac_fclose
1633 #endif /* CKCPRO_W */
1636 Systems whose mainline modules have access to the communication-line
1637 file descriptor, ttyfd.
1651 #endif /* CK_TTYFD */
1653 /* Systems where we can get our own process ID */
1667 /* Systems that support the Microsoft Telephony API (TAPI) */
1674 #endif /* CK_TAPI */
1691 #endif /* datageneral */
1693 #endif /* OS2ORUNIX */
1694 #endif /* NZXPAND */
1698 #endif /* NZXPAND */
1699 #endif /* NONZXPAND */
1701 /* nzxpand() option flags */
1703 #define ZX_FILONLY 1 /* Match only regular files */
1704 #define ZX_DIRONLY 2 /* Match only directories */
1705 #define ZX_RECURSE 4 /* Descend through directory tree */
1706 #define ZX_MATCHDOT 8 /* Match "dot files" */
1707 #define ZX_NOBACKUP 16 /* Don't match "backup files" */
1708 #define ZX_NOLINKS 32 /* Don't follow symlinks */
1711 #define nzxpand(a,b) zxpand(a)
1712 #endif /* NZXPAND */
1715 #ifndef ZXREWIND /* Platforms that have zxrewind() */
1730 #endif /* STRATUS */
1732 #endif /* datageneral */
1734 #endif /* OS2ORUNIX */
1735 #endif /* ZXREWIND */
1739 #endif /* ZXREWIND */
1740 #endif /* NOZXREWIND */
1742 /* Temporary-directory-for-RECEIVE feature ... */
1743 /* This says whether we have the isdir() function defined. */
1745 #ifdef UNIX /* UNIX has it */
1749 #define TMPDIRLEN 256
1751 #endif /* CK_TMPDIR */
1754 #ifdef VMS /* VMS too */
1757 #define TMPDIRLEN 256
1758 #endif /* CK_TMPDIR */
1761 #ifdef OS2 /* OS two too */
1764 #define TMPDIRLEN 129
1765 #endif /* CK_TMPDIR */
1768 #ifdef STRATUS /* Stratus VOS too. */
1771 #define TMPDIRLEN 256
1772 #endif /* CK_TMPDIR */
1773 #endif /* STRATUS */
1775 #ifdef OSK /* OS-9 too */
1778 #define TMPDIRLEN 256
1779 #endif /* CK_TMPDIR */
1782 #ifdef datageneral /* AOS/VS too */
1785 #define TMPDIRLEN 256
1786 #endif /* CK_TMPDIR */
1787 #endif /* datageneral */
1789 #ifdef CK_TMPDIR /* Needs command parser */
1793 #endif /* CK_TMPDIR */
1795 /* Whether to include <sys/time.h> */
1797 #ifndef NOTIMEH /* <time.h> */
1801 #endif /* NOTIMEH */
1803 #ifndef NOSYSTIMEH /* <sys/time.h> */
1805 #ifdef UNIX /* UNIX */
1806 #ifdef SVORPOSIX /* System V or POSIX... */
1835 #endif /* SV68R3V6 */
1839 #endif /* __linux__ */
1842 #endif /* SCO_32V4 */
1845 #else /* Not SVORPOSIX */
1847 #ifndef BELLV10 /* All but these... */
1853 #endif /* COHERENT */
1857 #endif /* BELLV10 */
1858 #endif /* SVORPOSIX */
1860 #endif /* SYSTIMEH */
1861 #endif /* NOSYSTIMEH */
1863 #ifndef NOSYSTIMEBH /* <sys/timeb.h> */
1885 #endif /* BELLV10 */
1890 #endif /* COHERENT */
1892 #endif /* SYSTIMEBH */
1893 #endif /* NOSYSTIMEBH */
1896 Debug and transaction logging is included automatically unless you define
1897 NODEBUG or NOTLOG. Do this if you want to save the space and overhead.
1898 (Note, in version 4F these definitions changed from "{}" to the null string
1899 to avoid problems with semicolons after braces, as in: "if (x) tlog(this);
1910 #endif /* NODEBUG */
1922 /* debug() macro style selection. */
1927 #endif /* IFDEBUG */
1933 #endif /* IFDEBUG */
1939 #endif /* IFDEBUG */
1942 #ifdef OXOS /* tst is faster than jsr */
1945 #endif /* IFDEBUG */
1952 extern int matchdot;
1957 _PROTOTYP( void bleep, (short) );
1959 #define bleep(x) if(tt_bell)putchar('\07')
1963 #ifdef BEBOX /* This was used only for DR7 */
1966 #ifdef BEOS /* This is used for BeOS 4.x */
1970 #endif /* BEOSORBEBOX */
1979 #define tlog(a,b,c,d)
1982 /* Debugging included. Declare debug log flag in main program only. */
1983 extern int tralog, tlogfmt;
1985 _PROTOTYP(VOID dotlog,(int, char *, char *, long));
1986 #define tlog(a,b,c,d) if (tralog && tlogfmt) dotlog(a,b,c,d)
1987 _PROTOTYP(VOID doxlog,(int, char *, long, int, int, char *));
1990 /* Formats for debug() and tlog() */
2005 #endif /* __linux__ */
2007 /* Platforms where small size is needed */
2013 /* Can we use realpath()? */
2019 #endif /* NOREALPATH */
2058 #endif /* COHERENT */
2062 #endif /* CK_SCOV5 */
2063 #endif /* CK_SCO32V4 */
2065 #endif /* SV68R3V6 */
2070 #endif /* NOREALPATH */
2075 #endif /* NOREALPATH */
2076 #endif /* CKREALPATH */
2084 #endif /* OS2ORUNIX */
2085 #endif /* CKREALPATH */
2087 /* CKSYMLINK should be set only if we can use readlink() */
2093 #endif /* NOSYMLINK */
2094 #endif /* CKSYMLINK */
2097 /* Platforms where we can use lstat() instead of stat() (for symlinks) */
2098 /* This should be set only if both lstat() and readlink() are available */
2105 #ifdef SVR4 /* SVR4 has lstat() */
2108 #ifdef BSD42 /* 4.2BSD and 4.3BSD have it */
2109 #define USE_LSTAT /* This should include old HPUXs */
2111 #ifdef BSD44 /* 4.4BSD has it */
2114 #ifdef LINUX /* LINUX has it */
2117 #ifdef SUNOS4 /* SunOS has it */
2124 #endif /* CKSYMLINK */
2126 #endif /* USE_LSTAT */
2127 #endif /* NOSYMLINK */
2128 #endif /* NOLSTAT */
2133 #endif /* USE_LSTAT */
2134 #endif /* NOLSTAT */
2136 #ifndef NOTTYLOCK /* UNIX systems that have ttylock() */
2138 #ifdef AIXRS /* AIX 3.1 and later */
2141 #ifdef USE_UU_LOCK /* FreeBSD or other with uu_lock() */
2144 #ifdef HAVE_BAUDBOY /* Red Hat Linux >= 7.2 */
2146 #endif /* HAVE_BAUDBOY */
2147 #endif /* USE_UU_LOCK */
2149 #endif /* USETTYLOCK */
2150 #endif /* NOTTYLOCK */
2152 /* Kermit feature selection */
2155 #ifndef NOCHANNELIO /* Channel-based file i/o package */
2168 #endif /* STRATUS */
2172 #endif /* CKCHANNELIO */
2173 #endif /* NOCHANNELIO */
2176 #ifndef NOCKEXEC /* EXEC command */
2179 #ifdef UNIX /* UNIX can do it */
2184 #endif /* NOCKEXEC */
2186 #ifndef NOFAST /* Fast Kermit protocol by default */
2199 #endif /* CK_FAST */
2202 #ifdef UNIX /* Transparent print */
2207 #endif /* NOXPRINT */
2210 #ifndef NOHWPARITY /* Hardware parity */
2212 #ifdef SVORPOSIX /* System V or POSIX can have it */
2215 #ifdef SUNOS41 /* SunOS 4.1 can have it */
2218 #ifdef OS2 /* K95 can have it */
2221 #endif /* SUNOS41 */
2222 #endif /* SVORPOSIX */
2223 #endif /* HWPARITY */
2224 #endif /* NOHWPARITY */
2226 #ifndef NOSTOPBITS /* Stop-bit selection */
2229 /* In Unix really this should only be if CSTOPB is defined. */
2230 /* But we don't know that yet. */
2235 #endif /* TN_COMPORT */
2236 #endif /* OS2ORUNIX */
2237 #endif /* STOPBITS */
2238 #endif /* NOSTOPBITS */
2241 #ifndef NETCMD /* Can SET NETWORK TYPE COMMAND */
2246 /* Pty support, nonportable, available on a case-by-case basis */
2249 #ifdef NEXT /* NeXTSTEP (tested on 3.1)*/
2252 #ifdef CK_SCOV5 /* SCO OSR5 (tested on 5.0.5)*/
2255 #ifdef QNX /* QNX (tested on 4.25) */
2258 #ifdef SINIX /* Sinix (tested on 5.42) */
2261 #ifdef DGUX540 /* DG/UX 5.4++ (tested on 5.4R4.11) */
2264 #ifdef OSF32 /* Digital Unix 3.2 */
2267 #ifdef OSF40 /* Digital Unix 4.0 / Tru64 */
2270 #ifdef IRIX60 /* IRIX 6.0 (not earlier) */
2273 #ifdef HPUX10 /* HPUX 10.00 or later */
2275 #ifndef HAVE_PTYTRAP
2276 #define HAVE_PTYTRAP
2277 #endif /* HAVE_PTYTRAP */
2279 #ifdef HPUX9 /* HPUX 9.00 (not earlier) */
2281 #ifndef HAVE_PTYTRAP
2282 #define HAVE_PTYTRAP
2283 #endif /* HAVE_PTYTRAP */
2285 #ifdef BSD44 /* BSD44, {Net,Free,Open}BSD */
2288 #ifdef BSDI /* BSDI/OS (tested in 4) */
2291 #ifdef SOLARIS /* Solaris (tested in 2.5) */
2294 #ifdef UW7 /* Unixware 7 */
2297 #ifdef SUNOS41 /* SunOS (tested in 4.1.3) */
2300 #ifdef AIX41 /* AIX 4.1 and later */
2303 #ifdef LINUX /* Linux */
2307 #endif /* SUNOS41 */
2309 #endif /* SOLARIS */
2317 #endif /* DGUX540 */
2320 #endif /* CK_SCOV5 */
2330 #ifdef NETPTY /* NETCMD required for NETPTY */
2336 #ifndef CK_UTSNAME /* Can we call uname()? */
2343 #ifdef POSIX /* It's in POSIX.1 */
2346 #ifdef SUNOS41 /* It's in SunOS 4.1 */
2349 #ifdef AIXRS /* It's in AIX */
2352 #ifdef SVR4 /* It's in SVR4 (but not SVR3) */
2355 #ifdef HPUX /* It's in HP-UX 5.00 and later */
2358 #ifdef OSF /* It's in OSF/1 / Digital UNIX */
2363 #endif /* CK_SCOV5 */
2368 #endif /* SUNOS41 */
2372 #endif /* CK_UTSNAME */
2374 /* This section for anything that might use floating-point */
2376 /* If the following causes trouble use -DFLOAT=float on the command line */
2381 #endif /* FNFLOAT */
2384 #endif /* CKFLOAT */
2391 /* Don't use double on 64-bit platforms -- bad things happen */
2392 #define CKFLOAT float
2393 #define CKFLOAT_S "float"
2395 #define CKFLOAT double
2396 #define CKFLOAT_S "double"
2397 #endif /* __alpha */
2398 #endif /* CKFLOAT */
2400 #ifndef NOGFTIMER /* Floating-point timers */
2402 #ifdef UNIX /* For UNIX */
2405 #ifdef VMS /* VMS */
2406 #ifndef OLD_VMS /* 5.0 and later */
2408 #endif /* OLD_VMS */
2410 #ifdef OS2 /* And K95 */
2413 #ifdef STRATUS /* And Stratus VOS */
2415 #endif /* STRATUS */
2416 #endif /* GFTIMER */
2417 #endif /* NOGFTIMER */
2420 #ifndef FNFLOAT /* Floating-point math functions */
2421 #ifdef VMS /* defined by default in VMS */
2424 #ifdef OS2 /* and K95 */
2428 #endif /* FNFLOAT */
2431 #else /* NOFLOAT is defined */
2435 #endif /* CKFLOAT */
2439 #endif /* GFTIMER */
2443 #endif /* FNFLOAT */
2445 #endif /* NOFLOAT */
2447 #ifdef GFTIMER /* Fraction of second to use when */
2448 #ifndef GFMINTIME /* elapsed time is <= 0 */
2449 #define GFMINTIME 0.005
2450 #endif /* GFMINTIME */
2451 #endif /* GFTIMER */
2454 extern long ztmsec, ztusec; /* Fraction of sec of current time */
2457 #ifndef NOUNPREFIXZERO /* Allow unprefixing of NUL (0) */
2458 #ifndef UNPREFIXZERO /* in file-transfer packets */
2459 #define UNPREFIXZERO
2460 #endif /* UNPREFIXZERO */
2461 #endif /* NOUNPREFIXZERO */
2464 #define NOCAL /* Calibrate */
2465 #endif /* CK_SMALL */
2467 #ifndef NOPATTERNS /* Filetype matching patterns */
2472 #endif /* CK_SMALL */
2474 #endif /* PATTERNS */
2475 #endif /* NOPATTERNS */
2480 #endif /* CALIBRATE */
2484 #endif /* CALIBRATE */
2487 #ifndef NORECURSE /* Recursive directory traversal */
2495 #endif /* CK_SMALL */
2503 #endif /* STRATUS */
2504 #endif /* OS2ORUNIX */
2506 #endif /* RECURSIVE */
2507 #endif /* NORECURSE */
2509 #ifndef CK_SMALL /* Enable file-transfer tuning code */
2510 #ifndef CKTUNING /* in which more code is added */
2511 #ifndef NOTUNING /* to avoid function calls, etc */
2513 #endif /* NOTUNING */
2514 #endif /* CKTUNING */
2515 #endif /* CK_SMALL */
2517 #ifndef NOURL /* Parse URLs in SET HOST, etc */
2519 #define NO_FTP_AUTH /* No auth "ftp" / "anonymous" */
2523 #ifndef CK_TRIGGER /* Trigger string to exit CONNECT */
2524 #ifdef OS2ORUNIX /* OK for UNIX and K95 */
2527 #ifdef VMS /* and VMS */
2530 #ifdef datageneral /* and AOS/VS */
2532 #endif /* datageneral */
2533 #endif /* OS2ORUNIX */
2535 #endif /* CK_TRIGGER */
2536 #endif /* NOTRIGGER */
2539 #define TRIGGERS 8 /* How many triggers allowed */
2540 #endif /* CK_TRIGGER */
2542 #ifndef XLIMITS /* CONNECT limits */
2546 #endif /* XLIMITS */
2551 #endif /* NOBROWSER */
2555 #endif /* NOFRILLS */
2557 #ifndef NOHTTP /* HTTP features need... */
2558 #ifdef NOICP /* an interactive command parser */
2562 #ifndef OS2ORUNIX /* K95 or UNIX (because of */
2563 #define NOHTTP /* time functions, time_t, etc) */
2564 #endif /* OS2ORUNIX */
2572 /* The HTTP code is not very portable, so it must be asked for with -DCKHTTP */
2576 #ifdef SUNOS4 /* We can use it in SunOS */
2579 #ifdef SOLARIS /* And in Solaris */
2581 #endif /* SOLARIS */
2582 #ifdef LINUX /* And Linux */
2585 #ifdef HPUX10 /* And HP-UX 10 and above */
2588 #ifdef OS2 /* And in K-95 */
2591 #ifdef AIX41 /* In AIX 4.1 and higher */
2594 #ifdef UNIXWARE /* In Unixware 2.1 and higher */
2595 #define CKHTTP /* and probably also in 1.x and 2.0 */
2596 #endif /* UNIXWARE */
2599 #endif /* CK_SCOV5 */
2600 #ifdef OSF /* And in OSF Digital UNIX/True 64 */
2603 #ifdef ultrix /* And in Ultrix Mips */
2608 /* Add more here... */
2610 #ifndef CKHTTP /* If CKHTTP not defined yet */
2611 #define NOHTTP /* then define HOHTTP */
2615 #ifdef NETCONN /* Special "network" types... */
2620 #endif /* NETFILE */
2632 #endif /* NOLOCAL */
2633 #endif /* NETCONN */
2640 #endif /* OS2ORUNIX */
2670 #endif /* BROWSER */
2677 #endif /* BROWSER */
2682 #endif /* BROWSER */
2683 #endif /* NOBROWSER */
2685 #else /* TCPSOCKET */
2686 #ifndef NOHTTP /* HTTP requires TCPSOCKET */
2689 #endif /* TCPSOCKET */
2693 #ifndef NOCKGETFQHOST
2695 #define NOCKGETFQHOST
2696 #else /* __ia64__ */
2698 #define NOCKGETFQHOST
2701 #define NOCKGETFQHOST
2702 #endif /* HPUXPRE65 */
2705 #endif /* NOCKGETFQHOST */
2707 Regarding System V/68 (SV68) (from Gerry Belanger, Oct 2002):
2709 1) The gethostbyname() appears to return the actual host IP
2710 address in the hostent struct, instead of the expected pointer
2711 to the address. Hence the bogus address in the bcopy/memcopy.
2712 This is despite the header agreeing with our expectations.
2714 2) the expected argument swap between bcopy and memcopy
2715 did not happen. What grief this might cause, I know not.
2717 #endif /* TCPSOCKET */
2723 #endif /* NOSOCKS */
2724 #endif /* OS2ONLY */
2728 #endif /* CK_SOCKS */
2731 #endif /* CK_SOCKS5 */
2736 #endif /* CK_SOCKS */
2738 #ifdef CK_SOCKS5 /* CK_SOCKS5 implies CK_SOCKS */
2741 #endif /* CK_SOCKS */
2742 #endif /* CK_SOCKS5 */
2743 #endif /* NOSOCKS */
2744 #endif /* TCPSOCKET */
2747 #ifndef CK_AUTHENTICATION
2769 #endif /* NO_SSL_KRB5 */
2770 #endif /* _M_ALPHA */
2773 #endif /* NO_KERBEROS */
2777 #define CK_AUTHENTICATION
2779 #endif /* CK_AUTHENTICATION */
2781 #ifdef CK_AUTHENTICATION /* Encryption must have Auth */
2782 #ifndef CK_ENCRYPTION
2783 #ifndef NO_ENCRYPTION
2785 #define CK_ENCRYPTION
2789 #endif /* NO_ENCRYPTION */
2790 #endif /* CK_ENCRYPTION */
2791 #endif /* CK_AUTHENTICATION */
2793 #ifdef NO_AUTHENTICATION /* Allow authentication to be */
2794 #ifdef CK_AUTHENTICATION /* disabled in NT and OS/2 */
2795 #undef CK_AUTHENTICATION
2796 #endif /* CK_AUTHENTICATION */
2799 #endif /* CK_KERBEROS */
2803 #ifdef CK_ENCRYPTION
2804 #undef CK_ENCRYPTION
2805 #endif /* CK_ENCRYPTION */
2806 #endif /* NO_AUTHENTICATION */
2808 #ifdef NO_ENCRYPTION /* Allow encryption to be */
2809 #ifdef CK_ENCRYPTION /* disabled in NT and OS/2 */
2810 #undef CK_ENCRYPTION
2811 #endif /* CK_ENCRYPTION */
2812 #endif /* NO_ENCRYPTION */
2814 #ifdef CK_KERBEROS /* Disable funcs not yet supported with Heimdal */
2818 #endif /* HEIMDAL */
2820 #endif /* CK_KERBEROS */
2823 SSH section. NOSSH disables any form of SSH support.
2824 If NOSSH is not defined (or implied by NONET, NOLOCAL, etc)
2825 then SSHBUILTIN is defined for K95 and SSHCMD is defined for UNIX.
2826 Then, if either SSHBUILTIN or SSHCMD is defined, ANYSSH is also defined.
2833 #endif /* OS2ONLY */
2844 #ifdef NOSSH /* NOSSH */
2845 #ifdef SSHBUILTIN /* undefines any SSH selctors */
2847 #endif /* SSHBUILTIN */
2850 #endif /* SFTP_BUILTIN */
2857 #else /* Not NOSSH */
2862 #endif /* SSHBUILTIN */
2880 #else /* SSHBUILTIN */
2884 #endif /* SSHBUILTIN */
2886 #endif /* NOLOCAL */
2889 /* This is in case #ifdef SSH is used anywhere in the K95 modules */
2896 #endif /* SSHBUILTIN */
2899 #ifdef CK_AUTHENTICATION
2903 #define CK_AUTHENTICATION
2906 #endif /* CK_AUTHENTICATION */
2908 /* Environment stuff */
2913 #endif /* NOPUTENV */
2914 #endif /* OS2ORUNIX */
2916 #ifndef CK_ENVIRONMENT
2918 #define CK_ENVIRONMENT
2921 #define CK_ENVIRONMENT
2924 #define CK_ENVIRONMENT
2927 #define CK_ENVIRONMENT
2929 #endif /* STRATUS */
2932 #endif /* CK_ENVIRONMENT */
2933 #ifndef NOSNDLOC /* RFC 779 SEND LOCATION */
2936 #endif /* CK_SNDLOC */
2937 #endif /* NOSNDLOC */
2938 #ifndef NOXDISPLOC /* RFC 1096 XDISPLOC */
2941 #endif /* CK_XDISPLOC */
2942 #endif /* NOXDISPLOC */
2946 #ifndef CK_FORWARD_X
2947 #ifdef CK_AUTHENTICATION
2949 #define CK_FORWARD_X
2950 #endif /* OS2ONLY */
2951 #endif /* CK_AUTHENTICATION */
2952 #endif /* CK_FORWARD_X */
2953 #endif /* NOSELECT */
2954 #endif /* NOPUTENV */
2955 #endif /* NOFORWARDX */
2960 #endif /* TN_COMPORT */
2961 #endif /* TCPSOCKET */
2962 #endif /* NO_COMPORT */
2966 #ifndef NOCTRLZ /* Allow SET FILE EOF CTRL-Z */
2970 #endif /* OS2ORUNIX */
2971 #endif /* CK_CTRLZ */
2972 #endif /* NOCTRLZ */
2975 #ifndef NOPERMS /* File permissions in A packets */
2984 #endif /* CK_PERMS */
2985 #endif /* NOPERMS */
2987 #define CK_PERMLEN 24 /* Max length of sys-dependent perms */
2988 #endif /* CK_PERMS */
2990 #ifdef UNIX /* NOSETBUF for everybody */
2992 #ifndef USE_SETBUF /* This is the escape clause */
2994 #endif /* USE_SETBUF */
2995 #endif /* NOSETBUF */
2998 #ifndef USE_STRERROR /* Whether to use strerror() */
3000 #define USE_STRERROR
3002 #endif /* USE_STRERROR */
3004 #ifdef VMS /* Features for all VMS builds */
3010 #endif /* NOSETBUF */
3013 #endif /* DYNAMIC */
3017 #endif /* CK_CURSES */
3018 #endif /* NOCURSES */
3021 #ifndef NOCKTIMERS /* Dynamic timeouts */
3024 #endif /* CK_TIMERS */
3025 #endif /* NOCKTIMERS */
3027 #define CK_SPEED /* Control-prefix removal */
3030 #endif /* NOCKSPEED */
3041 #endif /* CKXXCHAR */
3042 #endif /* NOCKXXCHAR */
3044 #ifdef MAC /* For Macintosh, no escape */
3045 #define NOPUSH /* to operating system */
3048 /* Systems where we can call zmkdir() to create directories. */
3069 #endif /* STRATUS */
3077 #endif /* datageneral */
3079 #endif /* CK_MKDIR */
3080 #endif /* NOMKDIR */
3082 #ifdef NOMKDIR /* Allow for command-line override */
3085 #endif /* CK_MKDIR */
3086 #endif /* NOMKDIR */
3088 /* Systems for which we can enable the REDIRECT command automatically */
3089 /* As of 6.0.193, it should work for all UNIX... */
3096 #ifdef OS2 /* As well as OS/2 and friends... */
3099 #endif /* CK_REDIR */
3100 #endif /* NOREDIRECT */
3102 #ifdef NOPUSH /* But... REDIRECT command is not */
3103 #ifdef CK_REDIR /* allowed if NOPUSH is defined. */
3105 #endif /* CK_REDIR */
3106 #ifdef NETCMD /* Nor is SET NET COMMAND */
3114 #ifndef PEXITSTAT /* \v(pexitstat) variable defined */
3121 #endif /* OS2ORUNIX */
3122 #endif /* PEXITSTAT */
3124 /* The following allows automatic enabling of REDIRECT to be overridden... */
3135 #endif /* CK_REDIR */
3136 #endif /* NOREDIRECT */
3145 #endif /* NONETCMD */
3148 _PROTOTYP( int ttruncmd, (char *) );
3149 #endif /* CK_REDIR */
3151 /* Use built-in DIRECTORY command */
3165 #endif /* UNIXOROSK */
3166 #endif /* DOMYDIR */
3167 #endif /* NOMYDIR */
3169 /* Sending from and receiving to commands/pipes */
3178 #endif /* PIPESEND */
3183 #endif /* NOPIPESEND */
3187 #endif /* PIPESEND */
3192 #endif /* BROWSER */
3195 /* Versions where we support the RESEND command */
3220 #endif /* datageneral */
3224 #endif /* STRATUS */
3230 #endif /* CK_RESEND */
3231 #endif /* NORESEND */
3234 /* Systems implementing "Doomsday Kermit" protocol ... */
3248 #endif /* STRATUS */
3252 #endif /* DOOMSDAY */
3254 /* Systems where we want the Thermometer to be used for fullscreen */
3259 #endif /* CK_PCT_BAR */
3262 /* Systems where we have a REXX command */
3269 #endif /* __32BIT__ */
3272 /* Platforms that have a ZCHKPID function */
3276 #endif /* OS2ORUNIX */
3279 /* If we can't check pids then we have treat all pids as active & valid. */
3280 #define zchkpid(x) 1
3281 #endif /* ZCHKPID */
3283 /* Systems that have a ZRENAME function */
3285 #define ZRENAME /* They all do */
3287 /* Systems that have a ZCOPY function */
3301 #endif /* STRATUS */
3307 /* Systems that have ttgwsiz() (they all should but they don't) */
3326 #endif /* CK_TTGWSIZ */
3327 #endif /* NOTTGWSIZ */
3332 #endif /* CK_TTGWSIZ */
3333 #endif /* NOTTGWSIZ */
3335 /* OS/2 C-Kermit features not available in 16-bit version... */
3340 #ifdef PCFONTS /* PC Font support */
3342 #endif /* PCFONTS */
3343 #ifdef NPIPE /* Named Pipes communication */
3346 #ifdef CK_NETBIOS /* NETBIOS communication */
3348 #endif /* CK_NETBIOS */
3349 #ifdef OS2MOUSE /* Mouse */
3351 #endif /* OS2MOUSE */
3352 #ifdef OS2PM /* Presentation Manager */
3355 #endif /* NOLOCAL */
3356 #ifdef CK_REXX /* Rexx */
3358 #endif /* CK_REXX */
3359 #endif /* __32BIT__ */
3360 #endif /* OS2ONLY */
3362 /* OS/2 C-Kermit features not available in Windows NT version... */
3366 #ifdef PCFONTS /* PC Font support */
3368 #endif /* PCFONTS */
3369 #ifdef NPIPE /* Named Pipes communication */
3372 #ifdef OS2PM /* Presentation Manager */
3375 #ifdef CK_REXX /* Rexx */
3377 #endif /* CK_REXX */
3382 Systems that have select().
3383 This is used for both msleep() and for read-buffer checking in in_chk().
3385 #define CK_SLEEPINT 250 /* milliseconds - set this to something that
3386 divides evenly into 1000 */
3403 Not really. I think it's only in HP-UX 7.0 and later, except it's also
3404 in earlier versions that have TCP/IP installed. Override this default
3405 in particular HP-UX makefile entries by adding -DNOSELECT, as in (e.g.)
3436 #endif /* __linux__ */
3438 #endif /* NOSELECT */
3442 The following section moved here from ckcnet.h in 6.1 because select()
3443 is now used for non-networking purposes.
3446 /* On HP-9000/500 HP-UX 5.21 this stuff is not defined in any header file */
3449 #ifndef NEEDSELECTDEFS
3450 #define NEEDSELECTDEFS
3451 #endif /* NEEDSELECTDEFS */
3452 #endif /* hp9000s500 */
3454 #ifdef NEEDSELECTDEFS
3455 typedef long fd_mask;
3460 #define FD_SETSIZE 32
3461 #endif /* FD_SETSIZE */
3463 #define NFDBITS (sizeof(fd_mask) * NBBY)
3464 #endif /* NFDBITS */
3466 #define howmany(x,y) (((x)+((y)-1))/(y))
3467 #endif /* howmany */
3468 typedef struct fd_set {
3469 fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
3472 #define FD_SET(n,p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
3475 #define FD_CLR(n,p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
3478 #define FD_ISSET(n,p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
3479 #endif /* FD_ISSET */
3481 #define FD_COPY(f,t) (bcopy(f,t,sizeof(*(f)))
3482 #endif /* FD_COPY */
3484 #define FD_ZERO(p) bzero((char *)(p),sizeof(*(p)))
3485 #endif /* FD_ZERO */
3486 #endif /* NEEDSELECTDEFS */
3489 CK_NEED_SIG is defined if the system cannot check the console to
3490 to see if characters are waiting. This is used during local-mode file
3491 transfer to interrupt the transfer, refresh the screen display, etc.
3492 If CK_NEED_SIG is defined, then file-transfer interruption characters
3493 have to be preceded a special character, e.g. the SIGQUIT character.
3494 CK_NEED_SIG should be defined if the conchk() function is not operational.
3496 #ifdef NOPOLL /* For overriding CK_POLL definition */
3499 #endif /* CK_POLL */
3502 #ifndef CK_POLL /* If we don't have poll() */
3503 #ifndef RDCHK /* And we don't have rdchk() */
3504 #ifndef SELECT /* And we don't have select() */
3511 #endif /* datageneral */
3517 #endif /* CK_NEED_SIG */
3521 #endif /* CK_POLL */
3523 #ifdef HPUX /* HP-UX has select() */
3526 #endif /* CK_NEED_SIG */
3529 #ifdef AIXRS /* AIX has select() */
3532 #endif /* CK_NEED_SIG */
3535 #ifdef BSD44 /* 4.4BSD has FIONREAD */
3538 #endif /* CK_NEED_SIG */
3541 #ifdef QNX /* QNX has FIONREAD and select() */
3544 #endif /* CK_NEED_SIG */
3550 #endif /* NOTIMEZONE */
3551 #endif /* COHERENT */
3554 #ifndef HAVE_TZ /* Can we use struct timezone? */
3565 #endif /* BELLV10 */
3566 #endif /* COHERENT */
3569 #endif /* NOTIMEZONE */
3570 #endif /* HAVE_TZ */
3571 #ifndef NOTIMEVAL /* Can we use struct timeval? */
3574 #endif /* HAVE_TV */
3575 #endif /* NOTIMEVAL */
3579 #endif /* HAVE_TZ */
3580 #endif /* NOTIMEZONE */
3586 #endif /* HAVE_TV */
3589 #endif /* HAVE_TZ */
3592 #endif /* NOTIMEVAL */
3595 #endif /* NOTIMEZONE */
3601 #endif /* HAVE_TV */
3604 #endif /* HAVE_TZ */
3607 #endif /* NOTIMEVAL */
3610 #endif /* NOTIMEZONE */
3611 #endif /* ATT7300 */
3614 Automatic parity detection.
3615 This actually implies a lot more now: length-driven packet reading,
3616 "Doomsday Kermit" IBM Mainframe file transfer through 3270 data streams, etc.
3618 #ifdef UNIX /* For Unix */
3621 #endif /* NOPARSEN */
3624 #ifdef VMS /* ... and VMS */
3627 #endif /* NOPARSEN */
3630 #endif /* __GNUC__ */
3633 #ifdef MAC /* and Macintosh */
3636 #endif /* NOPARSEN */
3639 #ifdef STRATUS /* and Stratus VOS */
3642 #endif /* NOPARSEN */
3643 #endif /* STRATUS */
3645 #ifdef OS2 /* and OS/2, finally */
3648 #endif /* NOPARSEN */
3651 #ifndef NODYNAMIC /* DYNAMIC is default for UNIX */
3652 #ifndef DYNAMIC /* as of C-Kermit 7.0 */
3656 #endif /* DYNAMIC */
3657 #endif /* NODYNAMIC */
3659 #ifdef DYNAMIC /* If DYNAMIC is defined */
3660 #define DCMDBUF /* then also define this. */
3661 #endif /* DYNAMIC */
3663 #ifndef CK_LBRK /* Can send Long BREAK */
3665 #ifdef UNIX /* (everybody but OS-9) */
3673 #endif /* datageneral */
3685 #endif /* STRATUS */
3687 #endif /* CK_LBRK */
3689 /* Carrier treatment */
3690 /* These are defined here because they are shared by the system dependent */
3691 /* and the system independent modules. */
3693 #define CAR_OFF 0 /* Off: ignore carrier always. */
3694 #define CAR_ON 1 /* On: heed carrier always, except during DIAL. */
3695 #define CAR_AUT 2 /* Auto: heed carrier, but only if line is declared */
3696 /* to be a modem line, and only during CONNECT. */
3698 /* And more generically (for use with any ON/OFF/AUTO feature) */
3705 Serial interface speeds available.
3707 As of C-Kermit 6.1 there is a new method to get the supported
3708 speeds, which obviates the need for all the craziness below. At runtime,
3709 just call the new ttspdlist() routine to get a list of supported speeds.
3710 Then the user interface module can build a keyword table or menu from it.
3713 #ifdef UNIX /* For now, only for UNIX */
3714 #ifndef OLINUXHISPEED /* But not systems with hacks for */
3715 #ifndef MINIX /* high speeds, like 110 = 115200 */
3718 #endif /* OLINUXHISPEED */
3721 #define TTSPDLIST /* VMS gets it too */
3724 #endif /* TTSPDLIST */
3726 #ifndef NODIAL /* Hangup by modem command */
3731 #endif /* NOMDMHUP */
3735 #ifndef NOLOGDIAL /* Connection log needs mjd(), etc. */
3737 #endif /* NOLOGDIAL */
3744 #ifndef NOLOGDIAL /* Connection log */
3746 #define CXLOGFILE "CX.LOG" /* Default connection log file name */
3747 #endif /* CXLOGFILE */
3751 #define CXLOGBUFL 1024 /* Connection log record buffer size */
3752 #endif /* CK_SMALL */
3753 #endif /* NOLOGDIAL */
3754 #endif /* CKLOGDIAL */
3756 #endif /* NOLOCAL */
3758 #ifdef NOTTSPDLIST /* Except if NOTTSPDLIST is defined */
3761 #endif /* TTSPDLIST */
3762 #endif /* NOTTSPDLIST */
3766 _PROTOTYP( long * ttspdlist, (void) );
3768 #else /* TTSPDLIST not defined */
3770 We must use a long and convoluted series of #ifdefs that have to be kept in
3771 sync with the code in the ck?tio.c module.
3773 We assume that everybody supports: 0, 110, 300, 600, 1200, 2400, 4800, and
3774 9600 bps. Symbols for other speeds are defined here. You can also add
3775 definitions on the CC command lines. These definitions affect the SET SPEED
3776 keyword table, and are not necessarily usable in the system-dependent
3777 speed-setting code in the ck?tio.c modules, which depends on system-specific
3778 symbols like (in UNIX) B19200. In other words, just defining it doesn't
3779 mean it'll work -- you also have to supply the supporting code in ttsspd()
3780 and ttgspd() in ck?tio.c.
3782 The symbols have the form BPS_xxxx, where xxxx is the speed in bits per
3783 second, or (for bps values larger than 9999) thousands of bps followed by K.
3784 The total symbol length should be 8 characters or less. Some values are
3785 enabled automatically below. You can disable a particular value by defining
3786 NOB_xxxx on the CC command line.
3791 #define BPS_50 /* 50 bps */
3795 #define BPS_75 /* 75 bps */
3800 #define BPS_7512 /* 75/1200 Split Speed */
3802 #endif /* NOB7512 */
3808 #undef BPS_134 /* 134.5 bps (IBM 2741) */
3809 #endif /* BPS_134 */
3813 #define BPS_150 /* 150 bps */
3817 #define BPS_200 /* 200 bps */
3822 #define BPS_1800 /* 1800 bps */
3832 #define BPS_3600 /* 3600 bps */
3838 #define BPS_7200 /* 7200 bps */
3839 #endif /* SOLARIS25 */
3844 #define BPS_14K /* 14400 bps */
3862 #endif /* NOB_14K */
3865 #define BPS_19K /* 19200 bps */
3876 #define BPS_28K /* 28800 bps */
3879 #define BPS_28K /* 28800 bps */
3884 #endif /* NOB_28K */
3887 #define BPS_38K /* 38400 bps */
3898 #define BPS_57K /* 57600 bps */
3939 #endif /* SCO_OSR504 */
3941 #endif /* BEOSORBEBOX */
3944 #endif /* __NetBSD__ */
3945 #endif /* __FreeBSD__ */
3946 #endif /* __386BSD__ */
3949 #endif /* __linux__ */
3952 #endif /* SOLARIS25 */
3954 #endif /* NOB_57K */
3965 #endif /* SOLARIS25 */
3967 #define BPS_76K /* 76800 bps */
3972 #endif /* __32BIT__ */
3982 #endif /* SCO_OSR504 */
3983 #endif /* NOB_76K */
3994 #endif /* SOLARIS25 */
3996 #define BPS_115K /* 115200 bps */
4019 #endif /* __32BIT__ */
4029 #endif /* SCO_OSR504 */
4031 #endif /* BEOSORBEBOX */
4033 #endif /* __NetBSD__ */
4034 #endif /* __FreeBSD__ */
4035 #endif /* __386BSD__ */
4036 #endif /* __linux__ */
4040 #endif /* NOB_115K */
4042 #ifndef NOB_230K /* 230400 bps */
4058 #endif /* __32BIT__ */
4062 #endif /* SOLARIS25 */
4063 #endif /* __linux__ */
4064 #endif /* SCO_OSR504 */
4066 #endif /* NOB_230K */
4068 #ifndef NOB_460K /* 460800 bps */
4078 #endif /* __32BIT__ */
4081 #endif /* __linux__ */
4082 #endif /* SCO_OSR504 */
4084 #endif /* NOB_460K */
4086 #ifndef NOB_921K /* 921600 bps */
4089 #endif /* SCO_OSR504 */
4090 #endif /* NOB_921K */
4092 #ifdef BPS_921K /* Maximum speed defined */
4093 #define MAX_SPD 921600L
4096 #define MAX_SPD 460800L
4099 #define MAX_SPD 230400L
4102 #define MAX_SPD 115200L
4105 #define MAX_SPD 76800L
4108 #define MAX_SPD 57600L
4111 #define MAX_SPD 38400L
4114 #define MAX_SPD 28800L
4117 #define MAX_SPD 19200L
4120 #define MAX_SPD 14400L
4122 #define MAX_SPD 9600L
4133 #endif /* TTSPDLIST */
4135 #ifndef CONGSPD /* Systems that can call congspd() */
4144 #endif /* STRATUS */
4145 #endif /* CONGSPD */
4147 /* Types of flow control available */
4149 #define CK_XONXOFF /* Everybody can do this, right? */
4151 #ifdef AMIGA /* Commodore Amiga */
4152 #define CK_RTSCTS /* has RTS/CTS */
4155 #ifdef SUN4S5 /* SunOS in System V environment */
4157 #else /* SunOS 4.0/4.1 in BSD environment */
4158 #ifdef SUNOS4 /* SunOS 4.0+later supports RTS/CTS */
4159 #ifdef SUNOS41 /* Easy in 4.1 and later */
4161 #else /* Harder in 4.0 */
4162 #ifndef __GNUC__ /* (see tthflow() in ckutio.c) */
4164 #define CK_RTSCTS /* Only if not using GNU gcc */
4165 #endif /* __GNUC__ */
4167 #endif /* SUNOS41 */
4171 #ifdef BSD44 /* And in 4.4 BSD, including BSDI */
4175 #ifdef TERMIOX /* Sys V R4 <termiox.h> */
4178 #endif /* CK_RTSCTS */
4181 #endif /* CK_DTRCD */
4183 #ifdef STERMIOX /* Sys V R4 <sys/termiox.h> */
4186 #endif /* CK_RTSCTS */
4189 #endif /* CK_DTRCD */
4190 #endif /* STERMIOX */
4191 #endif /* TERMIOX */
4193 #ifdef OXOS /* Olivetti X/OS R2 struct termios */
4194 #define CK_RTSCTS /* Ditto. */
4198 #ifdef AIXRS /* RS/6000 with AIX 3.x */
4199 #define CK_RTSCTS /* Has its own peculiar method... */
4202 #ifdef __linux__ /* Linux */
4204 #endif /* __linux__ */
4206 Hardware flow control is not defined in POSIX.1. Nevertheless, a certain
4207 style API for hardware flow control, using tcsetattr() and the CRTSCTS
4208 bit(s), seems to be gaining currency on POSIX-based UNIX systems. The
4209 following code defines the symbol POSIX_CRTSCTS for such systems.
4212 #ifdef __bsdi__ /* BSDI, a.k.a. BSD/386 */
4213 #define POSIX_CRTSCTS
4214 #endif /* __bsdi__ */
4215 #ifdef __linux__ /* Linux */
4216 #define POSIX_CRTSCTS
4217 #endif /* __linux__ */
4218 #ifdef __NetBSD__ /* NetBSD */
4219 #define POSIX_CRTSCTS
4220 #endif /* __NetBSD__ */
4222 #define POSIX_CRTSCTS
4223 #endif /* __OpenBSD__ */
4224 #ifdef BEOSORBEBOX /* BeBOX */
4225 #define POSIX_CRTSCTS
4226 /* BEBOX defines CRTSFL as (CTSFLOW & RTSFLOW) */
4227 #define CRTSCTS CRTSFL
4228 #endif /* BEOSORBEBOX */
4229 #ifdef IRIX52 /* IRIX 5.2 and later */
4230 #define POSIX_CRTSCTS
4231 #define CRTSCTS CNEW_RTSCTS /* See <sys/termios.h> */
4233 #endif /* CK_RTSCTS */
4235 /* Implementations that have implemented the ttsetflow() function. */
4237 #ifndef CK_TTSETFLOW
4239 #define CK_TTSETFLOW
4242 #define CK_TTSETFLOW
4244 #endif /* CK_TTSETFLOW */
4247 _PROTOTYP( int ttsetflow, (int) );
4248 #endif /* CK_TTSETFLOW */
4250 Systems where we can expand tilde at the beginning of file or directory names
4272 #ifdef HPUX /* I don't know why this is */
4273 #ifndef DTILDE /* necessary, since -DHPUX */
4274 #define DTILDE /* automatically defines ATTSV */
4275 #endif /* DTILDE */ /* (see above) ... */
4279 This is mainly for the benefit of ckufio.c (UNIX and OS/2 file support).
4280 Systems that have an atomic rename() function, so we don't have to use
4281 link() and unlink().
4299 #endif /* SUNOS41 */
4319 #ifdef NORENAME /* Allow for compile-time override */
4323 #endif /* NORENAME */
4325 #ifdef STRATUS /* Stratus VOS */
4329 #endif /* STRATUS */
4331 /* Line delimiter for text files */
4334 If the system uses a single character for text file line delimitation,
4335 define NLCHAR to the value of that character. For text files, that
4336 character will be converted to CRLF upon output, and CRLF will be converted
4337 to that character on input during text-mode (default) packet operations.
4339 #ifdef MAC /* Macintosh */
4342 #ifdef OSK /* OS-9/68K */
4344 #else /* All Unix-like systems */
4350 At this point, if there's a system that uses ordinary CRLF line
4351 delimitation AND the C compiler actually returns both the CR and
4352 the LF when doing input from a file, then #undef NLCHAR.
4354 #ifdef OS2 /* OS/2 */
4358 #ifdef GEMDOS /* Atari ST */
4363 VMS file formats are so complicated we need to do all the conversion
4364 work in the CKVFIO module, so we tell the rest of C-Kermit not to fiddle
4372 /* The device name of a job's controlling terminal */
4373 /* Special for VMS, same for all Unixes (?), not used by Macintosh */
4376 #define CTTNAM dftty
4379 #define CTTNAM "SYS$INPUT:" /* (4 Jan 2002) Was TT: */
4382 #define CTTNAM "@output"
4385 extern char myttystr[];
4386 #define CTTNAM myttystr
4389 #define CTTNAM "con"
4392 #define CTTNAM "/dev/tty"
4395 #define CTTNAM "aux:"
4398 extern char myttystr[];
4399 #define CTTNAM myttystr
4400 #else /* Anyone else... */
4401 #define CTTNAM "stdout" /* This is a kludge used by Mac */
4402 #endif /* STRATUS */
4407 #endif /* datageneral */
4419 #endif /* HAVECTTNAM */
4421 #ifndef ZFCDAT /* zfcdat() function available? */
4443 #endif /* datageneral */
4447 #endif /* STRATUS */
4452 #define tolower _tolower
4453 #define toupper _toupper
4454 #endif /* SUNS4S5 */
4459 #ifdef _CRAYCOM /* Cray Computer Corp. */
4461 #else /* _CRAYCOM */
4462 #include <errno.h> /* Cray Research UNICOS defines */
4463 /* errno as a function. */
4464 #endif /* _CRAYCOM */ /* OK for UNICOS 6.1 and 7.0. */
4466 #ifdef STRATUS /* Stratus VOS */
4468 #else /* not STRATUS */
4473 "glibc uses threads, kermit uses glibc; errno access is in Thread Local
4474 Storage (TLS) from glibc-3.2.2. ...a thread specific errno is being run in
4475 thread local storage relative to the %gs segment register, so some means to
4476 revector gets/puts needs to be done." - Jeff Johnson, Red Hat, Feb 2003.
4481 The following declaration would cause problems for VMS and OS/2, in which
4482 errno is an "extern volatile int noshare"...
4484 extern int errno; /* Needed by most modules. */
4485 #endif /* __GLIBC__ */
4488 #endif /* STRATUS */
4491 #ifdef pdp11 /* Try to make some space on PDP-11 */
4497 #endif /* NOCURSES */
4500 #endif /* NOBIGBUF */
4504 #ifndef BIGBUFOK /* Platforms with lots of memory */
4506 #ifdef QNX /* QNX */
4507 #ifndef QNX16 /* But not 16-bit versions */
4516 #ifdef STRATUS /* Stratus VOS */
4518 #endif /* STRATUS */
4520 #ifdef sparc /* SPARC processors */
4524 #ifdef mips /* MIPS processors */
4528 #ifdef HPUX9 /* HP-UX 9.x */
4532 #ifdef HPUX10 /* HP-UX 10.0 PA-RISC */
4536 #ifdef NEXT /* NeXTSTEP */
4537 #ifdef mc68000 /* on NEXT platforms... */
4539 #endif /* mc68000 */
4542 #ifdef LINUX /* Linux in 1998 should be OK */
4545 #endif /* BIGBUFOK */
4548 #ifdef OS2 /* 32-bit OS/2 2.x and above */
4551 #endif /* __32BIT__ */
4557 #ifdef Plan9 /* Plan 9 is OK */
4561 #ifdef VMS /* Any VMS is OK */
4564 #endif /* BIGBUFOK */
4567 #ifdef __alpha /* DEC 64-bit Alpha, e.g. OSF/1 */
4568 #ifndef BIGBUFOK /* Might already be defined for VMS */
4570 #endif /* BIGBUFOK */
4571 #endif /* __alpha */
4573 #ifdef sgi /* SGI with IRIX 4.0 or later */
4576 #endif /* BIGBUFOK */
4579 #ifdef AIXRS /* AIX on RISC */
4583 #ifdef CK_SCOV5 /* SCO OSR5 */
4586 #endif /* BIGBUFOK */
4587 #endif /* CK_SCOV5 */
4589 #ifdef SOLARIS /* Solaris x86 */
4592 #endif /* BIGBUFOK */
4593 #endif /* SOLARIS */
4595 #endif /* BIGBUFOK */
4596 #endif /* NOBIGBUF */
4601 #endif /* BIGBUFOK */
4602 #endif /* CK_SMALL */
4604 /* If "memory is no problem" then this improves performance */
4610 #endif /* IFDEBUG */
4611 #endif /* BIGBUFOK */
4615 /* Compile all the debug() statements away. Saves a lot of space and time. */
4616 #define debug(a,b,c,d)
4617 #define hexdump(a,b,c)
4618 /* Now define the debug() macro. */
4620 _PROTOTYP(int dodebug,(int,char *,char *,long));
4621 _PROTOTYP(int dohexdump,(CHAR *,CHAR *,int));
4623 /* Use this form to avoid function calls: */
4625 #define debug(a,b,c,d) if (deblog) dodebug(a,b,(char *)(c),(long)d)
4626 #define hexdump(a,b,c) if (deblog) dohexdump((CHAR *)(a),(CHAR *)(b),c)
4629 #define debug(a,b,c,d) ((void)(deblog?dodebug(a,b,(char *)(c),(long)d):0))
4630 #define hexdump(a,b,c) ((void)(deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0))
4632 #define debug(a,b,c,d) (deblog?dodebug(a,b,(char *)(c),(long)d):0)
4633 #define hexdump(a,b,c) (deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0)
4634 #endif /* CK_ANSIC */
4635 #endif /* COMMENT */
4637 /* Use this form to save space: */
4638 #define debug(a,b,c,d) dodebug(a,b,(char *)(c),(long)d)
4639 #define hexdump(a,b,c) dohexdump((CHAR *)(a),(CHAR *)(b),c)
4640 #endif /* IFDEBUG */
4643 /* File System Defaults */
4645 #ifndef UIDBUFLEN /* Length of User ID */
4647 #define UIDBUFLEN 256
4650 #define UIDBUFLEN 256
4652 #define UIDBUFLEN 64
4653 #endif /* BIGBUFOK */
4655 #endif /* UIDBUFLEN */
4665 #define MAXWLD 102400
4668 #endif /* BIGBUFOK */
4673 #define MAXWLD 102400 /* Maximum wildcard filenames */
4680 #endif /* STRATUS */
4681 #endif /* datageneral */
4693 /* Communication device / network host name length */
4696 #define TTNAMLEN 512
4699 #define TTNAMLEN 256
4702 #define TTNAMLEN 128
4705 #endif /* CK_SMALL */
4707 #endif /* BIGBUFOK */
4709 /* Program return codes for DECUS C and UNIX (VMS uses UNIX codes) */
4712 #define GOOD_EXIT IO_NORMAL
4713 #define BAD_EXIT IO_ERROR
4719 /* Special hack for Fortune, which doesn't have <sys/file.h>... */
4726 /* Special hack for OS-9/68k */
4729 #define SIGALRM 30 /* May always cancel I/O */
4731 #define SIGARB 1234 /* Arbitrary for I/O */
4732 SIGTYP (*signal())();
4738 #endif /* putchar */
4739 #define putchar(c) (putc(c,stdout)!=EOF)&&fflush(stdout)
4742 #ifdef datageneral /* Data General AOS/VS */
4745 #endif /* putchar */
4746 #define putchar(c) conoc(c)
4747 #endif /* datageneral */
4749 /* Escape/quote character used by the command parser */
4753 /* Symbols for RS-232 modem signals */
4755 #define KM_FG 1 /* Frame ground */
4756 #define KM_TXD 2 /* Transmit */
4757 #define KM_RXD 3 /* Receive */
4758 #define KM_RTS 4 /* Request to Send */
4759 #define KM_CTS 5 /* Clear to Send */
4760 #define KM_DSR 6 /* Data Set Ready */
4761 #define KM_SG 7 /* Signal ground */
4762 #define KM_DCD 8 /* Carrier Detect */
4763 #define KM_DTR 20 /* Data Terminal Ready */
4764 #define KM_RI 22 /* Ring Indication */
4766 /* Bit mask values for modem signals */
4768 #define BM_CTS 0001 /* Clear to send (From DCE) */
4769 #define BM_DSR 0002 /* Dataset ready (From DCE) */
4770 #define BM_DCD 0004 /* Carrier (From DCE) */
4771 #define BM_RNG 0010 /* Ring Indicator (From DCE) */
4772 #define BM_DTR 0020 /* Data Terminal Ready (From DTE) */
4773 #define BM_RTS 0040 /* Request to Send (From DTE) */
4775 /* Codes for full duplex flow control */
4777 #define FLO_NONE 0 /* None */
4778 #define FLO_XONX 1 /* Xon/Xoff (soft) */
4779 #define FLO_RTSC 2 /* RTS/CTS (hard) */
4780 #define FLO_DTRC 3 /* DTR/CD (hard) */
4781 #define FLO_ETXA 4 /* ETX/ACK (soft) */
4782 #define FLO_STRG 5 /* String-based (soft) */
4783 #define FLO_DIAL 6 /* DIALing kludge */
4784 #define FLO_DIAX 7 /* Cancel dialing kludge */
4785 #define FLO_DTRT 8 /* DTR/CTS (hard) */
4786 #define FLO_KEEP 9 /* Keep, i.e. don't touch or change */
4787 #define FLO_AUTO 10 /* Figure out automatically */
4789 /* Types of connections */
4791 #define CXT_REMOTE 0 /* Remote mode - no connection */
4792 #define CXT_DIRECT 1 /* Direct serial connection */
4793 #define CXT_MODEM 2 /* Modem dialout */
4794 #define CXT_TCPIP 3 /* TCP/IP - Telnet, Rlogin, etc */
4795 #define CXT_X25 4 /* X.25 peer-to-peer */
4796 #define CXT_DECNET 5 /* DECnet (CTERM, etc) */
4797 #define CXT_LAT 6 /* LAT */
4798 #define CXT_NETBIOS 7 /* NETBIOS */
4799 #define CXT_NPIPE 8 /* Named Pipe */
4800 #define CXT_PIPE 9 /* Pipe, Command, PTY, DLL, etc */
4801 #define CXT_SSH 10 /* SSH */
4802 #define CXT_MAX 10 /* Highest connection type */
4804 /* Autodownload Detection Options */
4806 #define ADL_PACK 0 /* Auto-Download detect packet */
4807 #define ADL_STR 1 /* Auto-Download detect string */
4809 /* And finally... */
4811 #ifdef COMMENT /* Make sure this is NOT defined! */
4813 #endif /* COMMENT */
4815 /* zstr zattr filinfo were here (moved to top for DECC 5 Jun 2000) */
4817 #ifndef ZFNQFP /* Versions that have zfnqfp() */
4832 #endif /* STRATUS */
4833 #endif /* datageneral */
4838 int len; /* Length of full pathname */
4839 char * fpath; /* Pointer to full pathname */
4840 char * fname; /* Pointer to name part */
4844 /* Systems that support FILE TYPE LABELED */
4854 #endif /* __32BIT__ */
4858 /* LABELED FILE options bitmask */
4860 #ifdef VMS /* For VMS */
4861 #define LBL_NAM 1 /* Ignore incoming name if set */
4862 #define LBL_PTH 2 /* Use complete path if set */
4863 #define LBL_ACL 4 /* Preserve ACLs if set */
4864 #define LBL_BCK 8 /* Preserve backup date if set */
4865 #define LBL_OWN 16 /* Preserve ownership if set */
4869 #ifdef OS2 /* Ditto for OS/2 */
4870 #define LBL_NOR 0x0000 /* Normal file */
4871 #define LBL_ARC 0x0020 /* Archive */
4872 #define LBL_DIR 0x0010 /* Directory */
4873 #define LBL_HID 0x0002 /* Hidden file */
4874 #define LBL_RO 0x0001 /* Read only file */
4875 #define LBL_SYS 0x0004 /* System file */
4876 #define LBL_EXT 0x0040 /* Extended */
4881 Data types. First the header file for data types so we can pick up the
4882 types used for pids, uids, and gids. Override this section by putting
4883 -DCKTYP_H=xxx on the command line to specify the header file where your
4884 system defines these types.
4890 #endif /* MULTINET */
4891 #endif /* __ALPHA */
4893 #ifdef CK_TGV_AXP /* Alpha, VMS, MultiNet */
4895 Starting in DECC 5.0, <stdlib.h> no longer includes <types.h>.
4896 But before that an elaborate workaround is required, which results in
4897 including <types.h> sometimes but not others, evidently depending on whether
4898 <types.h> protects itself against multiple inclusion, which in turn probably
4899 differentiates between DECC <types.h> and TGV <types.h>. Unfortunately I
4900 don't remember the details. (fdc, 25 Oct 96)
4904 Previously the test here was for DEC version prior to 4.0, but since the
4905 test involved an "#if" statement, it was not portable and broke some non-VMS
4906 builds. In any case, condition was never satisfied, so the result of
4907 commenting this section out is the same as the previous "#if" condition.
4909 #ifndef __TYPES_LOADED
4910 #define __TYPES_LOADED /* Work around bug in .h files */
4911 #endif /* __TYPES_LOADED */
4912 #endif /* COMMENT */
4913 #include <sys/types.h>
4916 #include <if.h> /* Needed to put up u_int typedef */
4917 #endif /* MULTINET */
4918 #else /* IF_DOT_H */
4920 typedef unsigned int u_int;
4921 #endif /* NEEDUINT */
4922 #endif /* IF_DOT_H */
4923 #else /* !CK_TGV_AXP */
4924 #ifdef OSK /* OS-9 */
4926 #else /* General case, not OS-9 */
4931 #define CKTYP_H <sys/types.h>
4935 #endif /* CKTYP_H */
4944 #include <sys/types.h>
4947 #ifdef CKTYP_H /* Include it. */
4948 #ifdef COHERENT /* Except for COHERENT */
4950 #include <sys/types.h>
4952 #ifdef datageneral /* AOS/VS */
4953 #include <sys/types.h>
4954 #else /* All others */
4955 #ifdef __bsdi__ /* BSDI */
4957 #undef _POSIX_SOURCE
4959 #endif /* __bsdi__ */
4963 #define _POSIX_SOURCE
4965 #endif /* __bsdi__ */
4966 #endif /* datageneral */
4967 #endif /* COHERENT */
4968 #endif /* CKTYP_H */
4971 #endif /* CK_TGV_AXP */
4972 #endif /* STRATUS */ /* End of types.h section */
4975 Data type for pids. If your system uses a different type, put something
4976 like -DPID_T=pid_t on command line, or override here.
4982 Data types for uids and gids. Same deal as for pids.
4983 Wouldn't be nice if there was a preprocessor test to find out if a
4987 /* Not used in VMS so who cares */
4993 /* Or would it be better (or worse?) to use _POSIX_SOURCE here? */
5000 #else /* Not POSIX */
5002 /* SVR4 and later have uid_t and gid_t. */
5003 /* SVR3 and earlier use int, or unsigned short, or.... */
5010 #else /* Not SVR4 */
5018 #else /* Not BSD43 */
5019 /* Default these to int for older UNIX versions */
5031 getpwuid() arg type, which is not necessarily the same as UID_T,
5032 e.g. in SCO UNIX SVR3, it's int.
5035 #define PWID_T UID_T
5047 #ifdef MACHWAIT /* WAIT_T argument for wait() */
5048 #include <sys/wait.h>
5050 typedef union wait WAIT_T;
5054 /* OSF wait.h defines BSD wait if _BSD is defined so hide _BSD from wait.h */
5060 #include <sys/wait.h>
5065 #ifdef CK_OSF_BSD /* OSF/1: Restore _BSD definition */
5068 #endif /* CK_OSF_BSD */
5072 #endif /* MACHWAIT */
5075 #endif /* CK_REDIR */
5077 /* Assorted other blah_t's handled here... */
5080 #define SIZE_T size_t
5083 /* Forward declarations of system-dependent functions callable from all */
5084 /* C-Kermit modules. */
5086 /* File-related functions from system-dependent file i/o module */
5089 /* For some reason, this does not agree with DEC C */
5090 _PROTOTYP( int zkself, (void) );
5091 #endif /* CKVFIO_C */
5092 _PROTOTYP( int zopeni, (int, char *) );
5093 _PROTOTYP( int zopeno, (int, char *, struct zattr *, struct filinfo *) );
5094 _PROTOTYP( int zclose, (int) );
5096 _PROTOTYP( int zchin, (int, int *) );
5098 _PROTOTYP( int zxin, (int, char *, int) );
5099 _PROTOTYP( int zsinl, (int, char *, int) );
5100 _PROTOTYP( int zinfill, (void) );
5101 _PROTOTYP( int zsout, (int, char*) );
5102 _PROTOTYP( int zsoutl, (int, char*) );
5103 _PROTOTYP( int zsoutx, (int, char*, int) );
5104 _PROTOTYP( int zchout, (int, char) );
5105 _PROTOTYP( int zoutdump, (void) );
5106 _PROTOTYP( int zsyscmd, (char *) );
5107 _PROTOTYP( int zshcmd, (char *) );
5109 _PROTOTYP( int zsetfil, (int, int) );
5110 _PROTOTYP( int zchkpid, (unsigned long) );
5113 _PROTOTYP( VOID z_exec, (char *, char **, int) );
5115 _PROTOTYP( int chkfn, (int) );
5116 _PROTOTYP( long zchki, (char *) );
5118 _PROTOTYP( long zgetfs, (char *) );
5121 _PROTOTYP( long zgetfs, (char *) );
5123 #define zgetfs(a) zchki(a)
5125 #endif /* VMSORUNIX */
5126 _PROTOTYP( int iswild, (char *) );
5127 _PROTOTYP( int isdir, (char *) );
5128 _PROTOTYP( int zchko, (char *) );
5129 _PROTOTYP( int zdelet, (char *) );
5130 _PROTOTYP( VOID zrtol, (char *,char *) );
5131 _PROTOTYP( VOID zltor, (char *,char *) );
5132 _PROTOTYP( VOID zstrip, (char *,char **) );
5134 _PROTOTYP( char * zrelname, (char *, char *) );
5136 _PROTOTYP( int zchdir, (char *) );
5137 _PROTOTYP( char * zhome, (void) );
5138 _PROTOTYP( char * zgtdir, (void) );
5139 _PROTOTYP( int zxcmd, (int, char *) );
5141 _PROTOTYP( int zclosf, (int) );
5144 _PROTOTYP( int nzxpand, (char *, int) );
5146 _PROTOTYP( int zxpand, (char *) );
5147 #endif /* NZXPAND */
5148 _PROTOTYP( int znext, (char *) );
5150 _PROTOTYP( int zxrewind, (void) );
5151 #endif /* ZXREWIND */
5152 _PROTOTYP( int zchkspa, (char *, long) );
5153 _PROTOTYP( VOID znewn, (char *, char **) );
5154 _PROTOTYP( int zrename, (char *, char *) );
5155 _PROTOTYP( int zcopy, (char *, char *) );
5156 _PROTOTYP( int zsattr, (struct zattr *) );
5157 _PROTOTYP( int zfree, (char *) );
5158 _PROTOTYP( char * zfcdat, (char *) );
5159 _PROTOTYP( int zstime, (char *, struct zattr *, int) );
5161 _PROTOTYP( char * zgperm, (char *) );
5162 _PROTOTYP( char * ziperm, (char *) );
5163 #endif /* CK_PERMS */
5164 _PROTOTYP( int zmail, (char *, char *) );
5165 _PROTOTYP( int zprint, (char *, char *) );
5166 _PROTOTYP( char * tilde_expand, (char *) );
5167 _PROTOTYP( int zmkdir, (char *) ) ;
5168 _PROTOTYP( int zfseek, (long) ) ;
5170 _PROTOTYP( struct zfnfp * zfnqfp, (char *, int, char * ) ) ;
5172 #define zfnqfp(a,b,c) ckstrncpy(c,a,b)
5174 _PROTOTYP( int zvuser, (char *) ) ;
5175 _PROTOTYP( int zvpass, (char *) ) ;
5176 _PROTOTYP( VOID zvlogout, (void) ) ;
5178 _PROTOTYP( int os2setlongname, ( char * fn, char * ln ) ) ;
5179 _PROTOTYP( int os2getlongname, ( char * fn, char ** ln ) ) ;
5180 _PROTOTYP( int os2rexx, ( char *, char *, int ) ) ;
5181 _PROTOTYP( int os2rexxfile, ( char *, char *, char *, int) ) ;
5182 _PROTOTYP( int os2geteas, (char *) ) ;
5183 _PROTOTYP( int os2seteas, (char *) ) ;
5184 _PROTOTYP( char * get_os2_vers, (void) ) ;
5185 _PROTOTYP( int do_label_send, (char *) ) ;
5186 _PROTOTYP( int do_label_recv, (void) ) ;
5188 _PROTOTYP( unsigned long os2_mouseon, (void) );
5189 _PROTOTYP( unsigned long os2_mousehide, (void) );
5190 _PROTOTYP( unsigned long os2_mouseshow, (void) );
5191 _PROTOTYP( unsigned long os2_mouseoff, (void) );
5192 _PROTOTYP( void os2_mouseevt, (void *) );
5193 _PROTOTYP( int mousebuttoncount, (void));
5194 #endif /* OS2MOUSE */
5197 /* Functions from system-dependent terminal i/o module */
5199 _PROTOTYP( int ttopen, (char *, int *, int, int) ); /* tty functions */
5201 _PROTOTYP( int ttclos, (int) );
5203 _PROTOTYP( int tthang, (void) );
5204 _PROTOTYP( int ttres, (void) );
5205 _PROTOTYP( int ttpkt, (long, int, int) );
5207 _PROTOTYP( int ttvt, (long, int) );
5209 _PROTOTYP( int ttsspd, (int) );
5210 _PROTOTYP( long ttgspd, (void) );
5211 _PROTOTYP( int ttflui, (void) );
5212 _PROTOTYP( int ttfluo, (void) );
5213 _PROTOTYP( int ttpushback, (CHAR *, int) );
5214 _PROTOTYP( int ttpeek, (void) );
5215 _PROTOTYP( int ttgwsiz, (void) );
5216 _PROTOTYP( int ttchk, (void) );
5217 _PROTOTYP( int ttxin, (int, CHAR *) );
5218 _PROTOTYP( int ttxout, (CHAR *, int) );
5219 _PROTOTYP( int ttol, (CHAR *, int) );
5220 _PROTOTYP( int ttoc, (char) );
5221 _PROTOTYP( int ttinc, (int) );
5222 _PROTOTYP( int ttscarr, (int) );
5223 _PROTOTYP( int ttgmdm, (void) );
5224 _PROTOTYP( int ttsndb, (void) );
5225 _PROTOTYP( int ttsndlb, (void) );
5227 _PROTOTYP( char * ttglckdir, (void) );
5231 _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
5234 _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
5237 _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
5240 _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
5243 _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
5245 _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR) );
5248 #endif /* STRATUS */
5251 #else /* ! PARSENSE */
5252 _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR) );
5253 #endif /* PARSENSE */
5255 /* XYZMODEM support */
5258 CK_XYZ enables the various commands and data structures.
5259 XYZ_INTERNAL means these protocols are built-in; if not defined,
5260 then they are external. XYZ_DLL is used to indicate a separate
5261 loadable library containing the XYZmodem protocol code.
5263 #ifdef pdp11 /* No room for this in PDP-11 */
5267 #ifndef NOCKXYZ /* Alternative protocols */
5275 #define XYZ_INTERNAL /* Internal and DLL */
5277 #endif /* NOXYZDLL */
5281 #endif /* NOCKXYZ */
5283 #ifdef XYZ_INTERNAL /* This ensures that XYZ_INTERNAL */
5284 #ifndef CK_XYZ /* is defined only if CK_XYZ is too */
5287 #endif /* XYZ_INTERNAL */
5288 #ifdef XYZ_DLL /* This ensures XYZ_DLL is defined */
5289 #ifndef XYZ_INTERNAL /* only if XYZ_INTERNAL is too */
5291 #endif /* XYZ_INTERNAL */
5292 #endif /* XYZ_DLL */
5294 /* Console functions */
5296 _PROTOTYP( int congm, (void) );
5298 _PROTOTYP( VOID conint, (SIGTYP (*)(int, int), SIGTYP (*)(int, int)) );
5300 _PROTOTYP( VOID conint, (SIGTYP (*)(int), SIGTYP (*)(int)) );
5301 #endif /* COMMENT */
5302 _PROTOTYP( VOID connoi, (void) );
5303 _PROTOTYP( int concb, (char) );
5305 _PROTOTYP( long congspd, (void) );
5306 #endif /* CONGSPD */
5307 _PROTOTYP( int conbin, (char) );
5308 _PROTOTYP( int conres, (void) );
5309 _PROTOTYP( int conoc, (char) );
5310 _PROTOTYP( int conxo, (int, char *) );
5311 _PROTOTYP( int conol, (char *) );
5312 _PROTOTYP( int conola, (char *[]) );
5313 _PROTOTYP( int conoll, (char *) );
5314 _PROTOTYP( int conchk, (void) );
5315 _PROTOTYP( int coninc, (int) );
5316 _PROTOTYP( char * conkbg, (void) );
5317 _PROTOTYP( int psuspend, (int) );
5318 _PROTOTYP( int priv_ini, (void) );
5319 _PROTOTYP( int priv_on, (void) );
5320 _PROTOTYP( int priv_off, (void) );
5321 _PROTOTYP( int priv_can, (void) );
5322 _PROTOTYP( int priv_chk, (void) );
5323 _PROTOTYP( int priv_opn, (char *, int) );
5325 _PROTOTYP( int sysinit, (void) ); /* Misc Kermit functions */
5326 _PROTOTYP( int syscleanup, (void) );
5327 _PROTOTYP( int msleep, (int) );
5328 _PROTOTYP( VOID rtimer, (void) );
5329 _PROTOTYP( int gtimer, (void) );
5331 _PROTOTYP( VOID rftimer, (void) );
5332 _PROTOTYP( CKFLOAT gftimer, (void) );
5333 #endif /* GFTIMER */
5334 _PROTOTYP( VOID ttimoff, (void) );
5335 _PROTOTYP( VOID ztime, (char **) );
5336 _PROTOTYP( int parchk, (CHAR *, CHAR, int) );
5337 _PROTOTYP( VOID doexit, (int, int) );
5338 _PROTOTYP( int askmore, (void) );
5339 _PROTOTYP( VOID fatal, (char *) );
5340 _PROTOTYP( VOID fatal2, (char *, char *) );
5342 _PROTOTYP( int ck_cancio, (void) );
5345 /* Key mapping support */
5350 #endif /* NOSETKEY */
5356 #endif /* NOSETKEY */
5359 _PROTOTYP( int congks, (int) );
5361 /* OS2 requires these definitions even if SET KEY is not being supported */
5364 typedef CHAR *MACRO;
5365 extern int wideresult;
5369 Catch-all for systems where we don't know how to read keyboard scan
5373 /* Note: CHAR (i.e. unsigned char) is very important here. */
5375 typedef CHAR * MACRO;
5376 #define congks coninc
5377 #endif /* NOSETKEY */
5381 #ifndef NOKVERBS /* No \Kverbs unless... */
5383 #endif /* NOKVERBS */
5389 Note: this value chosen to be bigger than PC BIOS key modifier bits,
5390 but still fit in 16 bits without affecting sign.
5392 As of K95 1.1.5, this no longer fits in 16 bits, good thing we are 32 bit.
5394 #define F_MACRO 0x2000 /* Bit indicating a macro indice */
5395 #define IS_MACRO(x) (x & F_MACRO)
5396 #define F_KVERB 0x4000 /* Bit indicating a keyboard verb */
5397 #define IS_KVERB(x) (x & F_KVERB) /* Test this bit */
5399 #endif /* NOKVERBS */
5401 #define F_ESC 0x8000 /* Bit indicating ESC char combination */
5402 #define IS_ESC(x) (x & F_ESC)
5403 #define F_CSI 0x10000 /* Bit indicating CSI char combination */
5404 #define IS_CSI(x) (x & F_CSI)
5406 #ifdef NOSPL /* This might be overkill.. */
5407 #ifndef NOKVERBS /* Not all \Kverbs require */
5408 #define NOKVERBS /* the script programming language. */
5409 #endif /* NOKVERBS */
5412 #endif /* NOTAKEARGS */
5416 Function prototypes for system and library functions.
5418 #ifdef _POSIX_SOURCE
5424 #endif /* _POSIX_SOURCE */
5434 #ifdef STRATUS /* Stratus VOS uses ANSI libraries */
5436 #endif /* STRATUS */
5442 #endif /* NOCURSES */
5445 #define S_IFMT 0xF000
5446 #define timezone _timezone
5447 #endif /* __IBMC__ */
5453 #endif /* __32BIT__ */
5454 #include <sys/timeb.h>
5460 #endif /* SIGUSR1 */
5461 #define SIGALRM SIGUSR1
5462 _PROTOTYP( unsigned alarm, (unsigned) );
5463 _PROTOTYP( unsigned sleep, (unsigned) );
5464 #endif /* __EMX__ */
5465 _PROTOTYP( unsigned long zdskspace, (int) );
5466 _PROTOTYP( int zchdsk, (int) );
5467 _PROTOTYP( int conincraw, (int) );
5468 _PROTOTYP( int ttiscom, (int f) );
5469 _PROTOTYP( int IsFileNameValid, (char *) );
5470 _PROTOTYP( void ChangeNameForFAT, (char *) );
5471 _PROTOTYP( char *GetLoadPath, (void) );
5474 /* Fullscreen file transfer display items... */
5477 #ifdef CK_NCURSES /* CK_NCURSES implies CK_CURSES */
5480 #endif /* CK_CURSES */
5481 #endif /* CK_NCURSES */
5483 #ifdef MYCURSES /* MYCURSES implies CK_CURSES */
5486 #endif /* CK_CURSES */
5487 #endif /* MYCURSES */
5488 #endif /* NOCURSES */
5493 #endif /* CK_CURSES */
5496 #endif /* NODISPLAY */
5497 #endif /* NOCURSES */
5501 The CK_WREFRESH symbol is defined if the curses library provides
5502 clearok() and wrefresh() functions, which are used in repainting
5505 #ifdef NOWREFRESH /* Override CK_WREFRESH */
5507 #ifdef CK_WREFRESH /* If this is defined, */
5508 #undef CK_WREFRESH /* undefine it. */
5509 #endif /* CK_WREFRESH */
5511 #else /* !NOWREFRESH */ /* No override... */
5513 #ifndef CK_WREFRESH /* If CK_WREFRESH not defined */
5515 Automatically define it for systems known to have it ...
5517 #ifdef VMS /* DEC (Open)VMS has it */
5520 #ifdef ultrix /* DEC ULTRIX has it */
5522 #ifdef SVR3 /* System V has it */
5525 #ifdef BSD44 /* 4.4 BSD has it */
5528 #ifdef NEXT /* Define it for NeXTSTEP */
5531 #ifdef SUNOS4 /* SunOS 4.x... */
5534 #ifdef SOLARIS25 /* Solaris 2.5 and later */
5537 #ifdef AIXRS /* RS/6000 AIX ... */
5540 #ifdef RTAIX /* RT PC AIX ... */
5543 #ifdef OSF /* DEC OSF/1 ... */
5546 /* Add more here, or just define CK_WREFRESH on the CC command line... */
5551 #endif /* SOLARIS25 */
5559 #else /* CK_WREFRESH is defined */
5561 /* This is within an ifdef CK_CURSES block. The following is not needed */
5563 #ifndef CK_CURSES /* CK_WREFRESH implies CK_CURSES */
5565 #endif /* CK_CURSES */
5567 #endif /* CK_WREFRESH */
5568 #endif /* NOWREFRESH */
5572 #define TRMBUFL 16384
5575 #define TRMBUFL 8192
5577 #define TRMBUFL 1024
5578 #endif /* BIGBUFOK */
5579 #endif /* DYNAMIC */
5580 #endif /* TRMBUFL */
5581 #endif /* CK_CURSES */
5584 Whether to use ckmatch() in all its glory for C-Shell-like patterns.
5585 If CKREGEX is NOT defined, all but * and ? matching are removed from
5586 ckmatch(). NOTE: Defining CKREGEX does not necessarily mean that ckmatch()
5587 regexes are used for filename matching. That depends on whether zxpand()
5588 in ck?fio.c calls ckmatch(). NOTE 2: REGEX is a misnomer -- these are not
5589 regular expressions in the computer-science sense (in which, e.g. "a*b"
5590 matches 0 or more 'a' characters followed by 'b') but patterns (in which
5591 "a*b" matches 'a' followed by 0 or more non-b characters, followed by b).
5596 #endif /* CKREGEX */
5597 #endif /* NOCKREGEX */
5599 /* Learned-script feature */
5607 #endif /* NOLOCAL */
5609 #endif /* NOLEARN */
5614 #endif /* CKLEARN */
5615 #else /* !NOLEARN */
5618 /* In UNIX this can work only with ckucns.c builds */
5624 #endif /* OS2ORUNIX */
5625 #endif /* CKLEARN */
5626 #endif /* NOLEARN */
5630 #define LEARNBUFSIZ 128
5631 #endif /* LEARNBUFSIZ */
5632 #endif /* CKLEARN */
5635 #ifndef CKTIDLE /* Pseudo-keepalive in CONNECT */
5636 #ifdef OS2 /* In K95 */
5639 #ifdef UNIX /* In UNIX but only ckucns versions */
5643 #endif /* NOSELECT */
5644 #endif /* NOLEARN */
5647 #endif /* CKTIDLE */
5648 #endif /* IKSDONLY */
5652 String library functions.
5653 For ANSI C, get prototypes from <string.h>.
5654 Otherwise, skip the prototypes.
5659 Prototypes for other commonly used library functions, such as
5660 malloc, free, getenv, atol, atoi, and exit. Otherwise, no prototypes.
5663 #ifdef DIAB /* DIAB DS90 */
5664 /* #include <commonC.h> */
5665 #include <sys/wait.h>
5668 extern void exit(int status);
5669 extern void _exit(int status);
5670 extern int uname(struct utsname *name);
5671 #endif /* COMMENT */
5672 extern int chmod(char *path, int mode);
5673 extern int ioctl(int fildes, int request, ...);
5674 extern int rdchk(int ttyfd);
5675 extern int nap(int m);
5677 extern int getppid(void);
5678 #endif /* COMMENT */
5679 extern int _filbuf(FILE *stream);
5680 extern int _flsbuf(char c,FILE *stream);
5684 Prototypes for UNIX functions like access, alarm, chdir, sleep, fork,
5685 and pause. Otherwise, no prototypes.
5695 #else /* NoT NeXT */
5699 #include <c_utilities.h>
5700 #else /* !STRATUS */
5706 #endif /* HAVE_CRYPT_H */
5707 #endif /* STRATUS */
5712 #else /* Not ANSI libs... */
5722 #endif /* HPUXPRE65 */
5731 It is essential that these are declared correctly!
5732 Which is not always easy. Take malloc() for instance ...
5737 #define SIZE_T_MALLOC
5738 #endif /* __STDC__ */
5740 #endif /* PYRAMID */
5742 Maybe some other environments need the same treatment for malloc.
5743 If so, define SIZE_T_MALLOC for them here or in compiler CFLAGS.
5745 #ifdef SIZE_T_MALLOC
5746 _PROTOTYP( void * malloc, (size_t) );
5748 _PROTOTYP( char * malloc, (unsigned int) );
5749 #endif /* SIZE_T_MALLOC */
5751 _PROTOTYP( char * getenv, (char *) );
5752 _PROTOTYP( long atol, (char *) );
5754 #endif /* SUNOS41 */
5755 #endif /* CK_ANSILIBS */
5758 <sys/param.h> generally picks up NULL, MAXPATHLEN, and MAXNAMLEN
5759 and seems to present on all Unixes going back at least to SCO Xenix
5760 with the exception(s) noted.
5762 #ifndef NO_PARAM_H /* 2001-11-03 */
5763 #ifndef UNIX /* Non-Unixes don't have it */
5766 #ifdef TRS16 /* Tandy Xenix doesn't have it */
5770 #endif /* NO_PARAM_H */
5773 #ifndef INCL_PARAM_H
5774 #define INCL_PARAM_H
5775 #endif /* INCL_PARAM_H */
5776 #include <sys/param.h>
5777 #endif /* NO_PARAM_H */
5779 #ifndef NULL /* In case NULL is still not defined */
5781 /* or #define NULL 0 */
5782 /* or #define NULL ((char *) 0) */
5783 /* or #define NULL ((void *) 0) */
5786 /* Maximum length for a fully qualified filename, not counting \0 at end. */
5788 This is a rough cut, and errs on the side of being too big. We don't
5789 want to pull in hundreds of header files looking for many and varied
5790 symbols, for fear of introducing unnecessary conflicts.
5793 #ifdef MAXPATHLEN /* (it probably isn't) */
5794 #define CKMAXPATH MAXPATHLEN
5796 #ifdef PATH_MAX /* POSIX */
5797 #define CKMAXPATH PATH_MAX
5800 #define CKMAXPATH 63
5803 #define CKMAXPATH 255
5805 #ifdef UNIX /* Even though some are way less... */
5806 #define CKMAXPATH 1024
5809 #define CKMAXPATH 675 /* (derivation is complicated...) */
5812 #define CKMAXPATH 256 /* == $MXPL from PARU.H */
5815 #define CKMAXPATH 256 /* == $MXPL from PARU.H */
5817 #define CKMAXPATH 255
5818 #endif /* STRATUS */
5819 #endif /* datageneral */
5824 #endif /* PATH_MAX */
5825 #endif /* MAXPATHLEN */
5826 #endif /* CKMAXPATH */
5828 /* Maximum length for the name of a tty device */
5831 #define DEVNAMLEN CKMAXPATH
5832 #endif /* DEVNAMLEN */
5834 /* Directory (path segment) separator */
5835 /* Not fully general - Tricky for VMS, Amiga, ... */
5840 #define ISDIRSEP(c) ((c)=='/')
5844 #define ISDIRSEP(c) ((c)=='/'||(c)=='\\')
5848 #define ISDIRSEP(c) (((c)==':')||((c)=='^')||((c)=='='))
5852 #define ISDIRSEP(c) ((c)=='>')
5855 #define DIRSEP ']' /* (not really) */
5856 #define ISDIRSEP(c) ((c)==']'||(c)==':')
5860 #define ISDIRSEP(c) ((c)==':')
5864 #define ISDIRSEP(c) ((c)=='/'||(c)==':')
5868 #define ISDIRSEP(c) ((c)=='\\'||(c)==':')
5871 #define ISDIRSEP(c) ((c)=='/')
5876 #endif /* STRATUS */
5877 #endif /* datageneral */
5882 /* FILE package parameters */
5890 #define CKMAXOPEN 390
5893 #define CKMAXOPEN 64
5896 #define CKMAXOPEN OPEN_MAX
5899 #define CKMAXOPEN FOPEN_MAX
5901 #define CKMAXOPEN 64
5902 #endif /* FOPEN_MAX */
5903 #endif /* OPEN_MAX */
5906 #endif /* CKMAXOPEN */
5908 /* Maximum channels for FOPEN = CKMAXOPEN minus logs, stdio, etc */
5911 #define Z_MINCHAN 16
5912 #endif /* Z_MINCHAN */
5915 #define Z_MAXCHAN (CKMAXOPEN-ZNFILS-5)
5916 #endif /* Z_MAXCHAN */
5919 /* New-format nzltor() and nzrtol() functions that handle pathnames */
5933 #endif /* STRATUS */
5940 _PROTOTYP( VOID nzltor, (char *, char *, int, int, int) );
5941 _PROTOTYP( VOID nzrtol, (char *, char *, int, int, int) );
5944 /* Implementations with a zrmdir() function */
5958 #endif /* STRATUS */
5965 _PROTOTYP( int zrmdir, (char *) );
5973 #endif /* UNIXOROSK */
5975 extern int filecase;
5977 #endif /* FILECASE */
5979 /* Funny names for library functions department... */
5982 #define setjmp setret
5983 #define longjmp longret
5984 #define jmp_buf ret_buf
5985 #define getcwd curdir
5989 /* The C-runtime conflicts with things we do in Stratus VOS ckltio.c ... */
5990 #define printf vosprtf
5991 _PROTOTYP( int vosprtf, (char *fmt, ...) );
5992 #define perror(txt) printf("%s\n", txt)
5993 /* char_varying is a string type from PL/I that VOS uses extensively */
5994 #define CV char_varying
5995 #endif /* STRATUS */
5999 #define isWin95() (OSVer==VER_PLATFORM_WIN32_WINDOWS)
6001 #define isWin95() (0)
6014 #endif /* SESLIMIT */
6025 #define query ckquery
6026 #endif /* BEOSORBEBOX */
6028 #ifndef PTYORPIPE /* NETCMD and/or NETPTY defined */
6036 #endif /* PTYORPIPE */
6038 /* mktemp() and mkstemp() */
6044 #endif /* OS2ORUNIX */
6055 #endif /* __linux__ */
6057 #endif /* MKSTEMP */
6058 #endif /* NOMKSTEMP */
6060 #endif /* NOMKTEMP */
6062 /* Platforms that have memcpy() -- only after all headers included */
6103 #endif /* STRATUS */
6104 #endif /* datageneral */
6111 #endif /* SOLARIS */
6112 #endif /* __linux__ */
6116 #endif /* USE_MEMCPY */
6119 #define memcpy(a,b,c) ckmemcpy((a),(b),(c))
6122 /* Because the prototype isn't picked up in the normal header files */
6123 _PROTOTYP( void *memcpy, (void *, const void *, size_t));
6124 #endif /* CK_SCO32V4 */
6125 #endif /* USE_MEMCPY */
6127 /* User authentication for IKS -- So far K95 and UNIX only */
6132 #endif /* NOLOGIN */
6142 #endif /* CK_SCOV5 */
6143 #endif /* NOSHADOW */
6144 #endif /* CK_LOGIN */
6146 #define NTCREATETOKEN
6148 #endif /* OS2ORUNIX */
6152 #endif /* CK_LOGIN */
6153 #endif /* NOLOGIN */
6159 #ifdef CK_LOGIN /* Telnet protocol required */
6160 #ifndef TNCODE /* for login to IKSD. */
6163 #endif /* CK_LOGIN */
6165 #ifdef CK_AUTHENTICATION
6168 #endif /* NOSENDUID */
6169 #endif /* CK_AUTHENTICATION */
6171 #ifdef TNCODE /* Should TELNET send user ID? */
6175 #endif /* CKSENDUID */
6176 #endif /* NOSENDUID */
6179 /* UNIX platforms that don't have getusershell() */
6182 #ifndef NOGETUSERSHELL
6184 #define NOGETUSERSHELL
6187 #define NOGETUSERSHELL
6190 #define NOGETUSERSHELL
6193 #define NOGETUSERSHELL
6196 #define NOGETUSERSHELL
6199 #define NOGETUSERSHELL
6200 #endif /* COHERENT */
6201 #endif /* UNIXWARE */
6206 #endif /* NOGETUSERSHELL */
6214 #endif /* CKSYSLOG */
6215 #endif /* NOSYSLOG */
6221 #endif /* CKSYSLOG */
6222 #endif /* NOSYSLOG */
6228 #ifndef NOGETUSERSHELL
6229 #ifndef GETUSERSHELL
6230 #define GETUSERSHELL
6231 #endif /* GETUSERSHELL */
6232 #endif /* NOGETUSERSHELL */
6234 _PROTOTYP( int ckxlogin, (CHAR *, CHAR *, CHAR *, int));
6235 _PROTOTYP( int ckxlogout, (VOID));
6236 #endif /* CK_LOGIN */
6238 #ifndef NOZLOCALTIME /* zlocaltime() available. */
6241 _PROTOTYP( char * zlocaltime, (char *) );
6242 #endif /* OS2ORUNIX */
6243 #endif /* NOZLOCALTIME */
6245 #ifdef CKSYSLOG /* Syslogging levels */
6246 #define SYSLG_NO 0 /* No logging */
6247 #define SYSLG_LI 1 /* Login/out */
6248 #define SYSLG_DI 2 /* Dialing out */
6249 #define SYSLG_AC 3 /* Making any kind of connection */
6250 #define SYSLG_PR 4 /* Protocol Operations */
6251 #define SYSLG_FC 5 /* File creation */
6252 #define SYSLG_FA 6 /* File reading */
6253 #define SYSLG_CM 7 /* Top-level commands */
6254 #define SYSLG_CX 8 /* All commands */
6255 #define SYSLG_DB 9 /* Debug */
6256 #define SYSLGMAX 9 /* Highest level */
6257 #define SYSLG_DF SYSLG_FA /* Default level */
6258 /* Logging function */
6259 _PROTOTYP(VOID cksyslog,(int, int, char *, char *, char *));
6260 #endif /* CKSYSLOG */
6262 extern int ckxlogging, ckxsyslog, ikdbopen;
6267 /* Keyword Table Template */
6269 /* Note: formerly defined in ckucmd.h but now more widely used */
6271 struct keytab { /* Keyword table */
6272 char *kwd; /* Pointer to keyword string */
6273 int kwval; /* Associated value */
6274 int flgs; /* Flags (as defined above) */
6276 #endif /* CK_KEYTAB */
6279 _PROTOTYP( int do_pty, (char *));
6280 _PROTOTYP( VOID end_pty, (void));
6284 _PROTOTYP( int zsetroot, (char *) );
6285 _PROTOTYP( char * zgetroot, (void) );
6286 _PROTOTYP( int zinroot, (char *) );
6289 /* Local Echo Buffer prototypes */
6290 _PROTOTYP( VOID le_init, (void) );
6291 _PROTOTYP( VOID le_clean, (void));
6292 _PROTOTYP( int le_inbuf, (void));
6293 _PROTOTYP( int le_putstr, (CHAR *));
6294 _PROTOTYP( int le_puts, (CHAR *, int));
6295 _PROTOTYP( int le_putchar, (CHAR));
6296 _PROTOTYP( int le_getchar, (CHAR *));
6298 /* #ifndef NOHTTP */
6303 #endif /* OS2ORUNIX */
6307 #endif /* CMDATE2TM */
6308 #endif /* NOCMDATE2TM */
6311 _PROTOTYP( struct tm * cmdate2tm, (char *,int));
6312 #endif /* CMDATE2TM */
6313 /* #endif */ /* NOHTTP */
6315 #ifndef NOSETTIME /* This would be set in CFLAGS */
6316 #ifdef SVR4ORPOSIX /* Defined in IEEE 1003.1-1996 */
6317 #ifndef UTIMEH /* and in SVID for SVR4 */
6320 #else /* SVR4ORPOSIX */
6321 #ifdef OSF /* Verified by Lucas Hart */
6326 #ifdef SUNOS41 /* Verified by Lucas Hart */
6334 #endif /* SYSUTIMEH */
6342 #endif /* SUNOS41 */
6344 #endif /* SVR4ORPOSIX */
6345 #endif /* NOSETTIME */
6348 _PROTOTYP( int ftpisconnected, (void));
6349 _PROTOTYP( int ftpisloggedin, (void));
6350 _PROTOTYP( int ftpissecure, (void));
6353 _PROTOTYP( int readpass, (char *, char *, int));
6354 _PROTOTYP( int readtext, (char *, char *, int));
6357 _PROTOTYP(int ck_auth_loaddll, (VOID));
6358 _PROTOTYP(int ck_auth_unloaddll, (VOID));
6362 _PROTOTYP(DWORD ckGetLongPathname,(LPCSTR lpFileName,
6363 LPSTR lpBuffer, DWORD cchBuffer));
6368 /* End of ckcdeb.h */
6369 #endif /* CKCDEB_H */