diff options
author | ru <ru@FreeBSD.org> | 2001-07-10 17:09:00 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-07-10 17:09:00 +0000 |
commit | 509648687568379aa73928b01295f92b31f340d0 (patch) | |
tree | 48f82ecc62866b510511d840037bd0c8dad377ff /contrib/groff/src/devices | |
parent | a8b501863ad5b196a10db9fa64dd61eb742bafeb (diff) | |
parent | 8d6dea3a5542a987c08a218c28776d3751d6878d (diff) | |
download | FreeBSD-src-509648687568379aa73928b01295f92b31f340d0.zip FreeBSD-src-509648687568379aa73928b01295f92b31f340d0.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r79543,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/groff/src/devices')
-rw-r--r-- | contrib/groff/src/devices/grodvi/dvi.cc | 7 | ||||
-rw-r--r-- | contrib/groff/src/devices/grodvi/grodvi.man | 8 | ||||
-rw-r--r-- | contrib/groff/src/devices/grohtml/Makefile.sub | 1 | ||||
-rw-r--r-- | contrib/groff/src/devices/grohtml/grohtml.man | 33 | ||||
-rw-r--r-- | contrib/groff/src/devices/grohtml/html-text.cc | 4 | ||||
-rw-r--r-- | contrib/groff/src/devices/grohtml/html-text.h | 2 | ||||
-rw-r--r-- | contrib/groff/src/devices/grohtml/output.cc | 5 | ||||
-rw-r--r-- | contrib/groff/src/devices/grohtml/post-html.cc | 29 | ||||
-rw-r--r-- | contrib/groff/src/devices/grolbp/lbp.cc | 7 | ||||
-rw-r--r-- | contrib/groff/src/devices/grolbp/lbp.h | 8 | ||||
-rw-r--r-- | contrib/groff/src/devices/grolj4/grolj4.man | 8 | ||||
-rw-r--r-- | contrib/groff/src/devices/grolj4/lj4.cc | 9 | ||||
-rw-r--r-- | contrib/groff/src/devices/grops/grops.man | 8 | ||||
-rw-r--r-- | contrib/groff/src/devices/grops/ps.cc | 6 | ||||
-rw-r--r-- | contrib/groff/src/devices/grops/psrm.cc | 11 | ||||
-rw-r--r-- | contrib/groff/src/devices/grotty/tty.cc | 3 |
16 files changed, 100 insertions, 49 deletions
diff --git a/contrib/groff/src/devices/grodvi/dvi.cc b/contrib/groff/src/devices/grodvi/dvi.cc index 74422f8..b5b7c49 100644 --- a/contrib/groff/src/devices/grodvi/dvi.cc +++ b/contrib/groff/src/devices/grodvi/dvi.cc @@ -22,6 +22,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "driver.h" #include "nonposix.h" +extern "C" const char *Version_string; + #define DEFAULT_LINEWIDTH 40 static int linewidth = DEFAULT_LINEWIDTH; @@ -521,8 +523,8 @@ void dvi_printer::moveto(int h, int v) void dvi_printer::draw(int code, int *p, int np, const environment *env) { if (code == 'l') { - int x, y; - int height = 0, width; + int x = 0, y = 0; + int height = 0, width = 0; int thickness; if (line_thickness < 0) thickness = env->size*RES_7227*linewidth/1000; @@ -863,7 +865,6 @@ int main(int argc, char **argv) switch(c) { case 'v': { - extern const char *Version_string; printf("GNU grodvi (groff) version %s\n", Version_string); exit(0); break; diff --git a/contrib/groff/src/devices/grodvi/grodvi.man b/contrib/groff/src/devices/grodvi/grodvi.man index 7aa4431..a4488ce 100644 --- a/contrib/groff/src/devices/grodvi/grodvi.man +++ b/contrib/groff/src/devices/grodvi/grodvi.man @@ -1,5 +1,5 @@ -.ig \"-*- nroff -*- -Copyright (C) 1989-2000 Free Software Foundation, Inc. +.ig +Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -172,3 +172,7 @@ and widths of rules be rounded. .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/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); } diff --git a/contrib/groff/src/devices/grolbp/lbp.cc b/contrib/groff/src/devices/grolbp/lbp.cc index 69196af..ec8c7b1 100644 --- a/contrib/groff/src/devices/grolbp/lbp.cc +++ b/contrib/groff/src/devices/grolbp/lbp.cc @@ -33,6 +33,8 @@ TODO #include "nonposix.h" +extern "C" const char *Version_string; + static short int papersize = -1, // papersize orientation = -1 , // orientation paperlength = 0, // Custom Paper size @@ -151,7 +153,7 @@ void lbp_font::handle_unknown_font_command(const char *command, static void wp54charset() { - int i; + unsigned int i; lbpputs("\033[714;100;29;0;32;120.}"); for (i = 0; i < sizeof(symset) ; i++) lbpputc(symset[i]); @@ -561,7 +563,7 @@ static struct static int set_papersize(const char *papersize) { - int i; + unsigned int i; // First test for a standard (i.e. supported directly by the printer) // papersize @@ -715,7 +717,6 @@ int main(int argc, char **argv) case 'l' : orientation = 1; break; case 'v' : { - extern const char *Version_string; printf("GNU grolbp (groff) version %s\n", Version_string); exit(0); diff --git a/contrib/groff/src/devices/grolbp/lbp.h b/contrib/groff/src/devices/grolbp/lbp.h index 6a11b19..cacf3ea 100644 --- a/contrib/groff/src/devices/grolbp/lbp.h +++ b/contrib/groff/src/devices/grolbp/lbp.h @@ -36,7 +36,7 @@ lbpinit(FILE *outfile) static inline void -lbpprintf(char *format, ... ) +lbpprintf(const char *format, ... ) { /* Taken from cjet */ va_list stuff; @@ -46,7 +46,7 @@ lbpprintf(char *format, ... ) }; static inline void -lbpputs(char *data) +lbpputs(const char *data) { fputs(data,lbpoutput); }; @@ -123,7 +123,7 @@ lbpruleabs(int x, int y, int hsize, int vsize) fprintf(lbpoutput,"\033[9r"); }; -static inline void vdmprintf(char *format, ... ); +static inline void vdmprintf(const char *format, ... ); static inline char * vdmnum(int num,char *result) @@ -179,7 +179,7 @@ vdmend() }; static inline void -vdmprintf(char *format, ... ) +vdmprintf(const char *format, ... ) { /* Taken from cjet */ va_list stuff; diff --git a/contrib/groff/src/devices/grolj4/grolj4.man b/contrib/groff/src/devices/grolj4/grolj4.man index 891d7dc..414ad78 100644 --- a/contrib/groff/src/devices/grolj4/grolj4.man +++ b/contrib/groff/src/devices/grolj4/grolj4.man @@ -1,5 +1,5 @@ -.ig \"-*- nroff -*- -Copyright (C) 1994-2000 Free Software Foundation, Inc. +.ig +Copyright (C) 1994-2000, 2001 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -142,3 +142,7 @@ Small dots. .BR groff_out (@MAN5EXT@), .BR groff_font (@MAN5EXT@), .BR groff_char (@MAN7EXT@) +. +.\" Local Variables: +.\" mode: nroff +.\" End: diff --git a/contrib/groff/src/devices/grolj4/lj4.cc b/contrib/groff/src/devices/grolj4/lj4.cc index 9fbc6af..6829acb 100644 --- a/contrib/groff/src/devices/grolj4/lj4.cc +++ b/contrib/groff/src/devices/grolj4/lj4.cc @@ -35,6 +35,8 @@ X command to include bitmap graphics #include "driver.h" #include "nonposix.h" +extern "C" const char *Version_string; + static struct { const char *name; int code; @@ -123,7 +125,8 @@ void lj4_font::handle_unknown_font_command(const char *command, const char *arg, const char *filename, int lineno) { - for (int i = 0; i < sizeof(command_table)/sizeof(command_table[0]); i++) { + for (unsigned int i = 0; + i < sizeof(command_table)/sizeof(command_table[0]); i++) { if (strcmp(command, command_table[i].s) == 0) { if (arg == 0) fatal_with_file_and_line(filename, lineno, @@ -568,7 +571,8 @@ printer *make_printer() static int lookup_paper_size(const char *s) { - for (int i = 0; i < sizeof(paper_table)/sizeof(paper_table[0]); i++) { + for (unsigned int i = 0; + i < sizeof(paper_table)/sizeof(paper_table[0]); i++) { // FIXME Perhaps allow unique prefix. if (strcasecmp(s, paper_table[i].name) == 0) return i; @@ -645,7 +649,6 @@ int main(int argc, char **argv) } case 'v': { - extern const char *Version_string; printf("GNU grolj4 (groff) version %s\n", Version_string); exit(0); break; diff --git a/contrib/groff/src/devices/grops/grops.man b/contrib/groff/src/devices/grops/grops.man index 1dac725..e9c6be4 100644 --- a/contrib/groff/src/devices/grops/grops.man +++ b/contrib/groff/src/devices/grops/grops.man @@ -1,5 +1,5 @@ -.ig \"-*- nroff -*- -Copyright (C) 1989-2000 Free Software Foundation, Inc. +.ig +Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -859,3 +859,7 @@ Temporary file. .BR groff_out (@MAN5EXT@), .BR groff_font (@MAN5EXT@), .BR groff_char (@MAN7EXT@) +. +.\" Local Variables: +.\" mode: nroff +.\" End: diff --git a/contrib/groff/src/devices/grops/ps.cc b/contrib/groff/src/devices/grops/ps.cc index 98b1a91..a467f04 100644 --- a/contrib/groff/src/devices/grops/ps.cc +++ b/contrib/groff/src/devices/grops/ps.cc @@ -33,6 +33,8 @@ extern "C" { } #endif /* NEED_DECLARATION_PUTENV */ +extern "C" const char *Version_string; + static int landscape_flag = 0; static int manual_feed_flag = 0; static int ncopies = 1; @@ -1119,7 +1121,6 @@ ps_printer::~ps_printer() putchar('\n'); out.set_file(stdout); { - extern const char *Version_string; out.begin_comment("Creator:") .comment_arg("groff") .comment_arg("version") @@ -1248,7 +1249,7 @@ void ps_printer::special(char *arg, const environment *env, char type) error("X command without `ps:' tag ignored"); return; } - for (int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++) + for (unsigned int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++) if (strncmp(command, proc_table[i].name, p - command) == 0) { (this->*(proc_table[i].proc))(p, env); return; @@ -1495,7 +1496,6 @@ int main(int argc, char **argv) switch(c) { case 'v': { - extern const char *Version_string; printf("GNU grops (groff) version %s\n", Version_string); exit(0); break; diff --git a/contrib/groff/src/devices/grops/psrm.cc b/contrib/groff/src/devices/grops/psrm.cc index b816c6b..5f232c0 100644 --- a/contrib/groff/src/devices/grops/psrm.cc +++ b/contrib/groff/src/devices/grops/psrm.cc @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -174,7 +175,7 @@ resource *resource_manager::lookup_font(const char *name) resource *r; for (r = resource_list; r; r = r->next) if (r->type == RESOURCE_FONT - && strlen(name) == r->name.length() + && strlen(name) == (size_t)r->name.length() && memcmp(name, r->name.contents(), r->name.length()) == 0) return r; string s(name); @@ -535,7 +536,7 @@ resource *resource_manager::read_resource_arg(const char **ptr) } int ri; for (ri = 0; ri < NRESOURCES; ri++) - if (strlen(resource_table[ri]) == *ptr - name + if (strlen(resource_table[ri]) == size_t(*ptr - name) && memcmp(resource_table[ri], name, *ptr - name) == 0) break; if (ri >= NRESOURCES) { @@ -717,7 +718,7 @@ int read_one_of(const char **ptr, const char **s, int n) ++(*ptr); } while (**ptr != '\0' && !white_space(**ptr)); for (int i = 0; i < n; i++) - if (strlen(s[i]) == *ptr - start + if (strlen(s[i]) == size_t(*ptr - start) && memcmp(s[i], start, *ptr - start) == 0) return i; return -1; @@ -859,7 +860,7 @@ static unsigned parse_extensions(const char *ptr) } while (*ptr != '\0' && !white_space(*ptr)); int i; for (i = 0; i < NEXTENSIONS; i++) - if (strlen(extension_table[i]) == ptr - name + if (strlen(extension_table[i]) == size_t(ptr - name) && memcmp(extension_table[i], name, ptr - name) == 0) { flags |= (1 << i); break; diff --git a/contrib/groff/src/devices/grotty/tty.cc b/contrib/groff/src/devices/grotty/tty.cc index a8ee065..d13adbf 100644 --- a/contrib/groff/src/devices/grotty/tty.cc +++ b/contrib/groff/src/devices/grotty/tty.cc @@ -21,6 +21,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "driver.h" #include "device.h" +extern "C" const char *Version_string; + #ifndef SHRT_MIN #define SHRT_MIN (-32768) #endif @@ -442,7 +444,6 @@ int main(int argc, char **argv) switch(c) { case 'v': { - extern const char *Version_string; printf("GNU grotty (groff) version %s\n", Version_string); exit(0); break; |