container_of: don't put member_ptr in container_off.
[ccan] / web / staticmoduleinfo.php
1 <?php
2 session_start();
3 include('logo.html');
4 include('menulist.html');
5 include('static-configuration');
6 $module_path=$argv[1];
7 $module=basename($module_path);
8 $maintainer=extract_field('maintainer',$module_path);
9 $author=extract_field('author',$module_path);
10 $summary=extract_field('summary',$module_path);
11 $see_also=extract_field('see_also',$module_path);
12 $description=htmlize_field('description',$module_path);
13 $example=extract_field('example',$module_path);
14 $dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module_path));
15 $extdepends=htmlspecialchars(shell_exec('tools/ccan_depends --compile --non-ccan '.$module_path));
16 $licence=extract_field('licence',$module_path);
17 $license=extract_field('license',$module_path);
18 ?>
19 <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="3" cellspacing="1">
20 <tr align="center" bgcolor="FFFFCC">
21 <td>
22 <a href="<?=$repo_base.$module?>">Browse Source</a>
23 </td>
24 <td>
25 <a href="../<?=$tar_dir?>/with-deps/<?=$module?>.tar.bz2">Download</a>
26 <a href="../<?=$tar_dir?>/<?=$module?>.tar.bz2">(without any required ccan dependencies)</a>
27 </tr>
28 </table>
29
30 <p>
31 </p>
32
33 <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="8" cellspacing="1">
34 <tr align="left" bgcolor="FFFFCC">
35 <td><h3>Module: </h3> <?=$module?> </td>
36 </tr>
37
38 <tr align="left" bgcolor="FFFFCC">
39 <td><h3>Summary: </h3> <?=$summary?></td>
40 </tr>
41
42 <?php
43 if ($maintainer) {
44 ?>
45 <tr align="left" bgcolor="FFFFCC"> 
46 <td><h3>Maintainer: </h3> <?=$maintainer?></td>
47 </tr>
48 <?php
49 }
50
51 if ($author) {
52 ?>
53 <tr align="left" bgcolor="FFFFCC"> 
54 <td><h3>Author: </h3> <?=$author?></td>
55 </tr>
56 <?php
57 }
58
59 if ($dependencies) {
60 ?>
61 <tr align="left" bgcolor="FFFFCC">
62 <td><h3>Dependencies: </h3> <pre> <?php
63         foreach (preg_split("/\s+/", $dependencies) as $dep) {
64                 echo '<a href="'.substr($dep, 5).'.html">'.$dep.'</a> ';
65         }
66 ?></pre></td>
67 </tr>
68 <?php 
69 }
70
71 if ($extdepends) {
72 ?>
73 <tr align="left" bgcolor="FFFFCC">
74 <td><h3>External dependencies: </h3> <?php
75         foreach (split("\n", $extdepends) as $dep) {
76                 $fields=preg_split("/\s+/", $dep);
77                 echo $fields[0].' ';
78                 if (count($fields) > 1)
79                         echo '(version '.$fields[1].') ';
80                 echo '<br>';
81         }
82 ?></td>
83 </tr>
84 <?php 
85 }
86 ?>
87 <tr align="left" bgcolor="FFFFCC">
88 <td><h3>Description: </h3> <?=$description;?> </td>
89 </tr>
90
91 <?php 
92 if ($see_also) {
93 ?>
94 <tr align="left" bgcolor="FFFFCC">
95 <td><h3>See Also: </h3> <pre> <?php
96         foreach (preg_split("/[\s,]+/", trim($see_also)) as $see) {
97                 echo '<a href="'.substr($see, 5).'.html">'.$see.'</a> ';
98         }
99 ?></pre></td>
100 </tr>
101 <?php
102 }
103
104 if ($example) {
105 ?>
106 <tr align="left" bgcolor="FFFFCC"> 
107 <td><h3>Example: </h3> <pre><?=$example?></pre></td>
108 </tr>
109 <?php
110 }
111
112 if ($licence) {
113 ?>
114 <tr align="left" bgcolor="FFFFCC"> 
115 <td><h3>License: </h3> <?=$licence?></td>
116 </tr>
117 <?php
118 }
119
120 if ($license) {
121 ?>
122 <tr align="left" bgcolor="FFFFCC"> 
123 <td><h3>License: </h3> <?=$license?></td>
124 </tr>
125 <?php
126 }
127 ?>
128 </table><hr>
129 </body></html>