/* darkstat 3 * * html.c: HTML header/footer templating for web interface. * copyright (c) 2006 Ben Stewart. * copyright (c) 2010 Malte S. Stretz. * * You may use, modify and redistribute this file under the terms of the * GNU General Public License version 2. (see COPYING.GPL) */ #include "config.h" /* for PACKAGE_STRING */ #include "str.h" #include "html.h" #include "http.h" /* for base_url */ void html_open(struct str *buf, const char *title, const char *interface, void (*header_callback)(struct str *buf)) { str_append(buf, "\n" "\n" "\n"); str_appendf(buf, "%s (darkstat3 : %s)\n" "\n", title, interface, PACKAGE_STRING); str_append(buf, "\n"); str_appendf(buf, "\n", base_url, "style.css"); if (header_callback != NULL) header_callback(buf); str_append(buf, "\n" "\n" "
\n" "\n" "
\n" "
\n"); str_appendf(buf, "

%s

\n", title); } void html_close(struct str *buf) { str_append(buf, "
\n" "\n" "\n" ); } /* vim:set ts=4 sw=4 tw=78 expandtab: */