summaryrefslogtreecommitdiff
path: root/scripts/conv_proto
blob: fad9cfaa83845a6d422900b4ea2e9809d05b6654 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/sh
#
# do some automatic conversion of prototypes
#

if test "$1" = "" ; then
	echo "usage: $0 list-of-files"
	exit 1
fi

tmpfile=`mktemp -q /tmp/asd.XXXXXX`

if test "$?" != "0" ; then
	echo "$0: cannot create temporary file"
	exit 1
fi

for file in ${1+"$@"} ; do
	echo "working on $file"
	cat $file | \
	sed -e \
	's/void php3_\(.*\)(INTERNAL_FUNCTION_PARAMETERS)/PHP_FUNCTION(\1)/' \
    -e 's/^extern void /void /' \
	-e 's/^extern PHP_FUNCTION/PHP_FUNCTION/' > $tmpfile
	cp $tmpfile $file
done

rm -f $tmpfile

exit 0