home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume5 / grabchars1.3 / globals.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-03  |  1.7 KB  |  54 lines

  1. /*
  2. **    $Header: globals.c,v 1.3 88/12/05 19:46:01 daniel grabchars_1_3 $
  3. **
  4. **    globals.c - declare global variables for grabchars
  5. **
  6. **    Dan Smith (daniel@island.uu.net), November 29, 1988
  7. */
  8. #include <stdio.h>
  9. #include "grabchars.h"    /* where we typedef FLAGS */
  10.  
  11. FILE *outfile, *otherout;
  12. FLAG *flags;
  13.  
  14. int exit_stat;
  15. char valid_chars[128], default_string[128];
  16.  
  17. #ifdef DV_ERASE
  18. char *erase_buf;    /* DV: Malloc'ed later */
  19. #endif
  20.  
  21. /*
  22. **    this gets in the way sitting in grabchars.c, so I moved it here.
  23. **    If you add anything, keep in mind that you're trying to squeeze
  24. **    everything onto a 24 line window/terminal... The "-h" doc
  25. **    is just a convenience, any option that grabchars doesn't already
  26. **    use will give the help screen...
  27. */
  28. char *usage_statement[] = {
  29. "usage: grabchars        gets one keystroke",
  30. "    -b            output to stdout and stderr",
  31. "    -c<valid characters>    only <valid chars> are returned",
  32. "    -d<char(s)>        default char or string to return",
  33. "    -e            output to stderr instead of stdout",
  34. "    -f            flush any previous input before reading",
  35. "    -h            help screen",
  36. "    -n<number>        number of characters to read",
  37. "    -p<prompt>        prompt to help user",
  38. "    -q<prompt>        prompt to help user (through stderr)",
  39. "    -r            RETURN key exits (use with -n)",
  40. "    -s            silent, just return status",
  41. "    -t<seconds>        timeout after <seconds>",
  42. "    -E            honor erase/kill characters", /* DV */
  43. "examples: (values to arguments can be in the same word or the next one)",
  44. "grabchars -c aeiou        get one of the vowels",
  45. "grabchars -c i            get the letter 'i'",
  46. "grabchars '-penter a letter '    print the prompt \"enter a letter \"",
  47. "grabchars -n4            get four characters",
  48. "grabchars -t2            timeout after two seconds",
  49. " ",
  50. "print a prompt and grab three characters...",
  51. "grabchars -p 'enter three characters >> ' -n 3",
  52. 0
  53. };
  54.