summaryrefslogtreecommitdiff
path: root/src/check-headers.sh
blob: 91a52a01527fa132195d23232c65bd71fc3fb5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

LANG=C

test -z "$srcdir" && srcdir=.
status=0

echo Checking public headers for missing cairo_public decorators

find "$srcdir" -name '*.h' -not -name '*-private.h' -not -name '*-test.h' -not -name 'cairoint.h' |
xargs grep -B 1 '^cairo_.*[ 	]\+(' |
awk '
/^--$/ { context=""; public=0; next; }
/:cairo_.*[ 	]+\(/ { if (!public) {print context; print; print "--";} next; }
/-cairo_public[ 	]/ {public=1;}
{ context=$0; }
' |
sed 's/[.]h-/.h:/' |
grep . && status=1

exit $status