cairo/src/check-headers.sh
Behdad Esfahbod 73c70488f3 [src/check-*.sh] Use computed list of source files instead of running "find"
When the lists are available use them.  They will be available to test
programs by make.
2008-09-18 15:56:53 -04:00

26 lines
544 B
Bash
Executable file

#!/bin/sh
LANG=C
test -z "$srcdir" && srcdir=.
stat=0
echo Checking public headers for missing cairo_public decorators
cd "$srcdir"
FILES=$all_cairo_headers
if test "x$FILES" = x; then
FILES=`find . -name 'cairo*.h' ! -name '*-private.h' ! -name 'cairoint.h'`
fi
grep -B 1 '^cairo_.*[ ]\+(' /dev/null $FILES |
awk '
/^--$/ { context=""; public=0; next; }
/:cairo_.*[ ]+\(/ { if (!public) {print context; print; print "--";} next; }
/-cairo_public.*[ ]/ {public=1;}
{ context=$0; }
' |
sed 's/[.]h-/.h:/' |
grep . && stat=1
exit $stat