initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / doc / Doxygen / tools / find-templateInComments
blob2ad47b936f0fad690a85c041ee388f9529ba71a9
1 #!/usr/bin/perl -w
2 use strict;
3 use File::Find ();
5 # -----------------------------------------------------------------------------
7 # Script
8 # find-templateInComments
10 # Description
11 # Search for *.[CH] files with '<xxx>' tags within the first comment block
12 # These likely need to be quoted as '\<xxx\>' for Doxygen.
13 # - print filename and lineNumber
15 # -----------------------------------------------------------------------------
17 my $re_filespec = qr{^.+\.[CH]$};
19 # for the convenience of &wanted calls, including -eval statements:
20 ## use vars qw( *name *dir *prune );
21 ## *name = *File::Find::name;
22 ## *dir = *File::Find::dir;
23 ## *prune = *File::Find::prune;
25 sub wanted {
26 unless ( lstat($_) and -f _ and -r _ and not -l _ and /$re_filespec/ ) {
27 return;
30 local @ARGV = $_;
31 while (<>) {
32 if (m{^\s*/\*} ... m{\*/})
34 if (m{\<\s*\w+\s*\>}) {
35 print "$File::Find::name line=$.\n";
38 if (m{\*/}) {
39 last;
44 close ARGV;
48 ## Traverse desired filesystems
49 for my $dir (@ARGV) {
50 no warnings 'File::Find';
51 warn "(**) checking '$dir' ...\n";
52 File::Find::find( { wanted => \&wanted }, $dir );