blob: 530edfdbfa7350d98196f2594de69ccef0a43f54 [file] [log] [blame]
#!/bin/bash
RETVAL=0
# param SRCDIR - path to the source files to search
SRC=$1
# param FUNC - name of the function in compat to check
function check_compat_func {
FILES=`grep -rE "([^[:alnum:]]|^)$1\([^\)]+\)" --include=\*.{c,h} $SRC | cut -d: -f1 | uniq`
for f in $FILES; do
grep -q "#include \"compat.h\"" $f
if [ $? -ne 0 ]; then
echo "Missing #include \"compat.h\" in file $f for function $1()"
RETVAL=$((RETVAL+1))
fi
done
}
check_compat_func asprintf
check_compat_func get_current_dir_name
check_compat_func getline
check_compat_func strndup
check_compat_func strnstr
check_compat_func vasprintf
check_compat_func vdprintf
exit $RETVAL