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

📄 ckuus4.c

📁 早期freebsd实现
💻 C
📖 第 1 页 / 共 5 页
字号:
    int y;    zclose(ZSFILE);    if(s[0] == '\0') return(0);    if (disp) {	xx.bs = 0; xx.cs = 0; xx.rl = 0; xx.org = 0; xx.cc = 0;	xx.typ = 0; xx.dsp = XYFZ_A; xx.os_specific = '\0';	xx.lblopts = 0;	y = zopeno(ZSFILE,s,NULL,&xx);    } else y = zopeno(ZSFILE,s,NULL,NULL);    if (y > 0)      strcpy(sesfil,s);    else      *sesfil = '\0';    return(y);}intdebopn(s,disp) char *s; int disp; {#ifdef DEBUG    char *tp;    static struct filinfo xx;    zclose(ZDFILE);    if (disp) {	xx.bs = 0; xx.cs = 0; xx.rl = 0; xx.org = 0; xx.cc = 0;	xx.typ = 0; xx.dsp = XYFZ_A; xx.os_specific = '\0';	xx.lblopts = 0;	deblog = zopeno(ZDFILE,s,NULL,&xx);    } else deblog = zopeno(ZDFILE,s,NULL,NULL);    if (deblog > 0) {	strcpy(debfil,s);	debug(F110,"Debug Log ",versio,0);#ifndef MAC	debug(F100,ckxsys,"",0);#endif /* MAC */	ztime(&tp);	debug(F100,tp,"",0);    } else *debfil = '\0';    return(deblog);#else    return(0);#endif}#ifndef NOSHOW/*  S H O P A R  --  Show Parameters  */#ifdef SUNX25VOIDshox25() {    if (nettype == NET_SX25) {	printf("SunLink X.25 V%d.%d",x25ver / 10,x25ver % 10);	if (ttnproto == NP_X3) printf(", PAD X.3, X.28, X.29 protocol,");	printf("\n Reverse charge call %s",	       revcall ? "selected" : "not selected");	printf (", Closed user group ");	if (closgr > -1)	  printf ("%d",closgr);	else	  printf ("not selected");	printf (",");	printf("\n Call user data %s.\n", cudata ? udata : "not selected");    }}#endif /* SUNX25 */VOIDshoparc() {    int i; char *s;    long zz;    puts("Communications Parameters:");    if (network) {	printf(" Host: %s",ttname);    } else {	printf(" Line: %s, speed: ",ttname);	if ((zz = ttgspd()) < 0) {	    printf("unknown");        } else {	    if (speed == 8880) printf("75/1200"); else printf("%ld",zz);	}    }    printf(", mode: ");    if (local) printf("local"); else printf("remote");    if (network == 0) {#ifndef NODIAL	for (i = 0; i < nmdm; i++) {	    if (mdmtab[i].kwval == mdmtyp) {		printf(", modem: %s",mdmtab[i].kwd);		break;	    }	}#endif /* NODIAL */    } else {	if (nettype == NET_TCPA) printf(", TCP/IP");	if (nettype == NET_TCPB) printf(", TCP/IP");        if (nettype == NET_DEC) {          if ( ttnproto == NP_LAT ) printf(", DECnet LAT");          else if ( ttnproto == NP_CTERM ) printf(", DECnet CTERM");          else printf(", DECnet");        }        if (nettype == NET_PIPE) printf(", Named Pipe");#ifdef SUNX25	shox25();#endif /* SUNX25 */	if (ttnproto == NP_TELNET) printf(", telnet protocol");    }    if (local) {	i = parity ? 7 : 8;	if (i == 8) i = (cmask == 0177) ? 7 : 8;	printf("\n Terminal bits: %d, p",i);    } else printf("\n P");    printf("arity: %s",parnam((char)parity));    printf(", duplex: ");    if (duplex) printf("half, "); else printf("full, ");    printf("flow: ");    if (flow == FLO_KEEP) printf("keep");        else if (flow == FLO_XONX) printf("xon/xoff");	else if (flow == FLO_NONE) printf("none");	else if (flow == FLO_DTRT) printf("dtr/cts");	else if (flow == FLO_RTSC) printf("rts/cts");        else if (flow == FLO_DTRC) printf("dtr/cd");	else printf("%d",flow);    printf(", handshake: ");    if (turn) printf("%d\n",turnch); else printf("none\n");    if (local && !network) {		/* Lockfile & carrier stuff */	if (carrier == CAR_OFF) s = "off";	else if (carrier == CAR_ON) s = "on";	else if (carrier == CAR_AUT) s = "auto";	else s = "unknown";	printf(" Carrier: %s", s);	if (carrier == CAR_ON) {	    if (cdtimo) printf(", timeout: %d sec", cdtimo);	    else printf(", timeout: none");	}#ifdef UNIX	if (haslock && *flfnam) {	/* Lockfiles only apply to UNIX... */	    printf(", lockfile: %s",flfnam);	}#endif /* UNIX */	printf("\n Escape character: %d (^%c)\n",escape,ctl(escape));    }}#ifdef TNCODEstatic VOIDshotel() {    printf("SET TELNET parameters:\n echo: %s\n newline-mode: %s\n",	   tn_duplex ? "local" : "remote", tn_nlm ? "on" : "off");    printf(" terminal-type: ");    if (tn_term) printf("%s\n",tn_term);    else {	char *p;	p = getenv("TERM");	if (p)	  printf("none (%s will be used)\n",p);	else printf("none\n");    }}#endif /* TNCODE */VOIDshonet() {#ifndef NETCONN    printf("\nNo networks are supported in this version of C-Kermit\n");#else    printf("\nSupported networks:\n");#ifdef VMS#ifdef MULTINET    printf(" TGV MultiNet TCP/IP");#else#ifdef WINTCP    printf(" WOLLONGONG WIN/TCP");#else#ifdef DEC_TCPIP    printf(" DEC TCP/IP Services for (Open)VMS");#else    printf(" None");#endif /* DEC_TCPIP */#endif /* WINTCP */#endif /* MULTINET */#ifdef TNCODE    printf(", TELNET protocol\n\n");    shotel();#endif /* TNCODE */    printf("\n");#else /* Not VMS */#ifdef SUNX25    printf(" SunLink X.25\n");#endif /* SUNX25 */#ifdef DECNET    printf(" DECnet\n");#endif /* DECNET */#ifdef NPIPE    printf(" LAN Manager Named Pipe\n");#endif /* DECNET */#ifdef TCPSOCKET    printf(" TCP/IP");#ifdef TNCODE    printf(", TELNET protocol\n\n");    shotel();#endif /* TNCODE */#endif /* TCPSOCKET */    printf("\n");#endif /* VMS */    printf("Current network type:\n");    if (nettype == NET_TCPA || nettype == NET_TCPB)      printf(" TCP/IP\n");#ifdef SUNX25    else if (nettype == NET_SX25) printf(" X.25\n");#endif /* SUNX25 */#ifdef DECNET    else if (nettype == NET_DEC) printf(" DECnet\n");#endif /* DECNET */    printf("\nActive SET HOST connection:\n");    if (network) {	printf(" %s",ttname);	if (*ipaddr) printf(" [%s]",ipaddr);	printf("\n Via: ");	if (nettype == NET_TCPA || nettype == NET_TCPB) printf("TCP/IP\n");	else if (nettype == NET_SX25) printf("SunLink X.25\n");	else if (nettype == NET_DEC) {          if ( ttnproto == NP_LAT ) printf("DECnet LAT\n");          else if ( ttnproto == NP_CTERM ) printf("DECnet CTERM\n");          else printf("DECnet\n");        }	else if (nettype == NET_PIPE) printf("LAN Manager Named Pipe\n");#ifdef SUNX25	if (nettype == NET_SX25) shox25();#endif /* SUNX25 */#ifdef TNCODE	if (ttnproto == NP_TELNET) {	    printf(" TELNET protocol\n");	    printf(" Echoing is currently %s\n",duplex ? "local" : "remote");	}#endif /* TNCODE */    } else printf(" None\n");    printf("\n");#endif /* NETCONN */}#ifndef NODIALVOIDshodial() {    if (mdmtyp >= 0 || local != 0) doshodial();}static VOIDshods(s) char *s; {			/* Show a dial-related string */    char c;    if (s == NULL || !(*s)) {		/* Empty? */	printf("(none)\n");    } else {				/* Not empty. */	while (c = *s++)		     /* Can contain controls */	  if (c > 31 && c < 127) { putchar(c); } /* so display them */	  else printf("\\{%d}",c);	     /* in backslash notation */	printf("\n");    }}intdoshodial() {    printf(" Dial directory: %s\n",dialdir ? dialdir : "(none)");    printf(" Dial hangup: %s, dial modem-hangup: %s\n",	   dialhng ? "on" : "off", dialmhu ? "on" : "off") ;    printf(" Dial kermit-spoof: %s",dialksp ? "on" : "off");    printf(", dial display: %s\n",dialdpy ? "on" : "off");    printf(" Dial speed-matching: %s",mdmspd ? "on" : "off");    printf(", dial mnp-enable: %s\n",dialmnp ? "on" : "off");    printf(" Dial init-string: ");    shods(getdws(mdmtyp));		/* Ask dial module for it */    printf(" Dial dial-command: ");    shods(getdcs(mdmtyp));		/* Ask dial module for it */    printf(" Dial prefix: ");    shods(dialnpr);    printf(" Dial timeout: ");    if (dialtmo > 0)      printf("%d sec", dialtmo);    else      printf("0 (auto)");    printf(", Redial number: %s\n",dialnum ? dialnum : "(none)");    return(0);}#endif /* NODIAL */#ifdef SUNX25VOIDshopad() {    int i;    printf("\nX.3 PAD Parameters:\n");    for (i = 0; i < npadx3; i++)      printf(" [%d] %s %d\n",padx3tab[i].kwval,padx3tab[i].kwd,	     padparms[padx3tab[i].kwval]);}#endif /* SUNX25 *//*  Show File Parameters */VOIDshoparf() {    char *s; int i;    printf("\nFile parameters:       ");#ifdef COMMENT    printf("Blocksize:     %5d      ",fblksiz);#endif /* COMMENT */    printf(" Attributes:       ");    if (atcapr) printf("on"); else printf("off");#ifdef VMS    printf("  Record-Length: %5d",frecl);#endif /* VMS */    printf("\n Names:   ");    printf("%-12s",(fncnv) ? "converted" : "literal");#ifdef DEBUG#ifndef MAC    printf("  Debugging Log:    ");    if (deblog) printf("%s",debfil); else printf("none");#endif /* MAC */#endif /* DEBUG */    printf("\n Type:    ");    switch (binary) {      case XYFT_T: s = "text";    break;#ifdef VMS      case XYFT_B: s = "binary fixed"; break;      case XYFT_I: s = "image";        break;      case XYFT_L: s = "labeled";      break;      case XYFT_U: s = "binary undef"; break;#else      case XYFT_B: s = "binary"; break;#endif /* VMS */      default: s = "?"; break;    }    printf("%-12s",s);#ifdef COMMENT    printf(" Organization:  ");    switch (forg) {      case XYFO_I: printf("%-10s","indexed"); break;      case XYFO_R: printf("%-10s","relative"); break;      case XYFO_S: printf("%-10s","sequential"); break;    }#endif /* COMMENT */#ifndef MAC    printf("  Packet Log:       ");    if (pktlog) printf(pktfil); else printf("none");#endif /* MAC */#ifdef UNIX    printf("  Longest filename: %d",maxnam);#endif /* UNIX */    printf("\n Collide: ");    for (i = 0; i < ncolx; i++)      if (colxtab[i].kwval == fncact) break;    printf("%-12s", (i == ncolx) ? "unknown" : colxtab[i].kwd);#ifdef COMMENT    printf(" Format:        ");    switch (frecfm) {      case XYFF_F:  printf("%-10s","fixed"); break;      case XYFF_VB: printf("%-10s","rcw"); break;      case XYFF_S:  printf("%-10s","stream"); break;      case XYFF_U:  printf("%-10s","undefined"); break;      case XYFF_V:  printf("%-10s","variable"); break;    }#endif /* COMMENT */#ifndef MAC    printf("  Session Log:      ");    if (seslog) printf(sesfil); else printf("none");#endif /* MAC */#ifdef UNIX    printf("  Longest pathname: %d",maxpath);#endif /* UNIX */    printf("\n Display: ");    switch (fdispla) {      case XYFD_N: printf("%-12s","none"); break;      case XYFD_R: printf("%-12s","serial"); break;      case XYFD_C: printf("%-12s","fullscreen"); break;      case XYFD_S: printf("%-12s","crt"); break;    }#ifdef COMMENT    printf("Carriage-Control: ");    switch (fcctrl) {      case XYFP_F: printf("%-10s","fortran"); break;      case XYFP_N: printf("%-10s","newline"); break;      case XYFP_P: printf("%-10s","machine"); break;      case XYFP_X: printf("%-10s","none"); break;    }#endif /* COMMENT */#ifdef TLOG#ifndef MAC    printf("  Transaction Log:  ");    if (tralog) printf(trafil); else printf("none");#endif /* MAC */#endif /* TLOG */#ifndef NOCSETS    if (binary == XYFT_T) {	shocharset();    } else#endif /* NOCSETS */      printf("\n");    printf("\nFile Byte Size: %d",(fmask == 0177) ? 7 : 8);    printf(", Incomplete Files: ");    if (keep) printf("keep"); else printf("discard");#ifdef KERMRC    printf(", Init file: %s",kermrc);#endif /* KERMRC */    printf("\n");}VOIDshoparp() {    printf("\nProtocol Parameters:   Send    Receive");    if (timef)      printf("\n Timeout (used=%2d):%7d*%8d ", timint, rtimo, pkttim);    else      printf("\n Timeout (used=%2d):%7d%9d ",  timint, rtimo, pkttim);#ifndef NOSERVER    printf("       Server Timeout:%4d\n",srvtim);#endif /* NOSERVER */    printf(  " Padding:      %11d%9d", npad,   mypadn);    if (bctr == 4)      printf("        Block Check: blank-free-2\n");    else      printf("        Block Check: %6d\n",bctr);    printf(  " Pad Character:%11d%9d", padch,  mypadc);    printf("        Delay:       %6d\n",delay);    printf(  " Packet Start: %11d%9d", mystch, stchr);    printf("        Max Retries: %6d\n",maxtry);    printf(  " Packet End:   %11d%9d", seol,   eol);    if (ebqflg)      printf("        8th-Bit Prefix: '%c'",ebq);#ifdef COMMENT/*  This is confusing.*/    printf(  "\n Packet Length:%11d", spsizf ? spsizr : spsiz);    printf( spsizf ? "*" : " " ); printf("%8d",  urpsiz);    printf( (urpsiz > 94) ? " (94)" : "     ");#else    printf(  "\n Packet Length:%11d ", spmax);    printf("%8d     ",  urpsiz);#endif /* COMMENT */    if (rptflg)      printf("   Repeat Prefix:  '%c'",rptq);    printf(  "\n Maximum Length: %9d%9d", maxsps, maxrps);    printf("        Window Size:%7d set, %d used\n",wslotr,wmax);    printf(    " Buffer Size:  %11d%9d", bigsbsiz, bigrbsiz);    printf("        Locking-Shift:    ");    if (lscapu == 2) {	printf("forced\n");    } else {	printf("%s", (lscapr ? "enabled" : "disabled"));	if (lscapr) printf(",%s%s", (lscapu ? " " : " not "), "used");	printf("\n");    }}#ifndef NOCSETSVOIDshoparl() {#ifdef COMMENT

⌨️ 快捷键说明

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