"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "susefilter-1.5/filter/ascii" of archive susefilter-1.5.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 #
2 # Module filter/ascii for apsfilter
3 #
4 # Copyright 1996 S.u.S.E. GmbH
5 # Author: Werner Fink <werner@suse.de>
6 #
7 #
8 # findfilter () is defined in handler/functions called by apsfilter
9 #
10 # print ascii using a2ps
11 #
12 if [ "$USE_RECODE_NOT_A2PS" = "yes" ] ; then
13 findfilter recode RECODE
14 HAVE_RECODE="$HAVE_RECODE -q latin1:ibmpc"
15 print_stdin()
16 {
17 #
18 # recode returns no PostScript but IBM[tm] compatible text
19 #
20 $DECOMPRESS $HAVE_RECODE | eval $PRINT_PS
21 }
22 else
23 findfilter a2ps A2PS
24 print_stdin()
25 {
26
27 case $PRINTER in
28 cdj*|*desk*|djet*) A2PS_MARGIN=1.6 ;;
29 *) A2PS_MARGIN=1.4 ;;
30 esac
31 #
32 # For a detailed description of the a2ps commandline options
33 # please look up the manpage
34 #
35
36 #
37 # If title is given in cf file then use it
38 #
39 A2PS_NAME="-H\"\""
40 [ "$NAME" = "stdin" -o "$NAME" = "(stdin)" ] || A2PS_NAME="-H\"$NAME\""
41 [ -n "$TITLE" ] && A2PS_NAME="-H\"$TITLE\""
42 #
43 # If full name is given in cf file then use it
44 #
45 A2PS_PERSON="-Q$PERSON"
46 [ -n "$LPERSON" ] && A2PS_PERSON="-Q\"$LPERSON\""
47 #
48 A2PS_BASIC_OPTIONS=" -8 -nP -X$PAPERSIZE -M$A2PS_MARGIN"
49 A2PS_BASIC_OPTIONS="$A2PS_BASIC_OPTIONS $A2PS_NAME $A2PS_PERSON -Z$HOST"
50 #
51 A2PS_STD_OPTIONS="-r -ns -nu"
52
53 # FEATURE: see in /etc/apsfilterrc
54 case $FEATURE in
55 1) A2PS_FEATURES="-p -1 -F9.0" ;;
56 2) A2PS_FEATURES="-l -2 -F6.9" ;;
57 1n) A2PS_FEATURES="-p -1 -F9.0 -nH -nL" ;;
58 2n) A2PS_FEATURES="-l -2 -F6.9 -nH -nL" ;;
59 1l) A2PS_FEATURES="-l -1 -F9.0" ;;
60 1ln) A2PS_FEATURES="-l -1 -F9.0 -nH -nL" ;;
61 *) A2PS_FEATURES=" -F6.9 -nH" ;;
62 esac
63
64 # if no user defined options then take the one we provide
65 # if user defined A2PS_OPTS, we have to keep the A2PS_BASIC_OPTIONS !!!
66
67 if [ -z "$A2PS_OPTS" ]; then
68 A2PS_OPTS="${A2PS_STD_OPTIONS} ${A2PS_FEATURES}"
69 fi
70 A2PS_OPTS="${A2PS_BASIC_OPTIONS} ${A2PS_OPTS}"
71
72 $DECOMPRESS eval $HAVE_A2PS ${A2PS_OPTS} | eval $PRINT_PS
73 }
74 fi
75
76 #
77 # Declare for export
78 #
79 declare -xf print_stdin
80
81 #
82 # End
83 #