202 |
} |
} |
203 |
|
|
204 |
|
|
205 |
static unsigned char *s=0; |
static char *s; |
206 |
static int |
static int |
207 |
ascii_close_global (struct outp_class *this UNUSED) |
ascii_close_global (struct outp_class *this UNUSED) |
208 |
{ |
{ |
1158 |
/* ascii_close_page () and support routines. */ |
/* ascii_close_page () and support routines. */ |
1159 |
|
|
1160 |
#define LINE_BUF_SIZE 1024 |
#define LINE_BUF_SIZE 1024 |
1161 |
static unsigned char *line_buf; |
static char *line_buf; |
1162 |
static unsigned char *line_p; |
static char *line_p; |
1163 |
|
|
1164 |
static inline int |
static inline int |
1165 |
commit_line_buf (struct outp_driver *this) |
commit_line_buf (struct outp_driver *this) |
1312 |
/* Writes CH into line_buf N times, or to THIS->output if line_buf |
/* Writes CH into line_buf N times, or to THIS->output if line_buf |
1313 |
overflows. */ |
overflows. */ |
1314 |
static inline void |
static inline void |
1315 |
output_char (struct outp_driver *this, int n, int ch) |
output_char (struct outp_driver *this, int n, char ch) |
1316 |
{ |
{ |
1317 |
if (LINE_BUF_SIZE - (line_p - line_buf) >= n) |
if (LINE_BUF_SIZE - (line_p - line_buf) >= n) |
1318 |
{ |
{ |
1474 |
} |
} |
1475 |
if (n_passes > 1) |
if (n_passes > 1) |
1476 |
{ |
{ |
1477 |
unsigned char ch; |
char ch; |
1478 |
|
|
1479 |
return_carriage (this, n_chars); |
return_carriage (this, n_chars); |
1480 |
n_chars = 0; |
n_chars = 0; |
1538 |
|
|
1539 |
struct ascii_driver_ext *x = this->ext; |
struct ascii_driver_ext *x = this->ext; |
1540 |
int nl_len, ff_len, total_len; |
int nl_len, ff_len, total_len; |
1541 |
unsigned char *cp; |
char *cp; |
1542 |
int i; |
int i; |
1543 |
|
|
1544 |
assert (this->driver_open && this->page_open); |
assert (this->driver_open && this->page_open); |
1624 |
output_string (this, s, &s[total_len]); |
output_string (this, s, &s[total_len]); |
1625 |
|
|
1626 |
if (line_p != line_buf && !commit_line_buf (this)) |
if (line_p != line_buf && !commit_line_buf (this)) |
|
{ |
|
|
free(s); |
|
|
s=0; |
|
1627 |
return 0; |
return 0; |
|
} |
|
1628 |
|
|
1629 |
this->page_open = 0; |
this->page_open = 0; |
1630 |
return 1; |
return 1; |