1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2
3 #line 1 "html-ostream.oo.h"
4 /* Output stream that produces HTML output.
5 Copyright (C) 2006, 2019 Free Software Foundation, Inc.
6 Written by Bruno Haible <bruno@clisp.org>, 2006.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21 #ifndef _HTML_OSTREAM_H
22 #define _HTML_OSTREAM_H
23
24 #include "ostream.h"
25
26
27 #line 28 "html-ostream.h"
28 struct html_ostream_representation;
29 /* html_ostream_t is defined as a pointer to struct html_ostream_representation.
30 In C++ mode, we use a smart pointer class.
31 In C mode, we have no other choice than a typedef to the root class type. */
32 #if IS_CPLUSPLUS
33 struct html_ostream_t
34 {
35 private:
36 struct html_ostream_representation *_pointer;
37 public:
html_ostream_thtml_ostream_t38 html_ostream_t () : _pointer (NULL) {}
html_ostream_thtml_ostream_t39 html_ostream_t (struct html_ostream_representation *pointer) : _pointer (pointer) {}
40 struct html_ostream_representation * operator -> () { return _pointer; }
41 operator struct html_ostream_representation * () { return _pointer; }
42 operator struct any_ostream_representation * () { return (struct any_ostream_representation *) _pointer; }
43 operator void * () { return _pointer; }
44 bool operator == (const void *p) { return _pointer == p; }
45 bool operator != (const void *p) { return _pointer != p; }
ostream_thtml_ostream_t46 operator ostream_t () { return (ostream_t) (struct any_ostream_representation *) _pointer; }
html_ostream_thtml_ostream_t47 explicit html_ostream_t (ostream_t x) : _pointer ((struct html_ostream_representation *) (void *) x) {}
48 };
49 #else
50 typedef ostream_t html_ostream_t;
51 #endif
52
53 /* Functions that invoke the methods. */
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 extern void html_ostream_write_mem (html_ostream_t first_arg, const void *data, size_t len);
58 extern void html_ostream_flush (html_ostream_t first_arg, ostream_flush_scope_t scope);
59 extern void html_ostream_free (html_ostream_t first_arg);
60 extern void html_ostream_begin_span (html_ostream_t first_arg, const char *classname);
61 extern void html_ostream_end_span (html_ostream_t first_arg, const char *classname);
62 extern const char * html_ostream_get_hyperlink_ref (html_ostream_t first_arg);
63 extern void html_ostream_set_hyperlink_ref (html_ostream_t first_arg, const char *ref);
64 extern void html_ostream_flush_to_current_style (html_ostream_t first_arg);
65 #ifdef __cplusplus
66 }
67 #endif
68
69 /* Type representing an implementation of html_ostream_t. */
70 struct html_ostream_implementation
71 {
72 const typeinfo_t * const *superclasses;
73 size_t superclasses_length;
74 size_t instance_size;
75 #define THIS_ARG html_ostream_t first_arg
76 #include "html_ostream.vt.h"
77 #undef THIS_ARG
78 };
79
80 /* Public portion of the object pointed to by a html_ostream_t. */
81 struct html_ostream_representation_header
82 {
83 const struct html_ostream_implementation *vtable;
84 };
85
86 #if HAVE_INLINE
87
88 /* Define the functions that invoke the methods as inline accesses to
89 the html_ostream_implementation.
90 Use #define to avoid a warning because of extern vs. static. */
91
92 # define html_ostream_write_mem html_ostream_write_mem_inline
93 static inline void
html_ostream_write_mem(html_ostream_t first_arg,const void * data,size_t len)94 html_ostream_write_mem (html_ostream_t first_arg, const void *data, size_t len)
95 {
96 const struct html_ostream_implementation *vtable =
97 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
98 vtable->write_mem (first_arg,data,len);
99 }
100
101 # define html_ostream_flush html_ostream_flush_inline
102 static inline void
html_ostream_flush(html_ostream_t first_arg,ostream_flush_scope_t scope)103 html_ostream_flush (html_ostream_t first_arg, ostream_flush_scope_t scope)
104 {
105 const struct html_ostream_implementation *vtable =
106 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
107 vtable->flush (first_arg,scope);
108 }
109
110 # define html_ostream_free html_ostream_free_inline
111 static inline void
html_ostream_free(html_ostream_t first_arg)112 html_ostream_free (html_ostream_t first_arg)
113 {
114 const struct html_ostream_implementation *vtable =
115 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
116 vtable->free (first_arg);
117 }
118
119 # define html_ostream_begin_span html_ostream_begin_span_inline
120 static inline void
html_ostream_begin_span(html_ostream_t first_arg,const char * classname)121 html_ostream_begin_span (html_ostream_t first_arg, const char *classname)
122 {
123 const struct html_ostream_implementation *vtable =
124 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
125 vtable->begin_span (first_arg,classname);
126 }
127
128 # define html_ostream_end_span html_ostream_end_span_inline
129 static inline void
html_ostream_end_span(html_ostream_t first_arg,const char * classname)130 html_ostream_end_span (html_ostream_t first_arg, const char *classname)
131 {
132 const struct html_ostream_implementation *vtable =
133 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
134 vtable->end_span (first_arg,classname);
135 }
136
137 # define html_ostream_get_hyperlink_ref html_ostream_get_hyperlink_ref_inline
138 static inline const char *
html_ostream_get_hyperlink_ref(html_ostream_t first_arg)139 html_ostream_get_hyperlink_ref (html_ostream_t first_arg)
140 {
141 const struct html_ostream_implementation *vtable =
142 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
143 return vtable->get_hyperlink_ref (first_arg);
144 }
145
146 # define html_ostream_set_hyperlink_ref html_ostream_set_hyperlink_ref_inline
147 static inline void
html_ostream_set_hyperlink_ref(html_ostream_t first_arg,const char * ref)148 html_ostream_set_hyperlink_ref (html_ostream_t first_arg, const char *ref)
149 {
150 const struct html_ostream_implementation *vtable =
151 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
152 vtable->set_hyperlink_ref (first_arg,ref);
153 }
154
155 # define html_ostream_flush_to_current_style html_ostream_flush_to_current_style_inline
156 static inline void
html_ostream_flush_to_current_style(html_ostream_t first_arg)157 html_ostream_flush_to_current_style (html_ostream_t first_arg)
158 {
159 const struct html_ostream_implementation *vtable =
160 ((struct html_ostream_representation_header *) (struct html_ostream_representation *) first_arg)->vtable;
161 vtable->flush_to_current_style (first_arg);
162 }
163
164 #endif
165
166 extern const typeinfo_t html_ostream_typeinfo;
167 #define html_ostream_SUPERCLASSES &html_ostream_typeinfo, ostream_SUPERCLASSES
168 #define html_ostream_SUPERCLASSES_LENGTH (1 + ostream_SUPERCLASSES_LENGTH)
169
170 extern const struct html_ostream_implementation html_ostream_vtable;
171
172 #line 49 "html-ostream.oo.h"
173
174
175 #ifdef __cplusplus
176 extern "C" {
177 #endif
178
179
180 /* Create an output stream that takes input in the UTF-8 encoding and
181 writes it in HTML form on DESTINATION.
182 This stream produces a sequence of lines. The caller is responsible
183 for opening the <body><html> elements before and for closing them after
184 the use of this stream.
185 Note that the resulting stream must be closed before DESTINATION can be
186 closed. */
187 extern html_ostream_t html_ostream_create (ostream_t destination);
188
189
190 #ifdef __cplusplus
191 }
192 #endif
193
194 #endif /* _HTML_OSTREAM_H */
195