📄 ckuus7.c
字号:
"ctrl", XYM_CTRL, 0, "ctrl-alt", XYM_CTRL|XYM_ALT, 0, "ctrl-alt-shift", XYM_CTRL|XYM_SHIFT|XYM_ALT, 0, "ctrl-shift", XYM_CTRL|XYM_SHIFT, 0, "none", 0, 0, "shift", XYM_SHIFT, 0};int nmmtab = (sizeof(mousemodtab) / sizeof(struct keytab));struct keytab mclicktab[] = { /* event button click modifier */ "click", XYM_C1, 0, "drag", XYM_DRAG, 0, "double-click", XYM_C2, 0};int nmctab = (sizeof(mclicktab) / sizeof(struct keytab));#ifndef NOKVERBSextern int nkverbs;extern struct keytab kverbs[];#endif /* NOKVERBS */#endif /* OS2MOUSE *//* #ifdef VMS */struct keytab fbtab[] = { /* Binary record types for VMS */ "fixed", XYFT_B, 0, /* Fixed is normal for binary */ "undefined", XYFT_U, 0 /* Undefined if they ask for it */};int nfbtyp = (sizeof(fbtab) / sizeof(struct keytab));/* #endif */#ifdef VMSstruct keytab lbltab[] = { /* Labeled File info */ "acl", LBL_ACL, 0, "backup-date", LBL_BCK, 0, "name", LBL_NAM, 0, "owner", LBL_OWN, 0, "path", LBL_PTH, 0};int nlblp = (sizeof(lbltab) / sizeof(struct keytab));#else#ifdef OS2struct keytab lbltab[] = { /* Labeled File info */ "archive", LBL_ARC, 0, "extended", LBL_EXT, 0, "hidden", LBL_HID, 0, "read-only", LBL_RO, 0, "system", LBL_SYS, 0};int nlblp = (sizeof(lbltab) / sizeof(struct keytab));#endif /* OS2 */#endif /* VMS */#ifdef CK_CURSES#ifdef CK_PCT_BARstatic struct keytab fdftab[] = { /* SET FILE DISPLAY FULL options */ "thermometer", 1, 0, "no-thermometer", 0, 0};extern int thermometer;#endif /* CK_PCT_BAR */#endif /* CK_CURSES */static struct keytab fdtab[] = { /* SET FILE DISPLAY options */#ifdef MAC /* Macintosh */ "fullscreen", XYFD_R, 0, /* Full-screen but not curses */ "none", XYFD_N, 0, "off", XYFD_N, CM_INV, "on", XYFD_R, CM_INV, "quiet", XYFD_N, CM_INV#else /* Not Mac */ "crt", XYFD_S, 0, /* CRT display */#ifdef CK_CURSES#ifdef COMMENT "curses", XYFD_C, CM_INV, /* Full-screen, curses */#endif /* COMMENT */ "fullscreen", XYFD_C, 0, /* Full-screen, whatever the method */#endif /* CK_CURSES */ "none", XYFD_N, 0, /* No display */ "off", XYFD_N, CM_INV, /* Ditto */ "on", XYFD_R, CM_INV, /* On = Serial */ "quiet", XYFD_N, CM_INV, /* No display */ "serial", XYFD_R, 0 /* Serial */#endif /* MAC */};int nfdtab = (sizeof(fdtab) / sizeof(struct keytab));struct keytab rsrtab[] = { /* For REMOTE SET RECEIVE */ "packet-length", XYLEN, 0, "timeout", XYTIMO, 0};int nrsrtab = (sizeof(rsrtab) / sizeof(struct keytab));/* Send/Receive Parameters */ struct keytab srtab[] = { "control-prefix", XYQCTL, 0, "end-of-packet", XYEOL, 0, "packet-length", XYLEN, 0, "pad-character", XYPADC, 0, "padding", XYNPAD, 0, "pathnames", XYFPATH, 0, "pause", XYPAUS, 0, "quote", XYQCTL, CM_INV, /* = CONTROL-PREFIX */ "start-of-packet", XYMARK, 0, "timeout", XYTIMO, 0};int nsrtab = (sizeof(srtab) / sizeof(struct keytab));/* REMOTE SET */struct keytab rmstab[] = { "attributes", XYATTR, 0, "block-check", XYCHKT, 0, "file", XYFILE, 0, "incomplete", XYIFD, 0, "receive", XYRECV, 0, "retry", XYRETR, 0, "server", XYSERV, 0, "transfer", XYXFER, 0, "window", XYWIND, 0};int nrms = (sizeof(rmstab) / sizeof(struct keytab));struct keytab attrtab[] = {#ifdef STRATUS "account", AT_ACCT, 0,#endif /* STRATUS */ "all", AT_XALL, 0,#ifdef COMMENT "blocksize", AT_BLKS, 0, /* not used */#endif /* COMMENT */#ifndef NOCSETS "character-set", AT_ENCO, 0,#endif /* NOCSETS */#ifdef STRATUS "creator", AT_CREA, 0,#endif /* STRATUS */ "date", AT_DATE, 0, "disposition", AT_DISP, 0, "encoding", AT_ENCO, CM_INV,#ifdef STRATUS "format", AT_RECF, 0,#endif /* STRATUS */ "length", AT_LENK, 0, "off", AT_ALLN, 0, "on", AT_ALLY, 0,#ifdef COMMENT "os-specific", AT_SYSP, 0, /* not used by UNIX or VMS */#endif /* COMMENT */ "system-id", AT_SYSI, 0, "type", AT_FTYP, 0};int natr = (sizeof(attrtab) / sizeof(struct keytab)); /* how many attributes */#ifndef NOSPLextern int indef, inecho, insilence, inbufsize;extern char * inpbuf, * inpbp;struct keytab inptab[] = { /* SET INPUT parameters */ "buffer-length", IN_BUF, 0, "case", IN_CAS, 0, "default-timeout", IN_DEF, CM_INV, /* There is no default timeout */ "echo", IN_ECH, 0,#ifdef OS2 "pacing", IN_PAC, CM_INV,#endif /* OS2 */ "silence", IN_SIL, 0, "timeout-action", IN_TIM, 0};int ninp = (sizeof(inptab) / sizeof(struct keytab));struct keytab intimt[] = { /* SET INPUT TIMEOUT parameters */ "proceed", 0, 0, /* 0 = proceed */ "quit", 1, 0 /* 1 = quit */};struct keytab incast[] = { /* SET INPUT CASE parameters */ "ignore", 0, 0, /* 0 = ignore */ "observe", 1, 0 /* 1 = observe */};#endif /* NOSPL */struct keytab nabltab[] = { /* For any command that needs */ "disabled", 0, 0, /* these keywords... */ "enabled", 1, 0};#ifdef OS2 struct keytab msktab[] = { /* SET MS-DOS KERMIT compatibilities */#ifdef COMMENT "color", MSK_COLOR, 0,#endif /* COMMENT */ "keycodes", MSK_KEYS, 0};int nmsk = (sizeof(msktab) / sizeof(struct keytab));struct keytab scrnupd[] = { /* SET TERMINAL SCREEN-UPDATE */ "fast", TTU_FAST, 0, "smooth", TTU_SMOOTH, 0 };int nscrnupd = (sizeof(scrnupd) / sizeof(struct keytab));struct keytab termfont[] = { /* SET TERMINAL FONT */#ifdef COMMENT "cp111", TTF_111, 0, "cp112", TTF_112, 0, "cp113", TTF_113, 0,#endif /* COMMENT */ "cp437", TTF_437, 0, "cp850", TTF_850, 0,#ifdef COMMENT "cp851", TTF_851, 0,#endif /* COMMENT */ "cp852", TTF_852, 0,#ifdef COMMENT "cp853", TTF_853, 0, "cp860", TTF_860, 0, "cp861", TTF_861, 0,#endif /* COMMENT */ "cp862", TTF_862, 0,#ifdef COMMENT "cp863", TTF_863, 0, "cp864", TTF_864, 0, "cp865", TTF_865, 0,#endif /* COMMENT */ "cp866", TTF_866, 0,#ifdef COMMENT "cp880", TTF_880, 0, "cp881", TTF_881, 0, "cp882", TTF_882, 0, "cp883", TTF_883, 0, "cp884", TTF_884, 0, "cp885", TTF_885, 0,#endif /* COMMENT */ "default", TTF_ROM, 0};int ntermfont = (sizeof(termfont) / sizeof(struct keytab));struct keytab anbktab[] = { /* For any command that needs */ "message", 2, 0, /* these keywords... */ "off", 0, 0, "on", 1, 0, "unsafe-messag0", 99, CM_INV, "unsafe-message", 3, CM_INV};int nansbk = (sizeof(anbktab) / sizeof(struct keytab));#endif /* OS2 *//* The following routines broken out of doprm() to give compilers a break. *//* S E T O N -- Parse on/off (default on), set parameter to result */ intseton(prm) int *prm; { int x, y; if ((y = cmkey(onoff,2,"","on",xxstring)) < 0) return(y); if ((x = cmcfm()) < 0) return(x); *prm = y; return(1);} /* S E T N U M -- Set parameter to result of cmnum() parse. *//* Call with pointer to integer variable to be set, x = number from cnum parse, y = return code from cmnum, max = maximum value to accept, -1 if no maximum. Returns -9 on failure, after printing a message, or 1 on success.*/intsetnum(prm,x,y,max) int x, y, *prm, max; { extern int cmflgs; debug(F101,"setnum","",y); if (y == -3) { printf("\n?Value required\n"); return(-9); } if (y == -2) { printf("%s?Not a number: %s\n",cmflgs == 1 ? "" : "\n", atxbuf); return(-9); } if (y < 0) return(y); if (max > -1 && x > max) { printf("?Sorry, %d is the maximum\n",max); return(-9); } if ((y = cmcfm()) < 0) return(y); *prm = x; return(1);} /* S E T C C -- Set parameter var to an ASCII control character value. *//* Parses a number, or a literal control character, or a caret (^) followed by an ASCII character whose value is 63-95 or 97-122, then gets confirmation, then sets the parameter to the code value of the character given. If there are any parse errors, they are returned, otherwise on success 1 is returned.*/intsetcc(dflt,var) char *dflt; int *var; { int x, y; unsigned int c; char *hlpmsg = "Control character,\n\ numeric ASCII value,\n\ or in ^X notation,\n\ or preceded by a backslash and entered literally"; /* This is a hack to turn off complaints from expression evaluator. */ x_ifnum = 1; y = cmnum(hlpmsg, dflt, 10, &x, xxstring); /* Parse a number */ x_ifnum = 0; /* Allow complaints again */ if (y < 0) { /* Parse failed */ if (y != -2) /* Reparse needed or somesuch */ return(y); /* Pass failure back up the chain */ } /* Did they type a real control character? */ for (c = strlen(atmbuf) - 1; c > 0; c--) /* Trim */ if (atmbuf[c] == SP) atmbuf[c] = NUL; if (y < 0) { /* It was not a number */ if ((c = atmbuf[0]) && !atmbuf[1]) { /* Was it a literal Ctrl char? */ if ((c > 037) && (c != 0177)) { printf("\n?Not a control character - %d\n",c); return(-9); } else { if ((y = cmcfm()) < 0) /* Confirm */ return(y); *var = c; /* Set the variable */ return(1); } } else if (atmbuf[0] == '^' && !atmbuf[2]) { /* Or ^X notation? */ c = atmbuf[1]; if (islower((char) c)) /* Uppercase lowercase letters */ c = toupper(c); if (c > 62 && c < 96) { /* Check range */ if ((y = cmcfm()) < 0) return(y); *var = ctl(c); /* OK */ return(1); } else { printf("?Not a control character - %s\n", atmbuf); return(-9); } } else { /* Something illegal was typed */ printf("?Invalid - %s\n", atmbuf); return(-9); } } if ((x > 037) && (x != 0177)) { /* They typed a number */ printf("\n?Not in ASCII control range - %d\n",x); return(-9); } if ((y = cmcfm()) < 0) /* In range, confirm */ return(y); *var = x; /* Set variable */ return(1);}intdoxdis() { int x, y, z; char *s; if ((x = cmkey(fdtab,nfdtab,"file transfer display style","", xxstring)) < 0) return(x);#ifdef CK_PCT_BAR if ((y = cmkey(fdftab,2,"","thermometer",xxstring)) < 0) return(y); thermometer = y;#endif /* CK_PCT_BAR */ if ((z = cmcfm()) < 0) return(z);#ifdef CK_CURSES if (x == XYFD_C) { /* FULLSCREEN */#ifndef MYCURSES extern char * trmbuf; /* Real curses */ int z; s = getenv("TERM"); if (!s) s = "";#ifndef COHERENT if (*s) z = tgetent(trmbuf,s); else z = 0; debug(F111,"SET tgetent",s,z); if (z < 1) {#ifdef VMS printf("Sorry, terminal type not supported: \"%s\"\n",s);#else printf("Sorry, terminal type unknown: \"%s\"\n",s);#endif /* VMS */ return(success = 0); }#endif /* COHERENT */#endif /* MYCURSES */ line[0] = '\0'; /* (What's this for?) */ }#endif /* CK_CURSES */ fdispla = x; /* It's OK. */ return(success = 1);}intsetfil(rmsflg) int rmsflg; { if (rmsflg) { if ((y = cmkey(rfiltab,nrfilp,"Remote file parameter","", xxstring)) < 0) { if (y == -3) { printf("?Remote file parameter required\n"); return(-9); } else return(y); } } else { if ((y = cmkey(filtab,nfilp,"File parameter","",xxstring)) < 0) return(y); } switch (y) {#ifdef COMMENT /* Not needed */ case XYFILB: /* Blocksize */ sprintf(tmpbuf,"%d",DBLKSIZ); if ((y = cmnum("file block size",tmpbuf,10,&z,xxstring)) < 0) return(y); if ((x = cmcfm()) < 0) return(x); if (rmsflg) { sprintf(tmpbuf,"%d",z); sstate = setgen('S', "311", tmpbuf, ""); return((int) sstate); } else { fblksiz = z; return(success = 1); }#endif /* COMMENT */ case XYFILS: /* Byte size */ if ((y = cmnum("file byte size (7 or 8)","8",10,&z,xxstring)) < 0) return(y); if (z != 7 && z != 8) { printf("\n?The choices are 7 and 8\n"); return(0); } if ((y = cmcfm()) < 0) return(y); if (z == 7) fmask = 0177; else if (z == 8) fmask = 0377; return(success = 1);#ifndef NOCSETS case XYFILC: /* Character set */ if ((x = cmkey(fcstab,nfilc,"local file code","ascii", xxstring)) < 0) return(x); if ((z = cmcfm()) < 0) return(z); fcharset = x;#ifndef MAC if (tcharset == TC_TRANSP) { /* Automatically pick XFER CHAR */ if (fcharset == FC_USASCII || fcharset == FC_UKASCII || fcharset == FC_DUASCII || fcharset == FC_FIASCII || fcharset == FC_FRASCII || fcharset == FC_FCASCII || fcharset == FC_GEASCII || fcharset == FC_ITASCII || fcharset == FC_NOASCII || fcharset == FC_POASCII || fcharset == FC_SPASCII || fcharset == FC_SWASCII || fcharset == FC_CHASCII ) tcharset = TC_1LATIN; else if (fcharset == FC_1LATIN || fcharset == FC_DECMCS || fcharset == FC_NEXT || fcharset == FC_CP437 || fcharset == FC_CP850 || fcharset == FC_APPQD || fcharset == FC_DGMCS || fcharset == FC_HPR8 )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -