COPYING: Add LGPL 2.1 license.
[collection4.git] / src / utils_cgi.c
index b96e15a..ed4c446 100644 (file)
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -344,7 +346,7 @@ int param_set (param_list_t *pl, const char *name, /* {{{ */
   return (0);
 } /* }}} int param_set */
 
-const char *param_as_string (param_list_t *pl) /* {{{ */
+char *param_as_string (param_list_t *pl) /* {{{ */
 {
   char buffer[4096];
   char key[2048];
@@ -549,7 +551,9 @@ int html_print_page (const char *title, /* {{{ */
 {
   char *title_html;
 
-  printf ("Content-Type: text/html\n\n");
+  printf ("Content-Type: text/html\n"
+      "X-Generator: "PACKAGE_STRING"\n"
+      "\n\n");
 
   if (title == NULL)
     title = "c4: collection4 graph interface";
@@ -573,6 +577,8 @@ int html_print_page (const char *title, /* {{{ */
       "        <td id=\"layout-top-left\">");
   if (cb->top_left != NULL)
     (*cb->top_left) (user_data);
+  else
+    html_print_logo (NULL);
   printf ("</td>\n"
       "        <td id=\"layout-top-center\">");
   if (cb->top_center != NULL)
@@ -621,6 +627,16 @@ int html_print_page (const char *title, /* {{{ */
   return (0);
 } /* }}} int html_print_page */
 
+int html_print_logo (__attribute__((unused)) void *user_data) /* {{{ */
+{
+  printf ("<a href=\"%s?action=list_graphs\" id=\"logo-canvas\">\n"
+      "  <h1>c<sup>4</sup></h1>\n"
+      "  <div id=\"logo-subscript\">collection&nbsp;4</div>\n"
+      "</a>\n");
+
+  return (0);
+} /* }}} int html_print_search_box */
+
 int html_print_search_box (__attribute__((unused)) void *user_data) /* {{{ */
 {
   char *term_html;