Files
mongo/dist/s_prototypes
Keith Bostic e5eb5523e1 The s_longlines script was off-by-one, fix lines exactly 80 characters long.
Change s_prototypes to split up prototypes that end up more than 80 characters
long.
2011-03-08 13:20:47 -05:00

34 lines
653 B
Bash
Executable File

#! /bin/sh
# Build a list of internal function prototypes.
t=__wt.$$
trap 'rm -f $t; exit 0' 0 1 2 3 13 15
(
echo '/* DO NOT EDIT: automatically built by dist/s_prototypes. */'
for i in `sed -e '/^[a-z]/! d' filelist`; do
sed -n \
-e '/^__wt_[a-z]/!{' \
-e h \
-e d \
-e '}' \
-e x \
-e '/^static/d' \
-e x \
-e ': loop' \
-e H \
-e n \
-e '/^{/!b loop' \
-e x \
-e 's/$/;/p' \
< ../$i
done) | awk '{
if (length() > 80)
gsub(", ", ",\n ");
print $0
}' > $t
f=../src/include/extern.h
cmp $t $f > /dev/null 2>&1 ||
(echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)