(put_char_id_table): Use `put_char_table'.
[chise/xemacs-chise.git] / src / chartab.c
index 865a38c..8260714 100644 (file)
@@ -254,7 +254,6 @@ uint8_byte_table_same_value_p (Lisp_Object obj)
 
 static int
 map_over_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Emchar ofs, int place,
-                          Lisp_Object ccs,
                           int (*fn) (struct chartab_range *range,
                                      Lisp_Object val, void *arg),
                           void *arg)
@@ -274,11 +273,8 @@ map_over_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Emchar ofs, int place,
          c1 = c + unit;
          for (; c < c1 && retval == 0; c++)
            {
-             if ( NILP (ccs) || charset_code_point (ccs, c) >= 0 )
-               {
-                 rainj.ch = c;
-                 retval = (fn) (&rainj, UINT8_DECODE (ct->property[i]), arg);
-               }
+             rainj.ch = c;
+             retval = (fn) (&rainj, UINT8_DECODE (ct->property[i]), arg);
            }
        }
       else
@@ -501,7 +497,6 @@ uint16_byte_table_same_value_p (Lisp_Object obj)
 
 static int
 map_over_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Emchar ofs, int place,
-                           Lisp_Object ccs,
                            int (*fn) (struct chartab_range *range,
                                       Lisp_Object val, void *arg),
                            void *arg)
@@ -521,12 +516,8 @@ map_over_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Emchar ofs, int place,
          c1 = c + unit;
          for (; c < c1 && retval == 0; c++)
            {
-             if ( NILP (ccs) || charset_code_point (ccs, c) >= 0 )
-               {
-                 rainj.ch = c;
-                 retval = (fn) (&rainj, UINT16_DECODE (ct->property[i]),
-                                arg);
-               }
+             rainj.ch = c;
+             retval = (fn) (&rainj, UINT16_DECODE (ct->property[i]), arg);
            }
        }
       else
@@ -683,7 +674,6 @@ byte_table_same_value_p (Lisp_Object obj)
 
 static int
 map_over_byte_table (Lisp_Byte_Table *ct, Emchar ofs, int place,
-                    Lisp_Object ccs,
                     int (*fn) (struct chartab_range *range,
                                Lisp_Object val, void *arg),
                     void *arg)
@@ -700,20 +690,20 @@ map_over_byte_table (Lisp_Byte_Table *ct, Emchar ofs, int place,
        {
          retval
            = map_over_uint8_byte_table (XUINT8_BYTE_TABLE(v),
-                                        c, place - 1, ccs, fn, arg);
+                                        c, place - 1, fn, arg);
          c += unit;
        }
       else if (UINT16_BYTE_TABLE_P (v))
        {
          retval
            = map_over_uint16_byte_table (XUINT16_BYTE_TABLE(v),
-                                         c, place - 1, ccs, fn, arg);
+                                         c, place - 1, fn, arg);
          c += unit;
        }
       else if (BYTE_TABLE_P (v))
        {
          retval = map_over_byte_table (XBYTE_TABLE(v),
-                                       c, place - 1, ccs, fn, arg);
+                                       c, place - 1, fn, arg);
          c += unit;
        }
       else if (!UNBOUNDP (v))
@@ -725,11 +715,8 @@ map_over_byte_table (Lisp_Byte_Table *ct, Emchar ofs, int place,
 
          for (; c < c1 && retval == 0; c++)
            {
-             if ( NILP (ccs) || charset_code_point (ccs, c) >= 0 )
-               {
-                 rainj.ch = c;
-                 retval = (fn) (&rainj, v, arg);
-               }
+             rainj.ch = c;
+             retval = (fn) (&rainj, v, arg);
            }
        }
       else
@@ -879,93 +866,7 @@ put_char_id_table (Lisp_Char_Table* cit,
   struct chartab_range range;
 
   decode_char_table_range (character, &range);
-  switch (range.type)
-    {
-    case CHARTAB_RANGE_ALL:
-      cit->table = value;
-      break;
-    case CHARTAB_RANGE_DEFAULT:
-      cit->default_value = value;
-      break;
-    case CHARTAB_RANGE_CHARSET:
-      {
-       Emchar c;
-       Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (range.charset);
-
-       if ( CHAR_TABLEP (encoding_table) )
-         {
-           for (c = 0; c < 1 << 24; c++)
-             {
-               if ( INTP (get_char_id_table (XCHAR_TABLE(encoding_table),
-                                             c)) )
-                 put_char_id_table_0 (cit, c, value);
-             }
-         }
-       else
-         {
-           for (c = 0; c < 1 << 24; c++)
-             {
-               if ( charset_code_point (range.charset, c) >= 0 )
-                 put_char_id_table_0 (cit, c, value);
-             }
-         }
-      }
-      break;
-    case CHARTAB_RANGE_ROW:
-      {
-       int cell_min, cell_max, i;
-
-       if (XCHARSET_DIMENSION (range.charset) < 2)
-         signal_simple_error ("Charset in row vector must be multi-byte",
-                              range.charset);
-       else
-         {
-           switch (XCHARSET_CHARS (range.charset))
-             {
-             case 94:
-               cell_min = 33; cell_max = 126;
-               break;
-             case 96:
-               cell_min = 32; cell_max = 127;
-               break;
-             case 128:
-               cell_min = 0; cell_max = 127;
-               break;
-             case 256:
-               cell_min = 0; cell_max = 255;
-               break;
-             default:
-               abort ();
-             }
-         }
-       if (XCHARSET_DIMENSION (range.charset) == 2)
-         check_int_range (range.row, cell_min, cell_max);
-       else if (XCHARSET_DIMENSION (range.charset) == 3)
-         {
-           check_int_range (range.row >> 8  , cell_min, cell_max);
-           check_int_range (range.row & 0xFF, cell_min, cell_max);
-         }
-       else if (XCHARSET_DIMENSION (range.charset) == 4)
-         {
-           check_int_range ( range.row >> 16       , cell_min, cell_max);
-           check_int_range ((range.row >> 8) & 0xFF, cell_min, cell_max);
-           check_int_range ( range.row       & 0xFF, cell_min, cell_max);
-         }
-       else
-         abort ();
-
-       for (i = cell_min; i <= cell_max; i++)
-         {
-           Emchar ch = DECODE_CHAR (range.charset, (range.row << 8) | i);
-           if ( charset_code_point (range.charset, ch) >= 0 )
-             put_char_id_table_0 (cit, ch, value);
-         }
-      }
-      break;
-    case CHARTAB_RANGE_CHAR:
-      put_char_id_table_0 (cit, range.ch, value);
-      break;
-    }
+  put_char_table (cit, &range, value);
 }
 
 
@@ -2639,14 +2540,14 @@ map_char_table (Lisp_Char_Table *ct,
            return retval;
        }
       if (UINT8_BYTE_TABLE_P (ct->table))
-       return map_over_uint8_byte_table (XUINT8_BYTE_TABLE(ct->table), 0, 3,
-                                         Qnil, fn, arg);
+       return map_over_uint8_byte_table (XUINT8_BYTE_TABLE(ct->table),
+                                         0, 3, fn, arg);
       else if (UINT16_BYTE_TABLE_P (ct->table))
-       return map_over_uint16_byte_table (XUINT16_BYTE_TABLE(ct->table), 0, 3,
-                                          Qnil, fn, arg);
+       return map_over_uint16_byte_table (XUINT16_BYTE_TABLE(ct->table),
+                                          0, 3, fn, arg);
       else if (BYTE_TABLE_P (ct->table))
-       return map_over_byte_table (XBYTE_TABLE(ct->table), 0, 3,
-                                   Qnil, fn, arg);
+       return map_over_byte_table (XBYTE_TABLE(ct->table),
+                                   0, 3, fn, arg);
       else if (!UNBOUNDP (ct->table))
 #if 0
        {