📄 ckuus3.c
字号:
#include "ckcsym.h" /* Symbol definitions */#ifndef NOICP/* C K U U S 3 -- "User Interface" for C-Kermit, part 3 *//* Author: Frank da Cruz <fdc@columbia.edu>, Columbia University Academic Information Systems, New York City. Copyright (C) 1985, 2000, Trustees of Columbia University in the City of New York. All rights reserved. See the C-Kermit COPYING.TXT file or the copyright text in the ckcmai.c module for disclaimer and permissions.*//* SET command (but much material has been split off into ckuus7.c). *//* Kermit-specific includes. Definitions here supersede those from system include files.*/#include "ckcdeb.h" /* Debugging & compiler things */#include "ckcasc.h" /* ASCII character symbols */#include "ckcker.h" /* Kermit application definitions */#include "ckcxla.h" /* Character set translation */#include "ckcnet.h" /* Network symbols */#ifdef CK_AUTHENTICATION#include "ckuath.h"#endif /* CK_AUTHENTICATION */#ifdef CK_SSL#include "ck_ssl.h"#endif /* CK_SSL */#include "ckuusr.h" /* User interface symbols */#ifdef OS2#ifdef CK_NETBIOS#include <os2.h>#ifdef COMMENT /* Would you believe */#undef COMMENT /* <os2.h> defines this ? */#endif /* COMMENT */#include "ckonbi.h"extern UCHAR NetBiosAdapter;#endif /* CK_NETBIOS */#include "ckocon.h"#include "ckokey.h"extern unsigned char colorcmd; /* Command-screen colors */extern struct keytab ttyclrtab[];extern int nclrs;extern int tt_cols[], tt_rows[], tt_szchng[];_PROTOTYP(int setprty, (void));extern char startupdir[], exedir[];extern int tt_modechg;#ifdef NT#include <windows.h>#include <tapi.h>#include "ckntap.h" /* Microsoft TAPI */#endif /* NT */#endif /* OS2 */#ifdef CK_RECALLextern int cm_retry;#endif /* CK_RECALL */extern int cmdint;extern int srvidl;#ifndef NOPUSH#ifndef NOFRILLS#ifdef VMSchar editor[CKMAXPATH + 1] = "edit";#elsechar editor[CKMAXPATH + 1] = { NUL, NUL };#endif /* VMS */char editopts[128] = { NUL, NUL };char editfile[CKMAXPATH + 1] = { NUL, NUL };#ifdef BROWSERchar browser[CKMAXPATH + 1] = { NUL, NUL };char browsopts[128] = { NUL, NUL };char browsurl[4096] = { NUL, NUL };#endif /* BROWSER */#endif /* NOFRILLS */#endif /* NOPUSH *//* Variables */int cmd_quoting = 1;extern int hints;#ifdef CK_KERBEROSchar * k4pwprompt = NULL; /* Kerberos 4 password prompt */char * k4prprompt = NULL; /* Kerberos 4 principal prompt */char * k5pwprompt = NULL; /* Kerberos 5 password prompt */char * k5prprompt = NULL; /* Kerberos 5 principal prompt */#endif /* CK_KERBEROS */#ifdef CK_SRPchar * srppwprompt = NULL;#endif /* CK_SRP */extern char * ckprompt, * ikprompt; /* Default prompt */extern xx_strp xxstring;extern char * cdmsgfile[], * cdmsgstr;extern int local, server, success, dest, sleepcan, inserver, flow, autoflow, binary, parity, escape, what, turn, duplex, backgrd, hwparity, stopbits, turnch, mdmtyp, network, quiet, nettype, carrier, debses, debtim, cdtimo, nlangs, bgset, pflag, msgflg, cmdmsk, suspend, techo, pacing, xitwarn, xitsta, outesc, cmd_cols, cmd_rows, ckxech, xaskmore, haveline, didsetlin, isguest;#ifndef NOSERVER extern int en_pri;#endif /* NOSERVER */#ifdef IKSDCONFextern int iksdcf;#endif /* IKSDCONF */#ifdef TCPSOCKET extern int tn_exit;#endif /* TCPSOCKET */#ifdef TNCODE char * tn_pr_uid = NULL;#endif /* TNCODE */ extern int exitonclose;#ifndef NOKVERBSextern int nkverbs;extern struct keytab kverbs[];#endif /* NOKVERBS */extern int ttnproto; /* Network protocol */extern char *ccntab[]; /* Names of control chars */#ifdef CK_APCextern int apcactive, apcstatus;#endif /* CK_APC */#ifndef NOSCRIPTextern int secho; /* Whether SCRIPT cmd should echo */#endif /* NOSCRIPT */#ifdef DCMDBUFextern char *atmbuf, *atxbuf;#elseextern char atmbuf[], atxbuf[];#endif /* DCMDBUF */extern int cmflgs;extern char psave[];extern char uidbuf[];extern int sl_uid_saved;int DeleteStartupFile = 0;extern int cmdlvl; /* Overall command level */#ifndef NOSPL_PROTOTYP( static int parsdir, (int) );char pwbuf[PWBUFL+1] = { NUL, NUL };int pwflg = 0;int pwcrypt = 0;char prmbuf[PWBUFL+1] = { NUL, NUL };int fndiags = 1; /* Function diagnostics on/off */int fnerror = 1; /* Function error treatment */#ifdef DCMDBUFextern int *count, *takerr, *merror, *inpcas;#elseextern int count[], takerr[], merror[], inpcas[];#endif /* DCMDBUF */extern int mecho; /* Macro echo */extern long ck_alarm;extern char alrm_date[], alrm_time[];#elseextern int takerr[];#endif /* NOSPL */extern int x_ifnum;extern int bigsbsiz, bigrbsiz; /* Packet buffers */extern long speed; /* Terminal speed */extern char ttname[]; /* Communication device name */extern char myhost[] ;extern char inidir[]; /* Ini File directory */#ifndef NOSETKEYextern KEY *keymap; /* Character map for SET KEY (1:1) */extern MACRO *macrotab; /* Macro map for SET KEY (1:string) */#ifdef OS2int wideresult; /* For SET KEY, wide OS/2 scan codes */extern int tt_scrsize[]; /* Scrollback buffer Sizes */#endif /* OS2 */#endif /* NOSETKEY *//* Printer settings */extern char * printername; /* NULL if printer not redirected */extern int printpipe;extern int noprinter;#ifdef PRINTSWIint printtimo = 0;char * printterm = NULL;char * printsep = NULL;int printertype = 0;#ifdef BPRINTint printbidi = 0; /* SET BPRINTER (bidirectional) */long pportspeed = 0L; /* Bidirection printer port speed, */int pportparity = 0; /* parity, */int pportflow = FLO_KEEP; /* and flow control */#endif /* BPRINT */#ifdef OS2extern int txt2ps; /* Text2PS conversion? */extern int ps_width, ps_length; /* Text2PS dimensions */#endif /* OS2 */#endif /* PRINTSWI */#ifdef OS2extern int tcp_avail; /* Nonzero if TCP/IP is available */#ifdef DECNETextern int dnet_avail; /* Ditto for DECnet */#endif /* DECNET */#ifdef SUPERLATextern int slat_avail;#endif /* SUPERLAT */#endif /* OS2 */static struct keytab logintab[] = { "password", LOGI_PSW, CM_INV, "prompt", LOGI_PRM, CM_INV, "userid", LOGI_UID, 0};#ifndef NOCSETS/* system-independent character sets, defined in ckcxla.[ch] */extern struct csinfo tcsinfo[];extern struct langinfo langs[];/* Other character-set related variables */extern int tcharset, tslevel, language;#endif /* NOCSETS *//* File-transfer variable declarations */#ifndef NOXFER#ifdef CK_AUTODLextern int cmdadl;#endif /* CK_AUTODL */#ifndef NOSERVERextern int ngetpath;extern char * getpath[];#endif /* NOSERVER */#ifdef PATTERNSextern int patterns;#endif /* PATTERNS */extern struct ck_p ptab[];extern CHAR sstate; /* Protocol start state */extern CHAR myctlq; /* Control-character prefix */extern CHAR myrptq; /* Repeat-count prefix */extern int protocol, size, spsiz, spmax, urpsiz, srvtim, srvcdmsg, slostart, srvdis, xfermode, ckdelay, keep, maxtry, unkcs, bctr, ebqflg, swcapr, wslotr, lscapr, lscapu, spsizr, rptena, rptmin, docrc, xfrcan, xfrchr, xfrnum, xfrbel, xfrint, srvping, g_xfermode;#ifdef PIPESENDextern int usepipes;#endif /* PIPESEND */#ifdef CKXXCHAR /* DOUBLE / IGNORE char table */extern int dblflag, ignflag, dblchar;extern short dblt[];#endif /* CKXXCHAR */#ifdef CK_SPEEDextern short ctlp[]; /* Control-prefix table */extern int prefixing;static struct keytab pfxtab[] = { "all", PX_ALL, 0, "cautious", PX_CAU, 0, "minimal", PX_WIL, 0, "none", PX_NON, CM_INV};#endif /* CK_SPEED */#endif /* NOXFER *//* Declarations from cmd package */#ifdef DCMDBUFextern char *cmdbuf; /* Command buffer */extern char *line;extern char *tmpbuf;#elseextern char cmdbuf[]; /* Command buffer */extern char line[]; /* Character buffer for anything */extern char tmpbuf[];#endif /* DCMDBUF *//* From main ckuser module... */extern char *tp, *lp; /* Temporary buffer */extern int tlevel; /* Take Command file level */#ifndef NOLOCAL#ifdef OS2ORUNIXextern int sessft; /* Session-log file type */#else#ifdef OSKextern int sessft;#endif /* OSK */#endif /* UNIX */#endif /* NOLOCAL */char * tempdir = NULL;#ifdef VMSint vms_msgs = 1; /* SET MESSAGES */extern int batch;#endif /* VMS *//* Keyword tables for SET commands */#ifdef CK_SPEEDstruct keytab ctltab[] = { "prefixed", 1, 0, /* Note, the values are important. */ "unprefixed", 0, 0};#endif /* CK_SPEED */static struct keytab oldnew[] = { "new", 0, 0, "old", 1, 0};#ifndef NOSPLstatic struct keytab functab[] = { "diagnostics", FUNC_DI, 0, "error", FUNC_ER, 0};static int nfunctab = (sizeof(functab) / sizeof(struct keytab));struct keytab outptab[] = { /* SET OUTPUT parameters */ "pacing", 0, 0, /* only one so far... */ "special-escapes", 1, 0};int noutptab = (sizeof(outptab) / sizeof(struct keytab)); /* How many */#endif /* NOSPL */struct keytab chktab[] = { /* Block check types */ "1", 1, 0, /* 1 = 6-bit checksum */ "2", 2, 0, /* 2 = 12-bit checksum */ "3", 3, 0, /* 3 = 16-bit CRC */ "4", 4, CM_INV, /* Same as B */ "blank-free-2", 4, 0 /* B = 12-bit checksum, no blanks */};struct keytab rpttab[] = { /* SET REPEAT */ "counts", 0, 0, /* On or Off */#ifdef COMMENT "minimum", 1, 0, /* Threshhold */#endif /* COMMENT */ "prefix", 2, 0 /* Repeat-prefix character value */};#ifndef NOLOCAL/* For SET [ MODEM ] CARRIER, and also for SET DIAL CONNECT */struct keytab crrtab[] = { "automatic", CAR_AUT, 0, /* 2 */ "off", CAR_OFF, 0, /* 0 */ "on", CAR_ON, 0 /* 1 */};int ncrr = 3;#endif /* NOLOCAL */struct keytab ooatab[] = { /* On/Off/Auto table */ "automatic", SET_AUTO, 0, /* 2 */ "off", SET_OFF, 0, /* 0 */ "on", SET_ON, 0 /* 1 */};struct keytab qvtab[] = { /* Quiet/Verbose table */ "quiet", 1, 0, "verbose", 0, 0};int nqvt = 2;/* For SET DEBUG */struct keytab dbgtab[] = { "off", 0, 0, "on", 1, 0, "session", 2, 0, "timestamps", 3, 0};int ndbg = 4;#ifndef NOLOCAL/* Transmission speeds */#ifdef TTSPDLIST /* Speed table constructed at runtime . . . */struct keytab * spdtab = NULL;int nspd = 0;#else/* Note, the values are encoded in cps rather than bps because 19200 and higher are too big for some ints. All but 75bps are multiples of ten. Result of lookup in this table must be multiplied by 10 to get actual speed in bps. If this number is 70, it must be changed to 75. If it is 888, this means 75/1200 split speed. The values are generic, rather than specific to UNIX. We can't use B75, B1200, B9600, etc, because non-UNIX versions of C-Kermit will not necessarily have these symbols defined. The BPS_xxx symbols are Kermit-specific, and are defined in ckcdeb.h or on the CC command line. Like all other keytabs, this one must be in "alphabetical" order, rather than numeric order.*/struct keytab spdtab[] = { "0", 0, CM_INV, "110", 11, 0,#ifdef BPS_115K "115200",11520, 0,#endif /* BPS_115K */ "1200", 120, 0,#ifdef BPS_134 "134.5", 134, 0,#endif /* BPS_134 */#ifdef BPS_14K "14400", 1440, 0,#endif /* BPS_14K */#ifdef BPS_150 "150", 15, 0,#endif /* BPS_150 */#ifdef BPS_1800 "1800", 180, 0,#endif /* BPS_150 */#ifdef BPS_19K "19200", 1920, 0,#endif /* BPS_19K */#ifdef BPS_200 "200", 20, 0,#endif /* BPS_200 */#ifdef BPS_230K "230400", 23040, 0,#endif /* BPS_230K */ "2400", 240, 0,#ifdef BPS_28K "28800", 2880, 0,#endif /* BPS_28K */ "300", 30, 0,#ifdef BPS_3600 "3600", 360, 0,#endif /* BPS_3600 */#ifdef BPS_38K "38400", 3840, 0,#endif /* BPS_38K */#ifdef BPS_460K "460800", 46080, 0, /* Need 32 bits for this... */#endif /* BPS_460K */ "4800", 480, 0,#ifdef BPS_50 "50", 5, 0,#endif /* BPS_50 */#ifdef BPS_57K "57600", 5760, 0,#endif /* BPS_57K */ "600", 60, 0,#ifdef BPS_7200 "7200", 720, 0,#endif /* BPS_7200 */#ifdef BPS_75 "75", 7, 0,#endif /* BPS_75 */#ifdef BPS_7512 "75/1200",888, 0, /* Code "888" for split speed */#endif /* BPS_7512 */#ifdef BPS_76K "76800", 7680, 0,#endif /* BPS_76K */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -