29 |
#include "termchar.h" |
#include "termchar.h" |
30 |
#include "termopts.h" |
#include "termopts.h" |
31 |
#include "lisp.h" |
#include "lisp.h" |
32 |
|
#include "buffer.h" |
33 |
|
#include "character.h" |
34 |
#include "charset.h" |
#include "charset.h" |
35 |
#include "coding.h" |
#include "coding.h" |
36 |
#include "keyboard.h" |
#include "keyboard.h" |
874 |
} |
} |
875 |
} |
} |
876 |
|
|
877 |
result = encode_coding (coding, buf, dst, len, dst_end - dst); |
coding->source = buf; |
878 |
|
coding->destination = dst; |
879 |
|
coding->dst_bytes = dst_end - dst; |
880 |
|
encode_coding_object (coding, Qnil, 0, 0, 1, len, Qnil); |
881 |
len -= coding->consumed; |
len -= coding->consumed; |
882 |
dst += coding->produced; |
dst += coding->produced; |
883 |
if (result == CODING_FINISH_INSUFFICIENT_DST |
if (coding->result == CODING_RESULT_INSUFFICIENT_DST) |
|
|| (result == CODING_FINISH_INSUFFICIENT_SRC |
|
|
&& len > dst_end - dst)) |
|
884 |
/* The remaining output buffer is too short. We must |
/* The remaining output buffer is too short. We must |
885 |
break the loop here without increasing SRC so that the |
break the loop here without increasing SRC so that the |
886 |
next call of this function starts from the same glyph. */ |
next call of this function starts from the same glyph. */ |
984 |
if (CODING_REQUIRE_FLUSHING (&terminal_coding)) |
if (CODING_REQUIRE_FLUSHING (&terminal_coding)) |
985 |
{ |
{ |
986 |
terminal_coding.mode |= CODING_MODE_LAST_BLOCK; |
terminal_coding.mode |= CODING_MODE_LAST_BLOCK; |
987 |
encode_coding (&terminal_coding, "", conversion_buffer, |
terminal_coding.source = (unsigned char *) ""; |
988 |
0, conversion_buffer_size); |
terminal_coding.destination = conversion_buffer; |
989 |
|
terminal_coding.dst_bytes = conversion_buffer_size; |
990 |
|
encode_coding_object (&terminal_coding, Qnil, 0, 0, 0, 0, Qnil); |
991 |
if (terminal_coding.produced > 0) |
if (terminal_coding.produced > 0) |
992 |
{ |
{ |
993 |
fwrite (conversion_buffer, 1, terminal_coding.produced, stdout); |
fwrite (conversion_buffer, 1, terminal_coding.produced, stdout); |
1718 |
} |
} |
1719 |
else |
else |
1720 |
{ |
{ |
1721 |
/* A multi-byte character. The display width is fixed for all |
it->pixel_width = CHAR_WIDTH (it->c); |
|
characters of the set. Some of the glyphs may have to be |
|
|
ignored because they are already displayed in a continued |
|
|
line. */ |
|
|
int charset = CHAR_CHARSET (it->c); |
|
|
|
|
|
it->pixel_width = CHARSET_WIDTH (charset); |
|
1722 |
it->nglyphs = it->pixel_width; |
it->nglyphs = it->pixel_width; |
1723 |
|
|
1724 |
if (it->glyph_row) |
if (it->glyph_row) |