Added LGPL standard comment, and copyright notices where necessary.
[wine] / tools / make_authors
1 #! /usr/bin/perl
2 #
3 # Generate AUTHORS and dlls/shell32/authors.h
4 #
5 # Copyright 1998 Alexandre Julliard
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 #
21
22 open(AUTHORS,"<AUTHORS") or die "Can't open AUTHORS";
23 open(NEWAUTHORS,">AUTHORS.new");
24 while(<AUTHORS>)
25   {
26     print NEWAUTHORS;
27     last if /^Wine is/;
28   }
29 while(<AUTHORS>)
30   {
31     chop;
32     s/^and //;
33     s/[,.]$//;
34     push @authors, $_;
35   }
36
37 # Sort them
38 sub cmpnames
39   {
40     @anames = split(" ",$a);
41     @bnames = split(" ",$b);
42     $ret = $anames[-1] cmp $bnames[-1];
43     $ret = $anames[0] cmp $bnames[0] unless $ret;
44     return $ret;
45   }
46 @authors = sort cmpnames @authors;
47
48 # Print authors
49 for ($i = 0; $i < $#authors; $i++)
50   {
51     print NEWAUTHORS "$authors[$i],\n";
52   }
53 print NEWAUTHORS "and $authors[$#authors].\n";
54 print "Created AUTHORS.new\n";
55
56 # Build authors.h file
57 open(NEWAUTHORS_H,">dlls/shell32/authors.h");
58
59 print NEWAUTHORS_H <<EOF;
60 #ifndef __WINE_AUTHORS_H
61 #define __WINE_AUTHORS_H
62
63 static const char * const SHELL_People[] =
64 {
65 EOF
66
67 # Print authors
68 for ($i = 0; $i <= $#authors; $i++)
69   {
70     print NEWAUTHORS_H "    \"$authors[$i]\",\n";
71   }
72 print NEWAUTHORS_H "    0\n};\n";
73 print NEWAUTHORS_H "\n#endif  /* __WINE_AUTHORS_H */\n";
74
75 print "Created dlls/shell32/authors.h\n";