File indexing completed on 2024-04-21 05:41:57

0001 #!/usr/bin/perl -w
0002 # Extract author information from C++ files
0003 # and print it out in DocBook format as a list
0004 # Daniel Naber <daniel.naber@t-online.de>
0005 # $Id$
0006 
0007 my $file = $ARGV[0];
0008 if( ! $file ) {
0009     print "Usage: $0 <file.cpp>\n";
0010     exit;
0011 }
0012 
0013 open(IN, $file) || die "Cannot open '$file': $!\n";
0014 undef $/;
0015 my $str = (<IN>);
0016 close(IN);
0017 
0018 print "<itemizedlist>\n";
0019 while( $str =~ m/addAuthor\s*\(\s*"(.*?)",\s*.*?,\s*"(.*?)"/gs ) {
0020     my ($name, $email) = ($1, $2);
0021     print "<listitem><para>$name <email>$email</email></para></listitem>\n";
0022     #print "$name, $email\n";
0023 }
0024 print "</itemizedlist>\n";
0025 
0026 print STDERR "Warning: maybe you need to fix umlauts manually...\n";
0027 exit;