#!/bin/sh
# Script to convert C++ source files to a text format, with 4 spaces for
# every tab, and with the leading block comment removed.  Used to
# reformat the example programs so they can be xincluded directly into
# the DocBook during XSLT processing.

SRCFILE=`echo ../../examples/$1 | sed -e s/txt/cpp/`
CLINE=`grep -n '\*\*/' $SRCFILE |cut -f1 -d:`
LINE=`echo $CLINE + 1 |bc`

#echo Converting $SRCFILE to $1, starting at line $LINE...

expand -t4 $SRCFILE | tail -n +$LINE > $1

