1010#
1111#
1212# 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 $
1414#
1515# NOTES
1616# non-essential whitespace is removed from the generated file.
@@ -53,7 +53,17 @@ while test $x -le $numargs ; do
5353done
5454
5555# 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`
5767
5868# ----------------
5969# strip comments and trash from .h before we generate
@@ -80,6 +90,12 @@ sed -e "s/;[ ]*$//g" \
8090 -e " s/(NameData/(name/g" \
8191 -e " s/(Oid/(oid/g" \
8292 -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" \
8399| awk '
84100# ----------------
85101# now use awk to process remaining .h file..
0 commit comments