/* ui.h - Created by Giampiero Caprino Modified by Erik Kuiper This file is part of Train Director Train Director is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. Train Director is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Train Director; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "html.h" static FILE *fhtml; void html_startpage(FILE *fp, char *title) { fhtml = fp; fprintf(fp, "\n"); fprintf(fp, "%s\n", title); fprintf(fp, "\n"); fprintf(fp, "

%s

\n", title); fprintf(fp, "
\n"); } void html_table(char **headers) { int i; fprintf(fhtml, "
\n"); fprintf(fhtml, "\n"); for(i = 0; headers[i]; ++i) fprintf(fhtml, "\n", headers[i]); fprintf(fhtml, "\n\n"); } void html_row(char **values) { int i; fprintf(fhtml, "\n"); for(i = 0; values[i]; ++i) fprintf(fhtml, "\n", *values[i] ? values[i] : " "); fprintf(fhtml, "\n\n"); } void html_endtable(void) { fprintf(fhtml, "
%s
%s
\n
\n\n"); } void html_endpage(void) { fprintf(fhtml, "\n"); }