3 # Program: KWSys - Kitware System Library
4 # Module: $RCSfile: kwsysHeaderDump.pl,v $
6 # Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
7 # See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 # This software is distributed WITHOUT ANY WARRANTY; without even
10 # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 # PURPOSE. See the above copyright notices for more information.
16 print "Usage: ./kwsysHeaderDump.pl <name> <header>\n";
22 open(INFILE
, $ARGV[1]);
23 while (chomp ($line = <INFILE
>))
25 if (($line !~ /^\#/) &&
26 ($line =~ s/.*kwsys${name}_([A-Za-z0-9_]*).*/\1/) &&
29 push(@lines, "$line");
30 if (length($line) > $max)
39 print sprintf("#define %-${width}s kwsys_ns(${name})\n", "kwsys${name}");
42 print sprintf("#define %-${width}s kwsys_ns(${name}_$l)\n",
46 print sprintf("# undef kwsys${name}\n");
49 print sprintf("# undef kwsys${name}_$l\n");