"Fossies" - the Fresh Open Source Software Archive

Member "ghostview-1.5/ad2c" (1 Oct 1992, 678 Bytes) of package /linux/misc/old/ghost/gnu/ghostview/ghostview-1.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 #
    3 #   ad2c : Convert app-defaults file to C strings decls.
    4 #
    5 #   George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
    6 #   19 Mar 1991 : gf
    7 #       Made it self-contained.
    8 #   6 Jan 1992 : mycroft@gnu.ai.mit.edu (Charles Hannum)
    9 #       Removed use of "-n" and ":read" label since Gnu and
   10 #       IBM sed print pattern space on "n" command. Still works
   11 #       with Sun sed, of course.
   12 #   7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
   13 #       Escape quotes after escaping backslashes.
   14 #
   15 
   16 sed '
   17 /^!/d
   18 /^$/d
   19 s/\\/\\\\/g
   20 s/\\$//g
   21 s/"/\\"/g
   22 s/^/"/
   23 : test
   24 /\\$/b slash
   25 s/$/",/
   26 p
   27 d
   28 : slash
   29 n
   30 /^!/d
   31 /^$/d
   32 s/"/\\"/g
   33 s/\\\\/\\/g
   34 s/\\n/\\\\n/g
   35 s/\\t/\\\\t/g
   36 s/\\f/\\\\f/g
   37 s/\\b/\\\\b/g
   38 b test' "$@"