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

📄 ckuusy.c

📁 C-Kermit源码。是使用串口/Modem和网络通讯的程序
💻 C
📖 第 1 页 / 共 5 页
字号:
            optact[i] = 1;            break;          case 'P':            opthlp[i] = "Literal file (Path) names";            arghlp[i] = NULL;            break;          case 'Q':            opthlp[i] = "Quick (FAST) Kermit protocol settings";            arghlp[i] = NULL;            break;          case 'R':                     /* Remote-Only */            opthlp[i] = "Remote-only (makes IF REMOTE true)";            arghlp[i] = NULL;            break;          case 'S':                     /* "Stay" - enter interactive */            opthlp[i] = "Stay (enter command parser after action options)";            arghlp[i] = NULL;            break;          case 'T':                     /* Text file transfer mode */            opthlp[i] = "Transfer files in Text mode";            arghlp[i] = NULL;            break;#ifdef ANYX25          case 'U':                     /* X.25 call user data */            opthlp[i] = "X.25 call User data";            arghlp[i] = "Call-user-data string";            break;#endif /* ANYX25 */          case 'V':                     /* No automatic filetype switching */            opthlp[i] = "Disable automatic filetype switching";            arghlp[i] = NULL;            break;#ifdef COMMENT#ifdef OS2          case 'W':                     /* Win32 Window Handle */            opthlp[i] = "";            arghlp[i] = NULL;            break;#endif /* OS2 */#endif /* COMMENT */#ifdef ANYX25          case 'X':                     /* SET HOST to X.25 address */            opthlp[i] = "Make an X.25 connection";            arghlp[i] = "X.25 or X.121 address";            break;#endif /* ANYX25 */          case 'Y':                     /* No initialization file */            opthlp[i] = "Skip initialization file";            arghlp[i] = NULL;            break;#ifdef ANYX25          case 'Z':                     /* SET HOST to X.25 file descriptor */            opthlp[i] = "Make an X.25 connection";            arghlp[i] = "Numeric file descriptor of open X.25 connection";            break;#endif /* ANYX25 */          case 'a':                     /* as-name */            opthlp[i] = "As-name for file(s) in -s, -r, or -g";            arghlp[i] = "As-name string";            break;          case 'b':                     /* Set bits-per-second for serial */            opthlp[i] = "Speed for serial device";            arghlp[i] = "Numeric Bits per second";            break;          case 'c':                     /* Connect before */            optact[i] = 1;            opthlp[i] = "CONNECT before transferring files";            arghlp[i] = NULL;            break;          case 'd':                     /* DEBUG */            opthlp[i] = "Create debug.log file";            arghlp[i] = NULL;            break;          case 'e':                     /* Extended packet length */            opthlp[i] = "Receive packet length";            arghlp[i] = "Length in bytes";            break;          case 'f':                     /* finish */            optact[i] = 1;            opthlp[i] = "Send Finish command to server";            arghlp[i] = NULL;            break;          case 'g':                     /* get */            optact[i] = 1;            opthlp[i] = "GET file(s)";            arghlp[i] = "Remote file specification";            break;          case 'h':                     /* help */            optact[i] = 1;            opthlp[i] = "Print brief Help (usage) text";            arghlp[i] = NULL;            break;          case 'i':                     /* Treat files as binary */            opthlp[i] ="Transfer files in bInary mode";            arghlp[i] = NULL;            break;#ifdef TCPSOCKET          case 'j':                     /* SET HOST (TCP/IP socket) */            opthlp[i] = "Make a TCP connection";            arghlp[i] = "TCP host name/address and optional socket number";            break;#endif /* TCPSOCKET */          case 'k':                     /* receive to stdout */            optact[i] = 1;            opthlp[i] = "RECEIVE file(s) to standard output";            arghlp[i] = NULL;            break;          case 'l':                     /* SET LINE */            opthlp[i] = "Make connection on serial communications device";            arghlp[i] = "Device name string";            break;          case 'm':                     /* Modem type */            opthlp[i] = "Modem type for use with -l device";            arghlp[i] = "Modem type string as in SET MODEM TYPE command";            break;          case 'n':                     /* connect after */            optact[i] = 1;            opthlp[i] = "CONNECT after transferring files";            arghlp[i] = NULL;            break;#ifdef ANYX25          case 'o':                     /* X.25 closed user group */            opthlp[i] = "X.25 closed user group";            arghlp[i] = "User group string";            break;#endif /* ANYX25 */          case 'p':                     /* SET PARITY */            opthlp[i] = "Parity";            arghlp[i] = "One of the following: even, odd, mark, none, space";            break;          case 'q':                     /* Quiet */            opthlp[i] = "Quiet (suppress most messages)";            arghlp[i] = NULL;            break;          case 'r':                     /* receive */            optact[i] = 1;            opthlp[i] = "RECEIVE file(s)";            arghlp[i] = NULL;            break;          case 's':                     /* send */            optact[i] = 1;            opthlp[i] = "SEND file(s)";            arghlp[i] = "One or more file specifications";            break;          case 't':                     /* Line turnaround handshake */            opthlp[i] = "XON Turnaround character for half-duplex connections";            arghlp[i] = NULL;            break;#ifdef ANYX25          case 'u':                     /* X.25 reverse charge call */            opthlp[i] = "X.25 reverse charge call";            arghlp[i] = NULL;            break;#endif /* ANYX25 */          case 'v':                     /* Vindow size */            opthlp[i] = "Window size";            arghlp[i] = "Number, 1 to 32";            break;          case 'w':                     /* Writeover */            opthlp[i] = "Incoming files Write over existing files";            arghlp[i] = NULL;            break;          case 'x':                     /* Server */            optact[i] = 1;            opthlp[i] = "Be a Kermit SERVER";            arghlp[i] = NULL;            break;          case 'y':                     /* Alternate init-file name */            opthlp[i] = "Alternative initialization file";            arghlp[i] = "File specification";            break;          case 'z':                     /* Not background */            opthlp[i] = "Force foreground behavior";            arghlp[i] = NULL;            break;          default:            opthlp[i] = NULL;            arghlp[i] = NULL;        }    }    inixopthlp();}#endif /* NOHELP */intdoxarg(s,pre) char ** s; int pre; {#ifdef CK_LOGIN    extern int ckxsyslog, ckxwtmp, ckxanon, ckxpriv, ckxperms;    extern char * anonfile, * userfile, * anonroot;#ifdef CKWTMP    extern char * wtmpfile;#endif /* CKWTMP */#endif /* CK_LOGIN */    extern int srvcdmsg;    extern char * cdmsgfile[], * cdmsgstr;    char tmpbuf[CKMAXPATH+1];    int i, x, y, z, havearg = 0;    char buf[XARGBUFL], c, * p;    if (nxargs < 1)      return(-1);    c = *(*s + 1);                      /* Hyphen or Plus sign */    p = *s + 2;    for (i = 0; *p && i < XARGBUFL; i++) {        buf[i] = *p++;        if (buf[i] == '=' || buf[i] == ':') {            havearg = 1;            buf[i] = NUL;            break;        } else if (buf[i] < ' ') {            buf[i] = NUL;            break;        }    }    if (i > XARGBUFL - 1)      return(-1);    buf[i] = NUL;    x = lookup(xargtab,buf,nxargs,&z);  /* Lookup the option keyword */    if (x < 0)                          /* On any kind of error */      return(-1);                       /* fail. */    /* Handle prescan versus post-initialization file */    if (((xargtab[z].flgs & CM_PRE) || (c == '+')) && !pre)      return(0);    else if (pre && !(xargtab[z].flgs & CM_PRE) && (c != '+'))      return(0);    /* Ensure that argument is given if and only if required */    p = havearg ? *s + i + 3 : NULL;    if ((xargtab[z].flgs & CM_ARG) && !havearg)      return(-1);    else if ((!(xargtab[z].flgs & CM_ARG)) && havearg)      return(-1);    switch (x) {                        /* OK to process this option... */#ifdef CKSYSLOG      case XA_SYSL:                     /* IKS: Syslog level */        y = 0;        if (isdigit(*p)) {            while (*p) {                if (*p < '0' || *p > '9')                  return(-1);                y = y * 10 + (*p++ - '0');            }        } else {            y = lookup(oktab,p,noktab,&z);            if (y > 0) y = SYSLG_DF;    /* Yes = default logging level */        }#ifndef SYSLOGLEVEL        /* If specified on cc command line, user can't change it. */        if (!inserver)                  /* Don't allow voluminous syslogging */          if (y > SYSLG_FA)             /* by ordinary users. */            y = SYSLG_FA;#endif /* SYSLOGLEVEL */        if (y < 0) return(-1);#ifdef DEBUG        if (y >= SYSLG_DB)          if (!deblog)            deblog = debopn("debug.log",0);#endif /* DEBUG */#ifdef SYSLOGLEVEL        /* If specified on cc command line, user can't change it. */        y = SYSLOGLEVEL;#endif /* SYSLOGLEVEL */        ckxsyslog = y;        /* printf("ckxsyslog=%d\n",ckxsyslog); */        break;#endif /* CKSYSLOG */#ifdef CK_LOGIN#ifdef CKWTMP      case XA_WTMP:                     /* IKS: wtmp log */        y = lookup(oktab,p,noktab,&z);        if (y < 0) return(-1);        ckxwtmp = y;        /* printf("ckxwtmp=%d\n",ckxwtmp); */        break;      case XA_WTFI:                     /* IKS: wtmp logfile */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;        makestr(&wtmpfile,p);        /* printf("wtmpfile=%s\n",wtmpfile); */        break;#endif /* CKWTMP */      case XA_ANON:                     /* IKS: Anonymous login allowed */        y = lookup(oktab,p,noktab,&z);        if (y < 0) return(-1);        ckxanon = y;        /* printf("ckxanon=%d\n",ckxanon); */        break;      case XA_PRIV:                     /* IKS: Priv'd login allowed */        y = lookup(oktab,p,noktab,&z);        if (y < 0) return(-1);        ckxpriv = y;        /* printf("ckxpriv=%d\n",ckxpriv); */        break;      case XA_PERM:                     /* IKS: Anonymous Upload Permissions */        y = 0;        while (*p) {            if (*p < '0' || *p > '7')              return(-1);            y = y * 8 + (*p++ - '0');        }        ckxperms = y;        /* printf("ckxperms=%04o\n",ckxperms); */        break;      case XA_ANFI:                     /* Anonymous init file */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;        makestr(&anonfile,p);        /* printf("anonfile=%s\n",anonfile); */        break;      case XA_USFI:                     /* IKS: Forbidden user file */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;        makestr(&userfile,p);        /* printf("userfile=%s\n",userfile); */        break;      case XA_ROOT:                     /* IKS: Anonymous root */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;        makestr(&anonroot,p);        /* printf("anonroot=%s\n",anonroot); */        break;#endif /* CK_LOGIN */#ifndef NOICP      case XA_CDFI:                     /* CD filename */#ifdef COMMENT        /* Do NOT expand this one! */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;#endif /* COMMENT */        makelist(p,cdmsgfile,16);        makestr(&cdmsgstr,p);        /* printf("cdmsgstr=%s\n",cdmsgstr); */        break;#endif /* NOICP */      case XA_CDMS:                     /* CD messages */        y = lookup(oktab,p,noktab,&z);        if (y < 0) return(-1);        srvcdmsg = y;        /* printf("srvcdmsg=%d\n",srvcdmsg); */        break;#ifndef NOXFER      case XA_IKLG:                     /* Transfer log on/off */        y = lookup(oktab,p,noktab,&z);        if (y < 0) return(-1);        xferlog = y;        /* printf("xferlog=%d\n",xferlog); */        break;      case XA_IKFI:                     /* Transfer log file */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;        makestr(&xferfile,p);        xferlog = 1;        /* printf("xferfile=%s\n",xferfile); */        break;      case XA_BAFI:                     /* IKS: banner (greeting) file */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;        makestr(&bannerfile,p);        /* printf("bannerfile=%s\n",bannerfile); */        break;#endif /* NOXFER */#ifndef NOHELP      case XA_HELP:                     /* Help */        /* printf("help\n"); */        for (i = 0; i <= XA_MAX; i++)          if (xopthlp[i])            printf("%s\n   %s\n\n",xopthlp[i],xarghlp[i]);#ifndef NOICP        if (stayflg || what == W_COMMAND)          break;        else#endif /* NOICP */          doexit(GOOD_EXIT,-1);#endif /* NOHELP */#ifndef NOHELP      case XA_HEFI:                     /* IKS: custom help file */        if (zfnqfp(p,CKMAXPATH,tmpbuf))          p = tmpbuf;        makestr(&helpfile,p);        /* printf("helpfile=%s\n",helpfile); */        break;#endif /* NOHELP */#ifdef CK_LOGIN      case XA_TIMO:        if (!rdigits(p))          return(-1);        logintimo = atoi(p);        /* printf("logintimo=%d\n",p); */        break;#endif /* CK_LOGIN */

⌨️ 快捷键说明

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