1
#!/bin/echo Usage: source
3
# Set the shell variables files, cfiles, hfiles, yfiles and sfiles with
4
# the names of all .c, .h, .y, and .S files in current directory tree.
5
# Define also some shell functions to grep the files. Typical usage is:
8
# $ source ../contrib/tools/find-sources
9
# $ gh BLCKSZ # grep BLCKSZ in .h files
10
# $ gcl MAXTUPLEN # list all .c files containing MAXTUPLEN
12
# THIS SCRIPT MUST BE SOURCED FROM BASH.
14
# Copyright (C) 1999 Massimo Dal Zotto <dz@cs.unitn.it>
16
# This program is free software; you can redistribute it and/or modify
17
# it under the terms of the GNU General Public License as published by
18
# the Free Software Foundation; either version 2 of the License, or
19
# (at your option) any later version.
21
# This program is distributed in the hope that it will be useful,
22
# but WITHOUT ANY WARRANTY; without even the implied warranty of
23
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
# GNU General Public License for more details.
26
# You should have received a copy of the GNU General Public License
27
# along with this program; if not, write to the Free Software
28
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
30
# Build the file lists
32
cfiles=`find $dir -name \*.c | sort`
33
hfiles=`find $dir -name \*.h | sort`
34
yfiles=`find $dir -name \*.y | sort`
35
sfiles=`find $dir -name \*.S | sort`
36
files="$hfiles $cfiles $yfiles $sfiles"
38
# Define some functions to grep the files in the lists
39
function g() { grep -- "$*" $files /dev/null; }
40
function gc() { grep -- "$*" $cfiles /dev/null; }
41
function gh() { grep -- "$*" $hfiles /dev/null; }
42
function gy() { grep -- "$*" $yfiles /dev/null; }
43
function gS() { grep -- "$*" $sfiles /dev/null; }
44
function gl() { grep -l -- "$*" $files /dev/null; }
45
function gcl() { grep -l -- "$*" $cfiles /dev/null; }
46
function ghl() { grep -l -- "$*" $hfiles /dev/null; }
47
function gyl() { grep -l -- "$*" $yfiles /dev/null; }
48
function gSl() { grep -l -- "$*" $sfiles /dev/null; }