#!/bin/sh
# $Id: cb++,v 1.4 2024/09/17 08:14:56 tom Exp $
# Wrapper for 'bcpp', which does indention of C++ code (but doesn't trim
# whitespace properly).
TMP=`mktemp 2>/dev/null` || TMP=bcpp$$
trap "rm -f $TMP; exit 1" 1 2 3 15
trap "rm -f $TMP" 0
for name in "$@"
do
	case $name in
	-*)
		echo "...Ignored  $name"
		;;
	*.cpp|*.cc|*.hh|*.h|*.ppc|*.pc|*.ph|*.htm*)
		save=${name}.orig
		rm -f "$save"
		bcpp -fnc bcpp.cfg -yb "$name"
		test -f "$save" && echo "** Modified $name"
		;;
	*)
		echo "...Skipping $name"
		;;
	esac
done
