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

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