]> thyrsus.com Git - ascii.git/commitdiff
Ready to ship.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 5 Dec 1995 20:45:16 +0000 (20:45 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 5 Dec 1995 20:45:16 +0000 (20:45 +0000)
Makefile
ascii.c
ascii.xml

index af94e61661aab12df0b882e074ba73fbe6985f1d..0f16b4a52b75910700c700164275dd7c0e527374 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,11 +7,11 @@ CFLAGS = -O
 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
diff --git a/ascii.c b/ascii.c
index 86e3e1651ea38c29822cbb7f1a1bee25e866707e..4aeb91146aa21bc6796cd85ca2a4cfc068ec2047 100644 (file)
--- a/ascii.c
+++ b/ascii.c
@@ -1,10 +1,11 @@
 /*
  * 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,
@@ -360,7 +361,7 @@ register char       *s, *t;
 static void ascii(str)
 char *str;
 {
-    int        ch;
+    int        ch, hi, lo;
     char **ptr;
     int len = strlen(str);
 
@@ -451,7 +452,9 @@ char *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;
index fb03ea3af82035163828fddf7cbfe15edb5b0a10..c73eb91c34179f5abc778e2cf7dbec75cad24075 100644 (file)
--- a/ascii.xml
+++ b/ascii.xml
@@ -26,6 +26,9 @@ Its printed form (for printables).
 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