# A bunch of shell functions that help finding unnecessary includes.
# Relies on appropriate versions of etags, grep, tr, awk and maybe bash.
#
# To use:
# $ . util/include.sh
# $ checkall
# Tries to list all names defined in the header file $1.
# Indented names are assumed to be members that don't need to be checked,
# which will fail for indented declarations with #ifdefs.
# lists possible uses in $2 of names defined in $1
# checks whether source file $2 #include's $1
# echo arguments if $2 includes $1 put shouldn't
# run check on all source for a given header
# should really cache the result of "names"
# run check on all pairs
# remove #include of $1 from $2
# remove doubtful includes for a list as output by checkall.
# remove special includes