10
10
#
11
11
#
12
12
# IDENTIFICATION
13
- # $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh.in,v 1.4 1999/11/04 08:00:56 inoue Exp $
13
+ # $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh.in,v 1.5 2000/01/11 04:02:28 tgl Exp $
14
14
#
15
15
# NOTES
16
16
# non-essential whitespace is removed from the generated file.
@@ -53,7 +53,17 @@ while test $x -le $numargs ; do
53
53
done
54
54
55
55
# Get NAMEDATALEN from postgres_ext.h
56
- NAMEDATALEN=` grep ' #define.*NAMEDATALEN' ../../include/postgres_ext.h | awk ' { print $3 }' `
56
+ NAMEDATALEN=` grep ' #define[ ]*NAMEDATALEN' ../../include/postgres_ext.h | awk ' { print $3 }' `
57
+
58
+ # Get INDEX_MAX_KEYS from config.h (who needs consistency?)
59
+ INDEXMAXKEYS=` grep ' #define[ ]*INDEX_MAX_KEYS' ../../include/config.h | awk ' { print $3 }' `
60
+
61
+ # NOTE: we assume here that FUNC_MAX_ARGS has the same value as INDEX_MAX_KEYS,
62
+ # and don't read it separately from config.h. This is OK because both of them
63
+ # must be equal to the length of oidvector.
64
+
65
+ INDEXMAXKEYS2=` expr $INDEXMAXKEYS ' *' 2`
66
+ INDEXMAXKEYS4=` expr $INDEXMAXKEYS ' *' 4`
57
67
58
68
# ----------------
59
69
# strip comments and trash from .h before we generate
@@ -80,6 +90,12 @@ sed -e "s/;[ ]*$//g" \
80
90
-e " s/(NameData/(name/g" \
81
91
-e " s/(Oid/(oid/g" \
82
92
-e " s/NAMEDATALEN/$NAMEDATALEN /g" \
93
+ -e " s/INDEX_MAX_KEYS\*2/$INDEXMAXKEYS2 /g" \
94
+ -e " s/INDEX_MAX_KEYS\*4/$INDEXMAXKEYS4 /g" \
95
+ -e " s/INDEX_MAX_KEYS/$INDEXMAXKEYS /g" \
96
+ -e " s/FUNC_MAX_ARGS\*2/$INDEXMAXKEYS2 /g" \
97
+ -e " s/FUNC_MAX_ARGS\*4/$INDEXMAXKEYS4 /g" \
98
+ -e " s/FUNC_MAX_ARGS/$INDEXMAXKEYS /g" \
83
99
| awk '
84
100
# ----------------
85
101
# now use awk to process remaining .h file..
0 commit comments