4ba9569b56ccd506141ab9700812f952be63947d
[platform/upstream/groff.git] / src / libs / libgroff / htmlhint.cpp
1 /* Copyright (C) 2000-2014  Free Software Foundation, Inc.
2      Written by Gaius Mulley (gaius@glam.ac.uk)
3
4 This file is part of groff.
5
6 groff is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19 #include "lib.h"
20
21 #include <stddef.h>
22 #include <stdlib.h>
23
24 #include "nonposix.h"
25 #include "stringclass.h"
26 #include "html-strings.h"
27
28 /*
29  *  This file contains a very simple set of routines which might
30  *  be shared by preprocessors.  It allows a preprocessor to indicate
31  *  when an inline image should be created.
32  *  This string is intercepted by pre-grohtml and substituted for
33  *  the image name and suppression escapes.
34  *
35  *  pre-html runs troff twice, once with -Thtml (or -Txhtml) and once
36  *  with -Tps.  `troff -Thtml' (and `troff -Txhtml') emits a
37  *  <src='image'.png> tag and the postscript device driver works out
38  *  the min/max limits of the graphic region.  These region limits are
39  *  read by pre-html and an image is generated via
40  *
41  *    troff -Tps -> gs -> png
42  */
43
44 /*
45  *  html_begin_suppress - emit a start of image tag which will be seen
46  *                        by pre-html.
47  */
48 void html_begin_suppress()
49 {
50   put_string(HTML_IMAGE_INLINE_BEGIN, stdout);
51 }
52
53 /*
54  *  html_end_suppress - emit an end of image tag which will be seen
55  *                      by pre-html.
56  */
57 void html_end_suppress()
58 {
59   put_string(HTML_IMAGE_INLINE_END, stdout);
60 }