comparison src/charset.c @ 88927:cd7645c9842b

Remove `emacs' conditional. Doc fixes. (map_char_table_for_charset): Declare.
author Dave Love <fx@gnu.org>
date Tue, 30 Jul 2002 11:33:15 +0000
parents 7702a9d9edff
children 1ff7f42f40ad
comparison
equal deleted inserted replaced
88926:f026b7e4fc61 88927:cd7645c9842b
21 You should have received a copy of the GNU General Public License 21 You should have received a copy of the GNU General Public License
22 along with GNU Emacs; see the file COPYING. If not, write to 22 along with GNU Emacs; see the file COPYING. If not, write to
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. */ 24 Boston, MA 02111-1307, USA. */
25 25
26 #ifdef emacs
27 #include <config.h> 26 #include <config.h>
28 #endif
29 27
30 #include <stdio.h> 28 #include <stdio.h>
31 #include <unistd.h> 29 #include <unistd.h>
32 #include <ctype.h> 30 #include <ctype.h>
33
34 #ifdef emacs
35
36 #include <sys/types.h> 31 #include <sys/types.h>
37 #include "lisp.h" 32 #include "lisp.h"
38 #include "character.h" 33 #include "character.h"
39 #include "charset.h" 34 #include "charset.h"
40 #include "coding.h" 35 #include "coding.h"
41 #include "disptab.h" 36 #include "disptab.h"
42 #include "buffer.h" 37 #include "buffer.h"
43 38
44 #else /* not emacs */
45
46 #include "mulelib.h"
47
48 #endif /* emacs */
49
50
51 /*** GENERAL NOTES on CODED CHARACTER SETS (CHARSETS) *** 39 /*** GENERAL NOTES on CODED CHARACTER SETS (CHARSETS) ***
52 40
53 A coded character set ("charset" hereafter) is a meaningful 41 A coded character set ("charset" hereafter) is a meaningful
54 collection (i.e. language, culture, functionality, etc.) of 42 collection (i.e. language, culture, functionality, etc.) of
55 characters. Emacs handles multiple charsets at once. In Emacs Lisp 43 characters. Emacs handles multiple charsets at once. In Emacs Lisp
106 94
107 /* List of charsets ordered by the priority. */ 95 /* List of charsets ordered by the priority. */
108 Lisp_Object Vcharset_ordered_list; 96 Lisp_Object Vcharset_ordered_list;
109 97
110 /* Incremented everytime we change Vcharset_ordered_list. This is 98 /* Incremented everytime we change Vcharset_ordered_list. This is
111 unsigned short so that it fits in Lisp_Int and never match with 99 unsigned short so that it fits in Lisp_Int and never matches
112 -1. */ 100 -1. */
113 unsigned short charset_ordered_list_tick; 101 unsigned short charset_ordered_list_tick;
114 102
115 /* List of iso-2022 charsets. */ 103 /* List of iso-2022 charsets. */
116 Lisp_Object Viso_2022_charset_list; 104 Lisp_Object Viso_2022_charset_list;
125 int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; 113 int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
126 114
127 Lisp_Object Vcharset_map_directory; 115 Lisp_Object Vcharset_map_directory;
128 116
129 Lisp_Object Vchar_unified_charset_table; 117 Lisp_Object Vchar_unified_charset_table;
118
119 /* Defined in chartab.c */
120 extern void
121 map_char_table_for_charset P_ ((void (*c_function) (Lisp_Object, Lisp_Object),
122 Lisp_Object function, Lisp_Object table,
123 Lisp_Object arg, struct charset *charset,
124 unsigned from, unsigned to));
130 125
131 #define CODE_POINT_TO_INDEX(charset, code) \ 126 #define CODE_POINT_TO_INDEX(charset, code) \
132 ((charset)->code_linear_p \ 127 ((charset)->code_linear_p \
133 ? (code) - (charset)->min_code \ 128 ? (code) - (charset)->min_code \
134 : (((charset)->code_space_mask[(code) >> 24] & 0x8) \ 129 : (((charset)->code_space_mask[(code) >> 24] & 0x8) \
1138 DEFUN ("unify-charset", Funify_charset, Sunify_charset, 1, 3, 0, 1133 DEFUN ("unify-charset", Funify_charset, Sunify_charset, 1, 3, 0,
1139 doc: /* Unify characters of CHARSET with Unicode. 1134 doc: /* Unify characters of CHARSET with Unicode.
1140 This means reading the relevant file and installing the table defined 1135 This means reading the relevant file and installing the table defined
1141 by CHARSET's `:unify-map' property. 1136 by CHARSET's `:unify-map' property.
1142 1137
1143 Optional second arg UNIFY-MAP a file name string or vector that has 1138 Optional second arg UNIFY-MAP is a file name string or a vector. It has
1144 the same meaning of the `:unify-map' attribute of the function 1139 the same meaning as the `:unify-map' attribute in the function
1145 `define-charset' (which see). 1140 `define-charset' (which see).
1146 1141
1147 Optional third argument DEUNIFY, if non-nil, means to de-unify CHARSET. */) 1142 Optional third argument DEUNIFY, if non-nil, means to de-unify CHARSET. */)
1148 (charset, unify_map, deunify) 1143 (charset, unify_map, deunify)
1149 Lisp_Object charset, unify_map, deunify; 1144 Lisp_Object charset, unify_map, deunify;
1279 charset = CHARSET_FROM_ID (charset_iso_8859_1); 1274 charset = CHARSET_FROM_ID (charset_iso_8859_1);
1280 while (p < endp) 1275 while (p < endp)
1281 { 1276 {
1282 int c = STRING_CHAR_ADVANCE (p); 1277 int c = STRING_CHAR_ADVANCE (p);
1283 1278
1279 /* Fixme: comparison of unsigned expression < 0 is always false */
1284 if (ENCODE_CHAR (charset, c) < 0) 1280 if (ENCODE_CHAR (charset, c) < 0)
1285 return 2; 1281 return 2;
1286 } 1282 }
1287 return 1; 1283 return 1;
1288 } 1284 }