clean:
rm -f ascii ascii.tar* ascii.shar
-ascii-1.3.tar: Makefile ascii.c ascii.1 ascii.lsm
- tar cvf ascii-1.3.tar Makefile ascii.c ascii.1 ascii.lsm
+ascii-2.0.tar: Makefile ascii.c ascii.1 ascii.lsm
+ tar cvf ascii-2.0.tar Makefile ascii.c ascii.1 ascii.lsm
-ascii-1.3.tar.gz: ascii-1.3.tar
- gzip ascii-1.3.tar
+ascii-2.0.tar.gz: ascii-2.0.tar
+ gzip ascii-2.0.tar
-ascii-1.3.shar:
- shar Makefile ascii.c ascii.1 ascii.lsm >ascii-1.3.shar
+ascii-2.0.shar:
+ shar Makefile ascii.c ascii.1 ascii.lsm >ascii-2.0.shar
/*
* ascii.c -- quick crossreference for ASCII character aliases
*
- * by Eric S. Raymond <esr@snark.uu.net>, v1.0 March 1990
+ * by Eric S. Raymond <esr@snark.thyrsus.com>, v1.0 March 1990
* v1.1 November 1990 -- revised `slang' from the 2.2 pronunciation guide
* v1.2 March 1995 -- Fixed a core-dump bug
* v1.3 October 1995 -- Fixed a bug that shows up only under ELF.
+ * v2.0 December 1995 -- Interpret ISO-style code table escapes.
*
* Tries to interpret arguments as names or aliases of ascii characters
* and dumps out *all* the aliases of each. Accepts literal characters,
static void ascii(str)
char *str;
{
- int ch;
+ int ch, hi, lo;
char **ptr;
int len = strlen(str);
speak(bval & 0xff);
}
- if (len >= 4 && isalpha(str[0])) /* OK, try to match long names */
+ if (sscanf(str, "%d/%d", &hi, &lo) == 2) /* code table reference? */
+ speak(hi*16 + lo);
+ else if (len >= 4 && isalpha(str[0])) /* try to match long names */
{
char canbuf[BUFSIZ], *ep;
int i;
Its full official name in English.
.TP 3
*
+Its ISO/ECMA code table reference.
+.TP 3
+*
Slang and other names in wide use for it among hackers.
.P
This utility accepts command-line strings and tries to interpret them as