717 |
if (bytes == 1) \ |
if (bytes == 1) \ |
718 |
{ \ |
{ \ |
719 |
*dst++ = (ch); \ |
*dst++ = (ch); \ |
720 |
if ((ch) >= 0x80 && (ch) < 0xA0) \ |
if (extra_bytes && (ch) >= 0x80 && (ch) < 0xA0) \ |
721 |
/* We may have to convert this eight-bit char to \ |
/* We may have to convert this eight-bit char to \ |
722 |
multibyte form later. */ \ |
multibyte form later. */ \ |
723 |
extra_bytes++; \ |
extra_bytes++; \ |
731 |
CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ |
CCL_SUSPEND (CCL_STAT_SUSPEND_BY_DST); \ |
732 |
} while (0) |
} while (0) |
733 |
|
|
734 |
|
|
735 |
/* Encode one character CH to multibyte form and write to the current |
/* Encode one character CH to multibyte form and write to the current |
736 |
output buffer. The output bytes always forms a valid multibyte |
output buffer. The output bytes always forms a valid multibyte |
737 |
sequence. */ |
sequence. */ |
875 |
each of them will be converted to multibyte form of 2-byte |
each of them will be converted to multibyte form of 2-byte |
876 |
sequence. For that conversion, we remember how many more bytes |
sequence. For that conversion, we remember how many more bytes |
877 |
we must keep in DESTINATION in this variable. */ |
we must keep in DESTINATION in this variable. */ |
878 |
int extra_bytes = 0; |
int extra_bytes = ccl->eight_bit_control; |
879 |
|
|
880 |
if (ic >= ccl->eof_ic) |
if (ic >= ccl->eof_ic) |
881 |
ic = CCL_HEADER_MAIN; |
ic = CCL_HEADER_MAIN; |
1850 |
ccl->ic = ic; |
ccl->ic = ic; |
1851 |
ccl->stack_idx = stack_idx; |
ccl->stack_idx = stack_idx; |
1852 |
ccl->prog = ccl_prog; |
ccl->prog = ccl_prog; |
1853 |
ccl->eight_bit_control = (extra_bytes > 0); |
ccl->eight_bit_control = (extra_bytes > 1); |
1854 |
if (consumed) |
if (consumed) |
1855 |
*consumed = src - source; |
*consumed = src - source; |
1856 |
return (dst ? dst - destination : 0); |
return (dst ? dst - destination : 0); |
2005 |
ccl->stack_idx = 0; |
ccl->stack_idx = 0; |
2006 |
ccl->eol_type = CODING_EOL_LF; |
ccl->eol_type = CODING_EOL_LF; |
2007 |
ccl->suppress_error = 0; |
ccl->suppress_error = 0; |
2008 |
|
ccl->eight_bit_control = 0; |
2009 |
return 0; |
return 0; |
2010 |
} |
} |
2011 |
|
|