+2007-07-25 Ben Pfaff <blp@gnu.org>
+
+ * devices: Add tty and listing devices that use VT100 (and xterm)
+ line-drawing characters.
+
2007-07-25 Ben Pfaff <blp@gnu.org>
* devices: Add an "interactive" category that defaults to
tty-ascii-bi:ascii:screen:output-file=${tty-output-file}
list-ascii-bi:ascii:listing:length=66 width=79 output-file=${list-output-file}
+# VT100 graphics devices.
+define vt100-graphics \
+ init='\033(B\033)0' \
+ box[1000]='\16q\17' box[1010]='\16q\17' box[0010]='\16q\17' \
+ box[0100]='\16x\17' box[0101]='\16x\17' box[0001]='\16x\17' \
+ box[0011]='\16j\17' box[1100]='\16l\17' box[0110]='\16k\17' \
+ box[1001]='\16m\17' box[1110]='\16w\17' box[1101]='\16t\17' \
+ box[0111]='\16u\17' box[1011]='\16v\17' box[1111]='\16n\17'
+
+tty-vt100:ascii:screen:squeeze=on headers=off top-margin=0 bottom-margin=0 \
+ paginate=off output-file=${tty-output-file} ${vt100-graphics}
+list-vt100:ascii:listing:length=66 width=79 output-file=${list-output-file} \
+ ${vt100-graphics}
+
# HTML device.
html:html::
@item output-file=@var{file-name}
File to which output should be sent. This can be an ordinary file name
-(e.g., @code{"pspp.txt"}), a pipe (e.g., @code{"|lpr"}), or
+(e.g., @code{"pspp.txt"}), a pipe (e.g., @code{"|more"}), or
stdout (@code{"-"}). Default: @code{"pspp.list"}.
@item paginate=@var{boolean}
special lines, in which case @samp{#} is used.
@end itemize
+@item init=@var{init-string}
+If set, this string is written at the beginning of each output file.
+It can be used to initialize device features, e.g.@: to enable VT100
+line-drawing characters.
+
@item emphasis=@var{emphasis-style}
How to emphasize text. Your choices are @code{bold}, @code{underline},
+2007-07-25 Ben Pfaff <blp@gnu.org>
+
+ Allow the user to specify an initialization string to write at the
+ beginning of an ASCII output file.
+ * ascii.c (struct ascii_driver_ext): New member `init'.
+ (ascii_open_driver): Initialize `init'.
+ (ascii_close_driver): Parse `init'.
+ (ascii_open_page): Write `init' to output file.
+
+ * output.c (get_option_token): Fix parsing of octal constants.
+
2007-07-25 Ben Pfaff <blp@gnu.org>
Make interactive output go to the terminal (bug #17213), by
bottom-margin=2
box[x]="strng" Sets box character X (X in base 4: 0-3333).
+ init="string" Set initialization string.
*/
/* Disable messages by failed range checks. */
int bottom_margin; /* Bottom margin in lines. */
char *box[LNS_COUNT]; /* Line & box drawing characters. */
+ char *init; /* Device initialization string. */
/* Internal state. */
char *file_name; /* Output file name. */
x->bottom_margin = 2;
for (i = 0; i < LNS_COUNT; i++)
x->box[i] = NULL;
+ x->init = NULL;
x->file_name = pool_strdup (x->pool, "pspp.list");
x->file = NULL;
x->page_number = 0;
enum
{
boolean_arg,
- string_arg,
+ emphasis_arg,
nonneg_int_arg,
pos_int_arg,
- output_file_arg
+ output_file_arg,
+ string_arg
};
static const struct outp_option option_tab[] =
{"paginate", boolean_arg, 1},
{"squeeze", boolean_arg, 2},
- {"emphasis", string_arg, 3},
+ {"emphasis", emphasis_arg, 0},
{"output-file", output_file_arg, 0},
{"bottom-margin", nonneg_int_arg, 1},
{"tab-width", nonneg_int_arg, 2},
+ {"init", string_arg, 0},
+
{NULL, 0, 0},
};
}
}
break;
- case string_arg:
+ case emphasis_arg:
if (!strcmp (value, "bold"))
x->emphasis = EMPH_BOLD;
else if (!strcmp (value, "underline"))
}
}
break;
+ case string_arg:
+ free (x->init);
+ x->init = pool_strdup (x->pool, value);
+ break;
default:
NOT_REACHED ();
}
return;
}
pool_attach_file (x->pool, x->file);
+
+ if (x->init != NULL)
+ fputs (x->init, x->file);
}
x->page_number++;
case '7':
out = c - '0';
while (ss_first (*s) >= '0' && ss_first (*s) <= '7')
- out = c * 8 + (ss_get_char (s) - '0');
+ out = out * 8 + (ss_get_char (s) - '0');
break;
case 'x':
case 'X':