--- /dev/null
+#!/usr/local/bin/perl
+
+# Update Postgres database entries from kdoc sources
+
+use DBI;
+
+$db = DBI->connect("DBI:Pg:dbname=deal",undef,undef);
+
+die $DBI::errstr if (!$db);
+
+print "Connected\n";
+
+$db->do("UPDATE classes SET persistent=FALSE;")
+ || die $db->errstr;
+
+while(<>)
+{
+ next unless(/=/);
+ next if (/\#/);
+ s/=.*//g;
+ chop;
+ print $_, " ";
+
+ # Try to find class name
+
+ $sth = $db->prepare("UPDATE classes set persistent=TRUE where name = '$_';")
+ || die $db->errstr;
+ $sth->execute || die $sth->errstr;
+
+ $rows = $sth->rows;
+ $sth->finish;
+
+ # Insert name if it did not exist.
+
+ if ($rows == 0)
+ {
+ print "insert";
+
+ $db->do("INSERT INTO classes ( name, display, persistent, manually ) values ( '$_', TRUE, TRUE, FALSE);")|| die $db->errstr;;
+ }
+ print "\n";
+}
$entry = pop @n;
while ($#n>=0)
{
- $entry .= " in " . pop @n;
+ $entry .= "+" . pop @n;
}
$entry .= '=' . $2 . '=' . $library;
push @entries, $entry;
Remark: Lowercase is sorted behind uppercase and destructors are isolated at
the end.
<hr>
-<UL>
+<TABLE CELLPADDING=9 CELLSPACING=0 RULES=ROWS BORDER=6>
+<TR><TH><B>function/class</B><TD ALIGN=CENTER><B>in class</B></TR>
EOT
;
foreach $entry (sort @entries)
{
@l = split "=", $entry;
-
+ @c = split '\+', @l[0];
@f = split "#", @l[1];
- print "<LI> <A HREF = \"$l[2]/@f[0]\">@l[0]</A>\n";
+ print "<TR><TH ALIGN=left><A HREF = \"$l[2]/@f[0]\">@c[0]</A><TD>@c[1]</TR>\n";
}
print << 'EOT'
-</UL>
+</TABLE>
</BODY>
</HTML>
EOT