Add scripting API control over unit 'stay'
[freeciv.git] / tests / header_guard.sh
blobdb7fa149527a0d03427d42d94fdc8ec0ee3270c3
1 #!/bin/sh
3 files=`find $1 -name "*.h" \
4 | sort \
5 | grep -v utility/spec \
6 | grep -v "Freeciv\.h" \
7 | grep -v \./common/packets_gen\.h \
8 | grep -v tolua_.*_gen\.h \
9 | grep -v fc_config\.h \
10 | grep -v dependencies \
11 | grep -v utility/md5\.h `
13 echo "# Header files without any include guard:"
14 for file in $files; do
15 grep "^#ifndef FC_.*_H$" $file >/dev/null \
16 || grep ifndef $file >/dev/null \
17 || echo $file
18 done
19 echo
21 echo "# Header files with a misnamed guard (doesn't match 'FC_.*_H'):"
22 for file in $files; do
23 grep "^#ifndef FC_.*_H$" $file >/dev/null \
24 || (grep ifndef $file >/dev/null \
25 && grep ifndef $file /dev/null | head -n1)
26 done
27 echo