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

📄 ckuus3.c

📁 早期freebsd实现
💻 C
📖 第 1 页 / 共 3 页
字号:
#ifndef NOICP/*  C K U U S 3 --  "User Interface" for Unix Kermit, part 3  */ /*  Author: Frank da Cruz (fdc@columbia.edu, FDCCU@CUVMA.BITNET),  Columbia University Center for Computing Activities.  First released January 1985.  Copyright (C) 1985, 1992, Trustees of Columbia University in the City of New  York.  Permission is granted to any individual or institution to use this  software as long as it is not sold for profit.  This copyright notice must be  retained.  This software may not be included in commercial products without  written permission of Columbia University.*/ /*  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 */ /* Variables */extern int size, spsiz, spmax, urpsiz, srvtim,   local, server, success,  flow, binary, 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, terror;extern char *ccntab[];#ifndef NOSCRIPTextern int secho;			/* Whether SCRIPT cmd should echo */#endif /* NOSCRIPT */#ifndef NOSPL#ifdef DCMDBUFextern int *count;#elseextern int count[];#endif /* DCMDBUF */extern int mecho, merror;		/* Macro echo, error */extern int incase;			/* INPUT case */#endif /* NOSPL */extern int bigsbsiz, bigrbsiz;		/* Packet buffers */extern long speed;			/* Terminal speed */extern CHAR sstate;			/* Protocol start state */extern char ttname[];			/* Communication device name */#ifndef MAC#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 */#endif /* OS2 */#endif /* NOSETKEY */#endif /* MAC */#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;#elseextern char cmdbuf[];			/* Command buffer */extern char line[];			/* Character buffer for anything */#endif /* DCMDBUF *//* From main ckuser module... */ extern char tmpbuf[], *tp, *lp;		/* Temporary buffer */extern int tlevel;			/* Take Command file level */#ifndef NOSPLextern int cmdlvl;			/* Overall command level */#endif /* NOSPL */#ifdef UNIXextern int sessft;			/* Session-log file type */#endif /* UNIX */#ifdef VMSint vms_msgs = 1;			/* SET MESSAGES */#endif /* VMS *//* Keyword tables for SET commands */ struct keytab chktab[] = {    "1", 1, 0,    "2", 2, 0,    "3", 3, 0,    "blank-free-2", 4, 0};/* For SET MODEM */struct keytab autotab[] = {    "changes-speed", 1, 0,    "matches-speed", 0, 0};/* For SET CARRIER */struct keytab crrtab[] = {    "auto", CAR_AUT, 0,    "off",  CAR_OFF, 0,    "on",   CAR_ON, 0};int ncrr = 3;/* For SET DEBUG */struct keytab dbgtab[] = {    "off",     0,  0,    "on",      1,  0,    "session", 2,  0};int ndbg = 3;/* Transmission speeds *//* Note, the values are encoded in cps rather than bps because 19200 and *//* 38400 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.  134.5 (IBM 2741) is not *//* supported, and split speed is not possible in AT&T UNIX. */ /* 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. *//* 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 OS2#ifdef __32BIT__ "115200",11520,  0,#endif /* __32BIT__ */#endif /* OS2 */  "1200",   120,  0,#ifdef OS2  "14400", 1440,  0,#endif /* OS2 */  "150",     15,  0,  "19200", 1920,  0,  "200",     20,  0,  "2400",   240,  0,  "300",     30,  0,  "3600",   360,  0,  "38400", 3840,  0,  "4800",   480,  0,  "50",       5,  0,#ifdef OS2  "57600", 5760,  0,  #endif /* OS2 */  "600",     60,  0,#ifdef OS2  "7200",   720,  0,#endif /* OS2 */  "75",       7,  0,#ifdef ANYBSD  "75/1200",888,  0,		/* Special code "888" for split speed */#endif /* ANYBSD */#ifdef OS2#ifdef __32BIT__  "76800", 7680,  0,#endif /* __32BIT__ */#endif /* OS2 */  "9600",   960,  0};int nspd = (sizeof(spdtab) / sizeof(struct keytab)); /* how many speeds */#ifndef NOCSETSextern struct keytab lngtab[];		/* Languages for SET LANGUAGE */extern int nlng;#endif /* NOCSETS *//* Duplex keyword table */ struct keytab dpxtab[] = {    "full", 	 0, 0,    "half",      1, 0}; /* SET FILE parameters */struct keytab filtab[] = {    "bytesize",         XYFILS, 0,#ifndef NOCSETS    "character-set",    XYFILC, 0,#endif /* NOCSETS */    "collision",        XYFILX, 0,    "display",          XYFILD, 0,    "incomplete",       XYFILI, 0,#ifdef VMS    "label",            XYFILL, 0,#endif /* VMS */    "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 */#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 */    "xon/xoff", FLO_XONX, 0};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)); struct keytab fttab[] = {		/* File types */#ifdef VMS    "b",         XYFT_B, CM_INV|CM_ABR,#endif /* VMS */    "binary",    XYFT_B, 0,#ifdef VMS    "block",     XYFT_I, CM_INV,    "image",     XYFT_I, 0,    "labeled",   XYFT_L, 0,#endif /* VMS */    "text",      XYFT_T, 0};int nfttyp = (sizeof(fttab) / sizeof(struct keytab)); #ifndef NODIALextern struct keytab mdmtab[] ;		/* Modem types (in module ckudia.c) */extern int nmdm;			/* Number of them */#ifndef MINIDIALextern int tbmodel;			/* Telebit model ID */#endif /* MINIDIAL */#endif /* NODIAL */ #ifdef UNIXstruct keytab wildtab[] = {		/* SET WILDCARD-EXPANSION */    "kermit",  0, 0,    "shell",   1, 0};#endif /* UNIX */#ifdef NETCONNextern struct keytab netcmd[];extern int nnets;#endif /* NETCONN */#ifdef SUNX25struct keytab x25tab[] = {    "call-user-data",    XYUDAT, 0,    "closed-user-group", XYCLOS, 0,    "reverse-charge",    XYREVC, 0  };int nx25 = (sizeof(x25tab) / sizeof(struct keytab));struct keytab padx3tab[] = {    "break-action",         PAD_BREAK_ACTION,           0,    "break-character",      PAD_BREAK_CHARACTER,        0,    "character-delete",     PAD_CHAR_DELETE_CHAR,       0,    "cr-padding",           PAD_PADDING_AFTER_CR,       0,    "discard-output",       PAD_SUPPRESSION_OF_DATA,    0,    "echo",                 PAD_ECHO,                   0,    "editing",              PAD_EDITING,                0,    "escape",               PAD_ESCAPE,                 0,    "forward",              PAD_DATA_FORWARD_CHAR,      0,    "lf-padding",           PAD_PADDING_AFTER_LF,       0,    "lf-insert",            PAD_LF_AFTER_CR,            0,    "line-delete",          PAD_BUFFER_DELETE_CHAR,     0,    "line-display",         PAD_BUFFER_DISPLAY_CHAR,    0,    "line-fold",            PAD_LINE_FOLDING,           0,    "pad-flow-control",     PAD_FLOW_CONTROL_BY_PAD,    0,    "service-signals",      PAD_SUPPRESSION_OF_SIGNALS, 0,    "timeout",              PAD_DATA_FORWARD_TIMEOUT,   0,/* Speed is read-only */    "transmission-rate",    PAD_LINE_SPEED,             0,    "user-flow-control",    PAD_FLOW_CONTROL_BY_USER,   0};int npadx3 = (sizeof(padx3tab) / sizeof(struct keytab));#endif /* SUNX25 *//* Parity keyword table */ struct keytab partab[] = {    "even",    'e', 0,    "mark",    'm', 0,    "none",     0 , 0,    "odd",     'o', 0,    "space",   's', 0};int npar = (sizeof(partab) / sizeof(struct keytab)); /* On/Off table */ struct keytab onoff[] = {    "off",       0, 0,    "on",        1, 0}; struct keytab rltab[] = {    "local",     1, 0,    "off",       0, CM_INV,    "on",        1, CM_INV,    "remote",    0, 0};int nrlt = (sizeof(rltab) / sizeof(struct keytab));/* Incomplete File Disposition table */staticstruct keytab ifdtab[] = {    "discard",   0, 0,    "keep",      1, 0};/* SET TAKE parameters table */staticstruct keytab taktab[] = {    "echo",  0, 0,    "error", 1, 0,    "off",   2, CM_INV,			/* For compatibility */    "on",    3, CM_INV			/* with MS-DOS Kermit... */};/* SET MACRO parameters table */staticstruct keytab smactab[] = {    "echo",  0, 0,    "error", 1, 0};#ifndef NOSCRIPTstaticstruct keytab scrtab[] = {    "echo",  0, 0};#endif /* NOSCRIPT *//* Bytesize table */struct keytab byttab[] = {    "bytesize",  0, 0};int nbytt = 1;#ifndef NOSERVER/* Server parameters table */struct keytab srvtab[] = {    "display", XYSERD, 0,    "timeout", XYSERT, 0};#endif /* NOSERVER *//* SET TRANSFER/XFER table */struct keytab tstab[] = {#ifndef NOCSETS    "character-set", 1,   0,#endif /* NOCSETS */    "locking-shift", 2,   0};int nts = (sizeof(tstab) / sizeof(struct keytab));#ifndef NOCSETS/* SET TRANSFER CHARACTER-SET table */extern struct keytab tcstab[];extern int ntcs;#endif /* NOCSETS *//* SET TRANSFER LOCKING-SHIFT table */struct keytab lstab[] = {    "forced", 2,   0,    "off",    0,   0,    "on",     1,   0

⌨️ 快捷键说明

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