Nth coding category. */
static struct coding_system coding_categories[coding_category_max];
-/*** Commonly used macros and functions ***/
-
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-#ifndef max
-#define max(a, b) ((a) > (b) ? (a) : (b))
-#endif
-
/* Encode a flag that can be nil, something else, or t as -1, 0, 1. */
static int
ONE_MORE_BYTE (c1);
if (c1 < ' ' || c1 >= 0x80
|| (id = iso_charset_table[0][c >= ','][c1]) < 0)
- /* Invalid designation sequence. Just ignore. */
- break;
+ {
+ /* Invalid designation sequence. Just ignore. */
+ if (c1 >= 0x80)
+ rejected |= (CATEGORY_MASK_ISO_7BIT
+ | CATEGORY_MASK_ISO_7_ELSE);
+ break;
+ }
}
else if (c == '$')
{
ONE_MORE_BYTE (c1);
if (c1 < ' ' || c1 >= 0x80
|| (id = iso_charset_table[1][c >= ','][c1]) < 0)
- /* Invalid designation sequence. Just ignore. */
- break;
+ {
+ /* Invalid designation sequence. Just ignore. */
+ if (c1 >= 0x80)
+ rejected |= (CATEGORY_MASK_ISO_7BIT
+ | CATEGORY_MASK_ISO_7_ELSE);
+ break;
+ }
}
else
- /* Invalid designation sequence. Just ignore it. */
- break;
+ {
+ /* Invalid designation sequence. Just ignore it. */
+ if (c >= 0x80)
+ rejected |= (CATEGORY_MASK_ISO_7BIT
+ | CATEGORY_MASK_ISO_7_ELSE);
+ break;
+ }
}
else
{
/* Invalid escape sequence. Just ignore it. */
+ if (c >= 0x80)
+ rejected |= (CATEGORY_MASK_ISO_7BIT
+ | CATEGORY_MASK_ISO_7_ELSE);
break;
}
if (inhibit_iso_escape_detection)
break;
single_shifting = 0;
- rejected |= CATEGORY_MASK_ISO_7BIT;
+ rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_7_ELSE;
if (CODING_ISO_FLAGS (&coding_categories[coding_category_iso_8_1])
& CODING_ISO_FLAG_SINGLE_SHIFT)
{
single_shifting = 0;
break;
}
+ rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_7_ELSE;
if (c >= 0xA0)
{
- rejected |= CATEGORY_MASK_ISO_7BIT | CATEGORY_MASK_ISO_7_ELSE;
found |= CATEGORY_MASK_ISO_8_1;
/* Check the length of succeeding codes of the range
0xA0..0FF. If the byte length is even, we include
doc: /* Internal use only. */)
(Lisp_Object coding_system, Lisp_Object terminal)
{
- struct terminal *term = get_terminal (terminal, 1);
+ struct terminal *term = decode_live_terminal (terminal);
struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (term);
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding);
(Lisp_Object terminal)
{
struct coding_system *terminal_coding
- = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
+ = TERMINAL_TERMINAL_CODING (decode_live_terminal (terminal));
Lisp_Object coding_system = CODING_ID_NAME (terminal_coding->id);
/* For backward compatibility, return nil if it is `undecided'. */
doc: /* Internal use only. */)
(Lisp_Object coding_system, Lisp_Object terminal)
{
- struct terminal *t = get_terminal (terminal, 1);
+ struct terminal *t = decode_live_terminal (terminal);
CHECK_SYMBOL (coding_system);
if (NILP (coding_system))
coding_system = Qno_conversion;
(Lisp_Object terminal)
{
return CODING_ID_NAME (TERMINAL_KEYBOARD_CODING
- (get_terminal (terminal, 1))->id);
+ (decode_live_terminal (terminal))->id);
}
\f