summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/dist/s_funcs
blob: 70ddc7cbd688f6a341d87a389541255f65d65700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/sh

# Complain about unused functions
t=__wt.$$
trap 'rm -f $t' 0 1 2 3 13 15

# List of files to search.
l=`sed -e '/^[a-z]/!d' -e 's/[	 ].*$//' -e 's,^,../,' filelist`
l="$l `echo ../src/*/*.i ../src/utilities/*.c ../bench/wtperf/*.c`"

(
# Copy out the functions we don't use, but it's OK.
sed -e '/^$/d' -e '/^#/d' < s_funcs.list

# Get the list of functions
search=`egrep -h '^[a-zA-Z0-9_][a-zA-Z0-9_]*\(' $l | sed -e 's/(.*//' | sort -u`

# Print the list of functions, followed by the occurrences: we're looking for
# functions that only appear once
echo "$search"
sed -n '/{/,/^}/p' $l | fgrep -wo "$search"

sed -n '/^#define/,/[^\\]$/p' ../src/include/*.h ../src/include/*.in |
    fgrep -who "$search"
) | sort | uniq -u > $t

test -s $t && cat $t

exit 0