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

📄 ckuus7.c

📁 linux终端仿真程序
💻 C
📖 第 1 页 / 共 5 页
字号:
#include "ckcsym.h"#ifndef NOICP/*  C K U U S 7 --  "User Interface" for C-Kermit, part 7  */ /*  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.*/ /*  This file created from parts of ckuus3.c, which became to big for  Mark Williams Coherent compiler to handle.*//*  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 */#include "ckucmd.h"#ifdef CKOUNI#include "ckouni.h"#endif /* CKOUNI */#ifdef OS2#ifndef NT#define INCL_NOPM #define INCL_VIO            /* needed for ckocon.h */#define INCL_DOSMODULEMGR#include <os2.h>#undef COMMENT#else /* NT */#define APIRET ULONG#include "cknwin.h"#include "ckntap.h"#endif /* NT */#include "ckowin.h"#include "ckocon.h"#include "ckodir.h"#ifdef OS2MOUSE#include "ckokey.h"#endif /* OS2MOUSE */#ifdef KUI#include "ikui.h"#endif /* KUI */#ifdef putchar#undef putchar#endif /* putchar */#define putchar(x) conoc(x)extern int mskkeys;#endif /* OS2 */    #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 */static int x, y = 0, z;static char *s;#ifdef CK_SPEEDextern short ctlp[];			/* Control-char prefixing table */#endif /* CK_SPEED */#ifdef NETCONNextern struct keytab netcmd[];#ifndef NODIALextern int dirline;extern int nnets, nnetdir;		/* Network services directory */extern char *netdir[];_PROTOTYP( VOID ndinit, (void) );_PROTOTYP( VOID ndreset, (void) );char *nh_p[MAXDNUMS + 1];		/* Network directory entry pointers */char *nh_p2[MAXDNUMS + 1];		/* Network directory entry nettype */char *nh_px[4][MAXDNUMS + 1];		/* Network-specific stuff... */#endif /* NODIAL */int nhcount = 0;int ndinited = 0;char * n_name = NULL;			/* Network name pointer */static int oldplex = -1;		/* Duplex holder around network */#endif /* NETCONN */_PROTOTYP(static int remtxt, (char **) );_PROTOTYP(VOID rmsg, (void) );_PROTOTYP(static int remcfm, (void) );#ifndef NOPUSHextern int nopush;#endif /* NOPUSH */int mdmsav = -1;			/* Save modem type around network */extern xx_strp xxstring;extern int remfile, rempipe, remappd; /* REMOTE output redirection */extern char * remdest;#ifdef CK_TMPDIRchar * dldir = NULL;#endif /* CK_TMPDIR */extern struct ck_p ptab[];extern int protocol;extern int success, nfilp, fmask, fncnv, frecl, binary, warn, msgflg, quiet;extern int cmask, maxrps, wslotr, bigsbsiz, bigrbsiz, urpsiz, rpsiz, spsiz;extern int spsizr, spsizf, maxsps, spmax, pflag, bctr, npad, timef, timint;extern int pkttim, rtimo, local, nfils, displa, atcapr, nettype, escape;extern int mdmtyp, duplex, dfloc, network, cdtimo, fncact, mypadn, autoflow;extern int tnlm, sosi, tlevel, lf_opts, backgrd, flow, fdispla, b_save, f_save;extern int fnrpath, fnspath, debses, parity, pktpaus, ttnproto, ckxech;extern int x_ifnum;extern int  atenci, atenco, atdati, atdato, atleni, atleno, atblki, atblko,  attypi, attypo, atsidi, atsido, atsysi, atsyso, atdisi, atdiso;extern char psave[];			/* For saving & restoring prompt */#ifdef OS2#ifdef NT#define stricmp _stricmpextern int tt_attr_bug;#endif /* NT */extern int tt_rows[], tt_cols[];extern int tt_cols_usr;extern int tt_szchng[VNUM];int tt_modechg = 1;extern struct _vtG G[4], *GL, *GR, *GNOW, *SSGL;struct _vtG savedG[4];extern int priority;extern bool send_c1;int send_c1_usr = FALSE;extern int sgrcolors;#elseextern int tt_rows, tt_cols;#endif /*  OS2 */#ifdef STRATUSextern int atfrmi, atfrmo, atcrei, atcreo, atacti, atacto;#endif /* STRATUS */extern int tt_escape;extern long speed;extern CHAR   feol, sstate, eol, seol, stchr, mystch, mypadc, padch, ctlq, myctlq;extern char *cmarg, *cmarg2, *dftty;extern char *tp, *lp;			/* Temporary buffer & pointers */#ifndef NOFRILLSextern char optbuf[];			/* Buffer for MAIL or PRINT options */extern int rprintf;			/* REMOTE PRINT flag */#endif /* NOFRILLS */extern char ttname[];int tttapi = 0;				/* is Line TAPI? */struct keytab * tapilinetab = NULL;int ntapiline = 0;#ifdef NETCONN				/* Network items */#ifdef ANYX25extern int revcall, closgr, cudata, nx25, npadx3;extern char udata[];extern CHAR padparms[];extern struct keytab x25tab[], padx3tab[];#endif /* ANYX25 */#ifdef OS2#ifndef NTextern bool ttslip,ttppp;#endif /* NT */#endif /* OS2 */#ifdef NPIPEextern char pipename[];#endif /* NPIPE */#ifdef TCPSOCKET#ifdef TNCODEextern int tn_init;#endif /* TNCODE */_PROTOTYP( int tn_snaws, (void) );#ifdef RLOGCODE_PROTOTYP( int rlog_naws, (void) );#endif /* RLOGCODE */extern int nawsflg;extern int me_binary, u_binary;#endif /* TCPSOCKET */#ifdef SUPERLATextern char slat_pwd[18];#endif /* SUPERLAT */#endif /* NETCONN */#ifdef COMMENT#ifndef NOSETKEYextern KEY *keymap;#ifndef OS2#define mapkey(x) keymap[x]#endif /* OS2 */extern MACRO *macrotab;_PROTOTYP( VOID shostrdef, (CHAR *) );#ifndef NOKVERBSextern struct keytab kverbs[];extern int nkverbs;#endif /* NOKVERBS */#endif /* NOSETKEY */#else#ifndef NOSETKEYextern KEY *keymap;extern MACRO *macrotab;_PROTOTYP( VOID shostrdef, (CHAR *) );#ifndef NOKVERBSextern struct keytab kverbs[];extern int nkverbs;#endif /* NOKVERBS */#endif /* NOSETKEY */#endif /* COMMENT *//* Keyword tables ... */extern struct keytab onoff[], filtab[], rltab[];extern int nrlt; struct keytab fttab[] = {		/* File types for SET FILE TYPE */    "ascii",     XYFT_B, CM_INV,#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,#endif /* VMS */#ifdef CK_LABELED    "labeled",   XYFT_L, 0,#endif /* CK_LABELED */#ifdef MAC    "macbinary", XYFT_M, 0,#endif /* MAC */    "text",      XYFT_T, 0};int nfttyp = (sizeof(fttab) / sizeof(struct keytab));static struct keytab rfttab[] = {	/* File types for REMOTE SET FILE */    "ascii",     XYFT_B, CM_INV,    "binary",    XYFT_B, 0,#ifdef VMS    "labeled",   XYFT_L, 0,#else#ifdef OS2    "labeled",   XYFT_L, 0,#endif /* OS2 */#endif /* VMS */    "text",      XYFT_T, 0};static int nrfttyp = (sizeof(rfttab) / sizeof(struct keytab));extern char uidbuf[];static int uidflag = 0;#ifndef NOSPLint query = 0;				/* Global flag for QUERY active */static struct keytab vartyp[] = {	/* Variable types for REMOTE QUERY */    "global", (int) 'G', CM_INV,    "kermit", (int) 'K', 0,    "system", (int) 'S', 0,    "user",   (int) 'G', 0};static int nvartyp = (sizeof(vartyp) / sizeof(struct keytab));#endif /* NOSPL */#ifdef CK_TIMERSstatic struct keytab timotab[] = {	/* Timer types */    "dynamic", 1, 0,    "fixed",   0, 0};#endif /* CK_TIMERS */#ifdef DCMDBUFextern char *atxbuf, *atmbuf;			/* Atom buffer */extern char *cmdbuf;			/* Command buffer */extern char *line, *tmpbuf;		/* Character buffers for anything */extern int *intime;			/* INPUT TIMEOUT */#else  /* Not DCMDBUF ... */extern char atxbuf[], atmbuf[];		/* Atom buffer */extern char cmdbuf[];			/* Command buffer */extern char line[], tmpbuf[];		/* Character buffer for anything */extern int intime[];#endif /* DCMDBUF */#ifndef NOCSETSextern struct keytab fcstab[];		/* For SET FILE CHARACTER-SET */extern struct keytab ttcstab[];extern int nfilc, fcharset, tcharset, ntermc, tcsr, tcsl;#ifdef OS2_PROTOTYP( int os2setcp, (int) );_PROTOTYP( int os2getcp, (void) );_PROTOTYP( void os2debugoff, (void) );#endif /* OS2 */#endif /* NOCSETS */#ifndef NOSPLextern int cmdlvl;			/* Overall command level */#ifdef DCMDBUFextern int *inpcas;			/* INPUT CASE setting on cmd stack */#elseextern int inpcas[];#endif /* DCMDBUF */#endif /* NOSPL */#ifdef CK_CURSES#ifndef VMS#ifndef COHERENT_PROTOTYP(int tgetent,(char *, char *));#endif /* COHERENT */#else#ifdef __DECC_PROTOTYP(int tgetent,(char *, char *));#endif /* __DECC */#endif /* VMS */#endif /* CK_CURSES */#ifndef NOXMIT#define XMITF 0				/* SET TRANSMIT values */#define XMITL 1				/* (Local to this module) */#define XMITP 2#define XMITE 3#define XMITX 4#define XMITS 5#define XMITW 6#define XMBUFL 50extern int xmitf, xmitl, xmitp, xmitx, xmits, xmitw;char xmitbuf[XMBUFL+1] = { NUL };	/* TRANSMIT eof string */struct keytab xmitab[] = {		/* SET TRANSMIT */    "echo",     XMITX, 0,    "eof",      XMITE, 0,    "fill",     XMITF, 0,    "linefeed", XMITL, 0,    "locking-shift", XMITS, 0,    "pause",    XMITW, 0,    "prompt",   XMITP, 0};int nxmit = (sizeof(xmitab) / sizeof(struct keytab));#endif /* NOXMIT *//* For SET FILE COLLISION *//* Some of the following may be possible for some C-Kermit implementations *//* but not others.  Those that are not possible for your implementation *//* should be ifdef'd out. */struct keytab colxtab[] = { /* SET FILE COLLISION options */#ifndef MAC    "append",    XYFX_A, 0,  /* append to old file */#endif /* MAC */#ifdef COMMENT    "ask",       XYFX_Q, 0,  /* ask what to do (not implemented) */#endif    "backup",    XYFX_B, 0,  /* rename old file */#ifndef MAC    /* This crashes Mac Kermit. */    "discard",   XYFX_D, 0,  /* don't accept new file */    "no-supersede", XYFX_D, CM_INV, /* ditto (MSK compatibility) */#endif /* MAC */    "overwrite", XYFX_X, 0,  /* overwrite the old file == file warning off */    "rename",    XYFX_R, 0   /* rename the incoming file == file warning on */#ifndef MAC    /* This crashes Mac Kermit. */,   "update",    XYFX_U, 0  /* replace if newer */#endif /* MAC */};int ncolx = (sizeof(colxtab) / sizeof(struct keytab));static struct keytab rfiltab[] = {	/* for REMOTE SET FILE */    "collision",     XYFILX, 0,    "names",         XYFILN, 0,    "record-length", XYFILR, 0,    "type",          XYFILT, 0};int nrfilp = (sizeof(rfiltab) / sizeof(struct keytab));struct keytab eoftab[] = {   		/* File eof delimiters */    "cr",        XYFA_C, 0,    "crlf",      XYFA_2, 0,    "lf",        XYFA_L, 0};static int neoftab = (sizeof(eoftab) / sizeof(struct keytab));struct keytab fntab[] = {   		/* File naming */    "converted", XYFN_C, 0,    "literal",   XYFN_L, 0};int nfntab = (sizeof(fntab) / sizeof(struct keytab));#ifndef NOLOCAL/* Terminal parameters table */static struct keytab trmtab[] = {#ifdef OS2    "answerback",    XYTANS, 0,#endif /* OS2 */#ifdef CK_APC    "apc",           XYTAPC, 0,#endif /* CK_APC */#ifdef OS2    "arrow-keys",    XYTARR, 0,#endif /* OS2 */#ifdef NT    "attr",	     XYTATTR, CM_INV|CM_ABR,    "attr-bug",      XYTATTBUG, CM_INV,#endif /* NT */#ifdef OS2    "attribute",     XYTATTR, 0,#endif /* OS2 */#ifdef CK_APC#ifdef CK_AUTODL   "autodownload",   XYTAUTODL, 0,#endif /* CK_AUTODL */#endif /* CK_APC */#ifdef OS2    "bell",          XYTBEL, CM_INV,#endif /* OS2 */    "bytesize",      XYTBYT, 0,#ifndef NOCSETS#ifndef KUI#ifdef OS2    "character-set", XYTCS,  CM_INV,#else /* OS2 */    "character-set", XYTCS,  0,#endif /* OS2 */#endif /* KUI */#endif /* NOCSETS */#ifdef OS2    "code-page",     XYTCPG, 0,    "color",         XYTCOL, 0,    "controls",      XYTCTRL, 0,#endif /* OS2 */    "cr-display",    XYTCRD, 0,#ifdef OS2    "cursor",        XYTCUR, 0,#endif /* OS2 */    "debug",         XYTDEB, 0,    "echo",          XYTEC,  0,    "escape-character", XYTESC, 0,#ifdef OS2#ifdef PCFONTS    "font",          XYTFON, 0,#endif /* PCFONTS */#endif /* OS2 */    "height",        XYTHIG, 0,#ifdef OS2#ifdef COMMENT

⌨️ 快捷键说明

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