#!/bin/sh
#
#	ad2c : Convert app-defaults file to C strings decls.
#
#	George Ferguson, ferguson@cs.rochester.edu, 12 Nov 1990.
#	19 Mar 1991: gf
#		Made it self-contained.
#	6 Jan 1992: mycroft@gnu.ai.mit.edu (Charles Hannum)
#		Removed use of "-n" and ":read" label since Gnu and
#		IBM sed print pattern space on "n" command. Still works
#		with Sun sed, of course.
#	7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
#		Escape quotes after escaping backslashes.
#	8 Jul 1992: Version 1.6
# 
#       For use by Statistical Sciences, Inc:
#       20 Aug 1992: Added '#' as a comment character for beginning of line.
#
#	10 Nov 1992: peter
#		sed on the Iris does not allow comments interspersed among
#		the commands.
#
#       18 Nov 1992: scott
#		Moved sed script to $C/ad2c.sed file to see if Iris likes
#		comments in there. It doesn't...filter that file to get rid of
#		the comments at the beginning of the line.
#
# From the README file:
#  DISCLAIMER:
#  
#       This software is provided as is with no warranty expressed or implied.
#       I hope you find it useful, but I won't be held responsable for
#       any damage that may occur from reading, compiling, installing or
#       using it.
#  
#       You are free to use any part of this code for other purposes. It
#       would be nice if you could keep my name on some part of whatever the
#       final product is.
#  

echo "/* This file is the result of running:"
echo " *   \$SHOME/cmd/ad2c $*"
echo " */"
echo

tmpdir=${S_TMPDIR:-$SHOME/tmp}
sed <$SHOME/cmd/ad2c.sed >$tmpdir/ad2c.sed.$$ '/^ *#/d'
sed -f $tmpdir/ad2c.sed.$$ ${1+"$@"}
rm -f $tmpdir/ad2c.sed.$$
