From: Eric S. Raymond Date: Wed, 27 Nov 2013 23:26:23 +0000 (-0500) Subject: Man page fixups - and recognize \0. X-Git-Tag: 3.14~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=e3030c3d65d321cdd5ece04a17fcd6e169588cc3;p=ascii.git Man page fixups - and recognize \0. --- diff --git a/NEWS b/NEWS index fd24d58..097875e 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,9 @@ ascii project news Repository head - ascci.cgi deleted: the it relies on is archaic and nonconformant. + Recognize \0 as ASCII NUL. + ascii.cgi deleted: the 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 4c1cc9d..a2f8db0 100644 --- 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) diff --git a/ascii.xml b/ascii.xml index f597469..0f55e7f 100644 --- a/ascii.xml +++ b/ascii.xml @@ -80,94 +80,67 @@ encodings of the character. DESCRIPTION Characters in the ASCII set can have many aliases, depending on context. A character's possible names include: - - -* + + Its bit pattern (binary representation). - - -* Its hex, decimal and octal representations. - - -* Its teletype mnemonic and caret-notation form (for control chars). - - -* Its backlash-escape form in C (for some control chars). - - -* Its printed form (for printables). - - -* Its full ISO official name in English. - - -* Its ISO/ECMA code table reference. - - -* Its name as an HTML/SGML entity. - - -* Slang and other names in wide use for it among hackers. - - - + This utility accepts command-line strings and tries to interpret them as one of the above. -When it finds a value, it prints all of the names +When it finds a value, it prints all 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. - + -character +character Any character not described by one of the following conventions represents the character itself. -^character +^character A caret followed by a character. -\character +\[abfnrtv0] A backslash followed by certain special characters (abfnrtv). -mnemonic +mnemonic An ASCII teletype mnemonic. @@ -178,61 +151,61 @@ represents the character itself. A hexadecimal (hex) sequence consists of one or two case-insensitive hex digit characters (01234567890abcdef). To ensure hex interpretation use -hexh, -0xhex, -xhex +hexh, +0xhex, +xhex or -\xhex. +\xhex. -decimal +decimal A decimal sequence consists of one, two or three decimal digit characters (0123456789). To ensure decimal interpretation use -\0ddecimal, -ddecimal, +\0ddecimal, +ddecimal, or -\ddecimal. +\ddecimal. -octal +octal An octal sequence consists of one, two or three octal digit characters (01234567). To ensure octal interpretation use -\octal, -0ooctal, -ooctal, +\<octal>, +0o<octal>, +o<octal>, or -\ooctal. +\o<octal>. -bit pattern +bit pattern A bit pattern (binary) sequence consists of one to eight binary digit characters (01). To ensure bit interpretation use -0bbit pattern, -bbit pattern +0b<bit pattern>, +b<bit pattern> or -\bbit pattern. +\b<bit pattern>. -ISO/ECMA code +ISO/ECMA code -A ISO/ECMA code sequence consists of one or two decimal digit characters, +An ISO/ECMA code sequence consists of one or two decimal digit characters, a slash, and one or two decimal digit characters. -name +name -An official ASCII or slang name. +An official ASCII or (unofficial) slang name. @@ -253,15 +226,14 @@ string. metacharacters in arguments (especially backslash). 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. +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. AUTHOR -Eric S. Raymond esr@snark.thyrsus.com; November +Eric S. Raymond esr@thyrsus.com; November 1990 (home page at http://www.catb.org/~esr/). Reproduce, use, and modify as you like as long as you don't remove diff --git a/nametable b/nametable index 67c4f67..7ce743b 100644 --- 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",