wireshark/make-tapreg-dotc
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00

47 lines
894 B
Bash
Executable file

#! /bin/sh
#
# $Id$
#
#
# The first argument is the output filename.
#
outfile="$1"
shift
#
# The second argument is the directory in which the source files live.
#
srcdir="$1"
shift
#
# All subsequent arguments are the files to scan.
#
rm -f ${outfile}-tmp
echo '/* Do not modify this file. */' >${outfile}-tmp
echo '/* It is created automatically by the Makefile. */'>>${outfile}-tmp
#
# Build code to call all the tap listener registration routines.
#
echo 'void register_all_tap_listeners(void) {' >>${outfile}-tmp
for f in "$@"
do
if [ -f $f ]
then
srcfile=$f
else
srcfile=$srcdir/$f
fi
grep '^register_tap_listener_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';' | sed -e 's/(.*//'
done | while read func; do
echo " { extern void $func (void);" >>${outfile}-tmp
echo " $func ();}" >>${outfile}-tmp
done
echo '}' >>${outfile}-tmp
mv ${outfile}-tmp ${outfile}