File: chk.proto

package info (click to toggle)
evolution-data-server 1.0.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 39,504 kB
  • ctags: 26,423
  • sloc: ansic: 175,347; tcl: 30,499; sh: 20,699; perl: 11,320; xml: 9,039; java: 7,653; cpp: 6,029; makefile: 4,866; awk: 1,338; yacc: 1,103; sed: 772; cs: 505; lex: 134; asm: 14
file content (45 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
#!/bin/sh -
#
# $Id: chk.proto,v 1.1.1.1 2003/11/20 22:14:04 toshok Exp $
#
# Check to make sure that prototypes are actually needed.

d=../..

[ -f $d/LICENSE ] || {
	echo 'FAIL: cannot find source distribution directory.'
	exit 1
}

t1=__1
t2=__2
t3=__3

egrep '__P' $d/dbinc_auto/*.h |
    sed -e 's/[	 ][	 ]*__P.*//' \
    -e 's/^.*[	 *]//' \
    -e '/__db_cprint/d' \
    -e '/__db_lprint/d' \
    -e '/__db_noop_log/d' \
    -e '/__db_prnpage/d' \
    -e '/__db_txnlist_print/d' \
    -e '/__db_util_arg/d' \
    -e '/__ham_func2/d' \
    -e '/__ham_func3/d' \
    -e '/_getpgnos/d' \
    -e '/_print$/d' \
    -e '/_read$/d' > $t1

find $d -name '*.in' -o -name '*.[ch]' -o -name '*.cpp' > $t2
for i in `cat $t1`; do
	c=$(egrep -low $i $(cat $t2) | wc -l)
	echo "$i: $c"
done | egrep ' 1$' > $t3

test -s $t3 && {
	cat $t3
	echo "FAIL: found unnecessary prototypes."
	exit 1
}

exit 0