allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (06/12/89)
Posting-number: Volume 7, Issue 31 Submitted-by: fox@marlow.UUCP (Paul Fox) Archive-name: crisp1.9/part11 #!/bin/sh # this is part 3 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # file utils/kbd.c continued # CurArch=3 if test ! -r s2_seq_.tmp then echo "Please unpack part 1 first!" exit 1; fi ( read Scheck if test "$Scheck" != $CurArch then echo "Please unpack part $Scheck next!" exit 1; else exit 0; fi ) < s2_seq_.tmp || exit 1 echo "x - Continuing file utils/kbd.c" sed 's/^X//' << 'SHAR_EOF' >> utils/kbd.c X "fkey66", K_FUNF-1+66, X "fkey67", K_FUNF-1+67, X "fkey68", K_FUNF-1+68, X "fkey69", K_FUNF-1+69, X "fkey70", K_FUNF-1+70, X "fkey71", K_FUNF-1+71, X "fkey72", K_FUNF-1+72, X "fkey73", K_FUNF-1+73, X "fkey74", K_FUNF-1+74, X "fkey75", K_FUNF-1+75, X "fkey76", K_FUNF-1+76, X "fkey77", K_FUNF-1+77, X "fkey78", K_FUNF-1+78, X "fkey79", K_FUNF-1+79, X "fkey80", K_FUNF-1+80, X "fkey81", K_FUNF-1+81, X "fkey82", K_FUNF-1+82, X "fkey83", K_FUNF-1+83, X "fkey84", K_FUNF-1+84, X "fkey85", K_FUNF-1+85, X "fkey86", K_FUNF-1+86, X "fkey87", K_FUNF-1+87, X "fkey88", K_FUNF-1+88, X "fkey89", K_FUNF-1+89, X "fkey90", K_FUNF-1+90, X "fkey91", K_FUNF-1+91, X "fkey92", K_FUNF-1+92, X "fkey93", K_FUNF-1+93, X "fkey94", K_FUNF-1+94, X "fkey95", K_FUNF-1+95, X "fkey96", K_FUNF-1+96, X "pfx1", K_PFXF-1+1, X "pfx2", K_PFXF-1+2, X "pfx3", K_PFXF-1+3, X "pfx4", K_PFXF-1+4, X "pfx5", K_PFXF-1+5, X "pfx6", K_PFXF-1+6, X "pfx7", K_PFXF-1+7, X "pfx8", K_PFXF-1+8, X "pfx9", K_PFXF-1+9, X "pfx10", K_PFXF-1+10, X "pfx11", K_PFXF-1+11, X "pfx12", K_PFXF-1+12, X "pfx13", K_PFXF-1+13, X "pfx14", K_PFXF-1+14, X "pfx15", K_PFXF-1+15, X "pfx16", K_PFXF-1+16, X "pfx17", K_PFXF-1+17, X "pfx18", K_PFXF-1+18, X "pfx19", K_PFXF-1+19, X "pfx20", K_PFXF-1+20, X "pfx21", K_PFXF-1+21, X "pfx22", K_PFXF-1+22, X "pfx23", K_PFXF-1+23, X "pfx24", K_PFXF-1+24, X "pfx25", K_PFXF-1+25, X "pfx26", K_PFXF-1+26, X "pfx27", K_PFXF-1+27, X "pfx28", K_PFXF-1+28, X "pfx29", K_PFXF-1+29, X "pfx30", K_PFXF-1+30, X "pfx31", K_PFXF-1+31, X "pfx32", K_PFXF-1+32, X "pfx33", K_PFXF-1+33, X "pfx34", K_PFXF-1+34, X "pfx35", K_PFXF-1+35, X "pfx36", K_PFXF-1+36, X "pfx37", K_PFXF-1+37, X "pfx38", K_PFXF-1+38, X "pfx39", K_PFXF-1+39, X "pfx40", K_PFXF-1+40, X "pfx41", K_PFXF-1+41, X "pfx42", K_PFXF-1+42, X "pfx43", K_PFXF-1+43, X "pfx44", K_PFXF-1+44, X "pfx45", K_PFXF-1+45, X "pfx46", K_PFXF-1+46, X "pfx47", K_PFXF-1+47, X "pfx48", K_PFXF-1+48, X "pfx49", K_PFXF-1+49, X "pfx50", K_PFXF-1+50, X "pfx51", K_PFXF-1+51, X "pfx52", K_PFXF-1+52, X "pfx53", K_PFXF-1+53, X "pfx54", K_PFXF-1+54, X "pfx55", K_PFXF-1+55, X "pfx56", K_PFXF-1+56, X "pfx57", K_PFXF-1+57, X "pfx58", K_PFXF-1+58, X "pfx59", K_PFXF-1+59, X NULL, X }; Xchar * Xmap(tbl, num) Xstruct map *tbl; X{ static char buf[12]; X X while (tbl->name) { X if (tbl->value == num) X return tbl->name; X tbl++; X } X sprintf(buf, " %02x ", num); X return buf; X} Xlookup(tbl, name) Xregister struct map *tbl; Xregister char *name; X{ register char ch = name[0]; X X while (tbl->name) { X if (tbl->name[0] == ch && strcmp(tbl->name, name) == 0) X return tbl->value; X tbl++; X } X return -1; X} Xmain(argc, argv) Xchar **argv; X{ int i, j; X int arg_index = do_switches(argc, argv); X X get_fkey(FALSE); X if (ioctl(0, GIO_KEYMAP, &kdkeymap) < 0) { X perror("GIO_KEYMAP"); X exit(1); X } X get_sysreq_table(); X if (arg_index >= argc) { X if (k_flag) X print_kbd_table(); X get_fkey(TRUE); X } X else { X readin_file(argv[arg_index]); X if (argc > 2) { X print_kbd_table(); X exit(0); X } X set_keyboard(); X set_fkey(); X } X exit(0); X} Xdo_switches(argc, argv) Xchar **argv; X{ char *cp; X int c; X extern char *optarg; X extern int optind; X X while ((c = getopt(argc, argv, "fk")) != EOF) X switch (c) { X case 'f': X f_flag = TRUE; X if (k_flag == MAYBE) X k_flag = FALSE; X break; X case 'k': X k_flag = TRUE; X if (f_flag == MAYBE) X f_flag = FALSE; X break; X default: X usage(); X } X X return optind; X} Xusage() X{ X fprintf(stderr, "Usage: kbd [-fk] [file]\n"); X fprintf(stderr, " -f Print function key string table.\n"); X fprintf(stderr, " -k Print keyboard mapping table.\n"); X exit(1); X} Xset_fkey() X{ register int i; X strmap_t smap; X register char *cp = (char *) smap; X X for (i = 0; i < NSTRKEYS; i++) { X if (fkeys[i]) { X strcpy(cp, fkeys[i]); X cp += strlen(cp) + 1; X continue; X } X *cp++ = NULL; X } X if (ioctl(0, PIO_STRMAP, smap) < 0) { X perror("PIO_STRMAP"); X exit(1); X } X} Xset_keyboard() X{ register int i; X X if (ioctl(0, PIO_KEYMAP, &kdkeymap) < 0) { X perror("PIO_KEYMAP"); X exit(1); X } X for (i = 0; i < kdkeymap.n_keys; i++) { X kbentry.kb_table = K_SRQTAB; X kbentry.kb_index = i; X kbentry.kb_value = sreq[i]; X if (ioctl(0, KDSKBENT, &kbentry) < 0) { X fprintf(stderr, "kb_table = %02x\n", kbentry.kb_table); X fprintf(stderr, "kb_index = %02x\n", kbentry.kb_index); X fprintf(stderr, "kb_value = %02x\n", kbentry.kb_value); X perror("ioctl(KBSKBENT)"); X exit(1); X } X } X} Xget_sysreq_table() X{ register int i; X X for (i = 0; i < kdkeymap.n_keys; i++) { X kbentry.kb_table = K_SRQTAB; X kbentry.kb_index = i; X if (ioctl(0, KDGKBENT, &kbentry) < 0) { X fprintf(stderr, "kb_table = %02x\n", kbentry.kb_table); X fprintf(stderr, "kb_index = %02x\n", kbentry.kb_index); X fprintf(stderr, "kb_value = %02x\n", kbentry.kb_value); X perror("ioctl(KBGKBENT)"); X exit(1); X } X sreq[i] = kbentry.kb_value; X } X} Xreadin_file(filename) Xchar *filename; X{ FILE *fp; X char lbuf[BUFSIZ]; X char *strtok(); X int entry; X char *cp; X long strtol(); X struct key_t key; X char *token; X int ch, i; X int line_no = 0; X X if ((fp = fopen(filename, "r")) == NULL) { X perror(filename); X exit(1); X } X while (!feof(fp)) { X line_no++; X if (fgets(lbuf, sizeof lbuf - 1, fp) == NULL) X break; X if (lbuf[0] == NULL || lbuf[0] == '#') X continue; X cp = lbuf; X if (*cp == 'f') { X char *malloc(); X register char *cp1; X int n; X X if (strncmp(cp, "fkey", 4) != 0) { X fprintf(stderr, "%s:%d: syntax error\n", filename, line_no); X exit(1); X } X cp += 4; X entry = (int) strtol(cp, &cp, 0); X entry--; X while (*cp != '"') X cp++; X cp1 = cp+1; X cp = malloc(30); X fkeys[entry] = cp; X for ( ; *cp1 != '"'; ) { X if (*cp1 != '\\') { X *cp++ = *cp1++; X continue; X } X cp1++; X if (*cp1 == 'x') { X cp1++; X n = XDIGIT(*cp1); X cp1++; X if (isxdigit(*cp1)) { X n = n * 16 + XDIGIT(*cp1); X cp1++; X } X *cp++ = n; X continue; X } X if (!isdigit(*cp1)) { X *cp++ = *cp1++; X continue; X } X n = *cp1++ - '0'; X if (isdigit(*cp1)) { X n = 8 * n + *cp1++ - '0'; X if (isdigit(*cp1)) X n = 8 * n + *cp1++ - '0'; X } X *cp++ = n; X } X *cp = NULL; X continue; X } X key.spcl = 0; X entry = (int) strtol(cp, &cp, 0); X for (i = 0; i < NUM_STATES; i++) { X while (*cp == ':' || isspace(*cp)) X cp++; X if (*cp == '\'') { X cp++; X if (*cp == '\\') X cp++; X key.map[i] = *cp++; X cp++; X continue; X } X token = strtok(cp, " \t"); X cp = token + strlen(token) + 1; X if ((token[0] == 'f' && token[1] == 'k' && X token[2] == 'e' && token[3] == 'y')) { X key.map[i] = K_FUNF+atoi(token+4)-1; X key.spcl |= (0x80 >> i); X continue; X } X if ((ch = lookup(msg1, token)) >= 0) { X key.map[i] = ch; X key.spcl |= (0x80 >> i); X continue; X } X if ((ch = lookup(ascii_msg, token)) >= 0) { X key.map[i] = ch; X continue; X } X fprintf(stderr, "%s:%d: syntax error in column %d '%s'\n", X filename, line_no, i, token); X exit(1); X } X while (isspace(*cp)) X cp++; X switch (*cp) { X case 'O': X key.flgs = 0; X break; X case 'C': X key.flgs = KMF_CLOCK; X break; X case 'N': X key.flgs = KMF_NLOCK; X break; X case 'B': X key.flgs = KMF_NLOCK | KMF_CLOCK; X break; X default: X fprintf(stderr, "%s:%d Invalid LOCK Column '%s'\n", X filename, line_no, cp); X exit(1); X } X cp = strtok(cp+1, " \t\n"); X ch = lookup(msg1, cp); X if (ch < 0) { X fprintf(stderr, "%s:%d Invalid SYSREQ field '%s'\n", X filename, line_no, cp); X exit(1); X } X sreq[entry] = ch; X kdkeymap.key[entry] = key; X } X} Xget_fkey(flag) X{ X register char *cp; X int fkey = 0; X X if (flag) { X if (ioctl(0, GIO_STRMAP, strmap) < 0) { X perror("GIO_STRMAP"); X exit(1); X } X } X for (cp = (char *) strmap; fkey < NSTRKEYS; fkey++) { X fkeys[fkey] = cp; X if (!flag) { X while (*cp) X cp++; X cp++; X continue; X } X printf("fkey%d = \"", fkey+1); X while (*cp) { X if (*cp == '\\') { X cp++; X printf("\\\\"); X } X else if (*cp == '"') { X cp++; X printf("\\\""); X } X else if (*cp >= ' ' && *cp <= 0x7e) X putchar(*cp++); X else X printf("\\x%02x", *cp++); X } X cp++; X printf("\"\n"); X } X} Xprint_kbd_table() X{ register int i, j; X print_header(); X for (i = 0; i < kdkeymap.n_keys; i++) { X printf("0x%02x: ", i); X for (j = 0; j < NUM_STATES; j++) { X int ch = kdkeymap.key[i].map[j]; X if (IS_SPECIAL(i,j)) { X printf("%-6s ", map(msg1, ch)); X } X else { X if (ch < ' ') X printf("%-3s ", ascii_msg[ch].name); X else if (ch <= 0x7e) { X if (ch == '\\' || ch == '\'') X printf(" '\\%c' ", ch); X else X printf(" '%c' ", ch); X } X else if (ch == 0x7f) X printf(" del "); X else X printf(" 0x%02x ", ch); X } X } X printf(" %s", msg2[kdkeymap.key[i].flgs & (KMF_CLOCK | KMF_NLOCK)]); X printf(" %s\n", map(msg1, sreq[i])); X } X} Xprint_header() X{ X printf("#\n"); X printf("# ALT\n"); X printf("# CTRL ALT ALT CTRL\n"); X printf("# BASE SHIFT CTRL SHIFT ALT SHIFT CTRL SHIFT LOCK SRQTAB\n"); X} SHAR_EOF echo "File utils/kbd.c is complete" chmod 0666 utils/kbd.c || echo "restore of utils/kbd.c fails" mkdir utils >/dev/null 2>&1 echo "x - extracting utils/getcwd.c (Text)" sed 's/^X//' << 'SHAR_EOF' > utils/getcwd.c && X/* X getcwd -- get current working directory name (POSIX and SVID compatible) X X last edit: 21-Sep-1987 D A Gwyn X X This public-domain getcwd() routine can be used to replace the UNIX X System V library routine (which uses popen() to capture the output of X the "pwd" command). Once that is done, "pwd" can be reimplemented as X just puts(getcwd()). X X This implementation depends on every directory having entries for X "." and "..". It also depends on the internals of the <dirent.h> X data structures to some degree. X X I considered using chdir() to ascend the hierarchy, followed by a X final chdir() to the path being returned by getcwd() to restore the X location, but decided that error recovery was too difficult that way. X The algorithm I settled on was inspired by my rewrite of the "pwd" X utility, combined with the dotdots[] array trick from the SVR2 shell. X*/ X# if !defined(CRISP) X#include <sys/types.h> X#include <sys/stat.h> X#include <string.h> X# endif X#include <dirent.h> X#include <errno.h> X Xtypedef char *pointer; /* (void *) if you have it */ X Xextern void free(); Xextern pointer malloc(); Xextern int fstat(), stat(); X Xextern int errno; /* normally done by <errno.h> */ X X#ifndef NULL X#define NULL 0 /* amorphous null pointer constant */ X#endif X X#ifndef NAME_MAX X#define NAME_MAX 255 /* maximum directory entry size */ X#endif X Xchar * Xgetcwd( buf, size ) /* returns pointer to CWD pathname */ X char *buf; /* where to put name (NULL to malloc) */ X int size; /* size of buf[] or malloc()ed memory */ X { X static char dotdots[] = X"../../../../../../../../../../../../../../../../../../../../../../../../../.."; X char *dotdot; /* -> dotdots[.], right to left */ X DIR *dirp; /* -> parent directory stream */ X struct dirent *dir; /* -> directory entry */ X struct stat stat1, stat2; /* info from stat() */ X struct stat *d = &stat1; /* -> info about "." */ X struct stat *dd = &stat2; /* -> info about ".." */ X register char *buffer; /* local copy of buf, or malloc()ed */ X char *bufend; /* -> buffer[size] */ X register char *endp; /* -> end of reversed string */ X register char *dname; /* entry name ("" for root) */ X int serrno = errno; /* save entry errno */ X X if ( size == 0 ) X { X errno = EINVAL; /* invalid argument */ X return NULL; X } X X if ( (buffer = buf) == NULL /* wants us to malloc() the string */ X && (buffer = (char *)malloc( (unsigned)size )) == NULL X ) { X errno = ENOMEM; /* cannot malloc() specified size */ X return NULL; X } X X if ( stat( ".", dd ) != 0 ) /* prime the pump */ X goto error; /* errno already set */ X X endp = buffer; /* initially, empty string */ X bufend = &buffer[size]; X X for ( dotdot = &dotdots[sizeof(dotdots)]; dotdot != dotdots; ) X { X dotdot -= 3; /* include one more "/.." section */ X /* (first time is actually "..") */ X X /* swap stat() info buffers */ X { X register struct stat *temp = d; X X d = dd; /* new current dir is old parent dir */ X dd = temp; X } X X if ( (dirp = opendir( dotdot )) == NULL ) /* new parent */ X goto error; /* errno already set */ X X if ( fstat( dirp->dd_fd, dd ) != 0 ) X { X serrno = errno; /* set by fstat() */ X (void)closedir( dirp ); X errno = serrno; /* in case closedir() clobbered it */ X goto error; X } X X if ( d->st_dev == dd->st_dev ) X { /* not crossing a mount point */ X if ( d->st_ino == dd->st_ino ) X { /* root directory */ X dname = ""; X goto append; X } X X do X if ( (dir = readdir( dirp )) == NULL ) X { X (void)closedir( dirp ); X errno = ENOENT; /* missing entry */ X goto error; X } X while ( dir->d_ino != d->st_ino ); X } X else { /* crossing a mount point */ X struct stat t; /* info re. test entry */ X char name[sizeof(dotdots) + 1 + NAME_MAX]; X X (void)strcpy( name, dotdot ); X dname = &name[strlen( name )]; X *dname++ = '/'; X X do { X if ( (dir = readdir( dirp )) == NULL ) X { X (void)closedir( dirp ); X errno = ENOENT; /* missing entry */ X goto error; X } X X (void)strcpy( dname, dir->d_name ); X /* must fit if NAME_MAX is not a lie */ X } X while ( stat( name, &t ) != 0 X || t.st_ino != d->st_ino X || t.st_dev != d->st_dev X ); X } X X dname = dir->d_name; X X /* append "/" and reversed dname string onto buffer */ X append: X if ( endp != buffer /* avoid trailing / in final name */ X || dname[0] == '\0' /* but allow "/" when CWD is root */ X ) X *endp++ = '/'; X X { X register char *app; /* traverses dname string */ X X for ( app = dname; *app != '\0'; ++app ) X ; X X if ( app - dname >= bufend - endp ) X { X (void)closedir( dirp ); X errno = ERANGE; /* won't fit allotted space */ X goto error; X } X X while ( app != dname ) X *endp++ = *--app; X } X X (void)closedir( dirp ); X X if ( dname[0] == '\0' ) /* reached root; wrap it up */ X { X register char *startp; /* -> buffer[.] */ X X *endp = '\0'; /* plant null terminator */ X X /* straighten out reversed pathname string */ X for ( startp = buffer; --endp > startp; ++startp ) X { X char temp = *endp; X X *endp = *startp; X *startp = temp; X } X X errno = serrno; /* restore entry errno */ X return buffer; X } X } X X errno = ENOMEM; /* actually, algorithm failure */ X X error: X if ( buf == NULL ) X free( (pointer)buffer ); X X return NULL; X } X SHAR_EOF chmod 0644 utils/getcwd.c || echo "restore of utils/getcwd.c fails" mkdir utils >/dev/null 2>&1 echo "x - extracting utils/keys (Text)" sed 's/^X//' << 'SHAR_EOF' > utils/keys && X# SCO Mapkey File X# X# The descriptions in this file are provided for informational X# purposes only, and are intended for the exclusive use of the X# clients, customers, and licensees of The Santa Cruz Operation, X# Inc. The Santa Cruz Operation does not warrant the correctness X# or suitability for any purpose of any information contained X# herein. X# X# Differences in keytop layout between various manufacturers X# of keyboards may require that this file be modified. X# -- scan codes 41 and 86 may differ X# X# UK alt X# scan cntrl alt alt cntrl lock X# code base shift cntrl shift alt shift cntrl shift state X 0 nop nop nop nop nop nop nop nop O X 1 esc esc nop nop esc esc nop nop O X 2 '1' '!' nop nop '`' '`' nop nop O X 3 '2' '"' nop nop '@' '@' nop nop O X 4 '3' '#' nop nop '#' '#' nop nop O X 5 '4' '$' nop nop '4' '4' nop nop O X 6 '5' '%' nop nop '5' '5' nop nop O X 7 '6' '^' rs nop '^' '^' rs nop O X 8 '7' '&' nop nop '[' '[' esc esc O X 9 '8' '*' nop nop '8' '8' nop nop O X 10 '9' '(' nop nop ']' ']' gs gs O X 11 '0' ')' nop nop '{' '{' nop nop O X 12 '-' '_' ns nop '|' '|' ns nop O X 13 '=' '+' nop nop '}' '}' nop nop O X 14 bs bs del del bs bs del del O X 15 ht btab nop nop ht btab nop nop O X 16 'q' 'Q' dc1 dc1 fkey77 'Q' dc1 dc1 C X 17 'w' 'W' etb etb fkey83 'W' etb etb C X 18 'e' 'E' enq enq fkey65 'E' enq enq C X 19 'r' 'R' dc2 dc2 fkey78 'R' dc2 dc2 C X 20 't' 'T' dc4 dc4 fkey80 'T' dc4 dc4 C X 21 'y' 'Y' em em fkey85 'Y' em em C X 22 'u' 'U' nak nak fkey81 'U' nak nak C X 23 'i' 'I' ht ht fkey69 'I' ht ht C X 24 'o' 'O' si si fkey75 'O' si si C X 25 'p' 'P' dle dle fkey76 'P' dle dle C X 26 '[' '{' esc esc '[' '{' esc esc O X 27 ']' '}' gs gs ']' '}' gs gs O X 28 cr cr nl nl cr cr nl nl O X 29 ctrl ctrl ctrl ctrl ctrl ctrl ctrl ctrl O X 30 'a' 'A' soh soh fkey61 'A' soh soh C X 31 's' 'S' dc3 dc3 fkey79 'S' dc3 dc3 C X 32 'd' 'D' eot eot fkey64 'D' eot eot C X 33 'f' 'F' ack ack fkey66 'F' ack ack C X 34 'g' 'G' bel bel fkey67 'G' bel bel C X 35 'h' 'H' bs bs fkey68 'H' bs bs C X 36 'j' 'J' nl nl fkey70 'J' nl nl C X 37 'k' 'K' vt vt fkey71 'K' vt vt C X 38 'l' 'L' np np fkey72 'L' np np C X 39 ';' ':' nop nop ';' ':' nop nop O X 40 0x27 '@' nop nop 0x27 '@' nop nop O X 41 '\\' '|' fs nop '\\' '\\' fs nop O X#alt kbd 41 '\'' 0xac fs nop 0x7c 0x7c fs nop O X 42 lshift lshift lshift lshift lshift lshift lshift lshift O X 43 '#' '~' nop nop '~' '~' nop nop O X 44 'z' 'Z' sub sub fkey86 'Z' sub sub C X 45 'x' 'X' can can fkey84 'X' can can C X 46 'c' 'C' etx etx fkey63 'C' etx etx C X 47 'v' 'V' syn syn fkey82 'V' syn syn C X 48 'b' 'B' stx stx fkey62 'B' stx stx C X 49 'n' 'N' so so fkey74 'N' so so C X 50 'm' 'M' cr cr fkey73 'M' cr cr C X 51 ',' '<' nop nop ',' '<' nop nop O X 52 '.' '>' nop nop '.' '>' nop nop O X 53 '/' '?' nop nop '/' '?' nop nop O X 54 rshift rshift rshift rshift rshift rshift rshift rshift O X 55 fkey81 '*' nscr nscr '*' '*' nscr nscr O X 56 alt alt alt alt alt alt alt alt O X 57 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' O X 58 clock clock clock clock clock clock clock clock O X 59 fkey1 fkey13 fkey25 fkey37 scr1 scr11 scr1 scr11 O X 60 fkey2 fkey14 fkey26 fkey38 scr2 scr12 scr2 scr12 O X 61 fkey3 fkey15 fkey27 fkey39 scr3 scr13 scr3 scr13 O X 62 fkey4 fkey16 fkey28 fkey40 scr4 scr14 scr4 scr14 O X 63 fkey5 fkey17 fkey29 fkey41 scr5 scr15 scr5 scr15 O X 64 fkey6 fkey18 fkey30 fkey42 scr6 scr16 scr6 scr16 O X 65 fkey7 fkey19 fkey31 fkey43 scr7 scr7 scr7 scr7 O X 66 fkey8 fkey20 fkey32 fkey44 scr8 scr8 scr8 scr8 O X 67 fkey9 fkey21 fkey33 fkey45 scr9 scr9 scr9 scr9 O X 68 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O X 69 nlock nlock dc3 dc3 nlock nlock dc3 dc3 O X 70 slock slock del del slock slock del del O X 71 fkey49 '7' fkey87 '7' '7' '7' '7' '7' N X 72 fkey50 '8' '8' '8' '8' '8' '8' '8' N X 73 fkey51 '9' fkey88 '9' '9' '9' '9' '9' N X 74 fkey52 '-' ns ns '-' '-' '-' '-' N X 75 fkey53 '4' fkey89 '4' '4' '4' '4' '4' N X 76 fkey54 '5' '5' '5' '5' '5' '5' '5' N X 77 fkey55 '6' fkey90 rs '6' '6' '6' '6' N X 78 fkey56 '+' '+' '+' '+' '+' '+' '+' N X 79 fkey57 '1' fkey91 '1' '1' '1' '1' '1' N X 80 fkey58 '2' '2' '2' '2' '2' '2' '2' N X 81 fkey59 '3' fkey92 '3' '3' '3' '3' '3' N X 82 fkey60 '0' '0' '0' '0' '0' '0' '0' N X 83 del '.' del del del del del del N X 84 0xad 0xad nop nop nop nop nop nop O X 85 nop nop nop nop nop nop nop nop O X 86 '\\' '|' nop nop '\\' '|' nop nop O X 87 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O X 88 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O SHAR_EOF chmod 0644 utils/keys || echo "restore of utils/keys fails" mkdir utils >/dev/null 2>&1 echo "x - extracting utils/keys.sv386 (Text)" sed 's/^X//' << 'SHAR_EOF' > utils/keys.sv386 && Xsetkey ctrl ins '?0' Xsetkey ctrl end '?1' Xsetkey ctrl down '?2' Xsetkey ctrl pgdn '?3' Xsetkey ctrl left '?4' Xsetkey ctrl center '?5' Xsetkey ctrl right '?6' Xsetkey ctrl home '?7' Xsetkey ctrl up '?8' Xsetkey ctrl pgup '?9' Xsetkey alt f10 '[?Y' Xsetkey plus '[T' Xsetkey minus '[S' SHAR_EOF chmod 0755 utils/keys.sv386 || echo "restore of utils/keys.sv386 fails" mkdir utils >/dev/null 2>&1 echo "x - extracting utils/m286.malloc (Text)" sed 's/^X//' << 'SHAR_EOF' > utils/m286.malloc && X#! /bin/sh X# This is a shell archive, meaning: X# 1. Remove everything above the #! /bin/sh line. X# 2. Save the resulting text in a file. X# 3. Execute the file with /bin/sh (not csh) to create: X# m286.3x X# m286.uue X# t.c X# tcheck.c X# This archive created: Thu Jul 28 06:59:39 1988 Xexport PATH; PATH=/bin:/usr/bin:$PATH Xecho shar: "extracting 'm286.3x'" '(2318 characters)' Xif test -f 'm286.3x' Xthen X echo shar: "will not over-write existing file 'm286.3x'" Xelse Xsed 's/^ X//' << \SHAR_EOF > 'm286.3x' X X.TH M286 3X X X.SH NAME X Xm286 \- malloc package for iAPX286 processor X X.SH SYNOPSIS X X.nf X X char *malloc(size) X X unsigned size; X X X X void free(ptr) X X char *ptr; X X X X char *realloc(ptr, size) X X char *ptr; X X unsigned size; X X X X char calloc(nelem, elsize) X X unsigned nelem, elsize; X X X X int dump_malloc() X X.fi X X.SH DESCRIPTION X X.I M286 X Xis a malloc(3C) compatible library designed for use on the iAPX286 processor. X XPerformance is greatly improved over both malloc(3C) and malloc(3X) by X Xallocating full 64K segments via the brk() system call and divving up X Xthe segments as needed, reducing UNIX overhead. Is is found in the library X X"m286", and is loaded if the option "-lm286" is used with cc(1) or X Xld(1). X X X X.I Malloc X Xreturns a pointer to a block of at least size bytes. X X X X.I Free X Xreturns the space previously allocated with calloc() or malloc() X Xas pointed to by the argument X X.I ptr. X XContents of the block are preserved until the next malloc() or calloc() X Xcall. X X X X.I Realloc X Xchanges the size of the blocked pointed to by X X.I ptr X Xto the size given by argument two in bytes. Contents of the block X Xwill be unchanged up to either the original size or the new size, X Xwhichever is smaller. X X X X.I Calloc X Xallocates space via malloc and intializes the space to zeros. The X Xamount of space allocated is set up to handle an array of X X.I nelem X Xelements of size X X.I elsize. X X X X.I Dump_malloc X Xprovides a means to debug pointer references by dumping a list of all X Xblocks within X X.I m286's X Xfree list or those currently allocated to the standard error device. The listing X Xcontains LLINK, RLINK which are pointers to the previous and next blocks X Xon the free list. TAG and ETAG are flags indicating whether the block is X Xin use or not. ULINK is always a pointer to the beginning of the block. X XAll of the fields are displayed as indexes into a array of words within X Xthe allocated segment. X X X X.SH CAVEATS X XSince performance is gained by allocating full 64K segments, an average X Xof 32K bytes will be wasted by the process. The maximum size block that X Xcan be allocated is 65488 bytes. If larger sizes are needed, use brk() directly. X X X XThis software is copyright and can only be used and distributed for X Xnon-commercial use. Commerical licenses can be obtained from X Xmike@cimcor.mn.org for a very low cost. X X.SH FILES X X.DT X X/usr/lib/large/libm286.a X X.SH "SEE ALSO" X Xmalloc(3c), malloc(3x), brk(2) XSHAR_EOF Xif test 2318 -ne "`wc -c < 'm286.3x'`" Xthen X echo shar: "error transmitting 'm286.3x'" '(should have been 2318 characters)' Xfi Xfi Xecho shar: "extracting 'm286.uue'" '(11124 characters)' Xif test -f 'm286.uue' Xthen X echo shar: "will not over-write existing file 'm286.uue'" Xelse Xsed 's/^ X//' << \SHAR_EOF > 'm286.uue' X Xbegin 644 libm286.a X XM(3QA<F-H/@HO(" @(" @(" @(" @(" @-3@S-C,U,#@T(" @," @(" @," @ X XM(" @," @(" @(" R,#0@(" @(" @8 H . !$ 1 $0 !$ X XM 1 $0 !$ 1 $0 !$ 1 $0 !$ 1!G971P86=E X XM '5?;65M<V5T '5?;65M8W!Y &YE=U]P86=E &=E=%]O9F9S970 9G)E95]F X XM<F]M7W!A9V4 86QL;V-A=&5?9G)O;5]P86=E ')E='5R;E]F<F5E7W!A9V5S X XM &UA;&QO8P!C86QL;V, 9G)E90!R96%L;&]C '1A9VET &1U;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Q"Z ')RX-^!@%T\K@B$+H >OPR @ +CP X XM ([8]P;,#___=1EH %H*1!H !H& ": (/$"+@! ,G+QT;^ 0#I80'_ X XM=OYH %H1!!H !H& ": (/$"O]V_IH 1$2)1OB)5OK'1OP &@ X XM 6A;$&@ &@8 )H @\0(: !:&T0: :!@ F@ "#Q CIT "+=OQ& X XM1M'F W;XCE[ZBS0#=OR#Q@71Y@-V^(Y>^O\TBW;\1D;1Y@-V^(Y>^HLT W;\ X XM@\8$T>8#=OB.7OK_-)KZ#= 1$124(MV_(/& ]'F W;XCE[Z_S2+=OQ&1M'F X XM W;XCE[Z_S2+=OQ&T>8#=OB.7OK_-)KZ#= 1$124(MV_-'F W;XCE[Z_S3_ X XM=OR+1OS1X -&^ 4( /]V^E!H %HLQ!H !H& ": (/$'HMV_$9&T>8# X XM=OB.7OJ+! 4& %&_(-^_ 9S!9H BT;\,]*#^@!T ^DC_ST @'0#Z1O_ X XMBW;^T>:X$ &.V/^T !%H %HZ!!H !H& ": (/$"O]&_KCP ([8H<P/ X XM.T;^<@/IC_[I?_Z0V _P 0 7 #@ # 7 H*"D-O<'ER:6=H=" Q.3@X X XM(&)Y($UI8VAA96P@1W)E;FEE<BP@86QL(')I9VAT<R!R97-E<G9E9 H* $%6 X XM04E,( !)3B!54T4 *D)!1"H@ T*($YO('-E9VUE;G1S(&%L;&]C871E9 T* X XM T*(%-E9VUE;G0@3F\N("5D(#H@#0H (%!T<B @(" @($)L;V-K#0H ($%D X XM9'(@(" @(&]F9G-E=" @(" @("!,3$E.2R @5$%'(" @(%-)6D4@(" @4DQ) X XM3DL@($5404<@(" @55!,24Y+#0H* "4N.&QX(" @)2XU=2 @(" @("4N-74@ X XM("5S(" E+C5U(" @)2XU=2 @)7,@("4N-74@#0H ( T*($%6('!O:6YT<R!T X XM;R E=0T*"@ %@ "L ) !P B 0 @ (@ $ :@ "< X XM ) ' @ 0!W '@ ( ? "P ! 'X L "0"# X XM *P D B "( ! (P B 0"5 *@ D F@ "( X XM ! )X B 0"B (@ $ I@ "( ! *D M 0"K X XM +0 D L0 "< ) +< @ 0"[ ( $ O@ !X X XM ! , " "0#^ 0 )P D ! ( " ! D" F "0 2 X XM @ (@ $ H ( "H ) *8" B 0"K @ (@ $ KP( !X X XM " ,H" > 0#, @ @ D 0, !X " !H# > @!U X XM P )@ D >P, "( ! ) # F "0"6 P (@ $ V , "8 X XM ) -X# B 0#Q P '@ ( S@0 "8 ) -<$ B 0#B X XM! '@ ( ^ 0 !X " !$% > @"0!0 )@ D F 4 !X X XM " ,H% > @"8!@ )@ D H 8 !X " *H& > 0"L X XM!@ @ D O 8 "8 ) ,(& B 0#<!@ '@ ( ^08 !X X XM " ) ' F "0"6!P (@ $ F0< !X " /D' F "0 " X XM" (@ $ IP@ "8 ) *T( B 0"U" '@ ( Q @ "< X XM ) ,H( @ 0#-" *@ D TP@ "( ! -@( B 0#< X XM" )P D X@@ " ! .D( @ 0#L" '@ $ [@@ ( X XM ) /D( G "0#_" ( $ ! D "8 ) H) B 0 = X XM"0 *@ D (PD "( ! "<) B 0 J"0 +0 $ + D "T X XM ) #4) G "0 ["0 ( $ 0@D !X ! $0) ( "0!+ X XM"0 * D 4 D " ! & ) > 0!B"0 #@ D =@D "@ X XM ) 'X) @ 0"2"0 )P D EPD " ! *0) H "0"I X XM"0 ( $ L0D !X ! +,) ( "0"Z"0 )P D P D " X XM ! ,H) > 0#,"0 #@ D Y D !X ! .8) 2 "0 ' X XM"@ '@ $ "0H 0 ) "$* K "0 G"@ (@ $ *PH "( X XM ! $X* > 0!0"@ "@ D 5PH !X ! %D* , "0!? X XM"@ '@ $ 80H ! ) ' * > @!Y"@ '@ $ >PH !8 X XM ) (4* > @#\"P *P D @P "( ! 8, B 0 C X XM# '@ $ )0P ( ) #8, > 0 X# "@ D <PP !X X XM " 'P, > @!9#0 '@ $ 6PT P ) &$- > @"K X XM#0 '@ ( M T !X ! +8- 2 "0#<#0 '@ $ W@T 8 X XM ) .H- > 0#L#0 %@ D ^ T !X " 0. @ 0 ' X XM#@ +@ D # X " ! \. O "0 :#@ ( $ '0X # X XM ) "8. G "0 L#@ ( $ ,PX #$ ) #8. @ 0 Y X XM#@ ,@ D / X #( ! #\. S 0!!#@ ,P D 40X !X X XM " %<. T "0!:#@ ( $ 70X #( ) & . R 0!C X XM#@ ,P $ 90X #, ) &X. > 0!P#@ @ D @ X #4 X XM ) (,. @ 0"&#@ ,@ D B0X #( ! (P. S 0". X XM#@ ,P D E X #8 ) )<. @ 0":#@ ,@ D G0X #( X XM ! * . S 0"B#@ ,P D J X !X " .D. > 0#K X XM#@ &@ D 'P\ !X ! "$/ : "0!'#P -P D 2@\ " X XM ! $T/ R "0!0#P ,@ $ 4P\ #, ! %4/ S "0!V X XM#P . $ > \ #@ ) (4/ > @"-#P '@ ( E0\ "8 X XM ) )L/ B 0">#P .0 D H0\ " ! *0/ R "0"G X XM#P ,@ $ J@\ #, ! *P/ S "0"U#P )P D N@\ " X XM ! ,(/ > @#%#P '@ ( R \ " ! ,H/ E "0 N X XM9FEL90 #^_P 9P%M86QL;V,N8P !G971P86=E X XM ! &X @$ )P $ !U7VUE;7-E="< ! " @$ X XM ' & !U7VUE;6-P>4, ! " @$ (@ X XM ( !N97=?<&%G964 ! " @$ 3 ( * X XM ,@ +$" ! "X @$ $0 , /0 ,(" X XM ! " @$ X , . 3 *(& ! &X @$ X XM &P( 0 7P +T( ! " @$ <P X XM 2 !M86QL;V, # ) ! &( @$ HP 4 !C X XM86QL;V, -,) ! &( @$ 0P 6 !F<F5E !8* X XM ! " @$ 3P 8 !R96%L;&]C &4* ! &( @$ X XM E0, : !T86=I= /H- ! &( @$ )P X XM < <0 "$. ! "0 @$ I@$ > N X XM=&5X= ! P'(#P S . N9&%T80 ,@/ X XM " P$X 0 @ N8G-S 1 # P&$ X XM ! ,@/ " P N,S, -@/ X XM " P!A=E]L:7-T 1 # P $ ,P/ " P X XM &@ ,X/ " P!X>&9U;FYY - / " P!M7V5N9&1S 'P1 X XM # P ) ( 1 # P!S8G)K @!B X XM<FL @ N,3 Q !00 " P N,3 S !L0 X XM " P N,3 T "(0 " P N,3 Y "D0 " P!? X XM:6]B @!F<')I;G1F @ N,3$S $00 X XM " P N,3$T %L0 " P N,3$U &T0 " P N X XM,3$X +,0 " P!A8F]R= @ N,3(Q .@0 X XM " P!] >'AC;W!Y<FEG:'0 ;5]C=7)I;F1X &9R965?:6YD> !M X XM7V9I<G-T7V5N9&1S &=E=%]O9F9S970 9G)E95]F<F]M7W!A9V4 86QL;V-A X XL=&5?9G)O;5]P86=E ')E='5R;E]F<F5E7W!A9V5S &1U;7!?;6%L;&]C IA X X X Xend XSHAR_EOF Xif test 11124 -ne "`wc -c < 'm286.uue'`" Xthen X echo shar: "error transmitting 'm286.uue'" '(should have been 11124 characters)' Xfi Xfi Xecho shar: "extracting 't.c'" '(635 characters)' Xif test -f 't.c' Xthen X echo shar: "will not over-write existing file 't.c'" Xelse Xsed 's/^ X//' << \SHAR_EOF > 't.c' X X#include <stdio.h> X X#include <malloc.h> X X X Xmain(argc, argv) X Xint argc; X Xchar *argv[]; X X{ X X char *p; X X int size,i,j; X X if (argc!=2) X X { X X printf("%s: Usage - t number \n",argv[0]); X X printf(" Where 'number' is the number of kilobytes to allocate\n"); X X exit(1); X X } X X X X if ((size=atoi(argv[1])) == 0) X X { X X printf("%s: Bad argument, must be integer in kilobytes",argv[0]); X X exit(1); X X } X X X X for (i=0; i<size; i++) X X for (j=0; j<10; j++) X X if ((p=malloc(100))==NULL) X X { X X printf("\nNot enough memory available\n"); X X printf("Was only able to allocate %ld bytes",i*1024L+j*100L); X X exit(2); X X } else fputc('.',stderr); X X fputc('\n', stderr); X X} XSHAR_EOF Xif test 635 -ne "`wc -c < 't.c'`" Xthen X echo shar: "error transmitting 't.c'" '(should have been 635 characters)' Xfi Xfi Xecho shar: "extracting 'tcheck.c'" '(1564 characters)' Xif test -f 'tcheck.c' Xthen X echo shar: "will not over-write existing file 'tcheck.c'" Xelse Xsed 's/^ X//' << \SHAR_EOF > 'tcheck.c' X X#include <stdio.h> X X#include <malloc.h> X X#include <signal.h> X Xchar *calloc(); X X X X#define NSEGS 512 /* must be power of two - this program allocates X X up to NSEGS * 1K bytes */ X X X Xchar *p[NSEGS]; X X X X#ifdef DEBUG X Xvoid fault(no) X Xint no; X X{ X X fprintf(stderr,"Caught signal number %d\n",no); X X dump_malloc(); X X abort(); X X} X X#endif X X X X X Xvoid print_pointers() X X{ X X int i; X X fprintf(stderr,"\n Pointers are : "); X X for (i=0; i<NSEGS; i++) X X fputc( (p[i]==NULL ? 'F':'T'), stderr); X X fputc('\n',stderr); X X} X X X X X X X Xmain(argc, argv) X Xint argc; X Xchar *argv[]; X X{ X X int j,k; X X unsigned s,fill; X X long i; X X X X#ifdef DEBUG X X signal(SIGINT,fault); X X#endif X X X X for (i=0; i<NSEGS; i++) X X p[i]=NULL; X X X X for (i=0; i<100000; i++) X X { X X k= rand() & (NSEGS - 1); /* choose a pointer */ X X if (p[k] == NULL) X X { X X int call_type; X X/* print_pointers(); */ X X s=(unsigned) rand() & 0x3ff; /* pick a size */ X X fprintf(stderr," %ld : Allocating a size of %u to pointer %d ",i,s,k); X X X X call_type = rand() & 1; X X p[k] = ( call_type ? malloc(s) : calloc(s,1) ); X X fprintf(stderr,"and getting %lx using %s\n", X X p[k], ( call_type ? "malloc" : "calloc")); X X for (fill=0; fill<s; fill++) /* fill the buffer */ X X p[k] [fill] = (char) (i & 0xff); X X X X } X X j=rand() & (NSEGS-1); /* choose another pointer */ X X if (p[j] != NULL) X X { X X fprintf(stderr," %ld : freeing %lx from pointer %d\n",i,p[j],j); X X free(p[j]); X X p[j]=NULL; X X } X X X X j=rand() & (NSEGS-1); X X if (p[j] != NULL) X X { X X s=rand()&0x3ff; X X fprintf(stderr," %ld : realloc %lx to size %d on pointer %d\n", X X i, p[j], s,j); X X p[j]=realloc(p[j], s); X X } X X X X } X X} XSHAR_EOF Xif test 1564 -ne "`wc -c < 'tcheck.c'`" Xthen X echo shar: "error transmitting 'tcheck.c'" '(should have been 1564 characters)' Xfi Xfi Xexit 0 X# End of shell archive X X SHAR_EOF chmod 0644 utils/m286.malloc || echo "restore of utils/m286.malloc fails" mkdir utils >/dev/null 2>&1 echo "x - extracting utils/strings (Text)" sed 's/^X//' << 'SHAR_EOF' > utils/strings && XString key values X"\x80" Function #1 X"\x81" Function #2 X"\x82" Function #3 X"\x83" Function #4 X"\x84" Function #5 X"\x85" Function #6 X"\x86" Function #7 X"\x87" Function #8 X"\x88" Function #9 X"\x89" Function #10 X"\x8a" Function #11 X"\x8b" Function #12 X"\x8c" Shift Function #1 X"\x8d" Shift Function #2 X"\x8e" Shift Function #3 X"\x8f" Shift Function #4 X"\x90" Shift Function #5 X"\x91" Shift Function #6 X"\x92" Shift Function #7 X"\x93" Shift Function #8 X"\x94" Shift Function #9 X"\x95" Shift Function #10 X"\x96" Shift Function #11 X"\x97" Shift Function #12 X"\x98" Control Function #1 X"\x99" Control Function #2 X"\x9a" Control Function #3 X"\x9b" Control Function #4 X"\x9c" Control Function #5 X"\x9d" Control Function #6 X"\x9e" Control Function #7 X"\x9f" Control Function #8 X"\xa0" Control Function #9 X"\xa1" Control Function #10 X"\xa2" Control Function #11 X"\xa3" Control Function #12 X"\xa4" Ctrl/Shft Function #1 X"\xa5" Ctrl/Shft Function #2 X"\xa6" Ctrl/Shft Function #3 X"\xa7" Ctrl/Shft Function #4 X"\xa8" Ctrl/Shft Function #5 X"\xa9" Ctrl/Shft Function #6 X"\xaa" Ctrl/Shft Function #7 X"\xab" Ctrl/Shft Function #8 X"\xac" Ctrl/Shft Function #9 X"\xad" Ctrl/Shft Function #10 X"\xae" Ctrl/Shft Function #11 X"\xaf" Ctrl/Shft Function #12 X"\xd1" Home X"\xd2" Up arrow X"\xd3" Page up X"\xd6" - X"\xce" Left arrow X"\xb5" 5 X"\xd0" Right arrow X"\xd5" + X"\xcb" End X"\xcc" Down arrow X"\xcd" Page down X"\xca" Insert X"\xb0" Alt-A X"\xb1" Alt-B X"\xb2" Alt-C X"\xb3" Alt-D X"\xb4" Alt-E X"\xb5" Alt-F X"\xb6" Alt-G X"\xb7" Alt-H X"\xb8" Alt-I X"\xb9" Alt-J X"\xba" Alt-K X"\xbb" Alt-L X"\xbc" Alt-M X"\xbd" Alt-N X"\xbe" Alt-O X"\xbf" Alt-P X"\xc0" Alt-Q X"\xc1" Alt-R X"\xc2" Alt-S X"\xc3" Alt-T X"\xc4" Alt-U X"\xc5" Alt-V X"\xc6" Alt-W X"\xc7" Alt-X X"\xc8" Alt-Y X"\xc9" Alt-Z X"\xdf" Ctrl-Home X"\xe1" Ctrl-PgUp X"\xdc" Ctrl- <- X"\xde" Ctrl- -> X"\xd9" Ctrl-End X"\xdb" Ctrl-PgDn X"\xe6" Shift-Tab X"" Undefined X"" Undefined X"" Undefined SHAR_EOF chmod 0644 utils/strings || echo "restore of utils/strings fails" mkdir utils >/dev/null 2>&1 echo "x - extracting utils/termcap (Text)" sed 's/^X//' << 'SHAR_EOF' > utils/termcap && X# ------------------------ X# X# Termcap source file @(#)termcap.src 1.32 88/03/14 SMI; from UCB 5.28 6/7/86 X# Kevin Layer, Berkeley X# Craig Leres, Berkeley X# Mark Horton, Berkeley X# X# Please mail changes to (arpanet): termcap@berkeley X# XMu|sun|Sun Microsystems Workstation console:\ X :am:bs:km:mi:ms:pt:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:\ X :ce=\E[K:cd=\E[J:\ X :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:rs=\E[s:\ X :md=\E[1m:mr=\E[7m:me=\E[m:\ X :al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\ X :up=\E[A:nd=\E[C:ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\ X :k1=\E[224z:k2=\E[225z:k3=\E[226z:k4=\E[227z:k5=\E[228z:\ X :k6=\E[229z:k7=\E[230z:k8=\E[231z:k9=\E[232z:\ X :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP: XM-|sun-e|sun-nic|sune|Sun Microsystems Workstation without insert character:\ X :ic@:im@:ei@:tc=sun: XMu|sun-s|Sun Microsystems Workstation window with status line:\ X :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun: XMu|sun-e-s|sun-s-e|Sun Microsystems Workstation with status hacked for emacs:\ X :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun-e: XM0|sun-48|Sun 48-line window:\ X :li#48:co#80:tc=sun: XM1|sun-34|Sun 34-line window:\ X :li#34:co#80:tc=sun: XM2|sun-24|Sun 24-line window:\ X :li#24:co#80:tc=sun: XM3|sun-17|Sun 17-line window:\ X :li#17:co#80:tc=sun: Xli|ansi|AT386|ansi80x25|Ansi standard crt:\ X :IC=\E[%d@:AL=\E[%dL:DL=\E[%dM:\ X :al=\E[L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J\E[H:cm=\E[%i%d;%dH:co#80:\ X :dc=\E[P:dl=\E[M:do=\E[B:bt=\E[Z:ei=:ho=\E[H:ic=\E[@:im=:li#25:\ X :mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:pt:so=\E[7m:se=\E[m:\ X :us=\E[4m:ue=\E[m:up=\E[A:\ X :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:eo:sf=\E[S:sr=\E[T:\ X :GS=\E[12m:GE=\E[10m:GV=\63:GH=D:\ X :GC=E:GL=\64:GR=C:RT=^J:G1=?:G2=Z:G3=@:G4=Y:GU=A:GD=B:\ X :CW=\E[M:NU=\E[N:RF=\E[O:RC=\E[P:\ X :WL=\E[S:WR=\E[T:CL=\E[U:CR=\E[V:\ X :HM=\E[H:EN=\E[F:PU=\E[I:PD=\E[G: Xvt100-80|Special for VMS:\ X :IC=\E[%d@:AL=\E[%dL:DL=\E[%dM:\ X :al=\E[L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J\E[H:cm=\E[%i%d;%dH:co#80:\ X :dc=\E[P:dl=\E[M:do=\E[B:bt=\E[Z:ei=:ho=\E[H:ic=\E[@:im=:li#25:\ X :mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:pt:so=\E[7m:se=\E[m:\ X :us=\E[4m:ue=\E[m:up=\E[A:\ X :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:eo:sf=\E[S:sr=\E[T:\ X :GS=\E[12m:GE=\E[10m:GV=\63:GH=D:\ X :GC=E:GL=\64:GR=C:RT=^J:G1=?:G2=Z:G3=@:G4=Y:GU=A:GD=B:\ X :CW=\E[M:NU=\E[N:RF=\E[O:RC=\E[P:\ X :WL=\E[S:WR=\E[T:CL=\E[U:CR=\E[V:\ X :HM=\E[H:EN=\E[F:PU=\E[I:PD=\E[G: Xsa|network:\ X :tc=unknown: Xsb|arpanet:\ X :tc=unknown: Xsc|bussiplexer:\ X :tc=unknown: Xsd|du|dialup:\ X :tc=unknown: Xse|ethernet:\ X :tc=unknown: Xsl|lpr|printer|print|printing|line printer:\ X :do=^J:le=^H:bs:co#132:hc:os: Xsp|plugboard|patch|patchboard:\ X :tc=unknown: Xsu|dumb|un|unknown:\ X :am:co#80:do=^J: Xsw|switch|intelligent switch:\ X :tc=unknown: Xsx|ansi|any ansi terminal with pessimistic assumptions:\ X :co#80:li#25:cl=50\E[;H\E[2J:bs:am:cm=\E[%i%d;%dH:\ X :nd=\E[C:up=\E[A:ce=\E[K:ho=\E[H:\ X :al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\ X :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\ X :ul=\E[33m\E[1m:ue=\E[0m\E[32m:\ X :so=\E[33m\E[1m:se=\E[0m\E[32m:\ X :up=\E[A:nd=\E[C:ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D: X# Following two entries added by P. Fox on behalf of D. MacKenzie X# bs is not defined because curses doesn't check bw, and so loses. XMW|wyse50|wy50|Wyse 50|wyse50.80:\ X :al=\EE:am:cd=\EY:ce=\ET:\ X :cl=\E+:cm=\E=%+ %+ :co#80:\ X :dc=\EW:dl=\ER:\ X :do=^J:ei=\Er:ho=\E{:im=\Eq:li#24:nd=^L:as=\EH^B:ae=\EH^C:\ X :up=^K:kb=^H:kd=^J:kl=^H:kr=^L:kh=^^:kn#10:\ X :hs:es:ds=\EA10\Ef \r:ts=\EA1v\Ef:fs=\r:ws#78:\ X :bt=\EI:ku=^K:sr=\Ej:bw:mi:ms:\ X :so=\E):se=\E(:\ X :vb=\E`8\E`9:\ X :k1=\001@\015:k2=\001A\015:k3=\001B\015:k4=\001C\015:\ X :k5=\001D\015:k6=\001E\015:k7=\001F\015:k8=\001G\015:\ X :k9=\001H\015:k10=\001I\015:k11=\001J\015:k12=\001K\015:\ X :k13=\001L\015:k14=\001M\015:k15=\001N\015:k16=\001O\015:\ X :as=\EH\002:ae=\EH\003:vi=\E`0:ve=\E`2:bl=^G:\ X :if=/usr/lib/tabset/std:pt: XMW|wyse50w|wyse50-w|wy50w|wy50-w|wyse50.132|Wyse 50 132col:\ X :co#132:cm=\Ea%i%dR%dC:tc=wyse50: Xv9|925a|tvi925a|TeleVideo Model 925:\ X :al=\EE:am:bs:bt=\EI:bw:cd=\EY:ce=\ET:cl=^Z:cm=\E=%+ %+ :co#80:dc=\EW:\ X :dl=\ER:do=^V:ei=:ic=\EQ:if=/usr/share/lib/tabset/std:im=:kb=^H:kd=^V:\ X :kh=^^:kl=^H:kn#12:kr=^L:ku=^K:li#24:nd=^L:pt:se=\EG0:sg#1:so=\EG4:\ X :ue=\EG0:ug#1:ul:up=^K:us=\EG8:is=\El\ X :vb=\Eb\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ed:\ X :ve=\E.4:vs=\E.2: Xv8|vi|tvi925|925|televideo model 925:\ X :hs:am:bs:co#80:li#24:cm=\E=%+ %+ :cl=\E*:cd=\Ey:ce=\Et:is=\El\E":\ X :al=\EE:dl=\ER:im=:ei=:ic=\EQ:dc=\EW:if=/usr/share/lib/tabset/stdcrt:\ X :ho=^^:nd=^L:bt=\EI:pt:so=\EG4:se=\EG0:sg#1:us=\EG8:ue=\EG0:ug#1:\ X :up=^K:do=^V:kb=^H:ku=^K:kd=^V:kl=^H:kr=^L:kh=^^:ma=^V^J^L :\ X :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:k7=^AF\r:\ X :k8=^AG\r:k9=^AH\r:k0=^AI\r:ko=ic,dc,al,dl,cl,ce,cd,bt:\ X :ts=\Ef:fs=\Eg:ds=\Eh:sr=\Ej:xn: Xwk|wyse-vp-nk|wyse-nk|Wyse 50 in ADDS Viewpoint enhanced mode with cursor keys gone:\ X :kl@:kr@:kd@:ku@:kh@:tc=wyse-vp: Xwv|wyse-vp|wyse|Wyse 50 in ADDS Viewpoint emulation mode with "enhance" on:\ X :am:do=^J:if=/usr/share/lib/tabset/wyse-adds:\ X :le=^H:bs:li#24:co#80:cm=\EY%+ %+ :cd=\Ek:ce=\EK:nd=^F:\ X :up=^Z:cl=^L:ho=^A:ll=^A^Z:kl=^U:kr=^F:kd=^J:ku=^Z:kh=^A:\ X :pt:so=^N:se=^O:us=^N:ue=^O:dl=\El:al=\EM:im=\Eq:ei=\Er:dc=\EW:\ X :is=\E`\072\E`9^O\Er:rs=\E`\072\E`9^O\Er: Xvw|w9|wyse925|wyse-925|Wyse-50 emulating tvi925:\ X :xn@:tc=tvi925: Xye|w50|wyse50|wyse-50|Wyse 50 in Wyse mode:\ X :al=\EE:am:bs:bt=\EI:cd=\EY:ce=\ET:cl=^Z:cm=\E=%+ %+ :co#80:\ X :da:db:dc=\EW:dl=\ER:ei=\Er:im=\Eq:is=\E`\072\200\EC\EDF\E'\E(:\ SHAR_EOF echo "End of part 3" echo "File utils/termcap is continued in part 4" echo "4" > s2_seq_.tmp exit 0 -- ===================== Reuters Ltd PLC, Tel: +44 628 891313 x. 212 Westthorpe House, UUCP: fox%marlow.uucp@idec.stc.co.uk Little Marlow, Bucks, England SL7 3RQ