summaryrefslogtreecommitdiffstats
path: root/contrib/groff/src/devices/grohtml
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/src/devices/grohtml')
-rw-r--r--contrib/groff/src/devices/grohtml/Makefile.sub1
-rw-r--r--contrib/groff/src/devices/grohtml/grohtml.man33
-rw-r--r--contrib/groff/src/devices/grohtml/html-text.cc4
-rw-r--r--contrib/groff/src/devices/grohtml/html-text.h2
-rw-r--r--contrib/groff/src/devices/grohtml/output.cc5
-rw-r--r--contrib/groff/src/devices/grohtml/post-html.cc29
6 files changed, 53 insertions, 21 deletions
diff --git a/contrib/groff/src/devices/grohtml/Makefile.sub b/contrib/groff/src/devices/grohtml/Makefile.sub
index 2c3a55a..10f28ce 100644
--- a/contrib/groff/src/devices/grohtml/Makefile.sub
+++ b/contrib/groff/src/devices/grohtml/Makefile.sub
@@ -12,5 +12,4 @@ CCSRCS=\
$(srcdir)/output.cc
HDRS=\
$(srcdir)/html.h \
- $(srcdir)/html-chars.h \
$(srcdir)/html-text.h
diff --git a/contrib/groff/src/devices/grohtml/grohtml.man b/contrib/groff/src/devices/grohtml/grohtml.man
index 8796d8f..7b0f5e1 100644
--- a/contrib/groff/src/devices/grohtml/grohtml.man
+++ b/contrib/groff/src/devices/grohtml/grohtml.man
@@ -1,4 +1,4 @@
-.ig \"-*- nroff -*-
+.ig
Copyright (C) 1999-2000, 2001 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
@@ -37,8 +37,10 @@ grohtml \- html driver for groff
.el .RB "[\ " "\\$1" "\ ]"
..
.OP \-v?lrn
+.OP \-D dir
.OP \-F dir
.OP \-i resolution
+.OP \-I image stem
.OP \-o image vertical offset
.RI "[\ " files\|.\|.\|. "\ ]"
.br
@@ -88,8 +90,9 @@ Turns off the automatic header and footer line (html rule).
.TP
.B -n
Generate simple heading anchors whenever a section/number heading is found.
-Without the option the anchor value is the textual heading. This can cause problems
-when a heading contains a `?' on some brousers (netscape).
+Without the option the anchor value is the textual heading.
+This can cause problems when a heading contains a `?' on some brousers
+(netscape).
This flag is automatically turned on if a heading contains an image.
.TP
.BI \-F dir
@@ -101,10 +104,23 @@ is the name of the device, usually
.BR html .
.TP
.BI \-i resolution
-select the resolution for all images.
+Select the resolution for all images.
By default this is 80 pixels per inch.
Example: -i100 indicates 100 pixels per inch.
.TP
+.BI \-I stem
+Determine the image stem name.
+If omitted grohtml uses
+.BI grohtml- XXX
+.RI ( XXX
+is the process ID).
+.TP
+.BI \-D dir
+Inform
+.B grohtml
+to place all image files into directory
+.IR dir .
+.TP
.B \-v
Print the version number.
.TP
@@ -120,7 +136,10 @@ and
mounted at font positions 1 to 4.
.SH DEPENDENCIES
.B grohtml
-is dependent upon the png utilities and gs.
+is dependent upon the png utilities
+.RB ( \&\%pnmcut ,\ \%pnmtopng )
+and GhostScript
+.RB ( gs ).
Images are generated whenever a table, picture, equation or line is
encountered.
.SH BUGS
@@ -135,3 +154,7 @@ It is still alpha code.
.BR groff_out (@MAN5EXT@),
.BR groff_font (@MAN5EXT@),
.BR groff_char (@MAN7EXT@)
+.
+.\" Local Variables:
+.\" mode: nroff
+.\" End:
diff --git a/contrib/groff/src/devices/grohtml/html-text.cc b/contrib/groff/src/devices/grohtml/html-text.cc
index 0b63aa0..56d6c78 100644
--- a/contrib/groff/src/devices/grohtml/html-text.cc
+++ b/contrib/groff/src/devices/grohtml/html-text.cc
@@ -350,7 +350,7 @@ void html_text::do_pre (void)
done_bold();
done_italic();
done_tt();
- char *type = done_para();
+ (void)done_para();
if (! is_present(PRE_TAG)) {
push_para(PRE_TAG, "");
}
@@ -661,7 +661,7 @@ int html_text::emitted_text (void)
* emit_space - writes a space providing that text was written beforehand.
*/
-int html_text::emit_space (void)
+void html_text::emit_space (void)
{
if (space_emitted) {
if (is_present(PRE_TAG)) {
diff --git a/contrib/groff/src/devices/grohtml/html-text.h b/contrib/groff/src/devices/grohtml/html-text.h
index c8ab2ac..5bbcd43 100644
--- a/contrib/groff/src/devices/grohtml/html-text.h
+++ b/contrib/groff/src/devices/grohtml/html-text.h
@@ -78,7 +78,7 @@ public:
void done_big (void);
void do_indent (char *arg, int indent, int pageoff, int linelen);
int emitted_text (void);
- int emit_space (void);
+ void emit_space (void);
int is_in_pre (void);
void remove_tag (HTML_TAG tag);
void remove_sub_sup (void);
diff --git a/contrib/groff/src/devices/grohtml/output.cc b/contrib/groff/src/devices/grohtml/output.cc
index 4c72bba..88ab7d6 100644
--- a/contrib/groff/src/devices/grohtml/output.cc
+++ b/contrib/groff/src/devices/grohtml/output.cc
@@ -71,7 +71,7 @@ word::~word ()
*/
word_list::word_list ()
- : head(0), tail(0), length(0)
+ : length(0), head(0), tail(0)
{
}
@@ -208,6 +208,7 @@ simple_output &simple_output::check_newline(int n)
fputc('\n', fp);
col = last_word.flush(fp);
}
+ return *this;
}
/*
@@ -236,6 +237,7 @@ simple_output &simple_output::space_or_newline (void)
col += last_word.flush(fp);
}
}
+ return *this;
}
/*
@@ -303,6 +305,7 @@ simple_output &simple_output::enable_newlines (int auto_newlines)
check_newline(0);
newlines = auto_newlines;
check_newline(0);
+ return *this;
}
/*
diff --git a/contrib/groff/src/devices/grohtml/post-html.cc b/contrib/groff/src/devices/grohtml/post-html.cc
index 0237bfc..0c36941 100644
--- a/contrib/groff/src/devices/grohtml/post-html.cc
+++ b/contrib/groff/src/devices/grohtml/post-html.cc
@@ -27,7 +27,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stringclass.h"
#include "cset.h"
#include "html.h"
-#include "html-chars.h"
#include "html-text.h"
#include <time.h>
@@ -39,6 +38,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <fcntl.h>
+extern "C" const char *Version_string;
+
#if !defined(TRUE)
# define TRUE (1==1)
#endif
@@ -102,11 +103,13 @@ static int max (int a, int b)
* is_subsection - returns TRUE if a1..a2 is within b1..b2
*/
+#if 0
static int is_subsection (int a1, int a2, int b1, int b2)
{
// easier to see whether this is not the case
return( !((a1 < b1) || (a1 > b2) || (a2 < b1) || (a2 > b2)) );
}
+#endif
/*
* is_intersection - returns TRUE if range a1..a2 intersects with b1..b2
@@ -357,11 +360,11 @@ public:
style text_style;
char *text_string;
unsigned int text_length;
- int minv, maxv, minh, maxh;
+ int minv, minh, maxv, maxh;
int is_raw_command; // should the text be sent directly to the device?
int is_tag; // is this a .br, .sp, .tl etc
- int is_line; // is the command a <line>?
int is_img_auto; // image created by eqn delim
+ int is_line; // is the command a <line>?
int thickness; // the thickness of a line
};
@@ -379,7 +382,7 @@ text_glob::text_glob (style *s, char *string, unsigned int length,
}
text_glob::text_glob ()
- : text_string(0), text_length(0), minv(-1), maxv(-1), minh(-1), maxh(-1),
+ : text_string(0), text_length(0), minv(-1), minh(-1), maxv(-1), maxh(-1),
is_raw_command(FALSE), is_tag(FALSE), is_line(FALSE), thickness(0)
{
}
@@ -455,7 +458,7 @@ struct element_list {
element_list *left;
text_glob *datum;
int lineno;
- int minv, maxv, minh, maxh;
+ int minv, minh, maxv, maxh;
element_list (text_glob *d,
int line_number,
@@ -465,7 +468,7 @@ struct element_list {
};
element_list::element_list ()
- : right(0), left(0), datum(0), lineno(0), minv(-1), maxv(-1), minh(-1), maxh(-1)
+ : right(0), left(0), datum(0), lineno(0), minv(-1), minh(-1), maxv(-1), maxh(-1)
{
}
@@ -2283,10 +2286,10 @@ html_printer::html_printer()
end_tempindent(0),
next_tag(INLINE),
fill_on(TRUE),
+ linelength(0),
pageoffset(0),
indentation(0),
prev_indent(0),
- linelength(0),
line_number(0)
{
#if defined(DEBUGGING)
@@ -2769,7 +2772,6 @@ html_printer::~html_printer()
header.write_headings(stdout, FALSE);
write_rule();
{
- extern const char *Version_string;
html.begin_comment("Creator : ")
.put_string("groff ")
.put_string("version ")
@@ -2877,12 +2879,11 @@ int main(int argc, char **argv)
{ "version", no_argument, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- while ((c = getopt_long(argc, argv, "o:i:F:vd?lrn", long_options, NULL))
+ while ((c = getopt_long(argc, argv, "o:i:I:D:F:vd?lrn", long_options, NULL))
!= EOF)
switch(c) {
case 'v':
{
- extern const char *Version_string;
printf("GNU post-grohtml (groff) version %s\n", Version_string);
exit(0);
break;
@@ -2902,6 +2903,12 @@ int main(int argc, char **argv)
case 'i':
/* handled by pre-html */
break;
+ case 'I':
+ /* handled by pre-html */
+ break;
+ case 'D':
+ /* handled by pre-html */
+ break;
case 'n':
simple_anchors = TRUE;
break;
@@ -2928,6 +2935,6 @@ int main(int argc, char **argv)
static void usage(FILE *stream)
{
- fprintf(stream, "usage: %s [-vld?n] [-F dir] [files ...]\n",
+ fprintf(stream, "usage: %s [-vld?n] [-D dir] [-I image_stem] [-F dir] [files ...]\n",
program_name);
}
OpenPOWER on IntegriCloud