]> git.ipfire.org Git - thirdparty/squid.git/blob - scripts/calc-must-ids.sh
SourceFormat Enforcement
[thirdparty/squid.git] / scripts / calc-must-ids.sh
1 #!/bin/sh
2 #
3 ## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
4 ##
5 ## Squid software is distributed under GPLv2+ license and includes
6 ## contributions from numerous individuals and organizations.
7 ## Please see the COPYING and CONTRIBUTORS files for details.
8 ##
9 #
10 # Usage:
11 # calc-must-ids.sh [MustID]
12 # Given an id it searches for the related Must expression in all
13 # source files. If no arguments given it returns all Must expressions
14 # with its ids and their exact position in the source files.
15 #
16 # Example usage:
17 # # ./scripts/calc-must-ids.sh 0xB79EF14
18 # ./src/adaptation/ecap/MessageRep.cc:356: 0xB79EF14 Must(false);
19 #
20
21 if test -z "$1"; then
22 find . -name "*.cc" -o -name "*.h" -o -name "*.cci" | \
23 xargs `dirname $0`/calc-must-ids.pl
24 else
25 find . -name "*.cc" -o -name "*.h" -o -name "*.cci" | \
26 xargs `dirname $0`/calc-must-ids.pl | grep ": $1 "
27 fi
28
29