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

📄 ckuusr.c

📁 KERMIT工具 这在办公室下载不了,很多人都没有载不到.
💻 C
📖 第 1 页 / 共 5 页
字号:
#ifdef SSHTEST#define SSHBUILTIN#endif /* SSHTEST */#include "ckcsym.h"char *userv = "User Interface 8.0.278, 12 Mar 2004";/*  C K U U S R --  "User Interface" for C-Kermit (Part 1)  *//*  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.*//*  Originally the entire user interface was in one module, ckuusr.c.  Over  the years it has been split into many modules: ckuus2.c, ckuus3.c, ...,  ckuus7.c.  ckuus2.c contains the HELP command parser and help-text strings;  ckuusy.c contains the UNIX-style command-line interface; ckuusx.c contains  routines needed by both the command-line interface and the interactive  command parser.*//*  The ckuus*.c modules depend on the existence of C library features like  fopen, fgets, feof, (f)printf, argv/argc, etc.  Other functions that are  likely to vary among different platforms -- like setting terminal modes or  interrupts -- are invoked via calls to functions that are defined in the  system- dependent modules, ck?[ft]io.c.  The command line parser processes  any arguments found on the command line, as passed to main() via argv/argc.  The interactive parser uses the facilities of the cmd package (developed for  this program, but usable by any program).  Any command parser may be  substituted for this one.  The only requirements for the Kermit command  parser are these:  . Set parameters via global variables like duplex, speed, ttname, etc.  See    ckmain.c for the declarations and descriptions of these variables.  . If a command can be executed without the use of Kermit protocol, then    execute the command directly and set the variable sstate to 0. Examples    include 'set' commands, local directory listings, the 'connect' command.  . If a command requires the Kermit protocol, set the following variables:     sstate                             string data       'x' (enter server mode)            (none)       'r' (send a 'get' command)         cmarg, cmarg2       'v' (enter receive mode)           cmarg2       'g' (send a generic command)       cmarg       's' (send files)                   nfils, cmarg & cmarg2 OR cmlist       'c' (send a remote host command)   cmarg     cmlist is an array of pointers to strings.     cmarg, cmarg2 are pointers to strings.     nfils is an integer.     cmarg can be a filename string (possibly wild), or	a pointer to a prefabricated generic command string, or	a pointer to a host command string.     cmarg2 is an "as-name" - the name to send file(s) under, or	the name under which to store incoming file(s); must not be wild.	A null or empty value means to use the file's own name.     cmlist is a list of filenames, such as passed via argv.     nfils is an integer, interpreted as follows:       -1: filespec (possibly wild) in cmarg, must be expanded internally.	0: send from stdin (standard input).       >0: number of files to send, from cmlist.  The screen() function is used to update the screen during file transfer.  The tlog() function writes to a transaction log.  The debug() function writes to a debugging log.  The intmsg() and chkint() functions provide the user i/o for interrupting    file transfers.*//* Includes */#ifdef MULTINET#define MULTINET_OLD_STYLE		/* Leave select prototype undefined */#endif /* MULTINET */#include "ckcdeb.h"#include "ckcasc.h"#include "ckcker.h"#include "ckcnet.h"			/* Network symbols */#include "ckuusr.h"#include "ckcxla.h"int g_fncact = -1;			/* Needed for NOICP builds */int noinit = 0;				/* Flag for skipping init file */int nscanfile = SCANFILEBUF;int rcdactive = 0;			/* RCD active */int keepallchars = 0;			/* See cmfld() */int locus = 1;				/* Current LOCUS is LOCAL */#ifdef OS2int autolocus = 2;			/* Automatic LOCUS switching: ASK */#else /* OS2 */int autolocus = 1;			/* Automatic LOCUS switching enabled */#endif /* OS2 */#ifndef NOICP#ifdef CKLEARN#ifdef VMS#include <time.h>			/* For CKLEARN */#endif /* VMS */#endif /* CKLEARN */#ifdef OS2#ifndef NT#define INCL_NOPM#define INCL_VIO			/* Needed for ckocon.h */#include <os2.h>#undef COMMENT#else#define APIRET ULONG#include <windows.h>#include <tapi.h>#include "cknwin.h"#include "ckntap.h"			/* CK_TAPI definition */#endif /* NT */#include "ckowin.h"#include "ckocon.h"extern int tcp_avail;extern bool viewonly;extern int k95stdout;extern int tt_scroll;#ifndef NOTERMextern tt_status[VNUM];#endif /* NOTERM */int display_demo = 1;#include "ckossh.h"#ifdef KUI#include "ikui.h"#endif /* KUI */#endif /* OS2 */int optlines = 0;int didsetlin = 0;#ifdef NEWFTPextern int ftpget, ftpisopen(), doftpres();_PROTOTYP(int doftptyp,(int));#endif /* NEWFTP */#ifdef VMSextern int batch;#endif /* VMS */#ifdef datageneral#include <packets:common.h>#define fgets(stringbuf,max,fd) dg_fgets(stringbuf,max,fd)#endif /* datageneral */extern int xcmdsrc, hints, cmflgs, whyclosed;char * hlptok = NULL;#ifdef CK_TTGWSIZ			/* Whether to use more-prompting */int xaskmore = 1;			/* Momentary setting */int saveask  = 1;			/* Permanent setting */#elseint xaskmore = 0;int saveask  = 0;#endif /* CK_TTGWSIZ */#ifndef NOCSETSextern int nfilc;extern struct keytab fcstab[];extern int fcharset;#endif /* NOCSETS */char * g_pswd = NULL;int g_pcpt = -1;int g_pflg = -1;extern int cmd_rows, cmd_cols;#ifdef CKROOTextern int ckrooterr;#endif /* CKROOT */extern int inserver, filepeek;#ifdef CKLEARNFILE * learnfp = NULL;char * learnfile = NULL;int learning = 0;#endif /* CKLEARN */#ifndef NOXFERextern int atcapr, atdiso, nfils, moving, protocol, sendmode, epktflg, size,  sndsrc, server, displa, fncnv, fnspath, fnrpath, xfermode, urpsiz,  spsizf, spsiz, spsizr, spmax, wslotr, prefixing, fncact, reliable,  setreliable;#ifdef IKSDCONFextern int iksdcf;#endif /* IKSDCONF */#ifdef CK_LOGINextern int isguest;#endif /* CK_LOGIN */extern long sendstart;extern char *cmarg, *cmarg2, **cmlist, *dftty;extern struct keytab fntab[]; extern int nfntab;extern struct ck_p ptab[NPROTOS];int sndcmd = 0;		/* Last command was a SEND-class command. */int g_xfermode = -1;int g_proto  = -1;int g_urpsiz = -1;int g_spsizf = -1;int g_spsiz  = -1;int g_spsizr = -1;int g_spmax  = -1;int g_wslotr = -1;int g_prefixing = -1;int g_fncnv  = -1;int g_fnspath = -1;int g_fnrpath = -1;int g_fnact  = -1;int g_displa = -1;int g_spath  = -1;int g_rpath  = -1;char * g_sfilter = NULL;char * g_rfilter = NULL;extern int patterns;#ifdef PATTERNSextern char *txtpatterns[], *binpatterns[];int g_patterns = -1;#endif /* PATTERNS */int g_skipbup = -1;#ifdef PIPESENDextern int usepipes, pipesend;extern char * sndfilter;#endif /* PIPESEND */#ifndef NOSPLextern int sndxlo, sndxhi, sndxin;#endif /* NOSPL */extern char fspec[];			/* Most recent filespec */extern int fspeclen;			/* Length of fspec[] buffer */#ifndef NOFRILLSextern int rmailf;			/* MAIL command items */extern char optbuf[];#endif /* NOFRILLS */extern int  en_cpy, en_cwd, en_del, en_dir, en_fin, en_get, en_bye, en_mai, en_pri,  en_hos, en_ren, en_sen, en_spa, en_set, en_typ, en_who, en_ret, en_xit,  en_mkd, en_rmd, en_asg;#ifndef NOMSEND				/* Multiple SEND */extern char *msfiles[];int filesinlist = 0;			/* And ADD ... */extern struct filelist * filehead;extern struct filelist * filetail;extern struct filelist * filenext;extern int addlist;#endif /* NOMSEND */static struct keytab addtab[] = {#ifdef PATTERNS    { "binary-patterns", ADD_BIN, 0 },#endif /* PATTERNS */#ifndef NOMSEND    { "send-list", ADD_SND, 0 },#endif /* NOMSEND */#ifdef PATTERNS    { "text-patterns", ADD_TXT, 0 },#endif /* PATTERNS */    { "", 0, 0 }};static int naddtab = sizeof(addtab)/sizeof(struct keytab) - 1;#ifndef NOCSETSstruct keytab assoctab[] = {    { "file-character-set",     ASSOC_FC, 0 },    { "transfer-character-set", ASSOC_TC, 0 },    { "xfer-character-set",     ASSOC_TC, CM_INV }};static int nassoc = sizeof(assoctab)/sizeof(struct keytab);extern int afcset[MAXFCSETS+1];		/* Character-set associations */extern int axcset[MAXTCSETS+1];#endif /* NOCSETS */#ifndef ADDCMD#ifndef NOMSEND#define ADDCMD#endif /* NOMSEND */#ifndef ADDCMD#ifdef PATTERNS#define ADDCMD#endif /* PATTERNS */#endif /* ADDCMD */#endif /* ADDCMD */#endif /* NOXFER *//* External Kermit Variables, see ckmain.c for description. */extern xx_strp xxstring;extern long xvernum;extern int local, xitsta, binary, msgflg, escape, duplex, quiet, tlevel,  pflag, zincnt, ckxech, carrier, what, nopush, haveline, bye_active;#ifdef TNCODEextern int debses;extern char tn_msg[];#endif /* TNCODE */int sleepcan = 1;int g_binary = -1;int g_recursive = -1;int g_matchdot = -1;extern int nolinks;extern long vernum;extern char *versio, *copyright[];extern char *ckxsys;#ifndef NOHELPextern char *introtxt[];extern char *newstxt[];#endif /* NOHELP */#ifndef OS2#ifndef UNIXextern char *PWDCMD;#endif /* UNIX */extern char *WHOCMD;#endif /* OS2 */extern char ttname[];extern CHAR sstate;extern int network;			/* Have active network connection */extern int nettype;			/* Type of network */extern int ttnproto;                    /* NET_TCPB protocol */#ifndef NODIALextern int dialsta, dialatmo, dialcon, dialcq; /* DIAL status, etc. */#endif /* NODIAL */#ifdef CK_APCextern int apcactive, apcstatus;#endif /* CK_APC */#ifndef NOPUSH#ifndef NOFRILLSextern char editor[];extern char editopts[];extern char editfile[];#endif /* NOFRILLS */#endif /* NOPUSH */#ifdef BROWSERextern char browser[];			/* Web browser application */extern char browsopts[];		/* Web browser options */extern char browsurl[];			/* Most recent URL */#endif /* BROWSER */#ifndef NOFTPchar ftpapp[CKMAXPATH+1] = { NUL, NUL }; /* ftp executable */char ftpopts[128] = { NUL, NUL };	/* ftp command-line options */#endif /* NOFTP */extern struct keytab onoff[];		/* On/Off keyword table */#ifdef CK_TMPDIRint f_tmpdir = 0;			/* Directory changed temporarily */char savdir[TMPDIRLEN];			/* For saving current directory */#endif /* CK_TMPDIR */int activecmd = -1;			/* Keyword index of active command */int doconx = -1;			/* CONNECT-class command active */int ooflag = 0;				/* User-settable on/off flag */int rcflag = 0;				/* Pointer to home directory string */int repars,				/* Reparse needed */    techo = 0;				/* Take echo */int secho = 1;				/* SCRIPT echo */int xitwarn =			/* Warn about open connection on exit */#ifdef NOWARN0#else1#endif /* NOWARN */;struct keytab onoffsw[] = {    { "/off", 0, 0 },    { "/on",  1, 0 }};#ifdef CKEXECstruct keytab redirsw[] = {    { "/redirect", 1, 0 }};#endif /* CKEXEC */#ifndef NOXMIT/* Variables for TRANSMIT command */int xmitx = 1;			/* Whether to echo during TRANSMIT */int xmitf = 0;			/* Character to fill empty lines */int xmitl = 0;			/* 0 = Don't send linefeed too */int xmitp = LF;			/* Host line prompt */int xmits = 0;			/* Use shift-in/shift-out, 0 = no */int xmitw = 0;			/* Milliseconds to pause during TRANSMIT */int xmitt = 1;			/* Seconds to wait for each char to echo */int xmita = 1;			/* Action upon timeout */#define XMI_BIN 1#define XMI_TXT 2#define XMI_CMD 3#define XMI_TRA 4#define XMI_VRB 5#define XMI_QUI 6#define XMI_NOW 7#define XMI_NOE 8static struct keytab xmitsw[] = {	/* TRANSMIT command options */    { "/binary",          XMI_BIN, 0 },#ifdef PIPESEND    { "/command",         XMI_CMD, CM_INV|CM_PSH },#endif /* PIPESEND */    { "/noecho",          XMI_NOE, 0 },    { "/nowait",          XMI_NOW, 0 },#ifdef PIPESEND    { "/pipe",            XMI_CMD, 0 },#endif /* PIPESEND */#ifdef COMMENT    { "/quiet",           XMI_QUI, 0 },#endif /* COMMENT */    { "/text",            XMI_TXT, 0 },    { "/transparent",     XMI_TRA, 0 },#ifdef COMMENT    { "/verbose",         XMI_VRB, 0 },#endif /* COMMENT */    { "", 0, 0 }};#define NXMITSW sizeof(xmitsw)/sizeof(struct keytab) - 1static int nxmitsw = NXMITSW;#endif /* NOXMIT *//* Declarations from ck?fio.c module */extern char *SPACMD, *SPACM2;		/* SPACE commands *//* Command-oriented items */

⌨️ 快捷键说明

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