#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <ctype.h>
#include <git2.h>
"</thead><tbody>\n", fp);
}
+void
+writenamespace(FILE *fp)
+{
+ fputs("<tr><td class=\"namespace\">", fp);
+ namespace[0] = toupper(namespace[0]);
+ xmlencode(fp, namespace, strlen(description));
+ namespace[0] = tolower(namespace[0]);
+ fputs("</td><td>", fp);
+ fputs("</td><td>", fp);
+ fputs("</td><td>", fp);
+ fputs("</td></tr>", fp);
+}
+
+
void
writefooter(FILE *fp)
{
writeheader(stdout);
+ char *old_namespace = "";
for (i = 1; i < argc; i++) {
repodir = argv[i];
if (!realpath(repodir, repodirabs))
/* use directory name as name and namespace*/
name = basename(repodirabs);
namespace = basename(dirname(repodirabs));
+ if (strcmp(old_namespace, namespace) != 0) {
+ writenamespace(stdout);
+ old_namespace = malloc( sizeof *namespace );
+ memcpy(old_namespace, namespace, strlen(namespace));
+ }
+
/* read description or .git/description */
joinpath(path, sizeof(path), repodir, "description");