Add scripting API control over unit 'stay'
[freeciv.git] / tests / fcintl.sh
blobfd460ce788630329a37354e1e5adefd714229f3b
1 #!/bin/sh
3 files=`find $1 -name "*.c" -o -name "*.h" | sort`
5 # helper variables
6 RES_ERR1="" # header files including fcintl.h
7 RES_ERR2="" # fc_config.h for fcintl.h
8 RES_ERR3="" # header files with fc_config.h
10 # check all files
11 for file in $files; do
12 #echo "check $file"
13 HAS_FCINTL=0
14 HAS_CONFIG=0
15 IS_HEADER=0
16 grep "#include \"fcintl.h\"" $file > /dev/null && HAS_FCINTL=1
17 grep "fc_config.h" $file > /dev/null && HAS_CONFIG=1
18 echo $file | grep "\.h" > /dev/null && IS_HEADER=1
19 if [ $HAS_FCINTL = 1 -a $IS_HEADER = 1 ]; then
20 RES_ERR1="$RES_ERR1 $file"
22 if [ $HAS_FCINTL = 1 -a $HAS_CONFIG = 0 ]; then
23 RES_ERR2="$RES_ERR2 $file"
25 if [ $IS_HEADER = 1 -a $HAS_CONFIG = 1 ]; then
26 RES_ERR3="$RES_ERR3 $file"
28 done
30 # print results
31 echo "# Check for header files including fc_config.h"
32 if [ "x$RES_ERR3" = "x" ]; then
33 echo "(no match)"
34 else
35 for II in $RES_ERR3; do
36 echo " $II"
37 done
39 echo
41 echo "# Check for header files including fcintl.h"
42 if [ "x$RES_ERR1" = "x" ]; then
43 echo "(no match)"
44 else
45 for II in $RES_ERR1; do
46 echo " $II"
47 done
49 echo
51 echo "# Check if fc_config.h is include when fcintl.h is used:"
52 if [ "x$RES_ERR2" = "x" ]; then
53 echo "(no match)"
54 else
55 for II in $RES_ERR2; do
56 echo " $II"
57 done
59 echo