#!/bin/sh
#
# mkfallback:	convert application defaults to C string table
#
# Author:	Kenneth Chin-Purcell, AHPCRC
#

awk 'BEGIN	{ cont = 0 }
/^[ 	]*#/ 	{ next }
/^[ 	]*!/	{ next }
/^[ 	]*$/	{ next }
/\\$/		{ if (cont)
			printf "%s", substr($0,1,length($0)-1);
		  else
			printf "\"%s", substr($0,1,length($0)-1);
		  cont = 1;
		  next;
		}
		{ if (cont)
			print $0 "\",";
		  else
			print "\"" $0 "\",";
		  cont = 0;
		}
' $1 | sed -e 's/:[	 ]*/: /' -e 's/\\/\\\\/g'
