comparison src/chartab.c @ 867:804517e16990

[xemacs-hg @ 2002-06-05 09:54:39 by ben] Textual renaming: text/char names abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, callint.c, casefiddle.c, casetab.c, charset.h, chartab.c, chartab.h, cmds.c, console-gtk.h, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console-x.h, console.h, data.c, device-msw.c, device-x.c, dialog-msw.c, dired-msw.c, dired.c, doc.c, doprnt.c, editfns.c, eldap.c, emodules.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-unixoid.c, events.c, events.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, font-lock.c, frame-gtk.c, frame-msw.c, frame-x.c, frame.c, glyphs-eimage.c, glyphs-msw.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-x.c, gui-x.h, gui.c, gui.h, hpplay.c, indent.c, insdel.c, insdel.h, intl-win32.c, keymap.c, line-number.c, line-number.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, md5.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-ccl.c, mule-charset.c, mule-coding.c, mule-wnnfns.c, ndir.h, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, procimpl.h, realpath.c, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, redisplay.h, regex.c, search.c, select-common.h, select-gtk.c, select-x.c, sound.h, symbols.c, syntax.c, syntax.h, sysdep.c, sysdep.h, sysdir.h, sysfile.h, sysproc.h, syspwd.h, systime.h, syswindows.h, termcap.c, tests.c, text.c, text.h, toolbar-common.c, tooltalk.c, ui-gtk.c, unexnt.c, unicode.c, win32.c: Text/char naming rationalization. [a] distinguish between "charptr" when it refers to operations on the pointer itself and when it refers to operations on text; and [b] use consistent naming for everything referring to internal format, i.e. Itext == text in internal format Ibyte == a byte in such text Ichar == a char as represented in internal character format thus e.g. set_charptr_emchar -> set_itext_ichar The pre and post tags on either side of this change are: pre-internal-format-textual-renaming post-internal-format-textual-renaming See the Internals Manual for details of exactly how this was done, how to handle the change in your workspace, etc.
author ben
date Wed, 05 Jun 2002 09:58:45 +0000
parents 2b6fa2618f76
children c925bacdda60
comparison
equal deleted inserted replaced
866:613552a02607 867:804517e16990
689 #ifdef MULE 689 #ifdef MULE
690 690
691 /* called from get_char_table(). */ 691 /* called from get_char_table(). */
692 Lisp_Object 692 Lisp_Object
693 get_non_ascii_char_table_value (Lisp_Char_Table *ct, int leading_byte, 693 get_non_ascii_char_table_value (Lisp_Char_Table *ct, int leading_byte,
694 Emchar c) 694 Ichar c)
695 { 695 {
696 Lisp_Object val; 696 Lisp_Object val;
697 Lisp_Object charset = charset_by_leading_byte (leading_byte); 697 Lisp_Object charset = charset_by_leading_byte (leading_byte);
698 int byte1, byte2; 698 int byte1, byte2;
699 699
700 BREAKUP_EMCHAR_1_UNSAFE (c, charset, byte1, byte2); 700 BREAKUP_ICHAR_1_UNSAFE (c, charset, byte1, byte2);
701 val = ct->level1[leading_byte - MIN_LEADING_BYTE]; 701 val = ct->level1[leading_byte - MIN_LEADING_BYTE];
702 if (CHAR_TABLE_ENTRYP (val)) 702 if (CHAR_TABLE_ENTRYP (val))
703 { 703 {
704 Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val); 704 Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
705 val = cte->level2[byte1 - 32]; 705 val = cte->level2[byte1 - 32];
1024 #ifdef MULE 1024 #ifdef MULE
1025 { 1025 {
1026 Lisp_Object charset; 1026 Lisp_Object charset;
1027 int byte1, byte2; 1027 int byte1, byte2;
1028 1028
1029 BREAKUP_EMCHAR (range->ch, charset, byte1, byte2); 1029 BREAKUP_ICHAR (range->ch, charset, byte1, byte2);
1030 if (EQ (charset, Vcharset_ascii)) 1030 if (EQ (charset, Vcharset_ascii))
1031 ct->ascii[byte1] = val; 1031 ct->ascii[byte1] = val;
1032 else if (EQ (charset, Vcharset_control_1)) 1032 else if (EQ (charset, Vcharset_control_1))
1033 ct->ascii[byte1 + 128] = val; 1033 ct->ascii[byte1 + 128] = val;
1034 else 1034 else
1135 1135
1136 rainj.type = CHARTAB_RANGE_CHAR; 1136 rainj.type = CHARTAB_RANGE_CHAR;
1137 1137
1138 for (i = start, retval = 0; i <= stop && retval == 0; i++) 1138 for (i = start, retval = 0; i <= stop && retval == 0; i++)
1139 { 1139 {
1140 rainj.ch = (Emchar) i; 1140 rainj.ch = (Ichar) i;
1141 if (!UNBOUNDP (ct->ascii[i])) 1141 if (!UNBOUNDP (ct->ascii[i]))
1142 retval = (fn) (&rainj, wrap_char_table (ct), ct->ascii[i], arg); 1142 retval = (fn) (&rainj, wrap_char_table (ct), ct->ascii[i], arg);
1143 } 1143 }
1144 1144
1145 return retval; 1145 return retval;
1216 1216
1217 rainj.type = CHARTAB_RANGE_CHAR; 1217 rainj.type = CHARTAB_RANGE_CHAR;
1218 1218
1219 for (i = start, retval = 0; i <= stop && retval == 0; i++) 1219 for (i = start, retval = 0; i <= stop && retval == 0; i++)
1220 { 1220 {
1221 rainj.ch = make_emchar (charset, row, i); 1221 rainj.ch = make_ichar (charset, row, i);
1222 if (!UNBOUNDP (cte->level2[i - 32])) 1222 if (!UNBOUNDP (cte->level2[i - 32]))
1223 retval = (fn) (&rainj, wrap_char_table (ct), cte->level2[i - 32], 1223 retval = (fn) (&rainj, wrap_char_table (ct), cte->level2[i - 32],
1224 arg); 1224 arg);
1225 } 1225 }
1226 return retval; 1226 return retval;
1264 struct chartab_range rainj; 1264 struct chartab_range rainj;
1265 rainj.type = CHARTAB_RANGE_CHAR; 1265 rainj.type = CHARTAB_RANGE_CHAR;
1266 1266
1267 for (i = start, retval = 0; i <= stop && retval == 0; i++) 1267 for (i = start, retval = 0; i <= stop && retval == 0; i++)
1268 { 1268 {
1269 rainj.ch = make_emchar (charset, i, 0); 1269 rainj.ch = make_ichar (charset, i, 0);
1270 if (!UNBOUNDP (cte->level2[i - 32])) 1270 if (!UNBOUNDP (cte->level2[i - 32]))
1271 retval = (fn) (&rainj, wrap_char_table (ct), cte->level2[i - 32], 1271 retval = (fn) (&rainj, wrap_char_table (ct), cte->level2[i - 32],
1272 arg); 1272 arg);
1273 } 1273 }
1274 } 1274 }
1356 } 1356 }
1357 #endif /* MULE */ 1357 #endif /* MULE */
1358 1358
1359 case CHARTAB_RANGE_CHAR: 1359 case CHARTAB_RANGE_CHAR:
1360 { 1360 {
1361 Emchar ch = range->ch; 1361 Ichar ch = range->ch;
1362 Lisp_Object val = get_char_table (ch, table); 1362 Lisp_Object val = get_char_table (ch, table);
1363 struct chartab_range rainj; 1363 struct chartab_range rainj;
1364 1364
1365 if (!UNBOUNDP (val)) 1365 if (!UNBOUNDP (val))
1366 { 1366 {
1503 data = Fcdr (Fcdr (data)); 1503 data = Fcdr (Fcdr (data));
1504 if (CONSP (range)) 1504 if (CONSP (range))
1505 { 1505 {
1506 if (CHAR_OR_CHAR_INTP (XCAR (range))) 1506 if (CHAR_OR_CHAR_INTP (XCAR (range)))
1507 { 1507 {
1508 Emchar first = XCHAR_OR_CHAR_INT (Fcar (range)); 1508 Ichar first = XCHAR_OR_CHAR_INT (Fcar (range));
1509 Emchar last = XCHAR_OR_CHAR_INT (Fcar (Fcdr (range))); 1509 Ichar last = XCHAR_OR_CHAR_INT (Fcar (Fcdr (range)));
1510 Emchar i; 1510 Ichar i;
1511 1511
1512 for (i = first; i <= last; i++) 1512 for (i = first; i <= last; i++)
1513 Fput_char_table (make_char (i), val, chartab); 1513 Fput_char_table (make_char (i), val, chartab);
1514 } 1514 }
1515 else 1515 else
1569 object = wrong_type_argument (Qcategory_table_p, object); 1569 object = wrong_type_argument (Qcategory_table_p, object);
1570 return object; 1570 return object;
1571 } 1571 }
1572 1572
1573 int 1573 int
1574 check_category_char (Emchar ch, Lisp_Object table, 1574 check_category_char (Ichar ch, Lisp_Object table,
1575 int designator, int not_p) 1575 int designator, int not_p)
1576 { 1576 {
1577 REGISTER Lisp_Object temp; 1577 REGISTER Lisp_Object temp;
1578 if (NILP (Fcategory_table_p (table))) 1578 if (NILP (Fcategory_table_p (table)))
1579 wtaerror ("Expected category table", table); 1579 wtaerror ("Expected category table", table);
1593 use, and defaults to BUFFER's category table. 1593 use, and defaults to BUFFER's category table.
1594 */ 1594 */
1595 (position, designator, buffer, category_table)) 1595 (position, designator, buffer, category_table))
1596 { 1596 {
1597 Lisp_Object ctbl; 1597 Lisp_Object ctbl;
1598 Emchar ch; 1598 Ichar ch;
1599 int des; 1599 int des;
1600 struct buffer *buf = decode_buffer (buffer, 0); 1600 struct buffer *buf = decode_buffer (buffer, 0);
1601 1601
1602 CHECK_INT (position); 1602 CHECK_INT (position);
1603 CHECK_CATEGORY_DESIGNATOR (designator); 1603 CHECK_CATEGORY_DESIGNATOR (designator);
1613 and defaults to the current buffer's category table. 1613 and defaults to the current buffer's category table.
1614 */ 1614 */
1615 (character, designator, category_table)) 1615 (character, designator, category_table))
1616 { 1616 {
1617 Lisp_Object ctbl; 1617 Lisp_Object ctbl;
1618 Emchar ch; 1618 Ichar ch;
1619 int des; 1619 int des;
1620 1620
1621 CHECK_CATEGORY_DESIGNATOR (designator); 1621 CHECK_CATEGORY_DESIGNATOR (designator);
1622 des = XCHAR (designator); 1622 des = XCHAR (designator);
1623 CHECK_CHAR (character); 1623 CHECK_CHAR (character);
1704 characters C1 and C2 if they appear in this order, else return 0. 1704 characters C1 and C2 if they appear in this order, else return 0.
1705 Use the macro WORD_BOUNDARY_P instead of calling this function 1705 Use the macro WORD_BOUNDARY_P instead of calling this function
1706 directly. */ 1706 directly. */
1707 1707
1708 int 1708 int
1709 word_boundary_p (Emchar c1, Emchar c2) 1709 word_boundary_p (Ichar c1, Ichar c2)
1710 { 1710 {
1711 Lisp_Object category_set1, category_set2; 1711 Lisp_Object category_set1, category_set2;
1712 Lisp_Object tail; 1712 Lisp_Object tail;
1713 int default_result; 1713 int default_result;
1714 1714
1717 c1 = cmpchar_component (c1, 0, 1); 1717 c1 = cmpchar_component (c1, 0, 1);
1718 if (COMPOSITE_CHAR_P (c2)) 1718 if (COMPOSITE_CHAR_P (c2))
1719 c2 = cmpchar_component (c2, 0, 1); 1719 c2 = cmpchar_component (c2, 0, 1);
1720 #endif 1720 #endif
1721 1721
1722 if (EQ (emchar_charset (c1), emchar_charset (c2))) 1722 if (EQ (ichar_charset (c1), ichar_charset (c2)))
1723 { 1723 {
1724 tail = Vword_separating_categories; 1724 tail = Vword_separating_categories;
1725 default_result = 0; 1725 default_result = 0;
1726 } 1726 }
1727 else 1727 else