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 CFILES
=`find . -name "*.c"`
16 for i
in $LIST_GLOBAL;do
17 key
=`echo $i|cut -d ':' -f1`
18 val
=`echo $i|cut -d ':' -f2`
20 found
=`grep "$key[ ]*()" $CFILES`
21 if test -z "$found"; then
22 echo "Not Used Global: $key() -> $val"
26 for i
in $LIST_LOCAL;do
27 key
=`echo $i|cut -d ':' -f1`
28 val
=`echo $i|cut -d ':' -f2`
30 found
=`grep "$key[ ]*(" $CFILES`
32 if test -z "$found"; then
33 echo "Not Used LOCAL: $key() -> $val"
37 echo "# do a 'make clean;make everything' before removing anything!"