comparison src/chartab.c @ 110:fe104dbd9147 r20-1b7

Import from CVS: tag r20-1b7
author cvs
date Mon, 13 Aug 2007 09:19:45 +0200
parents cf808b4c4290
children bfd6434d15b3
comparison
equal deleted inserted replaced
109:e183fc049578 110:fe104dbd9147
1645 obj = wrong_type_argument (Qcategory_table_p, obj); 1645 obj = wrong_type_argument (Qcategory_table_p, obj);
1646 return (obj); 1646 return (obj);
1647 } 1647 }
1648 1648
1649 int 1649 int
1650 check_category_at(Emchar ch, Lisp_Object table, 1650 check_category_char(Emchar ch, Lisp_Object table,
1651 unsigned int designator, unsigned int not) 1651 unsigned int designator, unsigned int not)
1652 { 1652 {
1653 register Lisp_Object temp; 1653 register Lisp_Object temp;
1654 struct Lisp_Char_Table *ctbl; 1654 struct Lisp_Char_Table *ctbl;
1655 #if 1 /* ifdef ERROR_CHECK_TYPECHECK */ 1655 #ifdef ERROR_CHECK_TYPECHECK
1656 if (NILP (Fcategory_table_p (table))) 1656 if (NILP (Fcategory_table_p (table)))
1657 signal_simple_error("Expected category table", table); 1657 signal_simple_error("Expected category table", table);
1658 #endif 1658 #endif
1659 ctbl = XCHAR_TABLE(table); 1659 ctbl = XCHAR_TABLE(table);
1660 temp = get_char_table(ch, ctbl); 1660 temp = get_char_table(ch, ctbl);
1663 designator -= ' '; 1663 designator -= ' ';
1664 return (bit_vector_bit(XBIT_VECTOR (temp), designator) ? !not : not); 1664 return (bit_vector_bit(XBIT_VECTOR (temp), designator) ? !not : not);
1665 } 1665 }
1666 1666
1667 DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /* 1667 DEFUN ("check-category-at", Fcheck_category_at, 2, 4, 0, /*
1668 Return t if category of a character at POS includes DESIGNATIOR, 1668 Return t if category of a character at POS includes DESIGNATOR,
1669 else return nil. Optional third arg specifies which buffer 1669 else return nil. Optional third arg specifies which buffer
1670 (defaulting to current), and fourth specifies the CATEGORY-TABLE, 1670 (defaulting to current), and fourth specifies the CATEGORY-TABLE,
1671 (defaulting to the buffer's category table). 1671 (defaulting to the buffer's category table).
1672 */ 1672 */
1673 (pos, designator, buffer, category_table)) 1673 (pos, designator, buffer, category_table))
1680 CHECK_INT (pos); 1680 CHECK_INT (pos);
1681 CHECK_CATEGORY_DESIGNATOR (designator); 1681 CHECK_CATEGORY_DESIGNATOR (designator);
1682 des = XREALINT(designator); 1682 des = XREALINT(designator);
1683 ctbl = check_category_table (category_table, Vstandard_category_table); 1683 ctbl = check_category_table (category_table, Vstandard_category_table);
1684 ch = BUF_FETCH_CHAR (buf, XINT(pos)); 1684 ch = BUF_FETCH_CHAR (buf, XINT(pos));
1685 return (check_category_at(ch, ctbl, des, 0) 1685 return (check_category_char(ch, ctbl, des, 0)
1686 ? Qt : Qnil);
1687 }
1688
1689 DEFUN ("char-in-category-p", Fchar_in_category_p, 2, 3, 0, /*
1690 Return t if category of character CHR includes DESIGNATOR, else
1691 return nil. Optional third arg specifies the CATEGORY-TABLE to use,
1692
1693 which defaults to the system default table.
1694 */
1695 (chr, designator, category_table))
1696 {
1697 Lisp_Object ctbl;
1698 Emchar ch;
1699 unsigned int des;
1700
1701 CHECK_CATEGORY_DESIGNATOR (designator);
1702 des = XREALINT(designator);
1703 CHECK_CHAR(chr);
1704 ch = XCHAR(chr);
1705 ctbl = check_category_table (category_table, Vstandard_category_table);
1706 return (check_category_char(ch, ctbl, des, 0)
1686 ? Qt : Qnil); 1707 ? Qt : Qnil);
1687 } 1708 }
1688 1709
1689 DEFUN ("category-table", Fcategory_table, 0, 1, 0, /* 1710 DEFUN ("category-table", Fcategory_table, 0, 1, 0, /*
1690 Return the current category table. 1711 Return the current category table.
1788 DEFSUBR (Fcategory_table); 1809 DEFSUBR (Fcategory_table);
1789 DEFSUBR (Fstandard_category_table); 1810 DEFSUBR (Fstandard_category_table);
1790 DEFSUBR (Fcopy_category_table); 1811 DEFSUBR (Fcopy_category_table);
1791 DEFSUBR (Fset_category_table); 1812 DEFSUBR (Fset_category_table);
1792 DEFSUBR (Fcheck_category_at); 1813 DEFSUBR (Fcheck_category_at);
1814 DEFSUBR (Fchar_in_category_p);
1793 DEFSUBR (Fcategory_designator_p); 1815 DEFSUBR (Fcategory_designator_p);
1794 DEFSUBR (Fcategory_table_value_p); 1816 DEFSUBR (Fcategory_table_value_p);
1795 #endif /* MULE */ 1817 #endif /* MULE */
1796 1818
1797 /* DO NOT staticpro this. It works just like Vweak_hash_tables. */ 1819 /* DO NOT staticpro this. It works just like Vweak_hash_tables. */