File: params.tst

package info (click to toggle)
a2ps 1:4.14-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 13,328 kB
  • sloc: ansic: 26,966; sh: 11,844; lex: 2,286; perl: 1,156; yacc: 757; makefile: 609; lisp: 398; ada: 263; objc: 189; f90: 109; ml: 85; sql: 74; pascal: 57; modula3: 33; haskell: 32; sed: 30; java: 29; python: 24
file content (38 lines) | stat: -rwxr-xr-x 683 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/sh
# -*- ksh -*-

# This program verifies that the use of PARAMS in consistent

: ${SRCDIR=.}

# Set up other vars
. $SRCDIR/defs || exit 1

fail=0

cd $top_srcdir
srcfiles=`echo lib/*.[chily] src/*.[chily]`

# Get all the files that define PARAMS or __P
res=`\
grep -l '#[\t ]*define[\t ]*PARAMS' $srcfiles;\
grep -l '#[\t ]*define[\t ]*__P' $srcfiles`

# These files _must_ check for PROTOTYPES
for i in $res;
do
  case $i in
    # Don't check obstack.h which has a macro starting with __P
    *obstack.h)
      ;;

    *)
      if grep -s PROTOTYPES $i; then :; else
	echo "$i defines PARAMS without checking PROTOTYPES";
	fail=1
      fi
      ;;
  esac
done

exit $fail