~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to contrib/tools/find-sources

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/echo Usage: source
 
2
#
 
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:
 
6
#
 
7
#   $ cd src/
 
8
#   $ source ../contrib/tools/find-sources
 
9
#   $ gh BLCKSZ                 # grep BLCKSZ in .h files
 
10
#   $ gcl MAXTUPLEN             # list all .c files containing MAXTUPLEN
 
11
#
 
12
# THIS SCRIPT MUST BE SOURCED FROM BASH.
 
13
#
 
14
# Copyright (C) 1999  Massimo Dal Zotto <dz@cs.unitn.it>
 
15
#
 
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.
 
20
#
 
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.
 
25
#
 
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.
 
29
 
 
30
# Build the file lists
 
31
dir=${1-`pwd`}/
 
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"
 
37
 
 
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; }
 
49
 
 
50
# end of file