]> thyrsus.com Git - ascii.git/commitdiff
First version of nametable inclusion works.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 28 Apr 2003 15:28:15 +0000 (15:28 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 28 Apr 2003 15:28:15 +0000 (15:28 +0000)
Makefile
ascii.c
ascii.spec
ascii.xml

index ec2d806912bfacd7c0457728092f9a286eae60bd..dcf32ad338b7e03bb671f773936abf942879de71 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,18 @@
 # ascii -- interactive ASCII reference
 
-# Note: When the version changes, you also have to change
-# the RPM spec file and LSM
+# Note: When the version changes, you also have to change the RPM spec file.
 VERS=3.1
 
 CFLAGS = -O
 
-ascii: ascii.c splashscreen.h
+ascii: ascii.c splashscreen.h nametable.h
        $(CC) -DREVISION=$(VERS) ascii.c -o ascii
 
 splashscreen.h: splashscreen
-       sed <splashscreen >splashscreen.h -e 's/\\/\\\\/g' -e 's/"/\\"/' -e 's/.*/P("&");/' 
+       sed <splashscreen >splashscreen.h -e 's/\\/\\\\/g' -e 's/"/\\"/' -e 's/.*/puts("&");/' 
+
+nametable.h: nametable
+       sed <nametable >nametable.h -e '/^#/d' -e 's/^[A-Za-z ]*: */    /' -e 's/%%/    },\n    {/'
 
 ascii.1: ascii.xml
        xmlto man ascii.xml 
diff --git a/ascii.c b/ascii.c
index 02a03f0d8587a6849ae6f4194480a38eae8c85a3..1b195a3776479732ac42baba71dcfa5b4be80535 100644 (file)
--- a/ascii.c
+++ b/ascii.c
@@ -45,226 +45,9 @@ void print_table(unsigned short delivery);
 
 static string cnames[128][16] =
 {
-    {"NUL",            "Null",                 (char *)NULL},
-    {"SOH",            "Start Of Heading",     (char *)NULL},
-    {"STX",            "Start of Text",        (char *)NULL},
-    {"ETX",            "End of Text",          (char *)NULL},
-    {"EOT",            "End Of Transmission",  (char *)NULL},
-    {"ENQ",            "Enquiry",              (char *)NULL},
-    {"ACK",            "Acknowledge",          (char *)NULL},
-    {"BEL",            "Bell", "\\a", "Alert", (char *)NULL},
-    {"BS",             "Backspace", "\\b",     (char *)NULL},
-    {"HT",  "TAB",     "Character Tabulation",
-                               "Horizontal Tab", "\\t", (char *)NULL},
-    {"LF",  "NL",      "Line Feed", "\\n", "Newline",  (char *)NULL},
-    {"VT",             "Line Tabulation",
-                               "Vertical Tab", "\\v", (char *)NULL},
-    {"FF",             "Form Feed", "\\f",             (char *)NULL},
-    {"CR",             "Carriage Return", "\\r",       (char *)NULL},
-    {"SO", "LS1",      "Shift Out", "Locking Shift 1", (char *)NULL},
-    {"SI", "LS0",      "Shift In", "Locking Shift 0",  (char *)NULL},
-    {"DLE",            "Data Link Escape",     (char *)NULL},
-    {"DC1",            "Device Control 1",     (char *)NULL},
-    {"DC2",            "Device Control 2",     (char *)NULL},
-    {"DC3",            "Device Control 3",     (char *)NULL},
-    {"DC4",            "Device Control 4",     (char *)NULL},
-    {"NAK",            "Negative Acknowledge", (char *)NULL},
-    {"SYN",            "Synchronous Idle",     (char *)NULL},
-    {"ETB",            "End of Transmission Block",    (char *)NULL},
-    {"CAN",            "Cancel",               (char *)NULL},
-    {"EM",             "End of Medium",        (char *)NULL},
-    {"SUB",            "Substitute",           (char *)NULL},
-    {"ESC",            "Escape",               (char *)NULL},
-    {"FS",             "File Separator",       (char *)NULL},
-    {"GS",             "Group Separator",      (char *)NULL},
-    {"RS",             "Record Separator",     (char *)NULL},
-    {"US",             "Unit Separator",       (char *)NULL},
-    {" ", "SP",                "Space", "Blank",       (char *)NULL},
-    {"!",              "Exclamation Mark",
-                               "Bang", "Excl", "Wow", "Factorial", "Shriek",
-                               "Pling", "Smash", "Cuss", (char *)NULL},
-    {"\"",             "Quotation Mark",
-                               "Double Quote", "Quote", "String Quote",
-                               "Dirk", "Literal Mark", "Double Glitch",
-                               "&quot;",
-                               "# See ' and ` for matching names.",
-                               (char *)NULL},
-    {"#",              "Number Sign",
-                               "Pound", "Number", "Sharp", "Crunch", "Mesh",
-                               "Hex", "Hash", "Flash", "Grid", "Octothorpe",
-                               (char *)NULL},
-    {"$",              "Currency Sign",
-                               "Dollar", "Buck", "Cash", "Ding",
-                               (char *)NULL},
-    {"%",              "Percent Sign",
-                               "Mod", (char *)NULL},
-    {"&",              "Ampersand",
-                               "Amper", "And", "&amp;", (char *)NULL},
-    {"'",              "Apostrophe",
-                               "Single Quote", "Close Quote",  "Prime",
-                               "Tick", "Pop", "Spark", "Glitch",
-                               "# See ` and \" for matching names.",
-                               (char *)NULL},
-    {"(",              "Left Parenthesis",
-                               "Open", "Open Paren",
-                               "Left Paren", "Wane", "Sad",
-                               "# See `)' for matching names.",
-                               (char *)NULL},
-    {")",              "Right Parenthesis",
-                               "Close", "Close Paren",
-                               "Right Paren", "Wax", "Happy",
-                               "# See `(' for matching names.",
-                                (char *)NULL},
-    {"*",              "Asterisk",
-                               "Star", "Splat", "Aster", "Times", "Gear",
-                               "Dingle", "Bug", "Twinkle", "Glob",  
-                               (char *)NULL},
-    {"+",              "Plus Sign",
-                               "Add", "Cross", (char *)NULL},
-    {",",              "Comma",
-                               "Tail", (char *)NULL},
-    {"-",              "Hyphen",
-                               "Dash", "Minus", "Worm", (char *)NULL}, 
-    {".",              "Full Stop",
-                               "Dot", "Decimal Point", "Radix Point",
-                               "Point", "Period", "Spot", (char *)NULL},
-    {"/",              "Solidus",
-                               "Slash", "Stroke", "Slant", "Diagonal",
-                               "Virgule", "Over", "Slat",
-                               "# See `\\' for matching names.",
-                               (char *)NULL},
-    {"0",              "Digit Zero", (char *)NULL},
-    {"1",              "Digit One", (char *)NULL},
-    {"2",              "Digit Two", (char *)NULL},
-    {"3",              "Digit Three", (char *)NULL},
-    {"4",              "Digit Four", (char *)NULL},
-    {"5",              "Digit Five", (char *)NULL},
-    {"6",              "Digit Six", (char *)NULL},
-    {"7",              "Digit Seven", (char *)NULL},
-    {"8",              "Digit Eight", (char *)NULL},
-    {"9",              "Digit Nine", (char *)NULL},
-    {":",              "Colon",
-                               "Double-Dot", (char *)NULL},
-    {";",              "Semicolon",
-                               "Semi", "Go-on", (char *)NULL},
-    {"<",              "Less-than Sign",
-                               "Left Angle Bracket", "Read From", "In",
-                               "From", "Comesfrom", "Left Funnel",
-                               "Left Broket", "Crunch", "Suck", "&lt;", 
-                               "# See `>' for matching names.",
-                                (char *)NULL},
-    {"=",              "Equals Sign",
-                               "Quadrathorp", "Gets", "Becomes", "Half-Mesh",
-                               (char *)NULL},
-    {">",              "Greater-than sign",
-                               "Right Angle" , "Write To", "Into", "Toward",
-                               "Out", "To", "Gozinta", "Right Funnel",
-                               "Right Broket", "Zap", "Blow", "&gt;",
-                               "# See `<' for matching names.",
-                                (char *)NULL},
-    {"?",              "Question Mark",
-                               "Whatmark", "What", "Ques", (char *)NULL},
-    {"@",              "Commercial At",
-                               "At", "Each", "Vortex", "Whorl", "Whirlpool",
-                               "Cyclone", "Snail", "Rose", (char *)NULL},
-    {"A",              "Majuscule A", "Capital A", "Uppercase A",(char*)NULL},
-    {"B",              "Majuscule B", "Capital B", "Uppercase B",(char*)NULL},
-    {"C",              "Majuscule C", "Capital C", "Uppercase C",(char*)NULL},
-    {"D",              "Majuscule D", "Capital D", "Uppercase D",(char*)NULL},
-    {"E",              "Majuscule E", "Capital E", "Uppercase E",(char*)NULL},
-    {"F",              "Majuscule F", "Capital F", "Uppercase F",(char*)NULL},
-    {"G",              "Majuscule G", "Capital G", "Uppercase G",(char*)NULL},
-    {"H",              "Majuscule H", "Capital H", "Uppercase H",(char*)NULL},
-    {"I",              "Majuscule I", "Capital I", "Uppercase I",(char*)NULL},
-    {"J",              "Majuscule J", "Capital J", "Uppercase J",(char*)NULL},
-    {"K",              "Majuscule K", "Capital K", "Uppercase K",(char*)NULL},
-    {"L",              "Majuscule L", "Capital L", "Uppercase L",(char*)NULL},
-    {"M",              "Majuscule M", "Capital M", "Uppercase M",(char*)NULL},
-    {"N",              "Majuscule N", "Capital N", "Uppercase N",(char*)NULL},
-    {"O",              "Majuscule O", "Capital O", "Uppercase O",(char*)NULL},
-    {"P",              "Majuscule P", "Capital P", "Uppercase P",(char*)NULL},
-    {"Q",              "Majuscule Q", "Capital Q", "Uppercase Q",(char*)NULL},
-    {"R",              "Majuscule R", "Capital R", "Uppercase R",(char*)NULL},
-    {"S",              "Majuscule S", "Capital S", "Uppercase S",(char*)NULL},
-    {"T",              "Majuscule T", "Capital T", "Uppercase T",(char*)NULL},
-    {"U",              "Majuscule U", "Capital U", "Uppercase U",(char*)NULL},
-    {"V",              "Majuscule V", "Capital V", "Uppercase V",(char*)NULL},
-    {"W",              "Majuscule W", "Capital W", "Uppercase W",(char*)NULL},
-    {"X",              "Majuscule X", "Capital X", "Uppercase X",(char*)NULL},
-    {"Y",              "Majuscule Y", "Capital Y", "Uppercase Y",(char*)NULL},
-    {"Z",              "Majuscule Z", "Capital Z", "Uppercase Z",(char*)NULL},
-    {"[",              "Left Square Bracket",
-                               "Bracket", "Bra", "Square",
-                               "# See `]' for matching names.",
-                                (char *)NULL},
-    {"\\",             "Reversed Solidus",
-                               "Backslash", "Bash", "Backslant", "Backwhack",
-                               "Backslat", "Literal", "Escape",
-                               "# See `/' for matching names.",
-                                (char *)NULL},
-    {"]",              "Right Square Bracket",
-                               "Unbracket", "Ket", "Unsquare",
-                               "# See `]' for matching names.",
-                                (char *)NULL},
-    {"^",              "Circumflex Accent",
-                               "Circumflex", "Caret", "Uparrow", "Hat",
-                               "Control", "Boink", "Chevron", "Hiccup",
-                               "Sharkfin", "Fang", (char*)NULL},
-    {"_",              "Low Line",
-                               "Underscore", "Underline", "Underbar",
-                               "Under", "Score", "Backarrow", "Flatworm", 
-       "# `Backarrow' refers to this character's graphic in 1963 ASCII.",
-                               (char*)NULL},
-    {"`",              "Grave Accent",
-                               "Grave", "Backquote", "Left Quote",
-                               "Open Quote", "Backprime", "Unapostrophe",
-                               "Backspark", "Birk", "Blugle", "Back Tick",
-                               "Push",
-                               "# See ' and \" for matching names.",
-                               (char *)NULL},
-    {"a",              "Miniscule a", "Small a", "Lowercase a",(char*)NULL},
-    {"b",              "Miniscule b", "Small b", "Lowercase b",(char*)NULL},
-    {"c",              "Miniscule c", "Small c", "Lowercase c",(char*)NULL},
-    {"d",              "Miniscule d", "Small d", "Lowercase d",(char*)NULL},
-    {"e",              "Miniscule e", "Small e", "Lowercase e",(char*)NULL},
-    {"f",              "Miniscule f", "Small f", "Lowercase f",(char*)NULL},
-    {"g",              "Miniscule g", "Small g", "Lowercase g",(char*)NULL},
-    {"h",              "Miniscule h", "Small h", "Lowercase h",(char*)NULL},
-    {"i",              "Miniscule i", "Small i", "Lowercase i",(char*)NULL},
-    {"j",              "Miniscule j", "Small j", "Lowercase j",(char*)NULL},
-    {"k",              "Miniscule k", "Small k", "Lowercase k",(char*)NULL},
-    {"l",              "Miniscule l", "Small l", "Lowercase l",(char*)NULL},
-    {"m",              "Miniscule m", "Small m", "Lowercase m",(char*)NULL},
-    {"n",              "Miniscule n", "Small n", "Lowercase n",(char*)NULL},
-    {"o",              "Miniscule o", "Small o", "Lowercase o",(char*)NULL},
-    {"p",              "Miniscule p", "Small p", "Lowercase p",(char*)NULL},
-    {"q",              "Miniscule q", "Small q", "Lowercase q",(char*)NULL},
-    {"r",              "Miniscule r", "Small r", "Lowercase r",(char*)NULL},
-    {"s",              "Miniscule s", "Small s", "Lowercase s",(char*)NULL},
-    {"t",              "Miniscule t", "Small t", "Lowercase t",(char*)NULL},
-    {"u",              "Miniscule u", "Small u", "Lowercase u",(char*)NULL},
-    {"v",              "Miniscule v", "Small v", "Lowercase v",(char*)NULL},
-    {"w",              "Miniscule w", "Small w", "Lowercase w",(char*)NULL},
-    {"x",              "Miniscule x", "Small x", "Lowercase x",(char*)NULL},
-    {"y",              "Miniscule y", "Small y", "Lowercase y",(char*)NULL},
-    {"z",              "Miniscule z", "Small z", "Lowercase z",(char*)NULL},
-    {"{",              "Left Curly Bracket",
-                               "Left Brace", "Brace", "Open Brace",
-                               "Curly", "Leftit", "Embrace",
-                               "# See `}' for matching names.",
-                                (char *)NULL},
-    {"|",              "Vertical Line",
-                               "Pipe", "Bar", "Or", "V-Bar", "Spike",
-                               "Gozinta", "Thru", (char *)NULL},
-    {"}",              "Right Curly Bracket",
-                               "Right Brace", "Unbrace", "Close Brace",
-                               "Uncurly", "Rytit", "Bracelet",
-                               "# See `{' for matching names.",
-                                (char *)NULL},
-    {"~",              "Overline",
-                               "Tilde", "Swung Dash", "Squiggle", "Approx",
-                               "Wiggle", "Twiddle", "Enyay", (char *)NULL},
-    {"DEL",            "Delete", (char *)NULL},
+    {
+#include "nametable.h"
+    }
 };
 /******************************************************************/
 static int atob(str)
index 1127685c3cf961a956bf0e589b9b9d8174dbda19..f303128e574e6814675ea590dc6be54f70c16ffa 100644 (file)
@@ -1,11 +1,12 @@
 Name: ascii
 Version: 3.1
 Release: 1
-URL: http://www.tuxedo.org/~esr/
+URL: http://www.catb.org/~esr/ascii/
 Source0: %{name}-%{version}.tar.gz
-Copyright: GPL
+License: GPL
 Group: Utilities/Text
 Summary: interactive ASCII name and synonym chart
+Packager: Eric S. Raymond <esr@thyrsus.com>
 
 %description
 The ascii utility provides easy conversion between various byte representations
index ee518b38d225e5ec21249afc81e31843f568c0f7..583fe4a486490e2af51219ede5e44370f362c0bd 100644 (file)
--- a/ascii.xml
+++ b/ascii.xml
@@ -289,7 +289,7 @@ for random 8-bit values.</para>
 
 <para>Eric S. Raymond <email>esr@snark.thyrsus.com</email>; November
 1990 (home page at <ulink
-url='http://www.tuxedo.org/~esr/'>http://www.tuxedo.org/~esr/</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
 this authorship notice.  Ioannis E. Tambouras
 &lt;ioannis@debian.org&gt; added command options and minor