?? ckuus3.c
字號:
#ifdef SSHTEST#define SSHBUILTIN#endif /* SSHTEST */#include "ckcsym.h" /* Symbol definitions *//* C K U U S 3 -- "User Interface" for C-Kermit, part 3 *//* Authors: Frank da Cruz <fdc@columbia.edu>, The Kermit Project, Columbia University, New York City Jeffrey E Altman <jaltman@secure-endpoints.com> Secure Endpoints Inc., New York City Copyright (C) 1985, 2004, 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 */char pwbuf[PWBUFL+1] = { NUL, NUL };int pwflg = 0;int pwcrypt = 0;#ifndef NOICP#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#include "ckcuni.h"#ifdef SSHBUILTIN#include "ckossh.h"#endif /* SSHBUILTIN */#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"#ifndef NOTERMextern unsigned char colorcmd; /* Command-screen colors */extern struct keytab ttyclrtab[];extern int nclrs;extern int tt_cols[], tt_rows[], tt_szchng[], tt_status[];#endif /* NOTERM */_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 */#ifndef OS2extern char * exedir;#endif /* OS2 */#ifdef CK_RECALLextern int cm_retry;#endif /* CK_RECALL */extern int cmdint;extern int srvidl;#ifdef CKFLOATextern CKFLOAT floatval; /* (see isfloat()) */#endif /* CKFLOAT */#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, xcmdsrc;#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, xsuspend, techo, pacing, xitwarn, xitsta, outesc, cmd_cols, cmd_rows, ckxech, xaskmore, haveline, didsetlin, isguest, mdmsav, clearrq, saveask;extern int reliable, setreliable, matchdot, matchfifo, dir_dots;#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 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) */#endif /* NOSETKEY */#ifdef OS2int wideresult; /* For wide OS/2 scan codes/cmnum() */#endif /* OS2 */#ifndef NOLOCAL#ifdef OS2extern int tt_scrsize[]; /* Scrollback buffer Sizes */#endif /* OS2 */#endif /* NOLOCAL *//* 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 */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, xfrxla;#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, 0};#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 NOLOCALextern int sessft; /* Session-log file type */extern int slogts; /* Session-log timestamps on/off */#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};#define MCH_FIFO 1#define MCH_DOTF 2struct keytab matchtab[] = { { "dotfile", MCH_DOTF, 0 }, { "fifo", MCH_FIFO, 0 }};int nmatchtab = (sizeof(matchtab) / sizeof(struct keytab));#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 ooktab[] = { /* On/Off/Ask table */ "ask", 2, 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 */#define DEB_OFF 0#define DEB_ON 1#define DEB_SES 2#define DEB_TIM 3#define DEB_LEN 4struct keytab dbgtab[] = { "linelength", DEB_LEN, CM_INV, "off", DEB_OFF, 0, "on", DEB_ON, 0, "session", DEB_SES, 0, "timestamps", DEB_TIM, 0};int ndbg = (sizeof(dbgtab) / sizeof(struct keytab));#ifndef NOLOCAL/* Transmission speeds */#ifdef TTSPDLIST /* Speed table constructed at runtime . . . */struct keytab * spdtab = NULL;int nspd = 0;#else
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -