summaryrefslogtreecommitdiff
path: root/src/devices/grotty
diff options
context:
space:
mode:
authorwlemb <wlemb>2003-07-07 07:37:33 +0000
committerwlemb <wlemb>2003-07-07 07:37:33 +0000
commitf011af41ce79eb34a7bba5097f4754caa4ab54ac (patch)
treeeaad8d7a2d42bd32cc0ce83d18d311c3da1c22dd /src/devices/grotty
parent68b7d33189b177dac5a8cc0755dde75c3514bbbc (diff)
downloadgroff-f011af41ce79eb34a7bba5097f4754caa4ab54ac.tar.gz
Make grotty work on platforms which have unsigned char as the
default for char. Based on a patch by Thomas Klausner <wiz@netbsd.org>. * src/devices/grotty/tty.cpp (schar): New typedef. Updated calls to declare_ptable and implement_ptable. (glyph): Use schar for back_color_idx and fore_color_idx. (tty_printer): Use schar for curr_fore_idx and curr_back_idx. (tty_printer::tty_color, tty_printer::tty_printer, tty_printer::color_to_idx, tty_printer::put_color): Updated. * src/roff/nroff/nroff.sh: Add option -d for completeness. * src/roff/nroff/nroff.man: Updated. * NEWS, tmac/groff_www.man: Updated. * doc/Makefile.sub: Updated. Implement support for multiple HTML output files. * src/preproc/html/pre-html.cpp (scanArguments): Dummy handling for -j command line option. * src/devices/grohtml/post-html.cpp (job_name, multiple_files): New global variables. (file): New fields `new_output_file', `require_links', `output_file_name'. (file::file): Updated. (files::set_file_name, files::set_links_required, files::are_links_required, files::is_new_output_file, files::file_name, files::next_file_name): New functions. (header_desc): New fields `no_of_level_one_headings', `header_filename'. (header_desc::header_desc): Updated. (header_desc::write_headings): Handle multiple files. (html_printer::write_header): Save file name in which header occurs. (html_printer::determine_header_level): Possibly split files on level one headings. (html_printer::do_links, html_printer::troff_tag): Updated. (html_printer::insert_split_file, html_printer::do_job_name, html_printer::emit_link, html_printer::write_navigation, html_printer::do_file_components): New functions. (html_printer::~html_printer): Handle multiple files. (main): Handle command line option `-j'. * src/devices/grohtml/grohtml.man: Updated. * doc/Makefile.sub (pic.html), doc/Makefile.in (pic.html): New rule which splits file. * tmac/www.tmac (JOBNAME): New macro. * tmac/s.tmac (SH-NO-TAG): New macro. (@SH): Call SH-NO-TAG. (@NH): Updated.
Diffstat (limited to 'src/devices/grotty')
-rw-r--r--src/devices/grotty/tty.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 812ebf82..2865298c 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -22,8 +22,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "device.h"
#include "ptable.h"
-declare_ptable(char)
-implement_ptable(char)
+typedef signed char schar;
+
+declare_ptable(schar)
+implement_ptable(schar)
extern "C" const char *Version_string;
@@ -141,8 +143,8 @@ public:
short hpos;
unsigned int code;
unsigned char mode;
- char back_color_idx;
- char fore_color_idx;
+ schar back_color_idx;
+ schar fore_color_idx;
void *operator new(size_t);
void operator delete(void *);
inline int draw_mode() { return mode & (VDRAW_MODE|HDRAW_MODE); }
@@ -181,19 +183,19 @@ class tty_printer : public printer {
int nlines;
int cached_v;
int cached_vpos;
- char curr_fore_idx;
- char curr_back_idx;
+ schar curr_fore_idx;
+ schar curr_back_idx;
int is_underline;
int is_bold;
int cu_flag;
- PTABLE(char) tty_colors;
+ PTABLE(schar) tty_colors;
void make_underline();
void make_bold(unsigned int);
- char color_to_idx(color *col);
+ schar color_to_idx(color *col);
void add_char(unsigned int, int, int, color *, color *, unsigned char);
char *make_rgb_string(unsigned int, unsigned int, unsigned int);
- int tty_color(unsigned int, unsigned int, unsigned int, char *,
- char = DEFAULT_COLOR_IDX);
+ int tty_color(unsigned int, unsigned int, unsigned int, schar *,
+ schar = DEFAULT_COLOR_IDX);
public:
tty_printer(const char *device);
~tty_printer();
@@ -203,7 +205,7 @@ public:
void change_color(const environment * const env);
void change_fill_color(const environment * const env);
void put_char(unsigned int);
- void put_color(char, int);
+ void put_color(schar, int);
void begin_page(int) { }
void end_page(int page_length);
font *make_font(const char *);
@@ -233,14 +235,14 @@ char *tty_printer::make_rgb_string(unsigned int r,
int tty_printer::tty_color(unsigned int r,
unsigned int g,
- unsigned int b, char *idx, char value)
+ unsigned int b, schar *idx, schar value)
{
int unknown_color = 0;
char *s = make_rgb_string(r, g, b);
- char *i = tty_colors.lookup(s);
+ schar *i = tty_colors.lookup(s);
if (!i) {
unknown_color = 1;
- i = new char[1];
+ i = new schar[1];
*i = value;
tty_colors.define(s, i);
}
@@ -252,7 +254,7 @@ int tty_printer::tty_color(unsigned int r,
tty_printer::tty_printer(const char *device) : cached_v(0)
{
is_utf8 = !strcmp(device, "utf8");
- char dummy;
+ schar dummy;
// black, white
(void)tty_color(0, 0, 0, &dummy, 0);
(void)tty_color(color::MAX_COLOR_VAL,
@@ -310,13 +312,13 @@ void tty_printer::make_bold(unsigned int c)
}
}
-char tty_printer::color_to_idx(color *col)
+schar tty_printer::color_to_idx(color *col)
{
if (col->is_default())
return DEFAULT_COLOR_IDX;
unsigned int r, g, b;
col->get_rgb(&r, &g, &b);
- char idx;
+ schar idx;
if (tty_color(r, g, b, &idx)) {
char *s = col->print_color();
error("Unknown color (%1) mapped to default", s);
@@ -511,7 +513,7 @@ void tty_printer::put_char(unsigned int wc)
putchar(wc);
}
-void tty_printer::put_color(char color_index, int back)
+void tty_printer::put_color(schar color_index, int back)
{
if (color_index == DEFAULT_COLOR_IDX) {
putstring(SGR_DEFAULT);