📄 ckuus4.c
字号:
#include "ckcsym.h"/* C K U U S 4 -- "User Interface" for C-Kermit, part 4 *//* Author: Frank da Cruz <fdc@columbia.edu>, Columbia University Academic Information Systems, New York City. Copyright (C) 1985, 1996, Trustees of Columbia University in the City of New York. The C-Kermit software may not be, in whole or in part, licensed or sold for profit as a software product itself, nor may it be included in or distributed with commercial products or otherwise distributed by commercial concerns to their clients or customers without written permission of the Office of Kermit Development and Distribution, Columbia University. This copyright notice must not be removed, altered, or obscured.*//* File ckuus4.c -- Functions moved from other ckuus*.c modules to even out their sizes.*/#include "ckcdeb.h"#include "ckcasc.h"#include "ckcker.h"#include "ckuusr.h"#include "ckuver.h"#include "ckcnet.h" /* Network symbols */#ifdef VMS#include <errno.h> /* For \v(errno) */#ifndef OLD_VMS#include <lib$routines.h> /* Not for VAX C 2.4 */#else#include <libdef.h>#endif /* OLD_VMS */_PROTOTYP(int vmsttyfd, (void) );#endif /* VMS */#ifdef OS2#ifndef NT#define INCL_NOPM#define INCL_VIO /* Needed for ckocon.h */#include <os2.h> #else #include <windows.h>#define APIRET ULONG#endif /* NT */#include "ckocon.h"#include "ckoetc.h"int StartedFromDialer = 0;HWND hwndDialer = 0;LONG KermitDialerID = 0;#ifdef putchar#undef putchar#endif /* putchar */#define putchar(x) conoc(x)#endif /* OS2 */extern xx_strp xxstring;#ifdef DEC_TCPIP#include <descrip>#include <dvidef>#include <dcdef>#endif /* DEC_TCPIP */#include "ckcxla.h" /* Character sets */#ifdef CKOUNI#include "ckouni.h"#endif /* CKOUNI */extern int quiet, network, xitsta, escape;#ifndef MAC#ifndef AMIGAextern int ttyfd;#endif /* MAC */#endif /* AMIGA */#ifdef NETCONNextern int tn_exit;#endif /* NETCONN */#ifndef NOICP /* Most of this file... */#ifndef AMIGA#ifndef MAC#include <signal.h>#endif /* MAC */#endif /* AMIGA */#ifdef STRATUS /* Stratus Computer, Inc. VOS */#ifdef putchar#undef putchar#endif /* putchar */#define putchar(x) conoc(x)#ifdef getchar#undef getchar#endif /* getchar */#define getchar(x) coninc(0)#endif /* STRATUS */#ifdef ANYX25extern int revcall, closgr, cudata, npadx3;int x25ver;extern char udata[];extern CHAR padparms[];extern struct keytab padx3tab[];#endif /* ANYX25 */#ifdef NETCONN#ifndef NODIALextern int nnetdir;extern char *netdir[];#endif /* NODIAL */extern char ipaddr[];#ifdef TNCODE_PROTOTYP (static VOID shotel, (void) );extern int tn_duplex, tn_nlm, tn_binary, tn_b_nlm, u_binary, me_binary;extern int tn_b_meu, tn_b_ume;extern char *tn_term;#endif /* TNCODE */#ifdef CK_NETBIOSextern unsigned short netbiosAvail;extern unsigned long NetbeuiAPI;extern unsigned char NetBiosName[];extern unsigned char NetBiosAdapter;extern unsigned char NetBiosLSN;#endif /* CK_NETBIOS */#ifdef TCPSOCKETextern char myipaddr[];#ifdef SOL_SOCKET#ifdef SO_LINGERextern int tcp_linger;extern int tcp_linger_tmo;#endif /* SO_LINGER */#ifdef TCP_NODELAYextern int tcp_nodelay;#endif /* TCP_NODELAY */#ifdef SO_SNDBUFextern int tcp_sendbuf;#endif /* SO_SNDBUF */#ifdef SO_RCVBUFextern int tcp_recvbuf;#endif /* SO_RCVBUF */#ifdef SO_KEEPALIVEextern int tcp_keepalive;#endif /* SO_KEEPALIVE */#endif /* SOL_SOCKET */#endif /* TCPSOCKET */#endif /* NETCONN */extern int cfilef;extern char cmdfil[];#ifndef NOSPL#ifdef CK_APCextern int apcactive; /* Nonzero = APC command was rec'd */extern int apcstatus; /* Are APC commands being processed? */#ifdef DCMDBUFextern char *apcbuf; /* APC command buffer */#elseextern char apcbuf[];#endif /* DCMDBUF */#endif /* CK_APC */extern char evalbuf[]; /* EVALUATE result */extern char uidbuf[], pwbuf[], prmbuf[];_PROTOTYP( static char * fneval, (char *, char * [], int, char * ) );_PROTOTYP( static VOID myflsh, (void) );_PROTOTYP( static char * getip, (char *) );static char hexdigits[16] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};extern char * tempdir;#ifdef CK_REXXextern char rexxbuf[];#endif /* CK_REXX */extern int tfline[];/* These need to be internationalized... */staticchar *wkdays[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};#endif /* NOSPL */staticchar *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};#ifdef OS2_PROTOTYP (int os2getcp, (void) );#ifdef TCPSOCKETextern char tcpname[];#endif /* TCPSOCKET */extern char startupdir[],exedir[];extern int tcp_avail;#ifdef DECNETextern int dnet_avail;#endif /* DECNET */#ifdef SUPERLATextern int slat_avail;#endif /* SUPERLAT */extern int tt_type, max_tt;extern struct tt_info_rec tt_info[];extern int tt_rows[], tt_cols[];#else /* OS2 */extern int tt_rows, tt_cols;#endif /* OS2 */extern struct keytab colxtab[];extern CHAR eol, feol, mypadc, mystch, padch, seol, stchr;extern char ttname[], *ckxsys, *versio, **xargv, *zinptr;extern char inidir[], *cksysid;extern int activecmd, remonly, cmd_rows;extern struct ck_p ptab[];extern int protocol, prefixing;extern int atcapr, autopar, bctr, bctu, bgset, bigrbsiz, bigsbsiz, binary, carrier, cdtimo, cmask, crunched, delay, duplex, ebq, ebqflg, flow, fmask, fncact, fncnv, inecho, keep, local, lscapr, lscapu, xfermode, maxrps, maxsps, maxtry, mypadn, ncolx, dest, slostart, nettype, nmac, noinit, npad, parity, pktlog, pkttim, rcflag, retrans, rpackets, rptflg, rptq, rtimo, seslog, sessft, sosi, spackets, spsiz, spsizf, spsizr, srvtim, stayflg, success, timeouts, tralog, tsecs, ttnproto, turn, turnch, urpsiz, wmax, wslotn, wslotr, xargc, xargs, zincnt, fdispla, tlevel, spmax, insilence, cmdmsk, timint, timef, fnrpath, fnspath, inbufsize;#ifdef VMS extern int frecl;#endif /* VMS */extern long ffc, filcnt, rptn, speed, tfc, tlci, tlco, ccu, ccp, vernum, xvernum, crc16;#ifndef NOSPLextern char fspec[], myhost[];#endif /* NOSPL */extern char *tfnam[]; /* Command file names */#ifdef CK_TMPDIRextern char *dldir;#endif /* CK_TMPDIR */#ifdef DCMDBUFextern struct cmdptr *cmdstk;extern char *line, *tmpbuf, *kermrc;#elseextern struct cmdptr cmdstk[];extern char line[], tmpbuf[], kermrcb[], *kermrc;#endif /* DCMDBUF */extern char pktfil[], /* Packet log file name */#ifdef DEBUG debfil[], /* Debug log file name */#endif /* DEBUG */#ifdef TLOG trafil[], /* Transaction log file name */#endif /* TLOG */ sesfil[]; /* Session log file name */#ifndef NOXMIT /* TRANSMIT command variables */extern char xmitbuf[];extern int xmitf, xmitl, xmitp, xmitx, xmits, xmitw;#endif /* NOXMIT */#ifndef NOSPL/* Script programming language items */extern char **a_ptr[]; /* Arrays */extern int a_dim[];extern char * inpbuf, inchar[]; /* Buffers for INPUT and REINPUT */extern char *inpbp; /* And pointer to same */#ifdef COMMENTstatic char *inpbps = inpbuf; /* And another */#endif /* COMMENT */static char *r3 = (char *)0;extern int incount; /* INPUT character count */extern int m_found; /* MINPUT result */extern int maclvl; /* Macro invocation level */extern struct mtab *mactab; /* Macro table */extern char *mrval[];extern int macargc[], cmdlvl;extern char *m_arg[MACLEVEL][10]; /* You have to put in the dimensions */extern char *g_var[GVARS]; /* for external 2-dimensional arrays. */#ifdef DCMDBUFextern int *count, *inpcas;#elseextern int count[], inpcas[];#endif /* DCMDBUF */#endif /* NOSPL */#ifdef UNIXextern int haslock; /* For UUCP locks */extern char flfnam[];#endif /* UNIX */#ifdef OS2ORUNIXextern int maxnam, maxpath; /* Longest name, path length */#endif /* OS2ORUNIX */extern int mdmtyp, mdmsav; #ifndef NODIAL/* DIAL-related variables */extern char modemmsg[];extern MDMINF *modemp[]; /* Pointers to modem info structs */extern int nmdm, dialhng, dialtmo, dialksp, dialdpy, dialsrt, dialmhu, dialsta;extern int dialrtr, dialint, dialrstr, dialcon, dialcq;extern int mdmspd, dialec, dialdc, dialfc, dialmth, dialesc;extern char *dialnum, *dialini, *dialdir[], *dialcmd, *dialnpr, *dialdcon, *dialdcoff, *dialecon, *dialecoff, *dialhcmd, *diallac, *dialhwfc, *dialswfc, *dialnofc, *dialpulse, *dialtone, *dialaaon, *dialaaoff;extern char *diallcc, *dialixp, *dialixs, *dialldp, *diallds, *dialpxx, *dialpxi, *dialpxo, *dialsfx, *dialtfp;extern int ntollfree;extern char *dialtfc[];extern int ndialdir, dialcnf, dialcvt;extern long dialmax, dialcapas;extern struct keytab mdmtab[];#ifdef BIGBUFOKextern char * dialmsg[];#endif /* BIGBUFOK */#endif /* NODIAL */#ifndef NOCSETS/* Translation stuff */extern int fcharset, tcharset, tslevel, language, nlng, tcsr, tcsl;extern struct keytab lngtab[];extern struct csinfo fcsinfo[], tcsinfo[];extern struct langinfo langs[];#ifdef CK_ANSICextern CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(CHAR); /* Character set */extern CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(CHAR); /* translation functions */#elseextern CHAR (*xls[MAXTCSETS+1][MAXFCSETS+1])(); /* Character set */extern CHAR (*xlr[MAXTCSETS+1][MAXFCSETS+1])(); /* translation functions. */#endif /* CK_ANSIC */#endif /* NOCSETS */#ifndef NOSPL/* Built-in variable names, maximum length VNAML (20 characters) */struct keytab vartab[] = { "_line", VN_TFLN, CM_INV, /* 192 */ "apcactive", VN_APC, CM_INV, /* 192 */ "argc", VN_ARGC, 0, "args", VN_ARGS, 0,#ifndef NOCSETS "charset", VN_CSET, 0, /* 192 */#endif /* NOCSETS */ "cmdfile", VN_CMDF, 0, "cmdlevel", VN_CMDL, 0, "cmdsource", VN_CMDS, 0, "cols", VN_COLS, 0, /* 190 */ "connection",VN_CONN, 0, /* 190 */ "count", VN_COUN, 0, "cps", VN_CPS, 0, /* 190 */ "cpu", VN_CPU, 0, "crc16", VN_CRC16, 0, /* 192 */#ifndef NODIAL "d$ac", VN_D_AC, 0, /* 192 */ "d$cc", VN_D_CC, 0, /* 192 */ "d$ip", VN_D_IP, 0, /* 192 */ "d$lp", VN_D_LP, 0, /* 192 */#endif /* NODIAL */ "date", VN_DATE, 0, "day", VN_DAY, 0, "dialnumber",VN_DNUM, 0, /* 192 */ "dialresult",VN_MDMSG, 0, /* 192 */ "dialstatus",VN_DIAL, 0, /* 190 */ "directory", VN_DIRE, 0, "download", VN_DLDIR, 0, /* 192 */ "errno", VN_ERRNO, 0, /* 192 */ "errstring", VN_ERSTR, 0, /* 192 */ "evaluate", VN_EVAL, 0, /* 190 */#ifdef OS2 "exedir", VN_EXEDIR,0, /* 192 */#endif /* OS2 */ "exitstatus",VN_EXIT, 0, "filespec", VN_FILE, 0, "fsize", VN_FFC, 0, /* 190 */ "ftype", VN_MODE, 0, /* 190 */ "home", VN_HOME, 0, "host", VN_HOST, 0, "input", VN_IBUF, 0, "inchar", VN_ICHR, 0, "incount", VN_ICNT, 0, "inidir", VN_INI, 0, /* 192 */ "instatus", VN_ISTAT, 0, /* 192 */ "ipaddress", VN_IPADDR,0, /* 192 */#ifdef OS2 "keyboard", VN_KEYB, 0,#endif /* OS2 */ "line", VN_LINE, 0, "local", VN_LCL, 0, "macro", VN_MAC, 0, "minput", VN_MINP, 0, /* 192 */ "modem", VN_MDM, 0,#ifndef NODIAL "m_aa_off", VN_M_ECX, 0, /* all 192... */ "m_aa_on", VN_M_AAO, 0, "m_dc_off", VN_M_DCX, 0, "m_dc_on", VN_M_DCO, 0, "m_dial", VN_M_DCM, 0, "m_ec_off", VN_M_ECX, 0, "m_ec_on", VN_M_ECO, 0, "m_fc_hw", VN_M_HWF, 0, "m_fc_no", VN_M_NFC, 0, "m_fc_sw", VN_M_SWF, 0, "m_hup", VN_M_HUP, 0, "m_init", VN_M_INI, 0, "m_pulse", VN_M_PDM, 0, "m_tone", VN_M_TDM, 0,#endif /* NODIAL */ "ndate", VN_NDAT, 0, "nday", VN_NDAY, 0, "newline", VN_NEWL, 0, "ntime", VN_NTIM, 0, "packetlen", VN_RPSIZ, 0, /* 192 */ "parity", VN_PRTY, 0, /* 190 */ "password", VN_PWD, CM_INV, /* 192 */ "platform", VN_SYSV, 0, "program", VN_PROG, 0, "query", VN_QUE, 0, /* 190 */ "prompt", VN_PRM, CM_INV, /* 192 */ "protocol", VN_PROTO, 0, /* 192 */ "return", VN_RET, 0,#ifdef CK_REXX "rexx", VN_REXX, 0, /* 190 */#endif /* CK_REXX */ "rows", VN_ROWS, 0, /* 190 */#ifdef OS2 "select", VN_SELCT, 0, /* 192 */#endif /* OS2 */ "speed", VN_SPEE, 0,#ifdef OS2 "space", VN_SPA, 0, "startup", VN_STAR, 0, /* 190 */#endif /* OS2 */ "status", VN_SUCC, 0, "sysid", VN_SYSI, 0, "system", VN_SYST, 0, "terminal", VN_TTYP, 0,#ifdef OS2 "termkey", VN_TRMK, CM_INV, /* 192 */#endif /* OS2 */ "tfsize", VN_TFC, 0, "time", VN_TIME, 0, "tmpdir", VN_TEMP, 0, /* 192 */#ifdef CK_TTYFD "ttyfd", VN_TTYF, 0,#endif /* CK_TTYFD */ "userid", VN_UID, 0, /* 192 */ "version", VN_VERS, 0, "window", VN_WINDO, 0, /* 192 */ "xversion", VN_XVNUM, 0 /* 192 */};int nvars = (sizeof(vartab) / sizeof(struct keytab));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -