Fix a few errors in comments. Patch by Fujii Masao, plus the one in
[PostgreSQL.git] / src / tools / pginclude / pgdefine
blob19a42303650c1645fa638e8079adc31e13db6574
2 # create macro calls for all defines in the file
4 # $PostgreSQL$
6 trap "rm -f /tmp/$$" 0 1 2 3 15
7 for FILE
8 do
9         cat "$FILE" | grep "^#define" >/tmp/$$
10         cat /tmp/$$ | sed -n 's/^#define[       ][      ]*\([a-zA-Z0-9_]*\)[    ][      ]*[^    ].*\\\\$/\1;/p'
11         cat /tmp/$$ | sed -n 's/^#define[       ][      ]*\([a-zA-Z0-9_]*\)[    ][      ]*[^    ].*[^\\\\]$/(void)\1;/p'
13         (
14                 cat /tmp/$$ | sed -n 's/^#define[       ][      ]*\([a-zA-Z0-9_]*([^)]*)\).*\\\\$/\1;/p'
15                 cat /tmp/$$ | sed -n 's/^#define[       ][      ]*\([a-zA-Z0-9_]*([^)]*)\).*[^\\\\]$/(=void)\1;/p'
16         ) |
17         sed 's/([a-zA-Z0-9_ ][a-zA-Z0-9_ ]*)/(0)/g' |
18         sed 's/([a-zA-Z0-9_ ]*,/(0,/g' |
19         sed 's/,[a-zA-Z0-9_ ]*,/,0,/g' |
20         sed 's/,[a-zA-Z0-9_ ]*)/,0)/g' |
21         sed 's/(=void)/(void)/g'
22 done