home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / achart next >
Text File  |  1989-08-25  |  4KB  |  122 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Bramalea Software Inc., Bramalea, Ont.
  3. subject: v08i018: achart.c - 80 * 22 line ASCII/hex/octal/control chart (shar)
  4. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5. Reply-To: wwg@brambo.UUCP (Warren W. Gay)
  6.  
  7. Posting-number: Volume 8, Issue 18
  8. Submitted-by: wwg@brambo.UUCP (Warren W. Gay)
  9. Archive-name: achart
  10.  
  11. #--------------------------------CUT HERE-------------------------------------
  12. #! /bin/sh
  13. #
  14. # This is a shell archive.  Save this into a file, edit it
  15. # and delete all lines above this comment.  Then give this
  16. # file to sh by executing the command "sh file".  The files
  17. # will be extracted into the current directory owned by
  18. # you with default permissions.
  19. #
  20. # The files contained herein are:
  21. #
  22. # -rw-r--r--   1 wwg      other       2961 Aug 25 15:05 achart.c
  23. #
  24. echo 'x - achart.c'
  25. if test -f achart.c; then echo 'shar: not overwriting achart.c'; else
  26. sed 's/^X//' << '________This_Is_The_END________' > achart.c
  27. X/* ACHART.C -- WWG -- VE3WWG -- 25AUG89 -- Bramalea Software Systems 
  28. X-------------------------------------------------------------------------------
  29. X    This program's distribution status is * UNLIMITED *
  30. X            see below for proof
  31. X-------------------------------------------------------------------------------
  32. X
  33. X    Any copy of this program may be copied again, without constraint,
  34. X    for all intents and purposes conceivable, or no purpose at all.
  35. X
  36. X    It may also be copied for inconceivable purposes, or not copied
  37. X    at all.  It may even be typed in manually again freely with plenty 
  38. X    of errors and perhaps only one or two.  It can be recreated again
  39. X    from scratch, or using parts of this original file.
  40. X
  41. X    It may also be munged, mangled, pillaged, ripped, torn, shreaded,
  42. X    pirated, shared, printed, sold, bought, traded, viewed, deleted,
  43. X    added, merged, stomped on, moved, renamed, recorded, erased,
  44. X    transported, stowed, scented, ignored, loved, hated, backed up,
  45. X    overwritten, edited, studied, exposed, gift wrapped, used, collected,
  46. X    displayed, spun, compressed, squashed, zooed, arced, tared,
  47. X    streched, sheared, rotated, rivited, transmitted and/or received,
  48. X    encrypted, converted, perverted, reverted, confiscated, used as
  49. X    evidence, or passed on in a will (taxes might apply).
  50. X
  51. X    It may be sent/received in ASCII, morse code, baudot, Russian (or
  52. X    any spoken language) and yes, even EBCDIC!
  53. X
  54. X    It may be stored on earth, or in space, your attic, your hard drive, 
  55. X    your sloppy disk, your flippy disk, or in rural Russia. It may also
  56. X    be kept in core memory, on paper or carbons, a coleco adam, vic-20,
  57. X    commodore (if u must), on reel to reel, cassette, bubble memory, 
  58. X    volatile memory, CD, magnetic drum, relays, vacuum tubes, WORM, ROM,
  59. X    EEPROM, EPROM, PROM, Wong, and yes, even an IBM 370 main frame.
  60. X
  61. X    Wait! There's more!
  62. X
  63. X    Even surviving 4004, 8008, 8080, 6502, 6800, and Cosmac ELFs processors
  64. X    need not fear any litigation.
  65. X
  66. X    Distribution and use is unlimited.
  67. X-------------------------------------------------------------------------------    
  68. X*/
  69. X#include "stdio.h"
  70. X#include "ctype.h"
  71. X
  72. Xint main(argc,argv)
  73. Xint argc;
  74. Xchar *argv[];
  75. X    {
  76. X    unsigned short u, v;
  77. X    void show();
  78. X
  79. X    for ( u = 0; u < 22; ++u ) {
  80. X        for ( v = 0; v < 6; ++v )
  81. X            show(u + v * 22);
  82. X        putchar('\n');
  83. X        }
  84. X    }
  85. X
  86. Xvoid show(u)
  87. Xunsigned short u;
  88. X    {
  89. X    char chr[10];
  90. X    static char *name[] = {
  91. X        "nul", "soh", "stx", "etx", "eot", "enq", "ack", "bel", "bs",
  92. X        "ht", "lf", "vt", "ff", "cr", "so", "si", "dle", "dc1", "dc2",
  93. X        "dc3", "dc4", "nak", "syn", "etb", "can", "em", "sub", "esc",
  94. X        "fs", "gs", "rs", "us" };
  95. X
  96. X    if ( u >= 128 )
  97. X        return;
  98. X    else if ( u < 040 )
  99. X        sprintf(chr,"^%c %-3s", (unsigned int) u + '@', name[u] );
  100. X    else if ( u == 040 )
  101. X        strcpy(chr,"space ");
  102. X    else if ( u == 127 )
  103. X        strcpy(chr,"del   ");
  104. X    else if ( u < 44 )
  105. X        sprintf(chr,"%c   ",u);
  106. X    else    {
  107. X        chr[0] = u;
  108. X        chr[1] = 0;
  109. X        }
  110. X    if ( u < 44 )
  111. X        printf("%02x %03o %-6s  ", u, u, chr);
  112. X    else     printf("%02x %03o %s   ", u, u, chr );
  113. X    }
  114. ________This_Is_The_END________
  115. if test `wc -l < achart.c` -ne 87; then
  116.     echo 'shar: achart.c was damaged during transit (should have been 87 bytes)'
  117. fi
  118. fi        ; : end of overwriting check
  119. exit 0
  120.  
  121.  
  122.