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

📄 ckcmai.c

📁 KERMIT工具 这在办公室下载不了,很多人都没有载不到.
💻 C
📖 第 1 页 / 共 5 页
字号:
int initflg = 0;                        /* sysinit() has executed... */int howcalled = I_AM_KERMIT;            /* How I was called */int hmtopline = 0;int quitting = 0;			/* I'm in the act of quitting */#ifdef IKSDCONFchar * iksdconf = IKSDCONF;             /* IKSD configuration file */int    iksdcf   = 0;                    /* Has IKSD c.f. been processed? */#endif /* IKSDCONF */int srvcdmsg = 0;                       /* [Server] CD message */char * cdmsgfile[8] = { NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL };char * cdmsgstr = NULL;char * ckcdpath = NULL;#ifdef NLCHAR                           /* Text-file line terminator */CHAR feol = NLCHAR;#elseCHAR feol = 0;#endif /* NLCHAR */int fblksiz = DBLKSIZ;          /* File blocksize */int frecl = DLRECL;             /* File record length */int frecfm = XYFF_S;            /* File record format (default = stream) */int forg = XYFO_S;              /* File organization (sequential) */int fcctrl = XYFP_N;            /* File carriage control (ctrl chars) */int filecase = FILECASE;        /* Case matters in filenames */int stathack = 1;               /* Fast directory lookups by default */char uidbuf[UIDBUFLEN] = { NUL, NUL };  /* User ID buffer */int cfilef = 0;                         /* Application ("kerbang") file flag */char cmdfil[CKMAXPATH + 1] = { NUL, NUL }; /* Application file name */int haveurl = 0;                        /* URL given on command line */#ifndef NOXFER/* Multi-protocol support */struct ck_p ptab[NPROTOS] = {           /* Initialize the Kermit part ... */  { "Kermit",    DRPSIZ,                             /* Receive packet size */    DSPSIZ,                             /* Send packet size */    0,                                  /* Send-packet-size-set flag */    DFWSIZ,                             /* Window size */#ifdef NEWDEFAULTS    PX_CAU,                             /* Control char unprefixing... */#else    PX_ALL,#endif /* NEWDEFAULTS */#ifdef VMS                              /* Default filename collision action */    XYFX_X,                             /* REPLACE for VAX/VMS */#else    XYFX_B,                             /* BACKUP for everybody else */#endif /* VMS */#ifdef OS2                              /* Flag for file name conversion */    XYFN_L,                             /* Literal for OS2 */#else    XYFN_C,                             /* Converted for others */#endif /* OS2 */    PATH_OFF,                   /* Send pathnames OFF */    PATH_AUTO,                  /* Receive pathnames AUTO */    NULL,                       /* Host receive initiation string (binary) */    NULL,                       /* Host receive initiation string (text)   */    NULL,                       /* Host server string */    NULL,                       /* External protocol send command (binary) */    NULL,                       /* External protocol send command (text)   */    NULL,                       /* External protocol receive command (bin) */    NULL }                      /* External protocol receive command (txt) */#ifdef CK_XYZ,{"XMODEM",    128,128,-1,-1,   1,-1,-1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL},{"XMODEM-CRC",128,128,-1,-1,  -1,-1,-1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL},{"YMODEM",   -1, -1,-1,-1,    -1,-1,-1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL},{"YMODEM-g", -1, -1,-1,-1,    -1,-1,-1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL},{"ZMODEM",   -1, -1,-1,-1,PX_WIL,-1,-1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL},{"Other",    -1, -1,-1,-1,    -1,-1,-1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL}#endif /* CK_XYZ */};/* Declarations for Send-Init Parameters */int spsiz = DSPSIZ,                     /* Current packet size to send */    spmax = DSPSIZ,                     /* Biggest packet size we can send */    lastspmax = DSPSIZ,                 /* Send-packet size last used */    spsizr = DSPSIZ,                    /* Send-packet size requested */    spsizf = 0,                         /* Flag to override size negotiation */    rpsiz = DRPSIZ,                     /* Biggest we want to receive */    urpsiz = DRPSIZ,                    /* User-requested receive pkt size */    maxrps = MAXRP,                     /* Maximum incoming long packet size */    maxsps = MAXSP,                     /* Maximum outbound l.p. size */    maxtry = MAXTRY,                    /* Maximum retries per packet */    wslots = 1,                         /* Window size currently in use */    wslotr = DFWSIZ,                    /* Window size from SET WINDOW */    wslotn = 1,                         /* Window size negotiated in S-pkt */    timeouts = 0,                       /* For statistics reporting */    spackets = 0,                       /*  ... */    rpackets = 0,                       /*  ... */    retrans = 0,                        /*  ... */    crunched = 0,                       /*  ... */    wmax = 0,                           /*  ... */    wcur = 0,                           /*  ... */    srvidl = 0,                         /* Server idle timeout */    srvdis = 1,                         /* Server file xfer display */    srvtim = DSRVTIM,                   /* Server command wait timeout */    srvping = 1,                        /* Server keepalive *//*  timint is the timeout interval I use when waiting for a packet.  pkttim is the SET RECEIVE TIMEOUT value, sent to the other Kermit.  rtimo is the SET SEND TIMEOUT value.  rtimo is the initial value of  timint.  timint is changed by the value in the incoming negotiation  packet unless a SET SEND TIMEOUT command was given.*/    timint = DMYTIM,                    /* Timeout interval I use */    pkttim = URTIME,                    /* Timeout I want you to use */    rtimo = DMYTIM,                     /* Normal packet wait timeout */    timef = 0,                          /* Flag to override what you ask */#ifdef CK_TIMERS    rttflg = 1,                         /* Use dynamic round-trip timers */#else    rttflg = 0,                         /* Use fixed timer */#endif /* CK_TIMERS */    mintime = 1,                        /* Minimum timeout */    maxtime = 0,                        /* Maximum timeout */    npad = MYPADN,                      /* How much padding to send */    mypadn = MYPADN,                    /* How much padding to ask for */    bctr = DFBCT,                       /* Block check type requested */    bctu = 1,                           /* Block check type used */    bctl = 1,                           /* Block check length */    c_save = -1,                        /* Block check saving and restoring */    ss_save = -1,                       /* Slow-start saving and restoring */    ebq =  MYEBQ,                       /* 8th bit prefix */    ebqflg = 0,                         /* 8th-bit quoting flag */    rqf = -1,                           /* Flag used in 8bq negotiation */    rq = 0,                             /* Received 8bq bid */    sq = 'Y',                           /* Sent 8bq bid */    rpt = 0,                            /* Repeat count */    rptq = MYRPTQ,                      /* Repeat prefix */    rptflg = 0,                         /* Repeat processing flag */    rptena = 1,                         /* Repeat processing enabled */    xfrcan = 1,                         /* Transfer cancellation enabled */    xfrint = 1,                         /* Transfer interruption enabled */    xfrchr = 3,                         /* Transfer cancel char = Ctrl-C */    xfrnum = 3,                         /* Need three of them by default */    g_xfrxla = -1;    char * xfrmsg = NULL;               /* Message for f.t. display screen */#endif /* NOXFER */#ifdef NOCSETSint xfrxla = 0;                         /* Character-set translation */#elseint xfrxla = 1;                         /* enabled or disabled */#endif /* NOCSETS */#ifndef NOXFERint epktflg = 0;                        /* E-PACKET command active */int capas  = 9,                         /* Position of Capabilities */    lpcapb = 2,                         /* Long Packet capability */    lpcapr = 1,                         /*  requested */    lpcapu = 0,                         /*  used */    swcapb = 4,                         /* Sliding Window capability */    swcapr = 1,                         /*  requested (allowed) */    swcapu = 0,                         /*  used */    atcapb = 8,                         /* Attribute capability */    atcapr = 1,                         /*  requested */    atcapu = 0,                         /*  used */    rscapb = 16,                        /* RESEND capability */    rscapr = 1,                         /*  requested by default */    rscapu = 0,                         /*  used */    lscapb = 32,                        /* Locking Shift capability */    lscapr = 1,                         /*  requested by default */    lscapu = 0;                         /*  used *//* Flags for whether to use particular attributes */int atenci = 1,                         /* Encoding in */    atenco = 1,                         /* Encoding out */    atdati = 1,                         /* Date in */    atdato = 1,                         /* Date out */    atdisi = 1,                         /* Disposition in/out */    atdiso = 1,    atleni = 1,                         /* Length in/out (both kinds) */    atleno = 1,    atblki = 1,                         /* Blocksize in/out */    atblko = 1,    attypi = 1,                         /* File type in/out */    attypo = 1,    atsidi = 1,                         /* System ID in/out */    atsido = 1,    atsysi = 1,                        /* System-dependent parameters in/out */    atsyso = 1;int dispos = 0;                         /* Disposition */#ifdef CK_PERMSint atlpri = 1,    atlpro = 1,    atgpri = 1,    atgpro = 1;#endif /* CK_PERMS */int atfrmi = 1,                         /* Record Format in/out */    atfrmo = 1;#ifdef STRATUSint atcrei = 1,                         /* Creator ID in/out */    atcreo = 1,    atacti = 1,                         /* Account in/out */    atacto = 1;#endif /* STRATUS */int sprmlen = -1;                       /* Send/Receive protocol parameter */int rprmlen = -1;                       /* string length limits */int sendipkts = 1;                      /* Send I packets */CHAR padch = MYPADC,                    /* Padding character to send */    mypadc = MYPADC,                    /* Padding character to ask for */    seol = MYEOL,                       /* End-Of-Line character to send */    eol = MYEOL,                        /* End-Of-Line character to look for */    ctlq = CTLQ,                        /* Control prefix in incoming data */    myctlq = CTLQ,                      /* Outbound control character prefix */    myrptq = MYRPTQ;                    /* Repeat prefix I want to use */int rptmin = 3;                         /* Repeat-count minimum */int usepipes = 0,                       /* Used for xfer to/from pipes */    g_usepipes = -1;char * filefile = NULL;                 /* File containing list of filenames *//* CD message filename list */char whoareu[16] = { NUL, NUL };        /* System ID of other Kermit */int sysindex = -1;                      /* and index to its system ID struct */int myindex  = -1;int wearealike = 0;                     /* 2 Kermits have compatible sysids */char * cksysid =                        /* My system ID */#ifdef UNIX    "U1"#else#ifdef VMS    "D7"#else#ifdef OSK    "UD"#else#ifdef AMIGA    "L3"#else#ifdef MAC    "A3"#else#ifdef OS2#ifdef NT    "UN"#else /* NT */    "UO"#endif /* NT */#else /* OS2 */#ifdef datageneral    "F3"#else#ifdef GEMDOS    "K2"#else#ifdef STRATUS    "MV"#else    ""#endif /* STRATUS */#endif /* GEMDOS */#endif /* datageneral */#endif /* OS2 */#endif /* MAC */#endif /* AMIGA */#endif /* OSK */#endif /* VMS */#endif /* UNIX */    ;int oopts = -1;                         /* O-Packet Options */int omode = -1;                         /* O-Packet Transfer Mode */int oname = -1;                         /* O-Packet Filename Options */int opath = -1;                         /* O-Packet Pathname Options */struct zattr iattr;                     /* Incoming file attributes */#ifdef VMS/* VMS labeled file default options - name only. */int lf_opts = LBL_NAM;#else#ifdef OS2/* OS/2 labeled file default options, all attributes but archived. */unsigned long int lf_opts = LBL_EXT|LBL_HID|LBL_RO|LBL_SYS;#elseint lf_opts = 0;#endif /* OS2 */#endif /* VMS *//* Packet-related variables */int pktnum = 0,                         /* Current packet number */    sndtyp = 0,                         /* Type of packet just sent */    rcvtyp = 0,                         /* Type of packet just received */    rsn,                                /* Received packet sequence number */    rln,                                /* Received packet length */    size,                               /* Current size of output pkt data */    osize,                              /* Previous output packet data size */    maxsize,                            /* Max size for building data field */    spktl = 0,                          /* Length packet being sent */    rpktl = 0,                          /* Length of packet just received */    pktpaus = 0,                        /* Interpacket pause interval, msec */    rprintf,                            /* REMOTE PRINT flag */    rmailf,                             /* MAIL flag */    xferstat = -1,                      /* Status of last transaction */    filestatus = 0;                     /* Status of last file transfer */CHAR pktmsgbuf[PKTMSGLEN+1];CHAR *epktmsg = pktmsgbuf;#ifdef pdp11int srvcmdlen = MAXRP;                  /* srvcmd buffer length */#else#ifdef DYNAMICint srvcmdlen = MAXRP;#elseint srvcmdlen = 0;#endif /* DYNAMIC */#endif /* pdp11 */

⌨️ 快捷键说明

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