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

📄 ckuus7.c

📁 C-Kermit源码。是使用串口/Modem和网络通讯的程序
💻 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, 2000,    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 file created from parts of ckuus3.c, which became too 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 VMS#ifndef TCPSOCKET#include <errno.h>#endif /* TCPSOCKET */#endif /* VMS */#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 <windows.h>#include <tapi.h>#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 CK_AUTHENTICATION#include "ckuath.h"#endif /* CK_AUTHENTICATION */#ifdef CK_SSL#include "ck_ssl.h"#endif /* CK_SSL */#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 */char * slmsg = NULL;static char * tmpslmsg = NULL;static int x, y = 0, z;static char *s;extern CHAR feol;extern int g_matchdot, saveask, hints;extern char * k_info_dir;#ifndef NOSPLextern int nmac;extern struct mtab *mactab;#endif /* NOSPL */#ifndef NOXFER#ifdef CK_SPEEDextern short ctlp[];			/* Control-char prefixing table */#endif /* CK_SPEED */#ifdef PIPESENDextern char * sndfilter;extern char * rcvfilter;#endif /* PIPESEND */extern char * snd_move;extern char * snd_rename;extern char * g_snd_move;extern char * g_snd_rename;extern char * rcv_move;extern char * rcv_rename;extern char * g_rcv_move;extern char * g_rcv_rename;#ifdef PATTERNSextern char *binpatterns[], *txtpatterns[];extern int patterns;#endif /* PATTERNS */extern char * remdest;#ifdef CK_TMPDIRchar * dldir = NULL;#endif /* CK_TMPDIR */extern struct ck_p ptab[];extern int protocol, remfile, rempipe, remappd, reliable, xreliable, fmask,  fncnv, frecl, maxrps, wslotr, bigsbsiz, bigrbsiz, urpsiz, rpsiz, spsiz,  bctr, npad, timef, timint, spsizr, spsizf, maxsps, spmax, nfils, displa,  atcapr, pkttim, rtimo, fncact, mypadn, fdispla, f_save, pktpaus, setreliable,  fnrpath, fnspath, atenci, atenco, atdati, atdato, atleni, atleno, atblki,  atblko, attypi, attypo, atsidi, atsido, atsysi, atsyso, atdisi, atdiso;extern int stathack;#ifdef STRATUSextern int atfrmi, atfrmo, atcrei, atcreo, atacti, atacto;#endif /* STRATUS */#ifdef CK_PERMSextern int atlpri, atlpro, atgpri, atgpro;#endif /* CK_PERMS */extern CHAR  sstate, eol, seol, stchr, mystch, mypadc, padch, ctlq, myctlq;#ifdef IKSDextern int inserver;#ifdef IKSDCONFextern int iksdcf;#endif /* IKSDCONF */#endif /* IKSD */extern char *cmarg, *cmarg2;#ifndef NOFRILLSextern char optbuf[];			/* Buffer for MAIL or PRINT options */extern int rprintf;			/* REMOTE PRINT flag */#endif /* NOFRILLS */#endif /* NOXFER */#ifdef CK_TRIGGERextern char * tt_trigger[];#endif /* CK_TRIGGER */extern int tcs_transp;#ifdef PCTERMextern int tt_pcterm;#endif /* PCTERM */#ifdef NTextern int tt_vtnt;#endif /* NT *//* Note: gcc -Wall wants braces around each keyword table entry. */static struct keytab psltab[] = {	/* SET LINE/PORT command options */    { "/connect", SL_CNX, 0 },#ifdef VMS    { "/noshare", SL_NSH, 0 },#endif /* VMS */    { "/server",  SL_SRV, 0 },#ifdef VMS    { "/share",   SL_SHR, 0 },#endif /* VMS */    { "", 0, 0 }};static int npsltab = sizeof(psltab)/sizeof(struct keytab) - 1;#ifdef NETCONNstatic struct keytab shtab[] = {	/* SET HOST command options */#ifdef NETCMD    "/command",      SL_CMD,    CM_INV,	/* (COMMAND is also a network type) */#endif /* NETCMD */    "/connect",      SL_CNX,    0,    "/network-type", SL_NET,    CM_ARG,    "/nowait",       SL_NOWAIT, 0,#ifndef NOSPL    "/password",     SL_PSW,    CM_ARG,#endif /* NOSPL */#ifdef NETCMD    "/pipe",         SL_CMD,    0,#endif /* NETCMD */#ifdef NETPTY    "/pty",          SL_PTY,    0,#endif /* NETPTY */    "/server",       SL_SRV,    0,    "/userid",       SL_UID,    CM_ARG,    "/wait",         SL_WAIT,   0,    "", 0, 0};static int nshtab = sizeof(shtab)/sizeof(struct keytab) - 1;static struct keytab shteltab[] = {	/* TELNET command options */#ifdef CK_AUTHENTICATION    "/auth",         SL_AUTH, CM_ARG,#endif /* CK_AUTHENTICATION */#ifdef CK_ENCRYPTION    "/encrypt",      SL_ENC,  CM_ARG,#endif /* CK_ENCRYPTION */    "/nowait",       SL_NOWAIT, 0,#ifndef NOSPL    "/password",     SL_PSW, CM_ARG,#endif /* NOSPL */    "/userid",       SL_UID, CM_ARG,    "/wait",         SL_WAIT,   0,    "", 0 ,0};static int nshteltab = sizeof(shteltab)/sizeof(struct keytab) - 1;#ifdef RLOGCODEstatic struct keytab shrlgtab[] = {	/* SET HOST RLOGIN command options */#ifdef CK_KERBEROS#ifdef CK_ENCRYPTION    "/encrypt",      SL_ENC, 0,#endif /* CK_ENCRYPTION */    "/k4",           SL_KRB4, CM_INV,    "/k5",           SL_KRB5, CM_INV,    "/kerberos4",    SL_KRB4, 0,    "/kerberos5",    SL_KRB5, 0,    "/kerberos_iv",  SL_KRB4, CM_INV,    "/kerberos_v",   SL_KRB5, CM_INV,    "/krb4",         SL_KRB4, CM_INV,    "/krb5",         SL_KRB5, CM_INV,#endif /* CK_KERBEROS */    "", 0 ,0};static int nshrlgtab = sizeof(shrlgtab)/sizeof(struct keytab)-1;#endif /* RLOGCODE */extern struct keytab netcmd[];extern int nnets;#ifndef NODIALextern int dirline;extern int nnetdir;			/* Network services directory */extern char *netdir[];_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) );extern int nopush;int mdmsav = -1;			/* Save modem type around network */extern int isguest;			/* Global flag for anonymous login */extern xx_strp xxstring;extern int success, binary, b_save, ckwarn, msgflg, quiet, cmask, pflag, local,  nettype, escape, mdmtyp, duplex, dfloc, network, cdtimo, autoflow, tnlm,  sosi, tlevel, lf_opts, backgrd, flow, debses, parity, ttnproto, ckxech,  x_ifnum, cmflgs, haveline, cxtype, cxflow[];extern char psave[];			/* For saving & restoring prompt */extern int sprmlen, rprmlen;#ifdef OS2static struct keytab strmkeytab[] = {    "clear",   0, 0,    "default", 1, 0};static int nstrmkeytab = sizeof(strmkeytab)/sizeof(struct keytab);static struct keytab strmswitab[] = {    "/literal", 0, 0};static int nstrmswitab = sizeof(strmswitab)/sizeof(struct keytab);static struct keytab normrev[] = {    "dark-display", 0, 0,    "light-display", 1, 0,    "normal",   0, 0,    "reverse",  1, 0};static struct keytab prnmtab[] = {    "auto", 1, 0,    "copy", 2, 0,    "off",  0, 0,    "on",   1, CM_INV,			/* Compatibility with XPRINT version */    "transparent", 3, 0};static int nprnmtab = sizeof(prnmtab)/sizeof(struct keytab);extern int tt_diff_upd;#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 = TVC_ENA;extern struct _vtG G[4];extern int priority;extern bool send_c1;int send_c1_usr = FALSE;extern int sgrcolors;extern int marginbell, marginbellcol;extern int autoscroll, wy_autopage;extern int tt_sac;extern int dec_nrc, dec_lang, dec_kbd;#else /* OS2 */extern int tt_rows, tt_cols;#endif /*  OS2 */extern int tt_escape;extern long speed;extern char *dftty;extern char *tp, *lp;			/* Temporary buffer & pointers */extern char ttname[];int tttapi = 0;				/* is Line TAPI? */struct keytab * tapilinetab = NULL;struct keytab * _tapilinetab = NULL;int ntapiline = 0;#ifdef NETCONN				/* Network items */#ifdef ANYX25extern int revcall, closgr, cudata, nx25;extern char udata[];extern struct keytab x25tab[];#ifndef IBMX25extern int npadx3;extern CHAR padparms[];extern struct keytab padx3tab[];#endif /* IBMX25 */#endif /* ANYX25 */#ifdef OS2#ifndef NTextern bool ttslip,ttppp;#endif /* NT */#endif /* OS2 */#ifdef NPIPEextern char pipename[];#endif /* NPIPE */#ifdef TCPSOCKETstatic struct keytab tcprawtab[] = {	/* SET HOST options */    "/default",    NP_DEFAULT,    CM_INV,#ifdef CK_AUTHENTICATION#ifdef CK_KERBEROS#ifdef RLOGCODE    "/ek4login",    NP_EK4LOGIN,    0,    "/ek5login",    NP_EK5LOGIN,    0,    "/k4login",     NP_K4LOGIN,     0,    "/k5login",     NP_K5LOGIN,     0,#endif /* RLOGCODE */#endif /* CK_KERBEROS */#endif /* CK_AUTHENTICATION */    "/no-telnet-init", NP_NONE,   0,    "/none",       NP_NONE,   CM_INV,    "/raw-socket", NP_TCPRAW, 0,#ifdef RLOGCODE    "/rlogin",     NP_RLOGIN, 0,#endif /* RLOGCODE */#ifdef CK_SSL    "/ssl",        NP_SSL,    0,    "/ssl-telnet", NP_SSL_TELNET, 0,#endif /* CK_SSL */    "/telnet",     NP_TELNET, 0,#ifdef CK_SSL    "/tls",        NP_TLS,    0,    "/tls-telnet", NP_TLS_TELNET, 0,#endif /* CK_SSL */    "", 0, 0};static int ntcpraw = (sizeof(tcprawtab) / sizeof(struct keytab)) - 1;#ifdef RLOGCODE_PROTOTYP( int rlog_naws, (void) );#endif /* RLOGCODE */#endif /* TCPSOCKET */#ifdef SUPERLATextern char slat_pwd[18];#endif /* SUPERLAT */#endif /* NETCONN */#ifdef TNCODEextern int tn_wait_flg;#endif /* TNCODE */#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 */#ifdef OS2				/* AUTODOWNLOAD parameters */extern int    adl_kmode, adl_zmode;	/* Match Packet to signal download */extern char * adl_kstr;			/* KERMIT Download String */extern char * adl_zstr;			/* ZMODEM Download String */extern int adl_kc0, adl_zc0;		/* Process ADL C0s in emulation */#endif /* OS2 *//* Keyword tables ... */extern struct keytab onoff[], rltab[];extern int nrlt;/* SET FILE parameters */static struct keytab filtab[] = {#ifndef NOXFER#ifdef PATTERNS    "binary-patterns",   XYFIBP, 0,#endif /* PATTERNS */    "bytesize",         XYFILS, 0,#ifndef NOCSETS    "character-set",    XYFILC, 0,#endif /* NOCSETS */    "collision",        XYFILX, 0,

⌨️ 快捷键说明

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