summaryrefslogtreecommitdiff
path: root/src/check-headers.sh
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2006-09-18 13:28:29 -0400
committerBehdad Esfahbod <behdad@behdad.org>2006-09-18 13:31:26 -0400
commit01f10fb27a675ff26bb0c0ca6748479215e6d6bd (patch)
treea4ad17ae92096b7749fd27e62f4710e0a9073bdb /src/check-headers.sh
parent38ed0eeb5bedb4af32bfc42b7f2b99b1805c8c17 (diff)
check-headers.sh: Add a test for cairo_public decorators in public headers
Test fails currently because of bug 8313 and similar issues.
Diffstat (limited to 'src/check-headers.sh')
-rwxr-xr-xsrc/check-headers.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/check-headers.sh b/src/check-headers.sh
new file mode 100755
index 000000000..1e8d59001
--- /dev/null
+++ b/src/check-headers.sh
@@ -0,0 +1,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