#! /bin/csh -f

#   This C shell script will change C code that refers to Karma header files
#   using the form:  #include <karma_*.h>  to the form:  #include <k_*.h>
#   This is useful for porting code to operating systems with limited filename
#   lengths.

#   Copyright (C) 1992,1993  Richard Gooch
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#   Richard Gooch may be reached by email at  karma-request@atnf.csiro.au
#   The postal address is:
#     Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.

if ("$#argv" != "2") then
    echo "Usage:	karma2dos infile outfile"
    exit 1
endif

set type = $argv[2]:e
set outfile = $argv[2]:r
set tmp = `echo $outfile | sed -e 's/karma_/k_/' | cut -c1-8 `
set outfile = ${tmp}.${type}

echo "Creating: $outfile"
dos_headers $argv[1] $outfile
exit 0
