Skip to content
Snippets Groups Projects
Commit 70e2e3d8 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Improve pginclude tools to process include file usage by other include files.

parent a18faa1b
No related branches found
No related tags found
No related merge requests found
:
# 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 $
# $PostgreSQL: pgsql/src/tools/pginclude/pgdefine,v 1.4 2006/07/13 16:39:20 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' |
cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*\)[ ][ ]*[^ ].*\\\\$/\1;/p'
cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*\)[ ][ ]*[^ ].*[^\\\\]$/(void)\1;/p'
(
cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*([^)]*)\).*\\\\$/\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' |
......
:
# remove extra #include's
# $PostgreSQL: pgsql/src/tools/pginclude/pgrminclude,v 1.13 2006/07/12 16:28:27 momjian Exp $
# $PostgreSQL: pgsql/src/tools/pginclude/pgrminclude,v 1.14 2006/07/13 16:39:20 momjian Exp $
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
find . \( -name CVS -a -prune \) -o -type f -name '*.[ch]' -print |
......@@ -71,6 +71,8 @@ do
cat /tmp/$$b
cat /tmp/$$.c
fi
grep -v '^#include[ ][ ]*[<"]'"$INCLUDE"'[>"]' \
"$FILE" >/tmp/$$b
mv /tmp/$$b "$FILE"
fi
done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment