⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ckuus3.c

📁 linux终端仿真程序
💻 C
📖 第 1 页 / 共 5 页
字号:
#include "ckcsym.h"			/* Symbol definitions */#ifndef NOICP/*  C K U U S 3 --  "User Interface" for Unix Kermit, part 3  */ /*  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.*/ /*  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 */#include "ckuusr.h"			/* User interface symbols */#ifdef OS2#ifdef NT#include "ckntap.h"			/* Microsoft TAPI */#endif /* NT */#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 srvidl;#endif /* OS2 */#ifdef CK_RECALLextern int cm_retry;#endif /* CK_RECALL *//* Variables */int cmd_quoting = 1;extern char * ckprompt;			/* Default prompt */extern xx_strp xxstring;extern struct ck_p ptab[];extern int protocol;#ifndef NOSERVERextern int ngetpath;extern char * getpath[];#endif /* NOSERVER */extern int size, spsiz, spmax, urpsiz, srvtim, slostart,  local, server, success, dest,  flow, autoflow, binary, xfermode, delay, parity, escape, what, srvdis,  turn, duplex, backgrd,  turnch, bctr, mdmtyp, keep, maxtry, unkcs, network,  ebqflg, quiet, swcapr, nettype,  wslotr, lscapr, lscapu,  carrier, debses,  cdtimo, nlangs, bgset, pflag, msgflg, dblchar,  cmdmsk, spsizr, wildxpand, suspend,  techo, rptena, rptmin, docrc,  xfrcan, xfrchr, xfrnum, pacing, xitwarn, xitsta,  cmd_cols, cmd_rows, ckxech, xaskmore, xfrbel;#ifdef TCPSOCKET  extern int tn_exit;#endif /* TCPSOCKET */  extern int exitonclose;#ifndef NOKVERBSextern int nkverbs;extern struct keytab kverbs[];#endif /* NOKVERBS */#ifdef TNCODEextern int ttnproto;#endif /* TNCODE */extern char *ccntab[];			/* Names of control chars */#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 */#ifndef NOSCRIPTextern int secho;			/* Whether SCRIPT cmd should echo */#endif /* NOSCRIPT */#ifdef DCMDBUFextern char *atmbuf, *atxbuf;#elseextern char atmbuf[], atxbuf[];#endif /* DCMDBUF */extern char psave[];extern char uidbuf[];#ifndef NOSPLint DeleteStartupFile =#ifdef NT                        1#else                        0#endif /* NT */;char pwbuf[64]  = { NUL, NUL };char prmbuf[64] = { NUL, NUL };#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 sstate;			/* Protocol start state */extern CHAR myctlq;			/* Control-character prefix */extern CHAR myrptq;			/* Repeat-count prefix */extern CHAR mystch, seol;		/* Packet start and end chars */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 */extern char * printfile;		/* NULL if printer not redirected */extern int printpipe;			/* For SET PRINTER */#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 */ /* 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 NOSPLextern int cmdlvl;			/* Overall command level */#endif /* NOSPL */#ifndef NOLOCAL#ifdef UNIXextern 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 */#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 */#ifndef NOSPLstruct keytab outptab[] = {		/* SET OUTPUT parameters */    "pacing", 0, 0			/* only one so far... */};#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 */    "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[] = {    "auto", CAR_AUT, 0,			/* 2 */    "off",  CAR_OFF, 0,			/* 0 */    "on",   CAR_ON, 0			/* 1 */};int ncrr = 3;#endif /* NOLOCAL */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};int ndbg = 3;#ifndef NOLOCAL/* Transmission speeds *//*  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_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 */  "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,		/* Special code "888" for split speed */#endif /* BPS_7512 */#ifdef BPS_76K  "76800", 7680,  0,#endif /* BPS_76K */  "9600",   960,  0};int nspd = (sizeof(spdtab) / sizeof(struct keytab)); /* How many speeds */#endif /* NOLOCAL */#ifndef NOCSETSextern struct keytab lngtab[];		/* Languages for SET LANGUAGE */extern int nlng;#endif /* NOCSETS */#ifndef NOLOCAL/* Duplex keyword table */ struct keytab dpxtab[] = {    "full", 	 0, 0,    "half",      1, 0};#endif /* NOLOCAL */ /* SET FILE parameters */struct keytab filtab[] = {    "bytesize",         XYFILS, 0,#ifndef NOCSETS    "character-set",    XYFILC, 0,#endif /* NOCSETS */    "collision",        XYFILX, 0,    "destination",      XYFILY, 0,    "display",          XYFILD, CM_INV,#ifdef CK_TMPDIR    "download-directory", XYFILG, 0,#endif /* CK_TMPDIR */    "end-of-line",      XYFILA, 0,    "eol",              XYFILA, CM_INV,    "incomplete",       XYFILI, 0,#ifdef CK_LABELED    "label",            XYFILL, 0,#endif /* CK_LABELED */    "names",            XYFILN, 0,#ifdef VMS    "record-length",    XYFILR, 0,#endif /* VMS */    "type",             XYFILT, 0,    "warning",          XYFILW, CM_INV};int nfilp = (sizeof(filtab) / sizeof(struct keytab));/* Flow Control */struct keytab flotab[] = {		/* SET FLOW-CONTROL keyword table */    "automatic", FLO_AUTO, 0,#ifdef CK_DTRCD    "dtr/cd",    FLO_DTRC, 0,#endif /* CK_DTRCD */#ifdef CK_DTRCTS    "dtr/cts",   FLO_DTRT, 0,#endif /* CK_DTRCTS */    "keep",      FLO_KEEP, 0,    "none",      FLO_NONE, 0,#ifdef CK_RTSCTS    "rts/cts",   FLO_RTSC, 0,#endif /* CK_RTSCTS */#ifndef Plan9    "xon/xoff",  FLO_XONX, 0#endif /* Plan9 */};int nflo = (sizeof(flotab) / sizeof(struct keytab));/*  Handshake characters  */ struct keytab hshtab[] = {    "bell", 007, 0,    "code", 998, 0,    "cr",   015, 0,    "esc",  033, 0,    "lf",   012, 0,    "none", 999, 0,			/* (can't use negative numbers) */    "xoff", 023, 0,    "xon",  021, 0};int nhsh = (sizeof(hshtab) / sizeof(struct keytab)); #ifndef NOLOCALstatic struct keytab sfttab[] = {	/* File types for SET SESSION-LOG */    "ascii",     XYFT_B, CM_INV,    "binary",    XYFT_B, 0,    "text",      XYFT_T, 0};static int nsfttab = (sizeof(sfttab) / sizeof(struct keytab));#endif /* NOLOCAL */#ifndef NODIAL#ifdef NETCONN				/* Networks directory depends */int nnetdir = 0;			/* on DIAL code -- fix later... */char *netdir[MAXDDIR];#endif /* NETCONN */_PROTOTYP( static int setdial, (int) );_PROTOTYP( static int setdcd, (void) );_PROTOTYP( static int parsdir, (int) );_PROTOTYP( static int cklogin, (void) );#ifndef MINIDIAL#ifdef OLDTBCODEextern int tbmodel;			/* Telebit model ID */#endif /* OLDTBCODE */#endif /* MINIDIAL */extern MDMINF *modemp[];		/* Pointers to modem info structs */extern struct keytab mdmtab[] ;		/* Modem types (in module ckudia.c) */extern int nmdm;			/* Number of them */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -