- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <libpspp/compiler.h>
#include <libpspp/pool.h>
#include <libpspp/start-date.h>
#include <libpspp/compiler.h>
#include <libpspp/pool.h>
#include <libpspp/start-date.h>
{
EMPH_BOLD, /* Overstrike for bold. */
EMPH_UNDERLINE, /* Overstrike for underlining. */
{
EMPH_BOLD, /* Overstrike for bold. */
EMPH_UNDERLINE, /* Overstrike for underlining. */
{
char s[2];
s[0] = get_default_box_char (i);
s[1] = '\0';
x->box[i] = pool_strdup (x->pool, s);
}
{
char s[2];
s[0] = get_default_box_char (i);
s[1] = '\0';
x->box[i] = pool_strdup (x->pool, s);
}
if (fn_close (x->file_name, x->file) != 0)
error (0, errno, _("ascii: closing output file \"%s\""), x->file_name);
pool_detach_file (x->pool, x->file);
pool_destroy (x->pool);
if (fn_close (x->file_name, x->file) != 0)
error (0, errno, _("ascii: closing output file \"%s\""), x->file_name);
pool_detach_file (x->pool, x->file);
pool_destroy (x->pool);
{
{"headers", boolean_arg, 0},
{"paginate", boolean_arg, 1},
{
{"headers", boolean_arg, 0},
{"paginate", boolean_arg, 1},
x->emphasis = EMPH_UNDERLINE;
else if (!strcmp (value, "none"))
x->emphasis = EMPH_NONE;
x->emphasis = EMPH_UNDERLINE;
else if (!strcmp (value, "none"))
x->emphasis = EMPH_NONE;
error (0, 0,
_("ascii: `emphasis' value must be `bold', "
"`underline', or `none'"));
error (0, 0,
_("ascii: `emphasis' value must be `bold', "
"`underline', or `none'"));
{
x->lines = pool_nrealloc (x->pool,
x->lines, this->length, sizeof *x->lines);
{
x->lines = pool_nrealloc (x->pool,
x->lines, this->length, sizeof *x->lines);
{
line->char_cap = MIN (length * 2, this->width);
line->chars = pool_nrealloc (ext->pool,
line->chars,
{
line->char_cap = MIN (length * 2, this->width);
line->chars = pool_nrealloc (ext->pool,
line->chars,
int x0, int y0, int x1, int y1,
enum outp_line_style top, enum outp_line_style left,
enum outp_line_style bottom, enum outp_line_style right)
int x0, int y0, int x1, int y1,
enum outp_line_style top, enum outp_line_style left,
enum outp_line_style bottom, enum outp_line_style right)
value = ((left << LNS_LEFT) | (right << LNS_RIGHT)
| (top << LNS_TOP) | (bottom << LNS_BOTTOM) | ATTR_BOX);
value = ((left << LNS_LEFT) | (right << LNS_RIGHT)
| (top << LNS_TOP) | (bottom << LNS_BOTTOM) | ATTR_BOX);
{
int x;
expand_line (this, y, x1);
for (x = x0; x < x1; x++)
{
int x;
expand_line (this, y, x1);
for (x = x0; x < x1; x++)
append_lr_justified (struct string *out, int width,
const char *left, const char *right)
{
append_lr_justified (struct string *out, int width,
const char *left, const char *right)
{
}
if (right != NULL)
{
size_t length = MIN (strlen (right), width);
memcpy (ds_end (out) - length, right, length);
}
}
if (right != NULL)
{
size_t length = MIN (strlen (right), width);
memcpy (ds_end (out) - length, right, length);
}
{
struct ascii_driver_ext *x = this->ext;
fwrite (ds_data (out), ds_length (out), 1, x->file);
{
struct ascii_driver_ext *x = this->ext;
fwrite (ds_data (out), ds_length (out), 1, x->file);
r1 = xasprintf (_("%s - Page %d"), get_start_date (), x->page_number);
r2 = xasprintf ("%s - %s" , version, host_system);
r1 = xasprintf (_("%s - Page %d"), get_start_date (), x->page_number);
r2 = xasprintf ("%s - %s" , version, host_system);
append_lr_justified (&out, this->width, outp_title, r1);
append_lr_justified (&out, this->width, outp_subtitle, r2);
append_lr_justified (&out, this->width, outp_title, r1);
append_lr_justified (&out, this->width, outp_subtitle, r2);
{
if (line_num >= x->line_cap)
break;
if (line_num > 0
&& x->lines[line_num].char_cnt == 0
&& x->lines[line_num - 1].char_cnt == 0)
{
if (line_num >= x->line_cap)
break;
if (line_num > 0
&& x->lines[line_num].char_cnt == 0
&& x->lines[line_num - 1].char_cnt == 0)
-
- if (line_num < x->line_cap)
- output_line (this, &x->lines[line_num], &out);
- ds_putc (&out, '\n');
+
+ if (line_num < x->line_cap)
+ output_line (this, &x->lines[line_num], &out);
+ ds_put_char (&out, '\n');
-
- ds_putc_multiple (&out, '\n', x->bottom_margin);
- if (x->paginate)
- ds_putc (&out, '\f');
+
+ ds_put_char_multiple (&out, '\n', x->bottom_margin);
+ if (x->paginate)
+ ds_put_char (&out, '\f');