Mercurial > emacs
comparison src/coding.c @ 24568:05c797dbc451
Add comments for decode_coding and encode_coding.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Tue, 06 Apr 1999 12:34:12 +0000 |
| parents | 3aeaac397061 |
| children | 6156dc5f5ce0 |
comparison
equal
deleted
inserted
replaced
| 24567:36e004c54eaf | 24568:05c797dbc451 |
|---|---|
| 3727 return result; | 3727 return result; |
| 3728 } | 3728 } |
| 3729 | 3729 |
| 3730 /* See "GENERAL NOTES about `decode_coding_XXX ()' functions". Before | 3730 /* See "GENERAL NOTES about `decode_coding_XXX ()' functions". Before |
| 3731 decoding, it may detect coding system and format of end-of-line if | 3731 decoding, it may detect coding system and format of end-of-line if |
| 3732 those are not yet decided. */ | 3732 those are not yet decided. |
| 3733 | |
| 3734 This function does not make full use of DESTINATION buffer. For | |
| 3735 instance, if coding->type is coding_type_iso2022, it uses only | |
| 3736 (DST_BYTES - 7) bytes of DESTINATION buffer. In the case that | |
| 3737 DST_BYTES is decided by the function decoding_buffer_size, it | |
| 3738 contains extra 256 bytes (defined by CONVERSION_BUFFER_EXTRA_ROOM). | |
| 3739 So, this function can decode the full SOURCE. But, in the other | |
| 3740 case, if you want to avoid carry over, you must supply at least 7 | |
| 3741 bytes more area in DESTINATION buffer than expected maximum bytes | |
| 3742 that will be produced by this function. */ | |
| 3733 | 3743 |
| 3734 int | 3744 int |
| 3735 decode_coding (coding, source, destination, src_bytes, dst_bytes) | 3745 decode_coding (coding, source, destination, src_bytes, dst_bytes) |
| 3736 struct coding_system *coding; | 3746 struct coding_system *coding; |
| 3737 unsigned char *source, *destination; | 3747 unsigned char *source, *destination; |
| 3810 } | 3820 } |
| 3811 | 3821 |
| 3812 return result; | 3822 return result; |
| 3813 } | 3823 } |
| 3814 | 3824 |
| 3815 /* See "GENERAL NOTES about `encode_coding_XXX ()' functions". */ | 3825 /* See "GENERAL NOTES about `encode_coding_XXX ()' functions". |
| 3826 | |
| 3827 This function does not make full use of DESTINATION buffer. For | |
| 3828 instance, if coding->type is coding_type_iso2022, it uses only | |
| 3829 (DST_BYTES - 20) bytes of DESTINATION buffer. In the case that | |
| 3830 DST_BYTES is decided by the function encoding_buffer_size, it | |
| 3831 contains extra 256 bytes (defined by CONVERSION_BUFFER_EXTRA_ROOM). | |
| 3832 So, this function can encode the full SOURCE. But, in the other | |
| 3833 case, if you want to avoid carry over, you must supply at least 20 | |
| 3834 bytes more area in DESTINATION buffer than expected maximum bytes | |
| 3835 that will be produced by this function. */ | |
| 3816 | 3836 |
| 3817 int | 3837 int |
| 3818 encode_coding (coding, source, destination, src_bytes, dst_bytes) | 3838 encode_coding (coding, source, destination, src_bytes, dst_bytes) |
| 3819 struct coding_system *coding; | 3839 struct coding_system *coding; |
| 3820 unsigned char *source, *destination; | 3840 unsigned char *source, *destination; |
