home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 1 / GoldFishApril1994_CD2.img / d4xx / d473 / cnewssrc / cnews_src.lzh / libamiga / unctrl.c < prev    next >
Text File  |  1990-12-25  |  2KB  |  53 lines

  1. /* Copyright 1990 Frank J. Edwards */
  2. /* All Rights Reserved. */
  3.  
  4. #define SIZEOF(x)    (sizeof(x) / sizeof((x)[0]))
  5.  
  6. char *_unctrl[] = {
  7.     "EOF",
  8.  
  9.     "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G",
  10.     "\\b", "\\t", "\\n", "^K", "\\f", "\\r", "^N", "^O",
  11.     "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W",
  12.     "^X", "^Y", "^Z", "\\E", "^\\", "^]", "^^", "^_",
  13.  
  14.     " ", "!", "\"", "#", "$", "%", "&", "'",
  15.     "(", ")", "*", "+", ",", "-", ".", "/",
  16.     "0", "1", "2", "3", "4", "5", "6", "7",
  17.     "8", "9", ":", ";", "<", "=", ">", "?",
  18.     "@", "A", "B", "C", "D", "E", "F", "G",
  19.     "H", "I", "J", "K", "L", "M", "N", "O",
  20.     "P", "Q", "R", "S", "T", "U", "V", "W",
  21.     "X", "Y", "Z", "[", "\\", "]", "^", "_",
  22.  
  23.     "`", "a", "b", "c", "d", "e", "f", "g",
  24.     "h", "i", "j", "k", "l", "m", "n", "o",
  25.     "p", "q", "r", "s", "t", "u", "v", "w",
  26.     "x", "y", "z", "{", "|", "}", "~", "DEL",
  27.  
  28.     /*    Top bit set on these values, so precede with "~"    */
  29.  
  30.     "~^@", "~^A", "~^B", "~^C", "~^D", "~^E", "~^F", "~^G",
  31.     "~\\b", "~\\t", "~\\n", "~^K", "~\\f", "~\\r", "~^N", "~^O",
  32.     "~^P", "~^Q", "~^R", "~^S", "~^T", "~^U", "~^V", "~^W",
  33.     "~^X", "~^Y", "~^Z", "~\\E", "~^\\", "~^]", "~^^", "~^_",
  34.  
  35.     "~ ", "~!", "~\"", "~#", "~$", "~%", "~&", "~'",
  36.     "~(", "~)", "~*", "~+", "~,", "~-", "~.", "~/",
  37.     "~0", "~1", "~2", "~3", "~4", "~5", "~6", "~7",
  38.     "~8", "~9", "~:", "~;", "~<", "~=", "~>", "~?",
  39.     "~@", "~A", "~B", "~C", "~D", "~E", "~F", "~G",
  40.     "~H", "~I", "~J", "~K", "~L", "~M", "~N", "~O",
  41.     "~P", "~Q", "~R", "~S", "~T", "~U", "~V", "~W",
  42.     "~X", "~Y", "~Z", "~[", "~\\", "~]", "~^", "~_",
  43.  
  44.     "~`", "~a", "~b", "~c", "~d", "~e", "~f", "~g",
  45.     "~h", "~i", "~j", "~k", "~l", "~m", "~n", "~o",
  46.     "~p", "~q", "~r", "~s", "~t", "~u", "~v", "~w",
  47.     "~x", "~y", "~z", "~{", "~|", "~}", "~~", "~DEL" };
  48.  
  49. char *unctrl(int ch)
  50. {
  51.     return( (++ch < 0 || ch > SIZEOF(_unctrl)) ? 0 : _unctrl[ ch ] );
  52. }
  53.