home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / ncurses-1.9.9e-src.tgz / tar.out / fsf / ncurses / include / MKparametrized.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1996-09-28  |  1KB  |  34 lines

  1. #!/bin/sh
  2. #
  3. # MKparametrized.sh -- generate indirection vectors for various sort methods
  4. #
  5. # The output of this script is C source for an array specifying whether
  6. # termcap strings should undergo parameter and padding translation.
  7. #
  8. cat <<EOF
  9. /*
  10.  * parametrized.h --- is a termcap capability parametrized?
  11.  *
  12.  * Note: this file is generated using parametrized.sh, do not edit by hand.
  13.  * A value of -1 in the table means suppress both pad and % translations.
  14.  * A value of 0 in the table means do pad but not % translations.
  15.  * A value of 1 in the table means do both pad and % translations.
  16.  */
  17.  
  18. static short const parametrized[] = {
  19. EOF
  20.  
  21. # We detect whether % translations should be done by looking for #[0-9] in the
  22. # description field.  We presently suppress padding translation only for the
  23. # XENIX acs_* capabilities.  Maybe someday we'll dedicate a flag field for
  24. # this, that would be cleaner....
  25.  
  26. awk <Caps.filtered '
  27. $3 != "str"    {next;}
  28. $1 ~ /^acs_/    {print "-1,\t/* ", $2, " */"; count++; next;}
  29. $0 ~ /#[0-9]/    {print "1,\t/* ", $2, " */"; count++; next;}
  30.         {print "0,\t/* ", $2, " */"; count++;}
  31. END        {printf("} /* %d entries */;\n\n", count);}
  32. '
  33.  
  34.