#!/bin/sh

# Add casa:: for AIPS++ classes and typedefs in the .h files (recursively).
# The script might change more than needed; suspicious changes are shown.
#
# Run as:
#    dosedns <sed-script>
#
# If no sed-script is given, it uses namespace.sed in the AIPS++ code tree.


  FIL="$1"
  if [ "$FIL" = "" ]; then
    FIL=`echo $CASAPATH | awk '{ print $1; }'`
    FIL=$FIL/code/install/codedevl/namespace.sed
  fi
  if [ ! -f "$FIL" ]; then
    echo "Error: sed script '$FIL' does not exist"
    exit 1;
  fi
  echo "dosedns: using sed-script $FIL"

  find . -name "*.h" >> dofiles

  cat dofiles | xargs -n1 dosedns_one "$FIL"
  \rm -f dofiles
