1 /* Output stream that produces HTML output.
2 Copyright (C) 2006 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2006.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef _HTML_OSTREAM_H
19 #define _HTML_OSTREAM_H
24 struct html_ostream : struct ostream
28 /* Start a <span class="CLASSNAME"> element. The CLASSNAME is the name
29 of a CSS class. It can be chosen arbitrarily and customized through
30 an inline or external CSS. */
31 void begin_span (html_ostream_t stream, const char *classname);
33 /* End a <span class="CLASSNAME"> element.
34 The begin_span / end_span calls must match properly. */
35 void end_span (html_ostream_t stream, const char *classname);
44 /* Create an output stream that takes input in the UTF-8 encoding and
45 writes it in HTML form on DESTINATION.
46 This stream produces a sequence of lines. The caller is responsible
47 for opening the <body><html> elements before and for closing them after
48 the use of this stream.
49 Note that the resulting stream must be closed before DESTINATION can be
51 extern html_ostream_t html_ostream_create (ostream_t destination);
58 #endif /* _HTML_OSTREAM_H */