Debian Codegraph @

dist/validate/s_chk_stats

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`. -
2 #
3 # $Id$
4 #
5 # Check to make sure all of the stat structure members are included in
6 # all of the possible formats.
7
8 # Top-level directory.
9
10 d=../..
11 [scip-shell system . . `[`. -f $d/LICENSE ] || {
12 echoscip-shell system . . echo. 'FAIL: cannot find source distribution directory.'
13 exit 1
14 }
15
16 docs=$d/docs/api_reference
17 s=$d/src
18 l=$d/lang
19
20 # Docs aren't in the source tree anymore, so we can't check the completeness.
21 check_docs="no"
22 exitv=0
23 t1=__tmp
24
25 # Extract the field names for a structure from the db.h file.
26 inc_fieldsscip-shell shell db5.3 5.3.28+dfsg2-11 inc_fields().()
27 {
28 sedscip-shell system . . sed. -e "/struct $1 {/,/^};$/p" \
29 -e d < $s/dbinc/db.in |
30 sedscip-shell system . . sed. -e 1d \
31 -e '$d' \
32 -e '/;/!dscip-shell filesystem . . `/;/!d`.' \
33 -e 's/;.*//' \
34 -e 's/^[ ].*[ \*]//'
35 }
36
37 catscip-shell system . . cat. << END_OF_IGNORE > IGNORE
38 bt_maxkey
39 bt_metaflags
40 hash_metaflags
41 qs_metaflags
42 qs_ndata
43 st_hash_max_nowait
44 st_filefail_cleanups
45 END_OF_IGNORE
46
47 # Check to make sure the elements of a structure from db.h appear in
48 # the other files.
49 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc().()
50 {
51 for i in `inc_fieldsscip-shell shell db5.3 5.3.28+dfsg2-11 inc_fields(). $1`; do
52 if egrepscip-shell system . . egrep. -w $i IGNORE > /dev/nullscip-shell filesystem . . `/dev/null`.; then
53 echoscip-shell system . . echo. " $1: ignoring $i"
54 continue
55 fi
56 for j in $2; do
57 # Docs aren't in the tree any more, skip the checks.
58 if [scip-shell system . . `[`. ! -e $j ]; then
59 ext=`echoscip-shell system . . echo. $j | awkscip-shell system . . awk. -F . '{print $NF}'`
60 if [scip-shell system . . `[`. "$ext" != "html" \
61 -o "$check_docs" = "yes" ]; then
62 echoscip-shell system . . echo. "$j file not found, skipping."
63 fi
64 continue
65 fi
66 if egrepscip-shell system . . egrep. -w $i $j > /dev/nullscip-shell filesystem . . `/dev/null`.; then
67 :;
68 else
69 echoscip-shell system . . echo. " $1: $i not found in $j."
70 exitv=1
71 fi
72 done
73 done
74 }
75
76 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). "__db_bt_stat" "$l/tcl/tcl_db.c $s/btree/bt_stat.c $docs/C/dbstat.html"
77 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). "__db_h_stat" "$l/tcl/tcl_db.c $s/hash/hash_stat.c $docs/C/dbstat.html"
78 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_lock_stat \
79 "$l/tcl/tcl_lock.c $s/lock/lock_stat.c $docs/C/lockstat.html"
80 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_log_stat "$l/tcl/tcl_log.c $s/log/log_stat.c $docs/C/logstat.html"
81 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_mpool_fstat \
82 "$l/tcl/tcl_mp.c $s/mp/mp_stat.c $docs/C/mempstat.html"
83 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_mpool_stat \
84 "$l/tcl/tcl_mp.c $s/mp/mp_stat.c $docs/C/mempstat.html"
85 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_mutex_stat \
86 "$s/mutex/mut_stat.c $docs/C/mutexstat.html"
87 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). "__db_qam_stat" \
88 "$l/tcl/tcl_db.c $s/qam/qam_stat.c $docs/C/dbstat.html"
89 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_rep_stat \
90 "$l/tcl/tcl_rep.c $s/rep/rep_stat.c $docs/C/repstat.html"
91 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_seq_stat \
92 "$l/tcl/tcl_seq.c $s/sequence/seq_stat.c $docs/C/seqstat.html"
93 incscip-shell shell db5.3 5.3.28+dfsg2-11 inc(). __db_txn_stat \
94 "$l/tcl/tcl_txn.c $s/txn/txn_stat.c $docs/C/txnstat.html"
95
96 # Check to make sure the elements from a man page appears in db.in.
97 manscip-shell shell db5.3 5.3.28+dfsg2-11 man().()
98 {
99 for i in `catscip-shell system . . cat. $t`; do
100 if egrepscip-shell system . . egrep. -w $i IGNORE > /dev/nullscip-shell filesystem . . `/dev/null`.; then
101 echoscip-shell system . . echo. " $1: ignoring $i"
102 continue
103 fi
104 if egrepscip-shell system . . egrep. -w $i $s/dbinc/db.in > /dev/nullscip-shell filesystem . . `/dev/null`.; then
105 :;
106 else
107 echoscip-shell system . . echo. " $1: $i not found in db.h."
108 exitv=1
109 fi
110 done
111 }
112
113 if [scip-shell system . . `[`. "$check_docs" = "yes" ]; then
114 sedscip-shell system . . sed. -e '/m4_field(/!dscip-shell filesystem . . `/m4_field(/!d`.' \
115 -e 's/.*m4_field[^,]*,[ ]*\([^,]*\).*/\1/' < \
116 $docs/C/dbstat.html > $t
117 manscip-shell shell db5.3 5.3.28+dfsg2-11 man(). "checking db_stat.so against db.h"
118
119 sedscip-shell system . . sed. -e '/m4_field(/!dscip-shell filesystem . . `/m4_field(/!d`.' \
120 -e 's/.*m4_field[^,]*,[ ]*\([^,]*\).*/\1/' < \
121 $docs/C/lockstat.html > $t
122 manscip-shell shell db5.3 5.3.28+dfsg2-11 man(). "checking lock_stat.so against db.h"
123
124 sedscip-shell system . . sed. -e '/m4_field(/!dscip-shell filesystem . . `/m4_field(/!d`.' \
125 -e 's/.*m4_field[^,]*,[ ]*\([^,]*\).*/\1/' < \
126 $docs/C/logstat.html > $t
127 manscip-shell shell db5.3 5.3.28+dfsg2-11 man(). "checking log_stat.so against db.h"
128
129 sedscip-shell system . . sed. -e '/m4_field(/!dscip-shell filesystem . . `/m4_field(/!d`.' \
130 -e 's/.*m4_field[^,]*,[ ]*\([^,]*\).*/\1/' < \
131 $docs/C/mempstat.html > $t
132 manscip-shell shell db5.3 5.3.28+dfsg2-11 man(). "checking memp_stat.so against db.h"
133
134 sedscip-shell system . . sed. -e '/m4_field(/!dscip-shell filesystem . . `/m4_field(/!d`.' \
135 -e 's/.*m4_field[^,]*,[ ]*\([^,]*\).*/\1/' < \
136 $docs/C/repstat.html > $t
137 manscip-shell shell db5.3 5.3.28+dfsg2-11 man(). "checking rep_stat.so against db.h"
138
139 sedscip-shell system . . sed. -e '/m4_field(/!dscip-shell filesystem . . `/m4_field(/!d`.' \
140 -e 's/.*m4_field[^,]*,[ ]*\([^,]*\).*/\1/' < \
141 $docs/C/seqstat.html > $t
142 manscip-shell shell db5.3 5.3.28+dfsg2-11 man(). "checking seq_stat.so against db.h"
143
144 sedscip-shell system . . sed. -e '/m4_field(/!dscip-shell filesystem . . `/m4_field(/!d`.' \
145 -e 's/.*m4_field[^,]*,[ ]*\([^,]*\).*/\1/' \
146 -e 's/__LB__.*//' < $docs/C/txnstat.html > $t
147 manscip-shell shell db5.3 5.3.28+dfsg2-11 man(). "checking txn_stat.so against db.h"
148 fi
149
150 rmscip-shell system . . rm. -f IGNORE
151
152 exit $exitv