-/* Buffer to store the result of terminal codes. It is initialized in
- term_init and, if necessary, enlarged in encode_terminal_code. */
-unsigned char *terminal_encode_buffer;
-/* Size of terminal_encode_buffer. */
-static int terminal_encode_buf_size;
-
-/* Encode SRC_LEN glyphs starting at SRC to terminal output codes and
- store them in terminal_encode_buffer.
-
- We store the number of glyphs actually converted in *CONSUMED. The
- return value is the number of bytes stored in
- terminal_encode_buffer.
-
- This function will stop before encoding all glyphs in these two
- cases.
-
- (1) If the first glyph doesn't have a string entry in Vglyph_table,
- it stops at encountering a glyph that has a string entry in
- Vglyph_table.n
-
- (2) If the first has a string entry in Vglyph_table, it stops after
- encoding that string.
-*/
-
-int
-encode_terminal_code (src, src_len, consumed)
+/* Buffers to store the source and result of code conversion for terminal. */
+static unsigned char *encode_terminal_src;
+static unsigned char *encode_terminal_dst;
+/* Allocated sizes of the above buffers. */
+static int encode_terminal_src_size;
+static int encode_terminal_dst_size;
+
+/* Encode SRC_LEN glyphs starting at SRC to terminal output codes.
+ Set CODING->produced to the byte-length of the resulting byte
+ sequence, and return a pointer to that byte sequence. */
+
+unsigned char *
+encode_terminal_code (src, src_len, coding)