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

📄 ckuusx.c

📁 KERMIT工具 这在办公室下载不了,很多人都没有载不到.
💻 C
📖 第 1 页 / 共 5 页
字号:
#include "ckcsym.h"/*  C K U U S X --  "User Interface" common functions. *//*  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.*//*  This module contains user interface functions needed by both the interactive  user interface and the command-line-only user interface.*//* Includes */#include "ckcdeb.h"#include "ckcasc.h"#include "ckcker.h"#include "ckuusr.h"#include "ckcxla.h"#ifndef NOHTERMCAP#ifdef NOTERMCAP#define NOHTERMCAP#else#ifndef BSD44#define NOHTERMCAP#else#ifdef __bsdi__#define NOHTERMCAP#else#ifdef OPENBSD#define NOHTERMCAP#else#ifdef MACOSX#define NOHTERMCAP#endif /* MACOSX */#endif /* OPENBSD */#endif /* __bsdi__ */#endif /* BSD44 */#endif /* NOTERMCAP */#endif /* NOHTERMCAP */#ifndef NOTERMCAP#ifdef BSD44#ifndef NOHTERMCAP#include <termcap.h>#endif /* NOHTERMCAP */#endif /* BSD44 */#else  /* !BSD44 */#ifdef linux#include <term.h>#endif /* linux */#endif /* NOTERMCAP */#ifdef OS2#include <string.h>_PROTOTYP(char * os2_gethostname, (void));#define getpid _getpid#endif /* OS2 */#ifdef BSD44#include <errno.h>#endif /* BSD44 */extern xx_strp xxstring;#ifdef OS2#include "ckcnet.h"#else /* OS2 */_PROTOTYP(int getlocalipaddr, (void));_PROTOTYP(int istncomport, (void));#ifndef NOCKGETFQHOST_PROTOTYP( char * ckgetfqhostname,(char *));#endif	/* NOCKGETFQHOST */#ifndef NETCONN/*  We should just pull in ckcnet.h here, but it causes a conflict with curses.h.*/#ifdef TCPSOCKET#define NETCONN#else#ifdef SUNX25#define NETCONN#else#ifdef STRATUSX25#define NETCONN#else#ifdef IBMX25#define NETCONN#else#ifdef HPX25#define NETCONN#else#ifdef DECNET#define NETCONN#else#ifdef NPIPE#define NETCONN#else#ifdef CK_NETBIOS#define NETCONN#ifdef SUPERLAT#define NETCONN#else#endif /* SUPERLAT */#endif /* TCPSOCKET */#endif /* SUNX25 */#endif /* STRATUSX25 */#endif /* IBMX25 */#endif /* HPX25 */#endif /* DECNET */#endif /* NPIPE */#endif /* CK_NETBIOS */#endif /* NETCONN */#endif /* OS2 */#ifndef TCPSOCKET#ifdef MULTINET#define TCPSOCKET#endif /* MULTINET */#ifdef DEC_TCPIP#define TCPSOCKET#endif /* DEC_TCPIP */#ifdef WINTCP#define TCPSOCKET#endif /* WINTCP */#ifdef TCPWARE#define TCPSOCKET#endif /* TCPWARE */#endif /* TCPSOCKET */#ifdef OS2#ifdef NT#include <windows.h>#include <tapi.h>#include "ckntap.h"#else /* NT */#define INCL_VIO#include <os2.h>#endif /* NT */#ifdef COMMENT                          /* Would you believe */#undef COMMENT                          /* <os2.h> defines this ? */#endif /* COMMENT */#ifdef CK_NETBIOS#include "ckonbi.h"#endif /* CK_NETBIOS */#include "ckocon.h"extern ascreen commandscreen;#ifdef KUI#include "ikui.h"#endif /* KUI */#endif /* OS2 */#ifdef NT#include "cknwin.h"#endif /* NT */#ifdef OS2#include "ckowin.h"#include "ckosyn.h"#endif /* OS2 */#ifdef CK_TAPIextern int tttapi;extern int tapipass;#endif /* CK_TAPI */#ifdef CK_KERBEROS#include "ckuath.h"#endif /* CK_KERBEROS */#ifndef WINTCP#include <signal.h>#endif /* WINTCP */#ifdef VMS#include <descrip.h>#include <ssdef.h>#include <stsdef.h>#ifndef OLD_VMS#include <lib$routines.h>  /* Not for VAX C 2.3 */#else#include <libdef.h>#endif /* OLD_VMS */#ifdef WINTCP#include <signal.h>#endif /* WINTCP */#endif /* VMS */#ifdef DCLFDOPEN/* fdopen() needs declaring because it's not declared in <stdio.h> */_PROTOTYP( FILE * fdopen, (int, char *) );#endif /* DCLFDOPEN */#ifdef DCLPOPEN/* popen() needs declaring because it's not declared in <stdio.h> */_PROTOTYP( FILE * popen, (char *, char *) );#endif /* DCLPOPEN */int tt_crd = 0;                         /* Carriage return display */int interrupted = 0;                    /* Interrupted from keyboard flag */static int fxd_inited = 0;              /* Fullscreen stuff initialized */#ifdef DEBUGchar debfil[CKMAXPATH+1];               /* Debugging log file name */#endif /* DEBUG */#ifdef TLOGchar trafil[CKMAXPATH+1];               /* Transaction log file name */#endif /* TLOG */char sesfil[CKMAXPATH+1];               /* Session log file name */#ifdef CKLOGDIALchar diafil[CKMAXPATH+1];               /* Connection log file name */char cxlogbuf[CXLOGBUFL+1];             /* Connection log record buffer */int cx_active = 0;                      /* Connection is active */extern int dialog;#endif /* CKLOGDIAL */#ifdef DYNAMICstatic char *cmdstr = NULL;             /* Place to build generic command */#else#ifdef pdp11static char cmdstr[256];#elsestatic char cmdstr[4096];#endif /* pdp11 */#endif /* DYNAMIC */#ifndef NOMSENDchar fspec[CMDBL+4];                    /* Filename string for \v(filespec) */int fspeclen = CMDBL;#elsechar fspec[CKMAXPATH+4];int fspeclen = CKMAXPATH;#endif /* NOMSEND */char * rfspec = NULL;			/* Received filespec: local */char * prfspec = NULL;			/* Preliminary rfspec */char * sfspec = NULL;			/* Sent filespec: local */char * psfspec = NULL;			/* Preliminary sfspec */char * srfspec = NULL;			/* Received filespec: remote */char * psrfspec = NULL;			/* Preliminary srfspec */char * rrfspec = NULL;			/* Sent filespec: remote */char * prrfspec = NULL;			/* Preliminary rrfspec */int success = 1,                        /* Command success/failure flag */    cmdlvl = 0,                         /* Command level */    action = 0,				/* Action selected on command line */    slogts = 0,				/* Session-log timestamps on/off */#ifdef UNIX    sessft = XYFT_T,                    /* Session log file type */#else    sessft = XYFT_B,			/* (text for UNIX binary for others) */#endif /* UNIX */    pflag = 1,                          /* Print prompt */    msgflg = 1;                         /* Print informational messages */extern int xaskmore, saveask;		/* More-prompting */#ifdef CK_APCextern int apcactive;#endif /* CK_APC *//* External variables */extern int local, quiet, binary, network, what, parity, xitsta, escape,  tlevel, bgset, backgrd, xsuspend, cmdint, nettype, seslog, dfloc;extern int cmd_rows, cmd_cols, xcmdsrc;extern char cmdfil[];#ifdef VMSextern int batch;#endif /* VMS */#ifdef datageneral                      /* 2/12/92 ENH */#include <sysid.h>extern int con_reads_mt, conint_ch, conint_avl;#endif /* datageneral */extern long speed;extern char ttname[], *dftty, *cmarg, **cmlist, *versio, myhost[];#ifndef NOCSETSextern int fcharset, tcharset, xfrxla;extern struct csinfo fcsinfo[], tcsinfo[];#endif /* NOCSETS */#ifdef OS2extern unsigned char colorcmd;#endif /* OS2 */#ifdef NOXFERint fdispla = XYFD_N;#else  /* NOXFER is not defined */#ifdef OS2                              /* File transfer display type */int fdispla = XYFD_C;                   /* Curses (fullscreen) if we have it */#else#ifdef CK_CURSESint fdispla = XYFD_C;#elseint fdispla = XYFD_S;                   /* Otherwise CRT */#endif /* CK_CURSES */#endif /* OS2 */extern struct ck_p ptab[];extern int protocol, xfrbel, xfrint;#ifdef STREAMINGextern int streaming, streamok;#endif /* STREAMING *//* Used internally */_PROTOTYP( VOID screenc, (int, char, long, char *) );_PROTOTYP( VOID screeng, (int, char, long, char *) );#ifdef CK_CURSES#ifndef DYNAMICstatic char xtrmbuf[TRMBUFL];           /* tgetent() buffer */char * trmbuf = xtrmbuf;#elsechar * trmbuf = NULL;#endif /* DYNAMIC */_PROTOTYP( static VOID dpyinit, (void) );_PROTOTYP( static long shocps, (int, long, long) );_PROTOTYP( static long shoetl, (long, long, long, long) );#endif /* CK_CURSES */static int ft_win = 0;  /* Fullscreen file transfer display window is active *//* Variables declared here */static char * skreason[] = {    "",					/* 0 */    "Remote file not older",		/* SKP_DAT */    "Identical modification times",	/* SKP_EQU */    "Type",				/* SKP_TYP */    "Size",				/* SKP_SIZ */    "Name collision",			/* SKP_NAM */    "Exception List",			/* SKP_EXL */    "Dot file",				/* SKP_DOT */    "Backup file",			/* SKP_BKU */    "Recovery not needed",		/* SKP_RES */    "Access denied",			/* SKP_ACC */    "Not a regular file",		/* SKP_NRF */    "Simulated",			/* SKP_SIM */    "Simulated - Remote file older",	/* SKP_XUP */    "Simulated - No remote file",	/* SKP_XNX */};static int nskreason = (sizeof(skreason) / sizeof(char *));char *gskreason(n) int n; {    return((n > 0 && n < nskreason) ? skreason[n] : "");}char pktfil[CKMAXPATH+1];               /* Packet log file name */#ifndef NOMSEND                         /* Multiple SEND */char *msfiles[MSENDMAX];#endif /* NOMSEND */#ifdef CK_TIMERSextern long rttdelay;extern int  rttflg;#endif /* CK_TIMERS */extern int rcvtimo;#ifdef CK_RESENDextern int sendmode;extern long sendstart, rs_len;#endif /* CK_RESEND */#ifdef CK_PCT_BAR                       /* File transfer thermometer */int thermometer = 1;                    /* ON by default */#endif /* CK_PCT_BAR */#ifdef GFTIMERCKFLOAT gtv = -1.0, oldgtv = -1.0;#else#ifndef OS2static#endif /* OS2 */  long gtv = -1L, oldgtv = -1L;#endif /* GFTIMER */extern int server, bctu, rptflg, ebqflg, spsiz, urpsiz, wmax, czseen, cxseen,  winlo, displa, timint, npad, ebq, bctr, rptq, atcapu, lpcapu,  swcapu, wslotn, wslotr, rtimo, mypadn, sq, capas, rpsiz, tsecs,  pktlog, lscapu, dest, srvdis, wslots, spackets, spktl, rpktl,  retrans, wcur, numerrs, fsecs, whatru, crunched, timeouts,  rpackets, fncnv, bye_active, discard, inserver, diractive, cdactive;extern long filcnt, filrej, ffc, tfc, rptn, fsize, filcps, tfcps, cps, peakcps;long oldcps = 0L;extern CHAR *rdatap, padch, seol, ctlq, mypadc, eol, *epktmsg;extern char *xfrmsg;#ifdef IKSDBFILE * dbfp = NULL;                     /* File pointer to database file */int dbenabled = 1;                      /* Flag for database is enabled */extern int ikdbopen;                    /* Flag for database is open */unsigned long mydbseek = 0L;            /* Seek pointer to my record */int mydbslot = 0;                       /* My slot number */unsigned long myflags = 0L;             /* My flags */unsigned long myatype = 0L;             /* My authorization type */unsigned long myamode = 0L;             /* My authorization mode */unsigned long mystate = 0L;             /* My state (SEND, RECEIVE, etc) */unsigned long mypid = 0L;               /* My PID */unsigned long myip = 0L;                /* My IP address */unsigned long peerip = 0L;              /* My peer's IP address */unsigned long dbip = 0L;                /* IP address in db record */unsigned long dbpid = 0L;               /* PID in db record */unsigned long dbflags = 0L;             /* Flags field in db record */unsigned long dblastused = 0L;          /* Last in-use record in db */char dbrec[DB_RECL];                    /* Database record buffer */char * dbdir   = NULL;                  /* Database directory */char * dbfile  = NULL;                  /* Database file full pathname */char myhexip[33] = { NUL, NUL };        /* My IP address in hex */char peerhexip[33] = { NUL, NUL };      /* Client's IP address in hex */#endif /* IKSDB */#ifdef GFTIMERextern CKFLOAT fpfsecs, fptsecs, fpxfsecs;#elseextern long xfsecs;#endif /* GFTIMER */#endif /* NOXFER */#ifdef TCPSOCKET#ifdef NEWFTPextern char * ftp_host, ftp_srvtyp[];extern int ftp_csx, ftp_csl, ftp_deb;#endif /* NEWFTP */extern char myipaddr[];#endif /* TCPSOCKET */#ifndef NOICP#ifndef NOSPL    extern struct mtab *mactab;         /* For ON_EXIT macro. */    extern int nmac;#endif /* NOSPL */#ifdef DCMDBUFextern char *cmdbuf;                    /* Command buffer */#elseextern char cmdbuf[];                   /* Command buffer */#endif /* DCMDBUF */extern int cmd_quoting;#endif /* NOICP */#ifndef NOCCTRAP#ifdef NT#include <setjmpex.h>#else /* NT */

⌨️ 快捷键说明

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