Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check for boost-graph
[simgrid.git] / tools / doxygen / index_create.pl
1 #!/usr/bin/env perl
2
3 # Copyright (c) 2005, 2012-2014. The SimGrid Team.
4 # All rights reserved.
5
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the license (GNU LGPL) which comes with this package.
8
9 use warnings;
10
11 ($#ARGV >= 1) or die "Usage: index_create.pl <input-tag-file> <output-doc-file>";
12
13 my($type) = "";
14 my($name) = "";
15 my(%database);
16
17 $input  = $ARGV[0];
18 $output = $ARGV[1];
19 open FILE,$input;
20 while($line=<FILE>) {
21     chomp $line;
22     if($line=~/compound kind=/) {
23         $type = $line;
24         $type =~ s/^[^\"]*\"//;
25         $type =~ s/\".*$//;
26         $line=<FILE>;chomp $line;
27     }
28     if($line=~/member kind=/) {
29         $type = $line;
30         $type =~ s/^[^\"]*\"//;
31         $type =~ s/\".*$//;
32         $line=<FILE>;chomp $line;
33     }
34     if($line=~/<name>/) {
35         $name = $line;
36         $name =~ s/.*<name>//;
37         $name =~ s/<\/name>.*//;
38         $database{$type}{$name} = 1;
39         $type = "";
40         $name = "";
41         next;
42     }
43 }
44 close FILE;
45
46 open OUTPUT,"> $output";
47 print OUTPUT <<EOF;
48 This file was generated by tools/doxygen/index_create.pl. DO NOT EDIT.
49
50 /** \\defgroup API_index Full Index
51  * \\brief The alphabetical list of all functions, macros and types
52  *  defined by SimGrid
53  *
54  * List of all functions, variables, defines, enums, and typedefs with
55  * links to the files they belong to.
56  *
57  * \\htmlonly Although completely useless, the complete list of structures defined can be found <a href="annotated.html">here</a> \\endhtmlonly
58
59 EOF
60
61 foreach $type (qw(define enumeration enumvalue function typedef)) {
62     if(defined $database{$type}) {
63         print OUTPUT "<h2>$type</h2> \n  <ul>\n";
64         foreach $name (sort keys %{$database{$type}}) {
65             if($type eq "function") {
66                 print OUTPUT "\t<LI> $name()</LI>\n";
67             } else {
68           if($type eq "enumeration") {
69                     print OUTPUT "\t<LI> ".$name."::EType</LI>\n";
70           }
71           else {
72                     print OUTPUT "\t<LI> #$name</LI>\n";
73           }
74             }
75         }
76         print OUTPUT "\n  </ul>\n";
77     }
78 }
79 print OUTPUT "*/";
80 close OUTPUT;
81