summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/_infotojson/infotojson.c13
-rwxr-xr-xweb/db/ccan.dbbin32768 -> 32768 bytes
-rw-r--r--web/dispmoduleinfo.php4
-rw-r--r--web/search.html11
-rw-r--r--web/search.php18
-rw-r--r--web/searchengine.php9
-rw-r--r--web/tarball/alloc-test.tarbin0 -> 92160 bytes
-rw-r--r--web/tarball/alloc-test_with_deps.tarbin0 -> 112640 bytes
-rw-r--r--web/tarball/alloc.tarbin92160 -> 92160 bytes
-rw-r--r--web/tarball/alloc_with_deps.tarbin112640 -> 112640 bytes
-rw-r--r--web/tarball/string-test.tarbin0 -> 30720 bytes
-rw-r--r--web/tarball/string-test_with_deps.tarbin0 -> 225280 bytes
-rw-r--r--web/tarball/string_with_deps.tarbin225280 -> 225280 bytes
-rw-r--r--web/tarball/talloc_with_deps.tarbin215040 -> 184320 bytes
-rw-r--r--web/tarball/typesafe_cb.tarbin30720 -> 30720 bytes
-rw-r--r--web/tarball/typesafe_cb_with_deps.tarbin40960 -> 40960 bytes
-rwxr-xr-xweb/tools/create_dep_tarbin45906 -> 58411 bytes
-rwxr-xr-xweb/tools/infotojsonbin50270 -> 60690 bytes
18 files changed, 40 insertions, 15 deletions
diff --git a/tools/_infotojson/infotojson.c b/tools/_infotojson/infotojson.c
index 4f21602c..e837ff4a 100644
--- a/tools/_infotojson/infotojson.c
+++ b/tools/_infotojson/infotojson.c
@@ -94,20 +94,23 @@ static int storejsontodb(const struct json *jsonobj, const char *db)
struct db_query *q;
handle = db_open(db);
- query = talloc_asprintf(NULL, "SELECT module from search where module=\"%s\";", jsonobj->module);
+ query = talloc_asprintf(NULL, "SELECT module, author from search where module=\"%s\";", jsonobj->module);
q = db_query(handle, query);
desc = strjoin(NULL, jsonobj->desc,"\n");
strreplace(desc, '\'', ' ');
depends = strjoin(NULL, jsonobj->depends,"\n");
- if (!q->num_rows)
+ if (q->num_rows && streq(jsonobj->author, q->rows[0][1]))
+ cmd = talloc_asprintf(NULL, "UPDATE search set author=\"%s\", title=\"%s\", desc=\'%s\' depends=\'%s\' where module=\"%s\";",
+ jsonobj->author, jsonobj->title, desc, depends, jsonobj->module);
+ else if (!q->num_rows)
cmd = talloc_asprintf(NULL, "INSERT INTO search VALUES(\"%s\",\"%s\",\"%s\", \'%s\', \'%s\', 0);",
jsonobj->module, jsonobj->author, jsonobj->title, depends, desc);
else
- cmd = talloc_asprintf(NULL, "UPDATE search set author=\"%s\", title=\"%s\", desc=\'%s\' depends=\'%s\' where module=\"%s\";",
- jsonobj->author, jsonobj->title, desc, depends, jsonobj->module);
-
+ cmd = talloc_asprintf(NULL, "INSERT INTO search VALUES(\"%s-%s\",\"%s\",\"%s\", \'%s\', \'%s\', 0);",
+ jsonobj->module, jsonobj->author, jsonobj->author, jsonobj->title, depends, desc);
+
db_command(handle, cmd);
db_close(handle);
talloc_free(depends);
diff --git a/web/db/ccan.db b/web/db/ccan.db
index 503c7fcc..fcb87f86 100755
--- a/web/db/ccan.db
+++ b/web/db/ccan.db
Binary files differ
diff --git a/web/dispmoduleinfo.php b/web/dispmoduleinfo.php
index 9c26f9ea..3906d3cc 100644
--- a/web/dispmoduleinfo.php
+++ b/web/dispmoduleinfo.php
@@ -13,12 +13,12 @@ $row = sqlite3_fetch_array($result);
<tr align="center" bgcolor="FFFFCC">
<td width="50%">
<?php
- if(file_exists($tar_dir . $_GET['module']."_dependencies.tar"))
+ if(file_exists($tar_dir . $_GET['module'].".tar"))
echo '<a href='. $tar_dir . $_GET['module'] . '.tar>Download</a>';
?>
<td>
<?php
- if(file_exists($tar_dir . $_GET['module']."_dependencies.tar"))
+ if(file_exists($tar_dir . $_GET['module']."_with_deps.tar"))
echo '<a href='. $tar_dir . $_GET['module'] . '_with_deps.tar>Download Dependencies</a>';
?>
</td>
diff --git a/web/search.html b/web/search.html
index 3a497b9f..694dbf25 100644
--- a/web/search.html
+++ b/web/search.html
@@ -24,4 +24,15 @@
<td align="left"><a href=search.php?disp=all>Display all</a></td>
</tr>
</table>
+ <table align="center">
+ <tr align="left">
+ <?php
+ for ($i = "a"; $i != "aa"; $i++) {
+ echo '<td><a href=search.php?disp='. $i . '>'. $i .'</a></td>';
+ }
+ ?>
+ </tr>
+ </td>
+ </tr>
+ </table>
</form>
diff --git a/web/search.php b/web/search.php
index d0c55330..d518d9f4 100644
--- a/web/search.php
+++ b/web/search.php
@@ -12,16 +12,22 @@ if(isset($_POST['search'])) {
if(trim($searchtext) == '') {
echo '<div align="center"><font color="RED">Please enter some keyword to search</font></div>';
exit();
- }
+ }
+ $searchtext = '%'.$searchtext.'%';
}
else if($_GET['author'] != '') {
- $searchtext = $_GET['author'];
+ $searchtext = '%'.$_GET['author'].'%';
$in = "author";
}
else if ($_GET['disp'] == 'all') {
- $searchtext = "";
+ $searchtext = "%";
+ $in = "module";
+}
+else if ($_GET['disp'] != '') {
+ $searchtext = $_GET['disp'].'%';
$in = "module";
}
+
else
exit();
@@ -29,12 +35,14 @@ $result = searchdb($searchtext, $in, $db);
echo '<table align="left" border="0" cellpadding="8" cellspacing="1">';
if($row = sqlite3_fetch_array($result))
echo "<tr><td><a href=\"dispmoduleinfo.php?module=".$row['module']."\">".$row["module"]."</a></br>".
- "<a href=\"search.php?author=".$row["author"]."\">".$row["author"]."</a> : ". $row["title"]." </br> </br></td></tr>";
+ "<a href=\"search.php?author=".$row["author"]."\">".$row["author"]."</a> : ". $row["title"].
+ " </br> </br></td></tr>";
else
echo '<div align="center"><font color="RED"> No results found</font></div>';
while($row = sqlite3_fetch_array($result)) {
echo "<tr><td><a href=\"dispmoduleinfo.php?module=".$row['module']."\">".$row["module"]."</a></br>".
- "<a href=\"search.php?author=".$row["author"]."\">".$row["author"]."</a> : ". $row["title"]." </br> </br></td></tr>";
+ "<a href=\"search.php?author=".$row["author"]."\">".$row["author"]."</a> : ". $row["title"].
+ " </br> </br></td></tr>";
}
echo '</table>';
?>
diff --git a/web/searchengine.php b/web/searchengine.php
index 6117f38b..fdc5e9f8 100644
--- a/web/searchengine.php
+++ b/web/searchengine.php
@@ -4,11 +4,14 @@ function searchdb($text, $in, $db)
//search db
$handle = sqlite3_open($db) or die("Could not open database");
if($in == 'module')
- $query = "select * from search where title LIKE \"%$text%\"";
+ $query = "select * from search where title LIKE \"$text\" order by module,
+ author";
else if($in == 'author')
- $query = "select * from search where author LIKE \"%$text%\"";
+ $query = "select * from search where author LIKE \"$text\" order by module,
+ author";
else
- $query = "select * from search where title LIKE \"%$text%\" or author LIKE \"%$text%\"";
+ $query = "select * from search where title LIKE \"$text\" or author LIKE \"$text\"
+ order by module, author";
$result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle));
return $result;
diff --git a/web/tarball/alloc-test.tar b/web/tarball/alloc-test.tar
new file mode 100644
index 00000000..32b17f9d
--- /dev/null
+++ b/web/tarball/alloc-test.tar
Binary files differ
diff --git a/web/tarball/alloc-test_with_deps.tar b/web/tarball/alloc-test_with_deps.tar
new file mode 100644
index 00000000..3cb4390e
--- /dev/null
+++ b/web/tarball/alloc-test_with_deps.tar
Binary files differ
diff --git a/web/tarball/alloc.tar b/web/tarball/alloc.tar
index f6accbde..6e90adad 100644
--- a/web/tarball/alloc.tar
+++ b/web/tarball/alloc.tar
Binary files differ
diff --git a/web/tarball/alloc_with_deps.tar b/web/tarball/alloc_with_deps.tar
index e302074c..265e05dd 100644
--- a/web/tarball/alloc_with_deps.tar
+++ b/web/tarball/alloc_with_deps.tar
Binary files differ
diff --git a/web/tarball/string-test.tar b/web/tarball/string-test.tar
new file mode 100644
index 00000000..affcc510
--- /dev/null
+++ b/web/tarball/string-test.tar
Binary files differ
diff --git a/web/tarball/string-test_with_deps.tar b/web/tarball/string-test_with_deps.tar
new file mode 100644
index 00000000..bf055345
--- /dev/null
+++ b/web/tarball/string-test_with_deps.tar
Binary files differ
diff --git a/web/tarball/string_with_deps.tar b/web/tarball/string_with_deps.tar
index f7cde076..7a9f37fa 100644
--- a/web/tarball/string_with_deps.tar
+++ b/web/tarball/string_with_deps.tar
Binary files differ
diff --git a/web/tarball/talloc_with_deps.tar b/web/tarball/talloc_with_deps.tar
index 38c87d39..7e222da8 100644
--- a/web/tarball/talloc_with_deps.tar
+++ b/web/tarball/talloc_with_deps.tar
Binary files differ
diff --git a/web/tarball/typesafe_cb.tar b/web/tarball/typesafe_cb.tar
index 937e7097..10fecaaf 100644
--- a/web/tarball/typesafe_cb.tar
+++ b/web/tarball/typesafe_cb.tar
Binary files differ
diff --git a/web/tarball/typesafe_cb_with_deps.tar b/web/tarball/typesafe_cb_with_deps.tar
index 79b8e588..5fe6dc04 100644
--- a/web/tarball/typesafe_cb_with_deps.tar
+++ b/web/tarball/typesafe_cb_with_deps.tar
Binary files differ
diff --git a/web/tools/create_dep_tar b/web/tools/create_dep_tar
index 50234d80..715fb6ba 100755
--- a/web/tools/create_dep_tar
+++ b/web/tools/create_dep_tar
Binary files differ
diff --git a/web/tools/infotojson b/web/tools/infotojson
index 9ceaa2fa..366a79d6 100755
--- a/web/tools/infotojson
+++ b/web/tools/infotojson
Binary files differ