Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc++' into mc-merge
[simgrid.git] / tools / doxygen / index_create.pl
1 #!/usr/bin/perl -w
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 ($#ARGV >= 1) or die "Usage: index_create.pl <input-tag-file> <output-doc-file>";
10
11 my($type) = "";
12 my($name) = "";
13 my(%database);
14
15 $input  = $ARGV[0];
16 $output = $ARGV[1];
17 open FILE,$input;
18 while($line=<FILE>) {
19     chomp $line;
20     if($line=~/compound kind=/) {
21         $type = $line;
22         $type =~ s/^[^\"]*\"//;
23         $type =~ s/\".*$//;
24         $line=<FILE>;chomp $line;
25     }
26     if($line=~/member kind=/) {
27         $type = $line;
28         $type =~ s/^[^\"]*\"//;
29         $type =~ s/\".*$//;
30         $line=<FILE>;chomp $line;
31     }
32     if($line=~/<name>/) {
33         $name = $line;
34         $name =~ s/.*<name>//;
35         $name =~ s/<\/name>.*//;
36         $database{$type}{$name} = 1;
37         $type = "";
38         $name = "";
39         next;
40     }
41 }
42 close FILE;
43
44 open OUTPUT,"> $output";
45 print OUTPUT <<EOF;
46 This file was generated by tools/doxygen/index_create.pl. DO NOT EDIT.
47
48 /** \\defgroup API_index Full Index
49  * \\brief The alphabetical list of all functions, macros and types
50  *  defined by SimGrid
51  *
52  * List of all functions, variables, defines, enums, and typedefs with
53  * links to the files they belong to.
54  *
55  * \\htmlonly Although completely useless, the complete list of structures defined can be found <a href="annotated.html">here</a> \\endhtmlonly
56
57
58 EOF
59
60 foreach $type (qw(define enumeration enumvalue function typedef)) {
61     if(defined $database{$type}) {
62         print OUTPUT "<h2>$type</h2> \n  <ul>\n";
63         foreach $name (sort keys %{$database{$type}}) {
64             if($type eq "function") {
65                 print OUTPUT "\t<LI> $name()</LI>\n";
66             } else {
67                 print OUTPUT "\t<LI> #$name</LI>\n";
68             }
69         }
70         print OUTPUT "\n  </ul>\n";
71     }
72 }
73 print OUTPUT "*/";
74 close OUTPUT;
75