📄 ckcmai.c
字号:
CHAR#ifdef pdp11 srvcmdbuf[MAXRP+4], *srvcmd = srvcmdbuf,#else#ifdef DYNAMIC *srvcmd = (CHAR *)0, /* Where to decode server command */#else srvcmdbuf[MAXRP+4], *srvcmd = srvcmdbuf,#endif /* DYNAMIC */#endif /* pdp11 */ padbuf[96], /* Buffer for send-padding */ *recpkt, *rdatap, /* Pointer to received packet data */ *data = (CHAR *)0, /* Pointer to send-packet data */ *srvptr, /* Pointer to srvcmd */ mystch = SOH, /* Outbound packet-start character */ stchr = SOH; /* Incoming packet-start character *//* File-related variables */#ifndef NOMSEND /* Multiple SEND */struct filelist * filehead = NULL; /* SEND list */struct filelist * filetail = NULL;struct filelist * filenext = NULL;int addlist = 0;#endif /* NOMSEND */char filnam[CKMAXPATH + 1]; /* Name of current file. */char ofilnam[CKMAXPATH + 1]; /* Original name. */int pipesend = 0; /* Nonzero if sending from pipe */#ifdef PIPESENDchar * sndfilter = NULL; /* Send and receive filters */char * rcvfilter = NULL;#endif /* PIPESEND */char ** sndarray = NULL; /* SEND /ARRAY pointer and range */#ifndef NOSPLint sndxlo = -1, sndxhi = -1, sndxin = -1;#endif /* NOSPL */#endif /* NOXFER */#ifndef NOSERVERint ngetpath = 0; /* GET search path */int fromgetpath = 0;char * getpath[MAXGETPATH];char * x_user = NULL; /* Server login information */char * x_passwd = NULL;char * x_acct = NULL;#endif /* NOSERVER */int x_login = 0; /* Login required */int x_logged = 0; /* User is logged in */extern int timelimit;#ifdef CK_LOGINint logintimo = 300; /* Login timeout */char * userfile = NULL; /* Forbidden user file */#endif /* CK_LOGIN */#ifdef IKSDchar * anonfile = NULL; /* Anonymous login init file */char * anonroot = NULL; /* Anonymous file-system root */int iks_timo = 300; /* 5 minutes idle timo */int iks_retry = 3; /* 3 attempts at login */#endif /* IKSD */#ifdef CKSYSLOGextern VOID zsyslog();extern int ckxlogging, ckxsyslog;#endif /* CKSYSLOG */int nzxopts = 0; /* Options for nzxpand() */int nfils = 0; /* Number of files in file group */long fsize = 0L; /* Size of current file */#ifdef UNIXint wildxpand = 0; /* Who expands wildcards */#else /* UNIX */#ifdef STRATUSint wildxpand = 1;#endif /* STRATUS */#endif /* UNIX */#ifdef UNIXOROSKint matchdot = 0; /* Whether to match dot files */#elseint matchdot = 1;#endif /* UNIXOROSK */int matchfifo = 0; /* Whether to match FIFO "files" */int clfils = 0; /* Flag for command-line files */int stayflg = 0; /* Flag for "stay", i.e. "-S" */int xfinish = 0; /* Flag for FINISH = EXIT */long ztusec = -1L; /* Used with ztime() */long ztmsec = -1L; /* Ditto *//* Communication device / connection variables */char ttname[TTNAMLEN+1]; /* Name of communication device */#ifdef MACint connected = 0; /* True if connected */int startconnected; /* initial state of connected */#endif /* MAC */long speed = -1L; /* Communication device speed */int wasclosed = 0; /* Connection was just closed */int whyclosed = WC_REMO; /* why it was closed */int qnxportlock = 0; /* QNX port locking on/off */#ifndef CLSONDISC#define CLSONDISC 0#endif /* CLSONDISC */int cxflow[CXT_MAX+1]; /* See initflow() */#ifndef NOSHOWchar * floname[] = { /* Flow control names */ "none", "xon/xoff", "rts/cts", "dtr/cd", "etx/ack", "string", "xxx1", "xxx2", "dtr/cts", "keep", "auto"};int nfloname = (sizeof(floname) / sizeof(char *));char * cxname[] = { /* Connection type names */ "remote", "direct-serial", "modem", "tcp/ip", "x.25", "decnet", "lat", "netbios", "named-pipe", "ssh", "pipe"};int ncxname = (sizeof(cxname) / sizeof(char *));#endif /* NOSHOW */int parity = DEFPAR, /* Parity specified, 0,'e','o',etc */ hwparity = 0, /* Hardware parity for serial port */ stopbits = -1, /* Stop bits for serial port */ clsondisc = CLSONDISC, /* Serial port close on disconnect */ autopar = 0, /* Automatic parity change flag */ sosi = 0, /* Shift-In/Out flag */ flow = 0, /* Flow control (see initflow()) */ autoflow = 1, /* Automatic flow control */ turn = 0, /* Line turnaround handshake flag */ turnch = XON, /* Line turnaround character */ duplex = 0, /* Duplex, full by default */ escape = DFESC, /* Escape character for connect */ ckdelay = DDELAY, /* Initial delay before sending */ tnlm = 0; /* Terminal newline mode *//* Networks for SET HOST */#ifdef BIGBUFOK#define MYHOSTL 1024#else#define MYHOSTL 100#endif /* BIGBUFOK */char myhost[MYHOSTL]; /* Local host name */int network = 0; /* Network vs serial connection */int inserver = 0; /* Running as an Internet server */int isguest = 0; /* User is anonymous */char * clienthost = NULL; /* Peer host name or address */int tcp_incoming = 0; /* Incoming TCP connection? */#ifdef NETCONN#ifdef TCPSOCKETint nettype = NET_TCPB; /* Default network type */#else#ifdef SUNX25int nettype = NET_SX25;#else#ifdef IBMX25int nettype = NET_IX25;#else#ifdef HPX25int nettype = NET_HX25;#else#ifdef STRATUSX25int nettype = NET_VX25;#else#ifdef DECNETint nettype = NET_DEC;#else#ifdef SUPERLATint nettype = NET_SLAT;#elseint nettype = NET_NONE;#endif /* SUPERLAT */#endif /* DECNET */#endif /* STRATUSX25 */#endif /* HPX25 */#endif /* IBMX25 */#endif /* SUNX25 */#endif /* TCPSOCKET */#else /* NETCONN */int nettype = NET_NONE;#endif /* NETCONN */#ifdef ANYX25int revcall = 0; /* X.25 reverse call not selected */int closgr = -1; /* X.25 closed user group */int cudata = 0; /* X.25 call user data not specified */char udata[MAXCUDATA]; /* X.25 call user data */#ifdef IBMX25/* I was unable to find any pre-defined MAX values for x25 addresses - the addresses that I've seen have been around 10-12 characters 32 is probably enough, 64 is hopefully safe for everyone.*/ x25addr_t local_nua = {'\0'}; /* local x.25 address */ x25addr_t remote_nua = {'\0'}; /* remote x.25 address */ char x25name[32] = {'\0'}; /* x25 device name, sx25a0 or sx25a1 */ char x25dev[64] = "/dev/x25pkt"; /* x25 device in /dev */ int x25port = 0; /* port used for X.25 - AIX only */#endif /* IBMX25 */#ifndef IBMX25/* This condition is unrelated to the above IBMX25 condition. IBM X.25 doesn't have PAD support.*/ CHAR padparms[MAXPADPARMS+1]; /* X.3 parameters */#endif /* IBMX25 */#endif /* ANYX25 *//* Other items */int isinterrupted = 0; /* Used in exception handling */int what = W_INIT; /* What I am doing */int lastxfer = 0; /* Last transfer (send or receive) */extern int mdmtyp; /* Modem (/network) type */#ifdef NTextern int StartedFromDialer;#ifdef NTSIGextern int TlsIndex;#endif /* NTSIG */#ifdef NTASMunsigned long ESPToRestore; /* Ditto */#endif /* NTASM */#endif /* NT */#ifdef OS2PMint os2pm = 0; /* OS/2 Presentation Manager flag */#endif /* OS2PM *//* Terminal screen size, if known, -1 means unknown. */#ifdef OS2#include "ckocon.h"#ifdef KUIint tt_rows[VNUM] = {24,24,25,1}; /* Rows (height) */int tt_cols[VNUM] = {80,80,80,80}; /* Columns (width) */int cmd_rows = 24, cmd_cols = 80; /* Command/console screen dimensions */#else /* KUI */int tt_rows[VNUM] = {-1,24,25,1}; /* Rows (height) */int tt_cols[VNUM] = {-1,80,80,80}; /* Columns (width) */int cmd_rows = -1, cmd_cols = -1; /* Command/console screen dimensions */#endif /* KUI */int k95stdio = 0; /* Stdio threads */int tt_bell = XYB_AUD | XYB_SYS; /* BELL AUDIBLE (system sounds) */#else /* OS2 */int tt_rows = -1; /* Rows (height) */int tt_cols = -1; /* Columns (width) */int cmd_rows = 24, cmd_cols = 80; /* Command/console screen dimensions */int tt_bell = XYB_AUD; /* BELL ON */#endif /* OS2 */int tt_print = 0; /* Transparent print disabled */int tt_escape = 1; /* Escaping back is enabled */int tt_scroll = 1; /* Scrolling operations are enabled */int tn_exit = 0; /* Exit on disconnect */int exitonclose = 0; /* Exit on close */int exithangup = 1; /* Hangup on exit */int haveline = 0; /* SET LINE or SET HOST in effect */int tlevel = -1; /* Take-file command level */int hints = 1; /* Whether to give hints */#ifdef NOLOCALint remonly = 1; /* Remote-mode-only advisory (-R) */int nolocal = 1; /* Remote-only strictly enforced */#elseint remonly = 0;int nolocal = 0;int cx_status = 0; /* CONNECT return status */#endif /* NOLOCAL */#ifndef NOSPLextern int cmdlvl; /* Command level */extern int maclvl; /* Macro invocation level */#endif /* NOSPL */int protocol = PROTO_K; /* File transfer protocol = Kermit */#ifdef NEWDEFAULTSint prefixing = PX_CAU;#elseint prefixing = PX_ALL;#endif /* NEWDEFAULTS */extern short ctlp[]; /* Control-prefix table */int carrier = CAR_AUT; /* Pay attention to carrier signal */int cdtimo = 0; /* Carrier wait timeout */int xitsta = GOOD_EXIT; /* Program exit status */#ifdef VMS /* Default filename collision action */int fncact = XYFX_X; /* REPLACE for VMS */#elseint fncact = XYFX_B; /* BACKUP for everybody else */#endif /* VMS */int fncsav = -1; /* For saving & restoring the above */int bgset = -1; /* BACKGROUND mode set explicitly */int cmdint = 1; /* Interrupts are allowed */#ifdef UNIXint xsuspend = DFSUSP; /* Whether SUSPEND command, etc, */#else /* is to be allowed. */int xsuspend = 0;#endif /* UNIX *//* Statistics variables */long filcnt, /* Number of files in transaction */ filrej, /* Number of files rejected in transaction */ flci, /* Characters from line, current file */ flco, /* Chars to line, current file */ tlci, /* Chars from line in transaction */ tlco, /* Chars to line in transaction */ ffc, /* Chars to/from current file */ tfc, /* Chars to/from files in transaction */ cps = 0L, /* Chars/sec last transfer */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -