3 # this script finds unused lp_*() functions
7 # user@host:~/samba/source>./script/find_unused_options.sh
10 LIST_GLOBAL=`grep '^FN_GLOBAL' param/loadparm.c |sed -e's/^FN_GLOBAL.*(\(.*\).*,.*\(&Globals\..*\)).*/\1:\2/'`
12 LIST_LOCAL=`grep '^FN_LOCAL' param/loadparm.c |sed -e's/^FN_LOCAL.*(\(.*\).*,[ ]*\(.*\)).*/\1:\2/'`
14 for i in $LIST_GLOBAL;do
15 key=`echo $i|cut -d ':' -f1`
16 val=`echo $i|cut -d ':' -f2`
18 found=`grep "$key[ ]*()" */*.c`
20 if test -z "$found"; then
21 found=`grep "$key[ ]*()" */*/*.c`
22 if test -z "$found"; then
23 echo "Not Used Global: $key() -> $val"
28 for i in $LIST_LOCAL;do
29 key=`echo $i|cut -d ':' -f1`
30 val=`echo $i|cut -d ':' -f2`
32 found=`grep "$key[ ]*(" */*.c`
34 if test -z "$found"; then
35 found=`grep "$key[ ]*(" */*/*.c`
36 if test -z "$found"; then
37 echo "Not Used LOCAL: $key() -> $val"
42 echo "# do a 'make clean;make everything' before removing anything!"