home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 200.img / SCO386X3.TD0 / usr / spool / lp / model / TandyDMP < prev    next >
Encoding:
Text File  |  1988-05-17  |  3.4 KB  |  134 lines

  1. :
  2. #    @(#) TandyDMP.src 1.2 88/05/13 
  3. #
  4. #    Copyright (C) The Santa Cruz Operation, 1987.
  5. #    This Module contains Proprietary Information of
  6. #    The Santa Cruz Operation, Microsoft Corporation
  7. #    and AT&T, and should be treated as Confidential.
  8. #
  9. #    lp interface for Tandy DMP Printers
  10. #
  11. #    This interface assumes that all DIP switches are OFF.
  12. #
  13. #    See your printer manual for details on how to use these options.
  14. #    Notice that some options are not compatible with others and that
  15. #    all options are not available on every Tandy DMP printer; check 
  16. #    your printer manual for details.
  17. #    
  18. #
  19. #    Tandy DMP 1.0
  20. #
  21. #    Options for lp -o:
  22. #
  23. #    compress    Standard Compressed 12 Characters per inch
  24. #    condense    Standard Condensed 17 Characters per inch
  25. #    corresp        Correspondence Quality 10 CPI
  26. #    corresp.12    Correspondence Quality 12 CPI
  27. #    prop        Proportional Spacing
  28. #    prop.comp    Compressed Proportional
  29. #    elongate    Elongated Characters
  30. #    bold        Bold Characters
  31. #    italic        Italic Characters
  32. #    dblheight    Double Height Characters
  33. #    microfont    Microfont Printout
  34. #    normal        Normal Printout.  Default if no options are chosen.
  35. #    
  36. #!    Tandy DMP Printer
  37.  
  38. trap  'echo "$fixup$fix" ; echo "\f\c" ; exit 144' 1 2 3 15
  39.  
  40. user=`grep "^$2:" /etc/passwd | line | awk -F: '{ print $5 }'`
  41.  
  42. if    nhead=`grep "^BANNERS=" /etc/default/lpd 2>/dev/null    |
  43.           line                        |
  44.           awk -F= '{ print $2 }'`
  45.     [ "N$nhead" = "N" ]
  46. then
  47.     nhead=1
  48. fi
  49.  
  50. while    [ $nhead -gt 0 ]
  51. do
  52.     echo "\014\c"
  53.     banner "$2"
  54.     echo "\n"
  55.     if    [ -n "$user" ]
  56.     then
  57.         echo "User: $user\n"
  58.     else
  59.         echo "\n"
  60.     fi
  61.     echo "Request id: $1    Printer: `basename $0`\n"
  62.     date
  63.     echo "\n"
  64.     if    [ -n "$3" ]
  65.     then
  66.         banner "$3"
  67.     fi
  68.     nhead=`expr $nhead - 1`
  69. done
  70.  
  71. fixup=
  72. for option in $5
  73. do
  74.     case "$option" in
  75.         compress)            # Compressed , (12 CPI)
  76.                    fix="\033\023"
  77.                   echo "\033\027";;
  78.             condense)                        # Condensed , (17 CPI)
  79.                    fix="\033\023"
  80.            echo "\033\024";;
  81.             corresp)                     # Correspondence Quality, 10 CPI
  82.                    fix="\033\023"
  83.            echo "\033\022";;
  84.             corresp.12)                    # Correspondence Quality, 12 CPI
  85.                    fix="\033\023"
  86.            echo "\033\035";;
  87.             prop)                      # Proportional Spacing
  88.                    fix="\033\023"
  89.            echo "\033\021";;
  90.             prop.comp)                       # Compressed Proportional
  91.                    fix="\033\023"
  92.            echo "\033\057";;
  93.             elongate)                       # Elongated Characters
  94.                    fix="\033\017"
  95.            echo "\033\016";;
  96.             bold)                       # Bold Characters
  97.                    fix="\033\040"
  98.            echo "\033\037";;
  99.             italic)                       # Italic Characters
  100.                    fix="\033B\000\033\023"
  101.            echo "\033B\001";;
  102.             dblheight)                       # Double Height
  103.                    fix="\033\027\033\023"
  104.            echo "\033W";;
  105.             microfont)                       # Microfont
  106.                    fix="\033\027\033\023"
  107.            echo "\033M";;
  108.         normal)            # Normal, Default
  109.            fix="\033\023"
  110.            echo "\033\023";;
  111.              *)                         # Illegal Option
  112.                    echo "Illegal printer option $option ignored\n" >&2 ;;
  113.         esac
  114.         fixup="$fixup$fix"
  115. done
  116.  
  117. copies="$4"
  118. shift; shift; shift; shift; shift
  119. files="$*"
  120.  
  121. echo "\014\c"
  122. i=1
  123. while    [ $i -le $copies ]
  124. do
  125.     for file in $files
  126.     do
  127.         cat "$file" 2>&1
  128.         echo "\014\c"
  129.     done
  130.     i=`expr $i + 1`
  131. done
  132. echo "$fixup\c"
  133. exit 0
  134.