Rename _info.c to _info: this means we can simple compile *.c.
[ccan] / web / static-configuration
1 <?php
2 //temp folder for uploads
3 $tempfolder = "/home/ccan/upload-temp/";
4
5 //location of upload script (for posting uploads)
6 $uploadscript = "http://ccan.ozlabs.org/uploader.php";
7
8 //infofile
9 $infofile = '/_info';
10
11 //ccan admin
12 $ccanadmin = "rusty@rustcorp.com.au";
13
14 //email from 
15 $frommail = "ccan@ozlabs.org";
16
17 //tar home dir
18 $tar_dir = 'tarballs';
19
20 //where bzr repo is: attach module name to browse
21 $repo_base = 'http://ccan.ozlabs.org/repo/?cmd=inventory;path=';
22
23 function extract_field($field,$module)
24 {
25    return htmlspecialchars(shell_exec('tools/doc_extract '.$field.' '.$module.'/_info'));
26 }
27
28 // Convert double line breaks into paragraphs, and blank spaces into preformat.
29 function htmlize_field($field,$module)
30 {
31    $state="inpara";
32    $result="<p>";
33    $raw=extract_field($field,$module);
34    foreach (explode("\n", $raw) as $line) {
35       if ($line == "") {
36          switch ($state) {
37          case "inpara":
38             $state="endpara";
39             $result .= "</p>";
40             break;
41          }
42       } else if ($line[0] == " " || $line[0] == "\t") {
43          switch ($state) {
44          case "literal":
45             break;
46          case "inpara":
47             $result .= "</p>";
48          case "endpara":
49             $result .= "<pre>";
50             $state = "literal";
51          }
52       } else {
53          switch ($state) {
54          case "literal":
55             $result .= "</pre>";
56          case "endpara":
57             $result .= "<p>";
58             $state = "inpara";
59          }
60       }
61       $result .= $line . "\n";
62    }
63
64    switch ($state) {
65       case "literal":
66          $result .= "</pre>";
67          break;
68       case "inpara":
69          $result .= "</p>";
70          break;
71    }
72    return $result;
73 }   
74 ?>