2634 |
ARG is passed to C_FUNCTION when that is called. */ |
ARG is passed to C_FUNCTION when that is called. */ |
2635 |
|
|
2636 |
void |
void |
2637 |
map_char_table (c_function, function, subtable, arg, depth, indices) |
map_char_table (c_function, function, table, subtable, arg, depth, indices) |
2638 |
void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); |
void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); |
2639 |
Lisp_Object function, subtable, arg, *indices; |
Lisp_Object function, table, subtable, arg, *indices; |
2640 |
int depth; |
int depth; |
2641 |
{ |
{ |
2642 |
int i, to; |
int i, to; |
2646 |
/* At first, handle ASCII and 8-bit European characters. */ |
/* At first, handle ASCII and 8-bit European characters. */ |
2647 |
for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++) |
for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++) |
2648 |
{ |
{ |
2649 |
Lisp_Object elt = XCHAR_TABLE (subtable)->contents[i]; |
Lisp_Object elt= XCHAR_TABLE (subtable)->contents[i]; |
2650 |
|
if (NILP (elt)) |
2651 |
|
elt = XCHAR_TABLE (subtable)->defalt; |
2652 |
|
if (NILP (elt)) |
2653 |
|
elt = Faref (subtable, make_number (i)); |
2654 |
if (c_function) |
if (c_function) |
2655 |
(*c_function) (arg, make_number (i), elt); |
(*c_function) (arg, make_number (i), elt); |
2656 |
else |
else |
2691 |
{ |
{ |
2692 |
if (depth >= 3) |
if (depth >= 3) |
2693 |
error ("Too deep char table"); |
error ("Too deep char table"); |
2694 |
map_char_table (c_function, function, elt, arg, depth + 1, indices); |
map_char_table (c_function, function, table, elt, arg, depth + 1, indices); |
2695 |
} |
} |
2696 |
else |
else |
2697 |
{ |
{ |
2699 |
|
|
2700 |
if (NILP (elt)) |
if (NILP (elt)) |
2701 |
elt = XCHAR_TABLE (subtable)->defalt; |
elt = XCHAR_TABLE (subtable)->defalt; |
2702 |
|
if (NILP (elt)) |
2703 |
|
elt = Faref (table, make_number (i)); |
2704 |
c1 = depth >= 1 ? XFASTINT (indices[1]) : 0; |
c1 = depth >= 1 ? XFASTINT (indices[1]) : 0; |
2705 |
c2 = depth >= 2 ? XFASTINT (indices[2]) : 0; |
c2 = depth >= 2 ? XFASTINT (indices[2]) : 0; |
2706 |
c = MAKE_CHAR (charset, c1, c2); |
c = MAKE_CHAR (charset, c1, c2); |
2737 |
be passed to map_char_table because it returns a Lisp_Object rather |
be passed to map_char_table because it returns a Lisp_Object rather |
2738 |
than returning nothing. |
than returning nothing. |
2739 |
Casting leads to crashes on some architectures. -stef */ |
Casting leads to crashes on some architectures. -stef */ |
2740 |
map_char_table (void_call2, Qnil, char_table, function, 0, indices); |
map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices); |
2741 |
return Qnil; |
return Qnil; |
2742 |
} |
} |
2743 |
|
|