003 File Manager
Current Path:
/usr/src/contrib/tcsh
usr
/
src
/
contrib
/
tcsh
/
📁
..
📄
FAQ
(12.47 KB)
📄
FREEBSD-Xlist
(107 B)
📄
FREEBSD-upgrade
(312 B)
📄
Fixes
(94.98 KB)
📄
Imakefile
(13.63 KB)
📄
MAKEDIFFS
(928 B)
📄
MAKESHAR
(2.08 KB)
📄
Makefile.in
(22.77 KB)
📄
Makefile.std
(19.75 KB)
📄
Makefile.vms
(18.47 KB)
📄
NewThings
(6.37 KB)
📄
Ported
(23.67 KB)
📄
README.md
(664 B)
📄
WishList
(10.86 KB)
📄
Y2K
(555 B)
📄
complete.tcsh
(53.67 KB)
📁
config
📄
config.guess
(42.41 KB)
📄
config.h.in
(7.43 KB)
📄
config.rpath
(14.52 KB)
📄
config.sub
(34.69 KB)
📄
config_f.h
(5.45 KB)
📄
configure
(224.09 KB)
📄
csh-mode.el
(29.15 KB)
📄
dotlock.c
(4.47 KB)
📄
dotlock.h
(1.55 KB)
📄
ed.chared.c
(74.68 KB)
📄
ed.decls.h
(9.6 KB)
📄
ed.defns.c
(50.56 KB)
📄
ed.h
(9.09 KB)
📄
ed.init.c
(19.51 KB)
📄
ed.inputl.c
(22.96 KB)
📄
ed.refresh.c
(33.56 KB)
📄
ed.screen.c
(39.44 KB)
📄
ed.term.c
(26.61 KB)
📄
ed.term.h
(11.71 KB)
📄
ed.xmap.c
(17.13 KB)
📄
eight-bit.me
(4.31 KB)
📄
gethost.c
(9.03 KB)
📄
glob.3
(11.14 KB)
📄
glob.c
(19.62 KB)
📄
glob.h
(4.1 KB)
📄
host.defs
(30.42 KB)
📄
imake.config
(2 KB)
📄
install-sh
(13.34 KB)
📄
ma.setp.c
(13.76 KB)
📄
mi.termios.c
(10.85 KB)
📄
mi.varargs.h
(306 B)
📄
mi.wait.h
(1.41 KB)
📁
nls
📄
patchlevel.h
(215 B)
📄
pathnames.h
(5.08 KB)
📄
sh.c
(61.95 KB)
📄
sh.char.c
(41.56 KB)
📄
sh.char.h
(12.01 KB)
📄
sh.decls.h
(14.66 KB)
📄
sh.dir.c
(32.37 KB)
📄
sh.dir.h
(2.3 KB)
📄
sh.dol.c
(23.6 KB)
📄
sh.err.c
(19.62 KB)
📄
sh.exec.c
(28.26 KB)
📄
sh.exp.c
(21.67 KB)
📄
sh.file.c
(18.11 KB)
📄
sh.func.c
(58.03 KB)
📄
sh.glob.c
(20.96 KB)
📄
sh.h
(37.71 KB)
📄
sh.hist.c
(37.78 KB)
📄
sh.init.c
(27.5 KB)
📄
sh.lex.c
(37.45 KB)
📄
sh.misc.c
(12.35 KB)
📄
sh.parse.c
(13.14 KB)
📄
sh.print.c
(6.37 KB)
📄
sh.proc.c
(50.09 KB)
📄
sh.proc.h
(5.16 KB)
📄
sh.sem.c
(25.39 KB)
📄
sh.set.c
(28.51 KB)
📄
sh.time.c
(18.67 KB)
📄
sh.types.h
(8.1 KB)
📄
snames.h
(2.68 KB)
📄
src.desc
(2.89 KB)
📄
svn
(743 B)
📄
tc.alloc.c
(17.09 KB)
📄
tc.bind.c
(12.03 KB)
📄
tc.const.c
(24.16 KB)
📄
tc.decls.h
(10.49 KB)
📄
tc.disc.c
(5.09 KB)
📄
tc.func.c
(49.15 KB)
📄
tc.h
(2.64 KB)
📄
tc.nls.c
(4.29 KB)
📄
tc.nls.h
(2.18 KB)
📄
tc.os.c
(36.71 KB)
📄
tc.os.h
(15.6 KB)
📄
tc.printf.c
(9.99 KB)
📄
tc.prompt.c
(16.47 KB)
📄
tc.sched.c
(6.76 KB)
📄
tc.sig.c
(3.53 KB)
📄
tc.sig.h
(5.53 KB)
📄
tc.str.c
(14.67 KB)
📄
tc.vers.c
(4.29 KB)
📄
tc.wait.h
(4.63 KB)
📄
tc.who.c
(16.47 KB)
📄
tcsh.man
(202.17 KB)
📄
tcsh.man.new
(199.97 KB)
📄
tcsh.man2html
(21.72 KB)
📄
termcap.vms
(1.53 KB)
📄
tw.color.c
(12.45 KB)
📄
tw.comp.c
(14.38 KB)
📄
tw.decls.h
(4.84 KB)
📄
tw.h
(3.26 KB)
📄
tw.help.c
(5.85 KB)
📄
tw.init.c
(22.13 KB)
📄
tw.parse.c
(56.96 KB)
📄
tw.spell.c
(5.04 KB)
📄
vms.termcap.c
(8.07 KB)
Editing: vms.termcap.c
/* * termcap.c 1.1 20/7/87 agc Joypace Ltd * * Copyright Joypace Ltd, London, UK, 1987. All rights reserved. * This file may be freely distributed provided that this notice * remains attached. * * A public domain implementation of the termcap(3) routines. */ #include "sh.h" #if defined(_VMS_POSIX) || defined(_OSD_POSIX) || defined(__ANDROID__) /* efth 1988-Apr-29 - Correct when TERM != name and TERMCAP is defined [tgetent] - Correct the comparison for the terminal name [tgetent] - Correct the value of ^x escapes [tgetstr] - Added %r to reverse row/column [tgoto] Paul Gillingwater <paul@actrix.gen.nz> July 1992 - Modified to allow terminal aliases in termcap file - Uses TERMCAP environment variable for file only */ #include <stdio.h> #include <string.h> #define CAPABLEN 2 #define ISSPACE(c) ((c) == ' ' || (c) == '\t' || (c) == '\r' || (c) == '\n') #define ISDIGIT(x) ((x) >= '0' && (x) <= '9') char *capab; /* the capability itself */ extern char *getenv(); /* new, improved getenv */ #ifndef fopen extern FILE *fopen(); /* old fopen */ #endif /* * tgetent - get the termcap entry for terminal name, and put it * in bp (which must be an array of 1024 chars). Returns 1 if * termcap entry found, 0 if not found, and -1 if file not found. */ int tgetent(char *bp, char *name) { #ifdef __ANDROID__ /* Use static termcap entry since termcap file usually doesn't exist. */ capab = bp; strcpy(bp, "linux|linux console:" ":am:eo:mi:ms:xn:xo:" ":it#8:" ":AL=\\E[%dL:DC=\\E[%dP:DL=\\E[%dM:IC=\\E[%d@:K2=\\E[G:al=\\E[L:" ":bl=^G:cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:cr=^M:" ":cs=\\E[%i%d;%dr:ct=\\E[3g:dc=\\E[P:dl=\\E[M:do=^J:ec=\\E[%dX:" ":ei=\\E[4l:ho=\\E[H:ic=\\E[@:im=\\E[4h:k1=\\E[[A:k2=\\E[[B:" ":k3=\\E[[C:k4=\\E[[D:k5=\\E[[E:k6=\\E[17~:k7=\\E[18~:k8=\\E[19~:" ":k9=\\E[20~:kD=\\E[3~:kI=\\E[2~:kN=\\E[6~:kP=\\E[5~:kb=\\177:" ":kd=\\E[B:kh=\\E[1~:kl=\\E[D:kr=\\E[C:ku=\\E[A:le=^H:mb=\\E[5m:" ":md=\\E[1m:me=\\E[0m:mh=\\E[2m:mr=\\E[7m:nd=\\E[C:nw=^M^J:" ":rc=\\E8:sc=\\E7:se=\\E[27m:sf=^J:so=\\E[7m:sr=\\EM:st=\\EH:ta=^I:" ":ue=\\E[24m:up=\\E[A:us=\\E[4m:vb=200\\E[?5h\\E[?5l:" ":ve=\\E[?25h\\E[?0c:vi=\\E[?25l\\E[?1c:vs=\\E[?25h\\E[?0c:" ); return(1); #else FILE *fp; char *termfile; char *cp, *ptr, /* temporary pointer */ tmp[1024]; /* buffer for terminal name *//*FIXBUF*/ size_t len = strlen(name); capab = bp; /* Use TERMCAP to override default. */ termfile = getenv("TERMCAP"); if (termfile == NULL ) termfile = "/etc/termcap"; if ((fp = fopen(termfile, "r")) == (FILE *) NULL) { fprintf(stderr, CGETS(31, 1, "Can't open TERMCAP: [%s]\n"), termfile); fprintf(stderr, CGETS(31, 2, "Can't open %s.\n"), termfile); sleep(1); return(-1); } while (fgets(bp, 1024, fp) != NULL) { /* Any line starting with # or NL is skipped as a comment */ if ((*bp == '#') || (*bp == '\n')) continue; /* Look for lines which end with two backslashes, and then append the next line. */ while (*(cp = &bp[strlen(bp) - 2]) == '\\') fgets(cp, 1024, fp); /* Skip over any spaces or tabs */ for (++cp ; ISSPACE(*cp) ; cp++); /* Make sure "name" matches exactly (efth) */ /* Here we might want to look at any aliases as well. We'll use sscanf to look at aliases. These are delimited by '|'. */ sscanf(bp,"%[^|]",tmp); if (strncmp(name, tmp, len) == 0) { fclose(fp); #ifdef DEBUG fprintf(stderr, CGETS(31, 3, "Found %s in %s.\n"), name, termfile); sleep(1); #endif /* DEBUG */ return(1); } ptr = bp; while ((ptr = strchr(ptr,'|')) != NULL) { ptr++; if (strchr(ptr,'|') == NULL) break; sscanf(ptr,"%[^|]",tmp); if (strncmp(name, tmp, len) == 0) { fclose(fp); #ifdef DEBUG fprintf(stderr,CGETS(31, 3, "Found %s in %s.\n"), name, termfile); sleep(1); #endif /* DEBUG */ return(1); } } } /* If we get here, then we haven't found a match. */ fclose(fp); #ifdef DEBUG fprintf(stderr,CGETS(31, 4, "No match found for %s in file %s\n"), name, termfile); sleep(1); #endif /* DEBUG */ return(0); #endif /* ANDROID */ } /* * tgetnum - get the numeric terminal capability corresponding * to id. Returns the value, -1 if invalid. */ int tgetnum(char *id) { char *cp; int ret; if ((cp = capab) == NULL || id == NULL) return(-1); while (*++cp != ':') ; for (++cp ; *cp ; cp++) { while (ISSPACE(*cp)) cp++; if (strncmp(cp, id, CAPABLEN) == 0) { while (*cp && *cp != ':' && *cp != '#') cp++; if (*cp != '#') return(-1); for (ret = 0, cp++ ; *cp && ISDIGIT(*cp) ; cp++) ret = ret * 10 + *cp - '0'; return(ret); } while (*cp && *cp != ':') cp++; } return(-1); } /* * tgetflag - get the boolean flag corresponding to id. Returns -1 * if invalid, 0 if the flag is not in termcap entry, or 1 if it is * present. */ int tgetflag(char *id) { char *cp; if ((cp = capab) == NULL || id == NULL) return(-1); while (*++cp != ':') ; for (++cp ; *cp ; cp++) { while (ISSPACE(*cp)) cp++; if (strncmp(cp, id, CAPABLEN) == 0) return(1); while (*cp && *cp != ':') cp++; } return(0); } /* * tgetstr - get the string capability corresponding to id and place * it in area (advancing area at same time). Expand escape sequences * etc. Returns the string, or NULL if it can't do it. */ char * tgetstr(char *id, char **area) { char *cp; char *ret; int i; if ((cp = capab) == NULL || id == NULL) return(NULL); while (*++cp != ':') ; for (++cp ; *cp ; cp++) { while (ISSPACE(*cp)) cp++; if (strncmp(cp, id, CAPABLEN) == 0) { while (*cp && *cp != ':' && *cp != '=') cp++; if (*cp != '=') return(NULL); for (ret = *area, cp++; *cp && *cp != ':' ; (*area)++, cp++) switch(*cp) { case '^' : **area = *++cp - '@'; /* fix (efth)*/ break; case '\\' : switch(*++cp) { case 'E' : **area = CTL_ESC('\033'); break; case 'n' : **area = '\n'; break; case 'r' : **area = '\r'; break; case 't' : **area = '\t'; break; case 'b' : **area = '\b'; break; case 'f' : **area = '\f'; break; case '0' : case '1' : case '2' : case '3' : for (i=0 ; *cp && ISDIGIT(*cp) ; cp++) i = i * 8 + *cp - '0'; **area = i; cp--; break; case '^' : case '\\' : **area = *cp; break; } break; default : **area = *cp; } *(*area)++ = '\0'; return(ret); } while (*cp && *cp != ':') cp++; } return(NULL); } /* * tgoto - given the cursor motion string cm, make up the string * for the cursor to go to (destcol, destline), and return the string. * Returns "OOPS" if something's gone wrong, or the string otherwise. */ char * tgoto(char *cm, int destcol, int destline) { char *rp; static char ret[24]; int incr = 0; int argno = 0, numval; for (rp = ret ; *cm ; cm++) { switch(*cm) { case '%' : switch(*++cm) { case '+' : numval = (argno == 0 ? destline : destcol); argno = 1 - argno; *rp++ = numval + incr + *++cm; break; case '%' : *rp++ = '%'; break; case 'i' : incr = 1; break; case 'd' : numval = (argno == 0 ? destline : destcol); numval += incr; argno = 1 - argno; *rp++ = '0' + (numval/10); *rp++ = '0' + (numval%10); break; case 'r' : argno = 1; break; } break; default : *rp++ = *cm; } } *rp = '\0'; return(ret); } /* * tputs - put the string cp out onto the terminal, using the function * outc. This should do padding for the terminal, but I can't find a * terminal that needs padding at the moment... */ int tputs(char *cp, int affcnt, int (*outc)()) { unsigned long delay = 0; if (cp == NULL) return(1); /* do any padding interpretation - left null for MINIX just now */ for (delay = 0; *cp && ISDIGIT(*cp) ; cp++) delay = delay * 10 + *cp - '0'; while (*cp) (*outc)(*cp++); #ifdef _OSD_POSIX usleep(delay*100); /* strictly spoken, it should be *1000 */ #endif return(1); } #endif /* _VMS_POSIX || _OSD_POSIX */
Upload File
Create Folder