jump to content

#! /bin/ksh
# Indent a Pro*C code
# Needs GNU-Indent has problems only with the : host variables
# So convert all : to some string , process and then revert back
# Vattekkat Satheesh Babu ; 04/06/98

PROGNM=`basename $0`
if [ $# -lt 1 ]
then
	echo "Usage : $PROGNM   ..."
	echo "  Does a beautify on the specified Pro*C files "
	echo "  Modifies to K & R style and 80 character lines"
	echo "  Output comes to stdout "
	exit
fi
Key_Word=`echo "PaTrIcKtNc$$"`

for FICHIER in "$*"
do
#	sed s/:/${Key_Word}/g $FICHIER | cb -s -l 80 | sed s/${Key_Word}/:/g 
	sed s/:/${Key_Word}/g $FICHIER | indent -gnu| sed s/${Key_Word}/:/g 
	# Styling options for indent - gnu=>GNU standards
	#							   kr =>Kernighan and Ritchie style
	#							   orig=>BSD style
	# If you don't have indent ( get it from GNU ) , use cb - only provides
	# K & R styling
done