]> thyrsus.com Git - ascii.git/commitdiff
Man page fixups - and recognize \0.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 27 Nov 2013 23:26:23 +0000 (18:26 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 27 Nov 2013 23:26:23 +0000 (18:26 -0500)
NEWS
ascii.c
ascii.xml
nametable

diff --git a/NEWS b/NEWS
index fd24d58367aef740364c332015e7ceb9f5691b15..097875e977f0206f043d77882b8b753904cdfd3a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,9 @@
                        ascii project news
 
 Repository head
-  ascci.cgi deleted: the <isindex> it relies on is archaic and nonconformant.
+  Recognize \0 as ASCII NUL.
+  ascii.cgi deleted: the <isindex> it relies on is archaic and nonconformant.
+  Markup improvements on the manual page.
 
 3.13: 2013-11-20
   Tweak Makefile to obey $(PREFIX) convention (from MacPorts).
diff --git a/ascii.c b/ascii.c
index 4c1cc9d63e8db70da42c31f98a301939d3a9797c..a2f8db07f4a8349771207a62e9cea6d706a50514 100644 (file)
--- a/ascii.c
+++ b/ascii.c
@@ -241,7 +241,7 @@ static void ascii(char *str)
     { speak((unsigned int)(str[1] & 0x1f)); return; }
 
     /* interpret C-style backslash escapes */
-    if (*str == '\\' &&  len == 2 && strchr("abfnrtv", str[1]))
+    if (*str == '\\' &&  len == 2 && strchr("abfnrtv0", str[1]))
        for (ch = 7; ch < 14; ch++)
            for (ptr = &cnames[ch][1]; *ptr; ptr++)
                if (**ptr == '\\' && strcmp(str, *ptr) == 0)
index f59746995e962d5a3b34385e0ac4cb1edfc88746..0f55e7f12228646b71cd616925f70675e445c7f7 100644 (file)
--- a/ascii.xml
+++ b/ascii.xml
@@ -80,94 +80,67 @@ encodings of the character.</para>
 <refsect1 id='description'><title>DESCRIPTION</title>
 <para>Characters in the ASCII set can have many aliases, depending on
 context. A character's possible names include:</para>
-<variablelist remap='TP'>
-<varlistentry>
-<term>*</term>
+
+<itemizedlist>
 <listitem>
 <para>Its bit pattern (binary representation).</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Its hex, decimal and octal representations.</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Its teletype mnemonic and caret-notation form (for control chars).</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Its backlash-escape form in C (for some control chars).</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Its printed form (for printables).</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Its full ISO official name in English.</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Its ISO/ECMA code table reference.</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Its name as an HTML/SGML entity.</para>
 </listitem>
-</varlistentry>
-<varlistentry>
-<term>*</term>
 <listitem>
 <para>Slang and other names in wide use for it among hackers.</para>
 </listitem>
-</varlistentry>
-</variablelist>
-
+</itemizedlist>
 
 <para>This utility accepts command-line strings and tries to interpret them as
 one of the above.
-When it finds a value, it prints <emphasis remap='I'>all</emphasis> of the names
+When it finds a value, it prints <emphasis>all</emphasis> of the names
 of the character.
 The constructs in the following list can be used to 
 specify character values.
 If an argument could be interpreted in two or more
 ways, names for all the different characters it might be are dumped.</para>
-<variablelist remap='TP'>
+<variablelist>
 <varlistentry>
-<term><emphasis remap='I'>character</emphasis></term>
+<term><emphasis>character</emphasis></term>
 <listitem>
 <para>Any character not described by one of the following conventions
 represents the character itself.</para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='B'>^</emphasis><emphasis remap='I'>character</emphasis></term>
+<term><emphasis role="bold">^</emphasis><emphasis>character</emphasis></term>
 <listitem>
 <para>A caret followed by a character.</para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='B'>\</emphasis><emphasis remap='I'>character</emphasis></term>
+<term><emphasis role="bold">\</emphasis><emphasis>[abfnrtv0]</emphasis></term>
 <listitem>
 <para>A backslash followed by certain special characters (abfnrtv).</para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='I'>mnemonic</emphasis></term>
+<term><emphasis>mnemonic</emphasis></term>
 <listitem>
 <para>An ASCII teletype mnemonic.</para>
 </listitem>
@@ -178,61 +151,61 @@ represents the character itself.</para>
 <para>A hexadecimal (hex) sequence consists of one or two case-insensitive hex digit
 characters (01234567890abcdef).
 To ensure hex interpretation use
-<emphasis remap='I'>hex</emphasis><emphasis remap='B'>h</emphasis><emphasis remap='I'>,</emphasis>
-<emphasis remap='B'>0x</emphasis><emphasis remap='I'>hex,</emphasis>
-<emphasis remap='B'>x</emphasis><emphasis remap='I'>hex</emphasis>
+<emphasis>hex</emphasis><emphasis role="bold">h</emphasis><emphasis>,</emphasis>
+<emphasis role="bold">0x</emphasis><emphasis>hex,</emphasis>
+<emphasis role="bold">x</emphasis><emphasis>hex</emphasis>
 or
-<emphasis remap='B'>\x</emphasis><emphasis remap='I'>hex.</emphasis></para>
+<emphasis role="bold">\x</emphasis><emphasis>hex.</emphasis></para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='I'>decimal</emphasis></term>
+<term><emphasis>decimal</emphasis></term>
 <listitem>
 <para>A decimal sequence consists of one, two or three decimal digit
 characters (0123456789).
 To ensure decimal interpretation use
-<emphasis remap='B'>\0d</emphasis><emphasis remap='I'>decimal,</emphasis>
-<emphasis remap='B'>d</emphasis><emphasis remap='I'>decimal,</emphasis>
+<emphasis role="bold">\0d</emphasis><emphasis>decimal,</emphasis>
+<emphasis role="bold">d</emphasis><emphasis>decimal,</emphasis>
 or
-<emphasis remap='B'>\d</emphasis><emphasis remap='I'>decimal.</emphasis></para>
+<emphasis role="bold">\d</emphasis><emphasis>decimal.</emphasis></para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='I'>octal</emphasis></term>
+<term><emphasis>octal</emphasis></term>
 <listitem>
 <para>An octal sequence consists of one, two or three octal digit
 characters (01234567).
 To ensure octal interpretation use
-<emphasis remap='B'>\</emphasis><emphasis remap='I'>octal,</emphasis>
-<emphasis remap='B'>0o</emphasis><emphasis remap='I'>octal,</emphasis>
-<emphasis remap='B'>o</emphasis><emphasis remap='I'>octal,</emphasis>
+<emphasis role="bold">\</emphasis><emphasis>&lt;octal&gt;,</emphasis>
+<emphasis role="bold">0o</emphasis><emphasis>&lt;octal&gt;,</emphasis>
+<emphasis role="bold">o</emphasis><emphasis>&lt;octal&gt;,</emphasis>
 or
-<emphasis remap='B'>\o</emphasis><emphasis remap='I'>octal.</emphasis></para>
+<emphasis role="bold">\o</emphasis><emphasis>&lt;octal&gt;.</emphasis></para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='I'>bit pattern</emphasis></term>
+<term><emphasis>bit pattern</emphasis></term>
 <listitem>
 <para>A bit pattern (binary) sequence consists of one to eight binary digit
 characters (01).
 To ensure bit interpretation use
-<emphasis remap='B'>0b</emphasis><emphasis remap='I'>bit pattern,</emphasis>
-<emphasis remap='B'>b</emphasis><emphasis remap='I'>bit pattern</emphasis>
+<emphasis role="bold">0b</emphasis><emphasis>&lt;bit pattern&gt;,</emphasis>
+<emphasis role="bold">b</emphasis><emphasis>&lt;bit pattern&gt;</emphasis>
 or
-<emphasis remap='B'>\b</emphasis><emphasis remap='I'>bit pattern.</emphasis></para>
+<emphasis role="bold">\b</emphasis><emphasis>&lt;bit pattern&gt;.</emphasis></para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='I'>ISO</emphasis>/<emphasis remap='I'>ECMA code</emphasis></term>
+<term><emphasis>ISO</emphasis>/<emphasis>ECMA code</emphasis></term>
 <listitem>
-<para>A ISO/ECMA code sequence consists of one or two decimal digit characters,
+<para>An ISO/ECMA code sequence consists of one or two decimal digit characters,
 a slash, and one or two decimal digit characters.</para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term><emphasis remap='I'>name</emphasis></term>
+<term><emphasis>name</emphasis></term>
 <listitem>
-<para>An official ASCII or slang name.</para>
+<para>An official ASCII or (unofficial) slang name.</para>
 </listitem>
 </varlistentry>
 </variablelist>
@@ -253,15 +226,14 @@ string.</para>
 metacharacters in arguments (especially backslash).</para>
 
 <para>This utility is particularly handy for interpreting cc(1)'s ugly
-octal `invalid-character' messages, or when coding anything to do with serial
-communications.
-As a side effect it serves as a handy base-converter
-for random 8-bit values.</para>
+octal `invalid-character' messages, or when coding anything to do with
+serial communications.  As a side effect it serves as a handy
+base-converter for random 8-bit values.</para>
 </refsect1>
 
 <refsect1 id='author'><title>AUTHOR</title>
 
-<para>Eric S. Raymond <email>esr@snark.thyrsus.com</email>; November
+<para>Eric S. Raymond <email>esr@thyrsus.com</email>; November
 1990 (home page at <ulink
 url='http://www.catb.org/~esr/'>http://www.catb.org/~esr/</ulink>).
 Reproduce, use, and modify as you like as long as you don't remove
index 67c4f671e888823172eb6dc93bebd37e78dc30d9..7ce743bd6bd08e2240984be12135163e2104bbd6 100644 (file)
--- a/nametable
+++ b/nametable
@@ -3,6 +3,7 @@
 # Most of this file gets copied into one big C initializer.
 Mnemonics: "NUL",
 ISO names: "Null",
+C escape:  "\\0",
 %%
 Mnemonics: "SOH",
 ISO names: "Start Of Heading",