* man2hlp.c: Take text width from help.h, not from the command

line.
* help.h: Declare HELP_TEXT_WIDTH.
* help.c: Use HELP_TEXT_WIDTH.
This commit is contained in:
Pavel Roskin 2002-09-22 17:03:28 +00:00
parent f1cec8dc2d
commit 8fad60a1c6
4 changed files with 19 additions and 14 deletions

View File

@ -1,5 +1,10 @@
2002-09-22 Pavel Roskin <proski@gnu.org>
* man2hlp.c: Take text width from help.h, not from the command
line.
* help.h: Declare HELP_TEXT_WIDTH.
* help.c: Use HELP_TEXT_WIDTH.
* help.h: Replace CHAR_BOLD_ON, CHAR_BOLD_OFF and CHAR_ITALIC_ON
with CHAR_FONT_BOLD, CHAR_FONT_NORMAL and CHAR_FONT_ITALIC
respectively for better consistency.

View File

@ -56,9 +56,12 @@
#define MAXLINKNAME 80
#define HISTORY_SIZE 20
#define HELP_WINDOW_WIDTH 62
#define HELP_WINDOW_WIDTH (HELP_TEXT_WIDTH + 4)
/* "$Id$" */
#define STRING_LINK_START "\01"
#define STRING_LINK_POINTER "\02"
#define STRING_LINK_END "\03"
#define STRING_NODE_END "\04"
static char *data; /* Pointer to the loaded data file */
static int help_lines; /* Lines in help viewer */

View File

@ -3,7 +3,9 @@
/* This file is included by help.c and man2hlp.c */
/* Some useful constants */
#define HELP_TEXT_WIDTH 58
/* Markers used in the help files */
#define CHAR_NODE_END '\04'
#define CHAR_LINK_START '\01'
#define CHAR_LINK_POINTER '\02'
@ -22,10 +24,6 @@
#define CHAR_TITLE_OFF '\023'
#define CHAR_FONT_ITALIC '\024'
#define CHAR_RESERVED '\025'
#define STRING_LINK_START "\01"
#define STRING_LINK_POINTER "\02"
#define STRING_LINK_END "\03"
#define STRING_NODE_END "\04"
void interactive_display (char *filename, char *node);
#endif /* __HELP_H */

View File

@ -27,7 +27,6 @@
#define BUFFER_SIZE 256
static int width; /* Output width in characters */
static int col = 0; /* Current output column */
static int out_row = 1; /* Current output row */
static int in_row = 0; /* Current input row */
@ -235,7 +234,7 @@ print_string (char *buffer)
if (*(buffer)) {
len = string_len (buffer);
/* Change the line if about to break the right margin */
if (col + len >= width)
if (col + len >= HELP_TEXT_WIDTH)
newline ();
/* Words are separated by spaces */
if (col > 0) {
@ -519,15 +518,15 @@ main (int argc, char **argv)
long file_end; /* Length of the output file */
/* Validity check for arguments */
if ((argc != 5) || ((width = atoi (argv[1])) <= 10)) {
if (argc != 4) {
fprintf (stderr,
"Usage: man2hlp width file.man template_file helpfile\n");
"Usage: man2hlp file.man template_file helpfile\n");
return 3;
}
c_man = argv[2];
c_tmpl = argv[3];
c_out = argv[4];
c_man = argv[1];
c_tmpl = argv[2];
c_out = argv[3];
/* First stage - process the manual, write to the output file */
f_man = fopen_check (c_man, "r");