aboutsummaryrefslogtreecommitdiff
path: root/src/tools/pginclude/pgdefine
blob: 41e71b452dc9f2973f64fd53c53cb29b68d01ced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
:
# create macro calls for all defines in the file

# $PostgreSQL: pgsql/src/tools/pginclude/pgdefine,v 1.3 2006/03/11 04:38:42 momjian Exp $

trap "rm -f /tmp/$$" 0 1 2 3 15
for FILE
do
	cat "$FILE" | grep "^#define" >/tmp/$$
	cat /tmp/$$ | sed -n 's/^#define[ 	][ 	]*\([a-zA-Z0-9_]*\)[ 	][ 	]*[^ 	].*$/(void)\1;/p'
	cat /tmp/$$ | sed -n 's/^#define[ 	][ 	]*\([a-zA-Z0-9_]*([^)]*)\).*$/(=void)\1;/p' |
	sed 's/([a-zA-Z0-9_ ][a-zA-Z0-9_ ]*)/(0)/g' |
	sed 's/([a-zA-Z0-9_ ]*,/(0,/g' |
	sed 's/,[a-zA-Z0-9_ ]*,/,0,/g' |
	sed 's/,[a-zA-Z0-9_ ]*)/,0)/g' |
	sed 's/(=void)/(void)/g'
done