4035 |
Lisp_Object conversion_buffer |
Lisp_Object conversion_buffer |
4036 |
= make_conversion_work_buffer (! NILP (current_buffer |
= make_conversion_work_buffer (! NILP (current_buffer |
4037 |
->enable_multibyte_characters)); |
->enable_multibyte_characters)); |
4038 |
|
struct gcpro1; |
4039 |
|
|
4040 |
record_unwind_protect (code_conversion_restore, save_excursion_save ()); |
record_unwind_protect (code_conversion_restore, save_excursion_save ()); |
4041 |
|
|
4053 |
inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */ |
inserted = 0; /* Bytes put into CONVERSION_BUFFER so far. */ |
4054 |
unprocessed = 0; /* Bytes not processed in previous loop. */ |
unprocessed = 0; /* Bytes not processed in previous loop. */ |
4055 |
|
|
4056 |
|
GCPRO1 (conversion_buffer); |
4057 |
while (how_much < total) |
while (how_much < total) |
4058 |
{ |
{ |
4059 |
/* We read one bunch by one (READ_BUF_SIZE bytes) to allow |
/* We read one bunch by one (READ_BUF_SIZE bytes) to allow |
4077 |
|
|
4078 |
how_much += this; |
how_much += this; |
4079 |
|
|
4080 |
|
BUF_SET_PT (XBUFFER (conversion_buffer), |
4081 |
|
BUF_Z (XBUFFER (conversion_buffer))); |
4082 |
decode_coding_c_string (&coding, read_buf, unprocessed + this, |
decode_coding_c_string (&coding, read_buf, unprocessed + this, |
4083 |
conversion_buffer); |
conversion_buffer); |
4084 |
unprocessed = coding.carryover_bytes; |
unprocessed = coding.carryover_bytes; |
4085 |
if (coding.carryover_bytes > 0) |
if (coding.carryover_bytes > 0) |
4086 |
bcopy (coding.carryover, read_buf, unprocessed); |
bcopy (coding.carryover, read_buf, unprocessed); |
4087 |
} |
} |
4088 |
|
UNGCPRO; |
4089 |
emacs_close (fd); |
emacs_close (fd); |
4090 |
|
|
4091 |
/* At this point, HOW_MUCH should equal TOTAL, or should be <= 0 |
/* At this point, HOW_MUCH should equal TOTAL, or should be <= 0 |