2008-01-28 21:49:26 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
LANG=C
|
|
|
|
|
|
|
|
|
|
test -z "$srcdir" && srcdir=.
|
|
|
|
|
status=0
|
|
|
|
|
|
|
|
|
|
echo Checking documentation blocks for missing decorators
|
|
|
|
|
|
|
|
|
|
FILES=`find "$srcdir" -name '*.h' -or -name '*.c' -or -name '*.cpp'`
|
|
|
|
|
|
|
|
|
|
enum_regexp='^\([/ ][*] .*[^%@]\)\<\(FALSE\|TRUE\|NULL\|CAIRO_[0-9A-Z_]*[^(0-9A-Z_]\)'
|
|
|
|
|
if grep "$enum_regexp" $FILES; then
|
|
|
|
|
status=1
|
|
|
|
|
echo Error: some macros in the docs are not prefixed by percent sign.
|
|
|
|
|
echo Fix this by running the following sed command as many times as needed:
|
|
|
|
|
echo " sed -i 's@$enum_regexp@\\1%\\2@' *.h *.c *.cpp"
|
|
|
|
|
fi
|
|
|
|
|
|
2008-01-28 22:10:20 -05:00
|
|
|
type_regexp='^[/ ][*]\( .*[^#]\| \)\<\(cairo[0-9a-z_]*_t\>\($\|[^:]$\|[^:].\)\)'
|
2008-01-28 21:49:26 -05:00
|
|
|
if grep "$type_regexp" $FILES; then
|
|
|
|
|
status=1
|
2008-01-28 22:10:20 -05:00
|
|
|
echo Error: some type names in the docs are not prefixed by hash sign,
|
|
|
|
|
echo neither are the only token in the doc line followed by collon.
|
|
|
|
|
echo Fix this by searching for the following regexp in the above files:
|
|
|
|
|
echo " '$type_regexp'"
|
2008-01-28 21:49:26 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
func_regexp='^\([/ ][*] .*[^#]\)\<\(cairo_[][<>/0-9a-z_]*\> \?[^][ <>(]\)'
|
|
|
|
|
if grep "$func_regexp" $FILES; then
|
|
|
|
|
status=1
|
|
|
|
|
echo Error: some function names in the docs are not followed by parantheses.
|
|
|
|
|
echo Fix this by searching for the following regexp in the above files:
|
|
|
|
|
echo " '$func_regexp'"
|
|
|
|
|
fi
|
|
|
|
|
|
2008-01-28 21:53:44 -05:00
|
|
|
note_regexp='NOTE'
|
|
|
|
|
if grep "$note_regexp" $FILES; then
|
|
|
|
|
status=1
|
|
|
|
|
echo Error: some source files contain the string 'NOTE'.
|
|
|
|
|
echo Be civil and replace it by 'Note' please.
|
|
|
|
|
fi
|
|
|
|
|
|
2008-01-28 21:49:26 -05:00
|
|
|
exit $status
|