Mercurial > emacs
comparison src/fns.c @ 40656:cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
| author | Pavel Jan?k <Pavel@Janik.cz> |
|---|---|
| date | Fri, 02 Nov 2001 20:46:55 +0000 |
| parents | 56075abda301 |
| children | 95dd892ad5e3 |
comparison
equal
deleted
inserted
replaced
| 40655:45453187feeb | 40656:cdfd4d09b79a |
|---|---|
| 205 doc: /* Return the number of bytes in STRING. | 205 doc: /* Return the number of bytes in STRING. |
| 206 If STRING is a multibyte string, this is greater than the length of STRING. */) | 206 If STRING is a multibyte string, this is greater than the length of STRING. */) |
| 207 (string) | 207 (string) |
| 208 Lisp_Object string; | 208 Lisp_Object string; |
| 209 { | 209 { |
| 210 CHECK_STRING (string, 1); | 210 CHECK_STRING (string); |
| 211 return make_number (STRING_BYTES (XSTRING (string))); | 211 return make_number (STRING_BYTES (XSTRING (string))); |
| 212 } | 212 } |
| 213 | 213 |
| 214 DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, | 214 DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, |
| 215 doc: /* Return t if two strings have identical contents. | 215 doc: /* Return t if two strings have identical contents. |
| 220 { | 220 { |
| 221 if (SYMBOLP (s1)) | 221 if (SYMBOLP (s1)) |
| 222 XSETSTRING (s1, XSYMBOL (s1)->name); | 222 XSETSTRING (s1, XSYMBOL (s1)->name); |
| 223 if (SYMBOLP (s2)) | 223 if (SYMBOLP (s2)) |
| 224 XSETSTRING (s2, XSYMBOL (s2)->name); | 224 XSETSTRING (s2, XSYMBOL (s2)->name); |
| 225 CHECK_STRING (s1, 0); | 225 CHECK_STRING (s1); |
| 226 CHECK_STRING (s2, 1); | 226 CHECK_STRING (s2); |
| 227 | 227 |
| 228 if (XSTRING (s1)->size != XSTRING (s2)->size | 228 if (XSTRING (s1)->size != XSTRING (s2)->size |
| 229 || STRING_BYTES (XSTRING (s1)) != STRING_BYTES (XSTRING (s2)) | 229 || STRING_BYTES (XSTRING (s1)) != STRING_BYTES (XSTRING (s2)) |
| 230 || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, STRING_BYTES (XSTRING (s1)))) | 230 || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, STRING_BYTES (XSTRING (s1)))) |
| 231 return Qnil; | 231 return Qnil; |
| 251 Lisp_Object str1, start1, end1, start2, str2, end2, ignore_case; | 251 Lisp_Object str1, start1, end1, start2, str2, end2, ignore_case; |
| 252 { | 252 { |
| 253 register int end1_char, end2_char; | 253 register int end1_char, end2_char; |
| 254 register int i1, i1_byte, i2, i2_byte; | 254 register int i1, i1_byte, i2, i2_byte; |
| 255 | 255 |
| 256 CHECK_STRING (str1, 0); | 256 CHECK_STRING (str1); |
| 257 CHECK_STRING (str2, 1); | 257 CHECK_STRING (str2); |
| 258 if (NILP (start1)) | 258 if (NILP (start1)) |
| 259 start1 = make_number (0); | 259 start1 = make_number (0); |
| 260 if (NILP (start2)) | 260 if (NILP (start2)) |
| 261 start2 = make_number (0); | 261 start2 = make_number (0); |
| 262 CHECK_NATNUM (start1, 2); | 262 CHECK_NATNUM (start1); |
| 263 CHECK_NATNUM (start2, 3); | 263 CHECK_NATNUM (start2); |
| 264 if (! NILP (end1)) | 264 if (! NILP (end1)) |
| 265 CHECK_NATNUM (end1, 4); | 265 CHECK_NATNUM (end1); |
| 266 if (! NILP (end2)) | 266 if (! NILP (end2)) |
| 267 CHECK_NATNUM (end2, 4); | 267 CHECK_NATNUM (end2); |
| 268 | 268 |
| 269 i1 = XINT (start1); | 269 i1 = XINT (start1); |
| 270 i2 = XINT (start2); | 270 i2 = XINT (start2); |
| 271 | 271 |
| 272 i1_byte = string_char_to_byte (str1, i1); | 272 i1_byte = string_char_to_byte (str1, i1); |
| 347 | 347 |
| 348 if (SYMBOLP (s1)) | 348 if (SYMBOLP (s1)) |
| 349 XSETSTRING (s1, XSYMBOL (s1)->name); | 349 XSETSTRING (s1, XSYMBOL (s1)->name); |
| 350 if (SYMBOLP (s2)) | 350 if (SYMBOLP (s2)) |
| 351 XSETSTRING (s2, XSYMBOL (s2)->name); | 351 XSETSTRING (s2, XSYMBOL (s2)->name); |
| 352 CHECK_STRING (s1, 0); | 352 CHECK_STRING (s1); |
| 353 CHECK_STRING (s2, 1); | 353 CHECK_STRING (s2); |
| 354 | 354 |
| 355 i1 = i1_byte = i2 = i2_byte = 0; | 355 i1 = i1_byte = i2 = i2_byte = 0; |
| 356 | 356 |
| 357 end = XSTRING (s1)->size; | 357 end = XSTRING (s1)->size; |
| 358 if (end > XSTRING (s2)->size) | 358 if (end > XSTRING (s2)->size) |
| 789 } | 789 } |
| 790 else if (VECTORP (val)) | 790 else if (VECTORP (val)) |
| 791 XVECTOR (val)->contents[toindex++] = elt; | 791 XVECTOR (val)->contents[toindex++] = elt; |
| 792 else | 792 else |
| 793 { | 793 { |
| 794 CHECK_NUMBER (elt, 0); | 794 CHECK_NUMBER (elt); |
| 795 if (SINGLE_BYTE_CHAR_P (XINT (elt))) | 795 if (SINGLE_BYTE_CHAR_P (XINT (elt))) |
| 796 { | 796 { |
| 797 if (some_multibyte) | 797 if (some_multibyte) |
| 798 toindex_byte | 798 toindex_byte |
| 799 += CHAR_STRING (XINT (elt), | 799 += CHAR_STRING (XINT (elt), |
| 1059 The function `unibyte-char-to-multibyte' is used to convert | 1059 The function `unibyte-char-to-multibyte' is used to convert |
| 1060 each unibyte character to a multibyte character. */) | 1060 each unibyte character to a multibyte character. */) |
| 1061 (string) | 1061 (string) |
| 1062 Lisp_Object string; | 1062 Lisp_Object string; |
| 1063 { | 1063 { |
| 1064 CHECK_STRING (string, 0); | 1064 CHECK_STRING (string); |
| 1065 | 1065 |
| 1066 return string_make_multibyte (string); | 1066 return string_make_multibyte (string); |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 DEFUN ("string-make-unibyte", Fstring_make_unibyte, Sstring_make_unibyte, | 1069 DEFUN ("string-make-unibyte", Fstring_make_unibyte, Sstring_make_unibyte, |
| 1072 Multibyte character codes are converted to unibyte | 1072 Multibyte character codes are converted to unibyte |
| 1073 by using just the low 8 bits. */) | 1073 by using just the low 8 bits. */) |
| 1074 (string) | 1074 (string) |
| 1075 Lisp_Object string; | 1075 Lisp_Object string; |
| 1076 { | 1076 { |
| 1077 CHECK_STRING (string, 0); | 1077 CHECK_STRING (string); |
| 1078 | 1078 |
| 1079 return string_make_unibyte (string); | 1079 return string_make_unibyte (string); |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte, | 1082 DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte, |
| 1088 `eight-bit-control' or `eight-bit-graphic', it is converted to the | 1088 `eight-bit-control' or `eight-bit-graphic', it is converted to the |
| 1089 corresponding single byte. */) | 1089 corresponding single byte. */) |
| 1090 (string) | 1090 (string) |
| 1091 Lisp_Object string; | 1091 Lisp_Object string; |
| 1092 { | 1092 { |
| 1093 CHECK_STRING (string, 0); | 1093 CHECK_STRING (string); |
| 1094 | 1094 |
| 1095 if (STRING_MULTIBYTE (string)) | 1095 if (STRING_MULTIBYTE (string)) |
| 1096 { | 1096 { |
| 1097 int bytes = STRING_BYTES (XSTRING (string)); | 1097 int bytes = STRING_BYTES (XSTRING (string)); |
| 1098 unsigned char *str = (unsigned char *) xmalloc (bytes); | 1098 unsigned char *str = (unsigned char *) xmalloc (bytes); |
| 1114 part of a multibyte form), it is converted to the corresponding | 1114 part of a multibyte form), it is converted to the corresponding |
| 1115 multibyte character of charset `eight-bit-control' or `eight-bit-graphic'. */) | 1115 multibyte character of charset `eight-bit-control' or `eight-bit-graphic'. */) |
| 1116 (string) | 1116 (string) |
| 1117 Lisp_Object string; | 1117 Lisp_Object string; |
| 1118 { | 1118 { |
| 1119 CHECK_STRING (string, 0); | 1119 CHECK_STRING (string); |
| 1120 | 1120 |
| 1121 if (! STRING_MULTIBYTE (string)) | 1121 if (! STRING_MULTIBYTE (string)) |
| 1122 { | 1122 { |
| 1123 Lisp_Object new_string; | 1123 Lisp_Object new_string; |
| 1124 int nchars, nbytes; | 1124 int nchars, nbytes; |
| 1148 (alist) | 1148 (alist) |
| 1149 Lisp_Object alist; | 1149 Lisp_Object alist; |
| 1150 { | 1150 { |
| 1151 register Lisp_Object tem; | 1151 register Lisp_Object tem; |
| 1152 | 1152 |
| 1153 CHECK_LIST (alist, 0); | 1153 CHECK_LIST (alist); |
| 1154 if (NILP (alist)) | 1154 if (NILP (alist)) |
| 1155 return alist; | 1155 return alist; |
| 1156 alist = concat (1, &alist, Lisp_Cons, 0); | 1156 alist = concat (1, &alist, Lisp_Cons, 0); |
| 1157 for (tem = alist; CONSP (tem); tem = XCDR (tem)) | 1157 for (tem = alist; CONSP (tem); tem = XCDR (tem)) |
| 1158 { | 1158 { |
| 1183 int from_byte = 0, to_byte = 0; | 1183 int from_byte = 0, to_byte = 0; |
| 1184 | 1184 |
| 1185 if (! (STRINGP (string) || VECTORP (string))) | 1185 if (! (STRINGP (string) || VECTORP (string))) |
| 1186 wrong_type_argument (Qarrayp, string); | 1186 wrong_type_argument (Qarrayp, string); |
| 1187 | 1187 |
| 1188 CHECK_NUMBER (from, 1); | 1188 CHECK_NUMBER (from); |
| 1189 | 1189 |
| 1190 if (STRINGP (string)) | 1190 if (STRINGP (string)) |
| 1191 { | 1191 { |
| 1192 size = XSTRING (string)->size; | 1192 size = XSTRING (string)->size; |
| 1193 size_byte = STRING_BYTES (XSTRING (string)); | 1193 size_byte = STRING_BYTES (XSTRING (string)); |
| 1200 to_char = size; | 1200 to_char = size; |
| 1201 to_byte = size_byte; | 1201 to_byte = size_byte; |
| 1202 } | 1202 } |
| 1203 else | 1203 else |
| 1204 { | 1204 { |
| 1205 CHECK_NUMBER (to, 2); | 1205 CHECK_NUMBER (to); |
| 1206 | 1206 |
| 1207 to_char = XINT (to); | 1207 to_char = XINT (to); |
| 1208 if (to_char < 0) | 1208 if (to_char < 0) |
| 1209 to_char += size; | 1209 to_char += size; |
| 1210 | 1210 |
| 1283 (n, list) | 1283 (n, list) |
| 1284 Lisp_Object n; | 1284 Lisp_Object n; |
| 1285 register Lisp_Object list; | 1285 register Lisp_Object list; |
| 1286 { | 1286 { |
| 1287 register int i, num; | 1287 register int i, num; |
| 1288 CHECK_NUMBER (n, 0); | 1288 CHECK_NUMBER (n); |
| 1289 num = XINT (n); | 1289 num = XINT (n); |
| 1290 for (i = 0; i < num && !NILP (list); i++) | 1290 for (i = 0; i < num && !NILP (list); i++) |
| 1291 { | 1291 { |
| 1292 QUIT; | 1292 QUIT; |
| 1293 if (! CONSP (list)) | 1293 if (! CONSP (list)) |
| 1309 DEFUN ("elt", Felt, Selt, 2, 2, 0, | 1309 DEFUN ("elt", Felt, Selt, 2, 2, 0, |
| 1310 doc: /* Return element of SEQUENCE at index N. */) | 1310 doc: /* Return element of SEQUENCE at index N. */) |
| 1311 (sequence, n) | 1311 (sequence, n) |
| 1312 register Lisp_Object sequence, n; | 1312 register Lisp_Object sequence, n; |
| 1313 { | 1313 { |
| 1314 CHECK_NUMBER (n, 0); | 1314 CHECK_NUMBER (n); |
| 1315 while (1) | 1315 while (1) |
| 1316 { | 1316 { |
| 1317 if (CONSP (sequence) || NILP (sequence)) | 1317 if (CONSP (sequence) || NILP (sequence)) |
| 1318 return Fcar (Fnthcdr (n, sequence)); | 1318 return Fcar (Fnthcdr (n, sequence)); |
| 1319 else if (STRINGP (sequence) || VECTORP (sequence) | 1319 else if (STRINGP (sequence) || VECTORP (sequence) |
| 1889 doc: /* Return the value of SYMBOL's PROPNAME property. | 1889 doc: /* Return the value of SYMBOL's PROPNAME property. |
| 1890 This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */) | 1890 This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */) |
| 1891 (symbol, propname) | 1891 (symbol, propname) |
| 1892 Lisp_Object symbol, propname; | 1892 Lisp_Object symbol, propname; |
| 1893 { | 1893 { |
| 1894 CHECK_SYMBOL (symbol, 0); | 1894 CHECK_SYMBOL (symbol); |
| 1895 return Fplist_get (XSYMBOL (symbol)->plist, propname); | 1895 return Fplist_get (XSYMBOL (symbol)->plist, propname); |
| 1896 } | 1896 } |
| 1897 | 1897 |
| 1898 DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, | 1898 DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, |
| 1899 doc: /* Change value in PLIST of PROP to VAL. | 1899 doc: /* Change value in PLIST of PROP to VAL. |
| 1935 doc: /* Store SYMBOL's PROPNAME property with value VALUE. | 1935 doc: /* Store SYMBOL's PROPNAME property with value VALUE. |
| 1936 It can be retrieved with `(get SYMBOL PROPNAME)'. */) | 1936 It can be retrieved with `(get SYMBOL PROPNAME)'. */) |
| 1937 (symbol, propname, value) | 1937 (symbol, propname, value) |
| 1938 Lisp_Object symbol, propname, value; | 1938 Lisp_Object symbol, propname, value; |
| 1939 { | 1939 { |
| 1940 CHECK_SYMBOL (symbol, 0); | 1940 CHECK_SYMBOL (symbol); |
| 1941 XSYMBOL (symbol)->plist | 1941 XSYMBOL (symbol)->plist |
| 1942 = Fplist_put (XSYMBOL (symbol)->plist, propname, value); | 1942 = Fplist_put (XSYMBOL (symbol)->plist, propname, value); |
| 1943 return value; | 1943 return value; |
| 1944 } | 1944 } |
| 1945 | 1945 |
| 2096 XCHAR_TABLE (array)->defalt = Qnil; | 2096 XCHAR_TABLE (array)->defalt = Qnil; |
| 2097 } | 2097 } |
| 2098 else if (STRINGP (array)) | 2098 else if (STRINGP (array)) |
| 2099 { | 2099 { |
| 2100 register unsigned char *p = XSTRING (array)->data; | 2100 register unsigned char *p = XSTRING (array)->data; |
| 2101 CHECK_NUMBER (item, 1); | 2101 CHECK_NUMBER (item); |
| 2102 charval = XINT (item); | 2102 charval = XINT (item); |
| 2103 size = XSTRING (array)->size; | 2103 size = XSTRING (array)->size; |
| 2104 if (STRING_MULTIBYTE (array)) | 2104 if (STRING_MULTIBYTE (array)) |
| 2105 { | 2105 { |
| 2106 unsigned char str[MAX_MULTIBYTE_LENGTH]; | 2106 unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 2146 1, 1, 0, | 2146 1, 1, 0, |
| 2147 doc: /* Return the subtype of char-table CHAR-TABLE. The value is a symbol. */) | 2147 doc: /* Return the subtype of char-table CHAR-TABLE. The value is a symbol. */) |
| 2148 (char_table) | 2148 (char_table) |
| 2149 Lisp_Object char_table; | 2149 Lisp_Object char_table; |
| 2150 { | 2150 { |
| 2151 CHECK_CHAR_TABLE (char_table, 0); | 2151 CHECK_CHAR_TABLE (char_table); |
| 2152 | 2152 |
| 2153 return XCHAR_TABLE (char_table)->purpose; | 2153 return XCHAR_TABLE (char_table)->purpose; |
| 2154 } | 2154 } |
| 2155 | 2155 |
| 2156 DEFUN ("char-table-parent", Fchar_table_parent, Schar_table_parent, | 2156 DEFUN ("char-table-parent", Fchar_table_parent, Schar_table_parent, |
| 2161 then the actual applicable value is inherited from the parent char-table | 2161 then the actual applicable value is inherited from the parent char-table |
| 2162 \(or from its parents, if necessary). */) | 2162 \(or from its parents, if necessary). */) |
| 2163 (char_table) | 2163 (char_table) |
| 2164 Lisp_Object char_table; | 2164 Lisp_Object char_table; |
| 2165 { | 2165 { |
| 2166 CHECK_CHAR_TABLE (char_table, 0); | 2166 CHECK_CHAR_TABLE (char_table); |
| 2167 | 2167 |
| 2168 return XCHAR_TABLE (char_table)->parent; | 2168 return XCHAR_TABLE (char_table)->parent; |
| 2169 } | 2169 } |
| 2170 | 2170 |
| 2171 DEFUN ("set-char-table-parent", Fset_char_table_parent, Sset_char_table_parent, | 2171 DEFUN ("set-char-table-parent", Fset_char_table_parent, Sset_char_table_parent, |
| 2175 (char_table, parent) | 2175 (char_table, parent) |
| 2176 Lisp_Object char_table, parent; | 2176 Lisp_Object char_table, parent; |
| 2177 { | 2177 { |
| 2178 Lisp_Object temp; | 2178 Lisp_Object temp; |
| 2179 | 2179 |
| 2180 CHECK_CHAR_TABLE (char_table, 0); | 2180 CHECK_CHAR_TABLE (char_table); |
| 2181 | 2181 |
| 2182 if (!NILP (parent)) | 2182 if (!NILP (parent)) |
| 2183 { | 2183 { |
| 2184 CHECK_CHAR_TABLE (parent, 0); | 2184 CHECK_CHAR_TABLE (parent); |
| 2185 | 2185 |
| 2186 for (temp = parent; !NILP (temp); temp = XCHAR_TABLE (temp)->parent) | 2186 for (temp = parent; !NILP (temp); temp = XCHAR_TABLE (temp)->parent) |
| 2187 if (EQ (temp, char_table)) | 2187 if (EQ (temp, char_table)) |
| 2188 error ("Attempt to make a chartable be its own parent"); | 2188 error ("Attempt to make a chartable be its own parent"); |
| 2189 } | 2189 } |
| 2197 2, 2, 0, | 2197 2, 2, 0, |
| 2198 doc: /* Return the value of CHAR-TABLE's extra-slot number N. */) | 2198 doc: /* Return the value of CHAR-TABLE's extra-slot number N. */) |
| 2199 (char_table, n) | 2199 (char_table, n) |
| 2200 Lisp_Object char_table, n; | 2200 Lisp_Object char_table, n; |
| 2201 { | 2201 { |
| 2202 CHECK_CHAR_TABLE (char_table, 1); | 2202 CHECK_CHAR_TABLE (char_table); |
| 2203 CHECK_NUMBER (n, 2); | 2203 CHECK_NUMBER (n); |
| 2204 if (XINT (n) < 0 | 2204 if (XINT (n) < 0 |
| 2205 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) | 2205 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) |
| 2206 args_out_of_range (char_table, n); | 2206 args_out_of_range (char_table, n); |
| 2207 | 2207 |
| 2208 return XCHAR_TABLE (char_table)->extras[XINT (n)]; | 2208 return XCHAR_TABLE (char_table)->extras[XINT (n)]; |
| 2213 3, 3, 0, | 2213 3, 3, 0, |
| 2214 doc: /* Set CHAR-TABLE's extra-slot number N to VALUE. */) | 2214 doc: /* Set CHAR-TABLE's extra-slot number N to VALUE. */) |
| 2215 (char_table, n, value) | 2215 (char_table, n, value) |
| 2216 Lisp_Object char_table, n, value; | 2216 Lisp_Object char_table, n, value; |
| 2217 { | 2217 { |
| 2218 CHECK_CHAR_TABLE (char_table, 1); | 2218 CHECK_CHAR_TABLE (char_table); |
| 2219 CHECK_NUMBER (n, 2); | 2219 CHECK_NUMBER (n); |
| 2220 if (XINT (n) < 0 | 2220 if (XINT (n) < 0 |
| 2221 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) | 2221 || XINT (n) >= CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (char_table))) |
| 2222 args_out_of_range (char_table, n); | 2222 args_out_of_range (char_table, n); |
| 2223 | 2223 |
| 2224 return XCHAR_TABLE (char_table)->extras[XINT (n)] = value; | 2224 return XCHAR_TABLE (char_table)->extras[XINT (n)] = value; |
| 2231 a vector which identifies a character set or a row of a character set, | 2231 a vector which identifies a character set or a row of a character set, |
| 2232 a character set name, or a character code. */) | 2232 a character set name, or a character code. */) |
| 2233 (char_table, range) | 2233 (char_table, range) |
| 2234 Lisp_Object char_table, range; | 2234 Lisp_Object char_table, range; |
| 2235 { | 2235 { |
| 2236 CHECK_CHAR_TABLE (char_table, 0); | 2236 CHECK_CHAR_TABLE (char_table); |
| 2237 | 2237 |
| 2238 if (EQ (range, Qnil)) | 2238 if (EQ (range, Qnil)) |
| 2239 return XCHAR_TABLE (char_table)->defalt; | 2239 return XCHAR_TABLE (char_table)->defalt; |
| 2240 else if (INTEGERP (range)) | 2240 else if (INTEGERP (range)) |
| 2241 return Faref (char_table, range); | 2241 return Faref (char_table, range); |
| 2242 else if (SYMBOLP (range)) | 2242 else if (SYMBOLP (range)) |
| 2243 { | 2243 { |
| 2244 Lisp_Object charset_info; | 2244 Lisp_Object charset_info; |
| 2245 | 2245 |
| 2246 charset_info = Fget (range, Qcharset); | 2246 charset_info = Fget (range, Qcharset); |
| 2247 CHECK_VECTOR (charset_info, 0); | 2247 CHECK_VECTOR (charset_info); |
| 2248 | 2248 |
| 2249 return Faref (char_table, | 2249 return Faref (char_table, |
| 2250 make_number (XINT (XVECTOR (charset_info)->contents[0]) | 2250 make_number (XINT (XVECTOR (charset_info)->contents[0]) |
| 2251 + 128)); | 2251 + 128)); |
| 2252 } | 2252 } |
| 2279 (char_table, range, value) | 2279 (char_table, range, value) |
| 2280 Lisp_Object char_table, range, value; | 2280 Lisp_Object char_table, range, value; |
| 2281 { | 2281 { |
| 2282 int i; | 2282 int i; |
| 2283 | 2283 |
| 2284 CHECK_CHAR_TABLE (char_table, 0); | 2284 CHECK_CHAR_TABLE (char_table); |
| 2285 | 2285 |
| 2286 if (EQ (range, Qt)) | 2286 if (EQ (range, Qt)) |
| 2287 for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++) | 2287 for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++) |
| 2288 XCHAR_TABLE (char_table)->contents[i] = value; | 2288 XCHAR_TABLE (char_table)->contents[i] = value; |
| 2289 else if (EQ (range, Qnil)) | 2289 else if (EQ (range, Qnil)) |
| 2291 else if (SYMBOLP (range)) | 2291 else if (SYMBOLP (range)) |
| 2292 { | 2292 { |
| 2293 Lisp_Object charset_info; | 2293 Lisp_Object charset_info; |
| 2294 | 2294 |
| 2295 charset_info = Fget (range, Qcharset); | 2295 charset_info = Fget (range, Qcharset); |
| 2296 CHECK_VECTOR (charset_info, 0); | 2296 CHECK_VECTOR (charset_info); |
| 2297 | 2297 |
| 2298 return Faset (char_table, | 2298 return Faset (char_table, |
| 2299 make_number (XINT (XVECTOR (charset_info)->contents[0]) | 2299 make_number (XINT (XVECTOR (charset_info)->contents[0]) |
| 2300 + 128), | 2300 + 128), |
| 2301 value); | 2301 value); |
| 2333 Lisp_Object char_table, ch, value; | 2333 Lisp_Object char_table, ch, value; |
| 2334 { | 2334 { |
| 2335 int c, charset, code1, code2; | 2335 int c, charset, code1, code2; |
| 2336 Lisp_Object temp; | 2336 Lisp_Object temp; |
| 2337 | 2337 |
| 2338 CHECK_CHAR_TABLE (char_table, 0); | 2338 CHECK_CHAR_TABLE (char_table); |
| 2339 CHECK_NUMBER (ch, 1); | 2339 CHECK_NUMBER (ch); |
| 2340 | 2340 |
| 2341 c = XINT (ch); | 2341 c = XINT (ch); |
| 2342 SPLIT_CHAR (c, charset, code1, code2); | 2342 SPLIT_CHAR (c, charset, code1, code2); |
| 2343 | 2343 |
| 2344 /* Since we may want to set the default value for a character set | 2344 /* Since we may want to set the default value for a character set |
| 2422 { | 2422 { |
| 2423 Lisp_Object elt; | 2423 Lisp_Object elt; |
| 2424 int dim; | 2424 int dim; |
| 2425 int i, j; | 2425 int i, j; |
| 2426 | 2426 |
| 2427 CHECK_CHAR_TABLE (table, 0); | 2427 CHECK_CHAR_TABLE (table); |
| 2428 | 2428 |
| 2429 for (i = CHAR_TABLE_SINGLE_BYTE_SLOTS; i < CHAR_TABLE_ORDINARY_SLOTS; i++) | 2429 for (i = CHAR_TABLE_SINGLE_BYTE_SLOTS; i < CHAR_TABLE_ORDINARY_SLOTS; i++) |
| 2430 { | 2430 { |
| 2431 elt = XCHAR_TABLE (table)->contents[i]; | 2431 elt = XCHAR_TABLE (table)->contents[i]; |
| 2432 if (!SUB_CHAR_TABLE_P (elt)) | 2432 if (!SUB_CHAR_TABLE_P (elt)) |
| 2531 Lisp_Object function, char_table; | 2531 Lisp_Object function, char_table; |
| 2532 { | 2532 { |
| 2533 /* The depth of char table is at most 3. */ | 2533 /* The depth of char table is at most 3. */ |
| 2534 Lisp_Object indices[3]; | 2534 Lisp_Object indices[3]; |
| 2535 | 2535 |
| 2536 CHECK_CHAR_TABLE (char_table, 1); | 2536 CHECK_CHAR_TABLE (char_table); |
| 2537 | 2537 |
| 2538 map_char_table (NULL, function, char_table, char_table, 0, indices); | 2538 map_char_table (NULL, function, char_table, char_table, 0, indices); |
| 2539 return Qnil; | 2539 return Qnil; |
| 2540 } | 2540 } |
| 2541 | 2541 |
| 2815 | 2815 |
| 2816 specbind (Qcursor_in_echo_area, Qt); | 2816 specbind (Qcursor_in_echo_area, Qt); |
| 2817 | 2817 |
| 2818 map = Fsymbol_value (intern ("query-replace-map")); | 2818 map = Fsymbol_value (intern ("query-replace-map")); |
| 2819 | 2819 |
| 2820 CHECK_STRING (prompt, 0); | 2820 CHECK_STRING (prompt); |
| 2821 xprompt = prompt; | 2821 xprompt = prompt; |
| 2822 GCPRO2 (prompt, xprompt); | 2822 GCPRO2 (prompt, xprompt); |
| 2823 | 2823 |
| 2824 #ifdef HAVE_X_WINDOWS | 2824 #ifdef HAVE_X_WINDOWS |
| 2825 if (display_hourglass_p) | 2825 if (display_hourglass_p) |
| 2945 { | 2945 { |
| 2946 register Lisp_Object ans; | 2946 register Lisp_Object ans; |
| 2947 Lisp_Object args[2]; | 2947 Lisp_Object args[2]; |
| 2948 struct gcpro gcpro1; | 2948 struct gcpro gcpro1; |
| 2949 | 2949 |
| 2950 CHECK_STRING (prompt, 0); | 2950 CHECK_STRING (prompt); |
| 2951 | 2951 |
| 2952 #ifdef HAVE_MENUS | 2952 #ifdef HAVE_MENUS |
| 2953 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) | 2953 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) |
| 2954 && use_dialog_box | 2954 && use_dialog_box |
| 2955 && have_menus_p ()) | 2955 && have_menus_p ()) |
| 3041 SUBFEATURE can be used to check a specific subfeature of FEATURE. */) | 3041 SUBFEATURE can be used to check a specific subfeature of FEATURE. */) |
| 3042 (feature, subfeature) | 3042 (feature, subfeature) |
| 3043 Lisp_Object feature, subfeature; | 3043 Lisp_Object feature, subfeature; |
| 3044 { | 3044 { |
| 3045 register Lisp_Object tem; | 3045 register Lisp_Object tem; |
| 3046 CHECK_SYMBOL (feature, 0); | 3046 CHECK_SYMBOL (feature); |
| 3047 tem = Fmemq (feature, Vfeatures); | 3047 tem = Fmemq (feature, Vfeatures); |
| 3048 if (!NILP (tem) && !NILP (subfeature)) | 3048 if (!NILP (tem) && !NILP (subfeature)) |
| 3049 tem = Fmemq (subfeature, Fget (feature, Qsubfeatures)); | 3049 tem = Fmemq (subfeature, Fget (feature, Qsubfeatures)); |
| 3050 return (NILP (tem)) ? Qnil : Qt; | 3050 return (NILP (tem)) ? Qnil : Qt; |
| 3051 } | 3051 } |
| 3056 particular subfeatures supported in this version of FEATURE. */) | 3056 particular subfeatures supported in this version of FEATURE. */) |
| 3057 (feature, subfeatures) | 3057 (feature, subfeatures) |
| 3058 Lisp_Object feature, subfeatures; | 3058 Lisp_Object feature, subfeatures; |
| 3059 { | 3059 { |
| 3060 register Lisp_Object tem; | 3060 register Lisp_Object tem; |
| 3061 CHECK_SYMBOL (feature, 0); | 3061 CHECK_SYMBOL (feature); |
| 3062 if (!NILP (Vautoload_queue)) | 3062 if (!NILP (Vautoload_queue)) |
| 3063 Vautoload_queue = Fcons (Fcons (Vfeatures, Qnil), Vautoload_queue); | 3063 Vautoload_queue = Fcons (Fcons (Vfeatures, Qnil), Vautoload_queue); |
| 3064 tem = Fmemq (feature, Vfeatures); | 3064 tem = Fmemq (feature, Vfeatures); |
| 3065 if (NILP (tem)) | 3065 if (NILP (tem)) |
| 3066 Vfeatures = Fcons (feature, Vfeatures); | 3066 Vfeatures = Fcons (feature, Vfeatures); |
| 3104 Lisp_Object feature, filename, noerror; | 3104 Lisp_Object feature, filename, noerror; |
| 3105 { | 3105 { |
| 3106 register Lisp_Object tem; | 3106 register Lisp_Object tem; |
| 3107 struct gcpro gcpro1, gcpro2; | 3107 struct gcpro gcpro1, gcpro2; |
| 3108 | 3108 |
| 3109 CHECK_SYMBOL (feature, 0); | 3109 CHECK_SYMBOL (feature); |
| 3110 | 3110 |
| 3111 tem = Fmemq (feature, Vfeatures); | 3111 tem = Fmemq (feature, Vfeatures); |
| 3112 | 3112 |
| 3113 LOADHIST_ATTACH (Fcons (Qrequire, feature)); | 3113 LOADHIST_ATTACH (Fcons (Qrequire, feature)); |
| 3114 | 3114 |
| 3192 doc: /* In WIDGET, set PROPERTY to VALUE. | 3192 doc: /* In WIDGET, set PROPERTY to VALUE. |
| 3193 The value can later be retrieved with `widget-get'. */) | 3193 The value can later be retrieved with `widget-get'. */) |
| 3194 (widget, property, value) | 3194 (widget, property, value) |
| 3195 Lisp_Object widget, property, value; | 3195 Lisp_Object widget, property, value; |
| 3196 { | 3196 { |
| 3197 CHECK_CONS (widget, 1); | 3197 CHECK_CONS (widget); |
| 3198 XSETCDR (widget, Fplist_put (XCDR (widget), property, value)); | 3198 XSETCDR (widget, Fplist_put (XCDR (widget), property, value)); |
| 3199 return value; | 3199 return value; |
| 3200 } | 3200 } |
| 3201 | 3201 |
| 3202 DEFUN ("widget-get", Fwidget_get, Swidget_get, 2, 2, 0, | 3202 DEFUN ("widget-get", Fwidget_get, Swidget_get, 2, 2, 0, |
| 3210 | 3210 |
| 3211 while (1) | 3211 while (1) |
| 3212 { | 3212 { |
| 3213 if (NILP (widget)) | 3213 if (NILP (widget)) |
| 3214 return Qnil; | 3214 return Qnil; |
| 3215 CHECK_CONS (widget, 1); | 3215 CHECK_CONS (widget); |
| 3216 tmp = Fplist_member (XCDR (widget), property); | 3216 tmp = Fplist_member (XCDR (widget), property); |
| 3217 if (CONSP (tmp)) | 3217 if (CONSP (tmp)) |
| 3218 { | 3218 { |
| 3219 tmp = XCDR (tmp); | 3219 tmp = XCDR (tmp); |
| 3220 return CAR (tmp); | 3220 return CAR (tmp); |
| 3408 { | 3408 { |
| 3409 int allength, length, encoded_length; | 3409 int allength, length, encoded_length; |
| 3410 char *encoded; | 3410 char *encoded; |
| 3411 Lisp_Object encoded_string; | 3411 Lisp_Object encoded_string; |
| 3412 | 3412 |
| 3413 CHECK_STRING (string, 1); | 3413 CHECK_STRING (string); |
| 3414 | 3414 |
| 3415 /* We need to allocate enough room for encoding the text. | 3415 /* We need to allocate enough room for encoding the text. |
| 3416 We need 33 1/3% more space, plus a newline every 76 | 3416 We need 33 1/3% more space, plus a newline every 76 |
| 3417 characters, and then we round up. */ | 3417 characters, and then we round up. */ |
| 3418 length = STRING_BYTES (XSTRING (string)); | 3418 length = STRING_BYTES (XSTRING (string)); |
| 3614 { | 3614 { |
| 3615 char *decoded; | 3615 char *decoded; |
| 3616 int length, decoded_length; | 3616 int length, decoded_length; |
| 3617 Lisp_Object decoded_string; | 3617 Lisp_Object decoded_string; |
| 3618 | 3618 |
| 3619 CHECK_STRING (string, 1); | 3619 CHECK_STRING (string); |
| 3620 | 3620 |
| 3621 length = STRING_BYTES (XSTRING (string)); | 3621 length = STRING_BYTES (XSTRING (string)); |
| 3622 /* We need to allocate enough room for decoding the text. */ | 3622 /* We need to allocate enough room for decoding the text. */ |
| 3623 if (length <= MAX_ALLOCA) | 3623 if (length <= MAX_ALLOCA) |
| 3624 decoded = (char *) alloca (length); | 3624 decoded = (char *) alloca (length); |
| 3823 | 3823 |
| 3824 static struct Lisp_Hash_Table * | 3824 static struct Lisp_Hash_Table * |
| 3825 check_hash_table (obj) | 3825 check_hash_table (obj) |
| 3826 Lisp_Object obj; | 3826 Lisp_Object obj; |
| 3827 { | 3827 { |
| 3828 CHECK_HASH_TABLE (obj, 0); | 3828 CHECK_HASH_TABLE (obj); |
| 3829 return XHASH_TABLE (obj); | 3829 return XHASH_TABLE (obj); |
| 3830 } | 3830 } |
| 3831 | 3831 |
| 3832 | 3832 |
| 3833 /* Value is the next integer I >= N, N >= 0 which is "almost" a prime | 3833 /* Value is the next integer I >= N, N >= 0 which is "almost" a prime |
| 5107 size = XSTRING (object)->size; | 5107 size = XSTRING (object)->size; |
| 5108 size_byte = STRING_BYTES (XSTRING (object)); | 5108 size_byte = STRING_BYTES (XSTRING (object)); |
| 5109 | 5109 |
| 5110 if (!NILP (start)) | 5110 if (!NILP (start)) |
| 5111 { | 5111 { |
| 5112 CHECK_NUMBER (start, 1); | 5112 CHECK_NUMBER (start); |
| 5113 | 5113 |
| 5114 start_char = XINT (start); | 5114 start_char = XINT (start); |
| 5115 | 5115 |
| 5116 if (start_char < 0) | 5116 if (start_char < 0) |
| 5117 start_char += size; | 5117 start_char += size; |
| 5124 end_char = size; | 5124 end_char = size; |
| 5125 end_byte = size_byte; | 5125 end_byte = size_byte; |
| 5126 } | 5126 } |
| 5127 else | 5127 else |
| 5128 { | 5128 { |
| 5129 CHECK_NUMBER (end, 2); | 5129 CHECK_NUMBER (end); |
| 5130 | 5130 |
| 5131 end_char = XINT (end); | 5131 end_char = XINT (end); |
| 5132 | 5132 |
| 5133 if (end_char < 0) | 5133 if (end_char < 0) |
| 5134 end_char += size; | 5134 end_char += size; |
| 5140 args_out_of_range_3 (object, make_number (start_char), | 5140 args_out_of_range_3 (object, make_number (start_char), |
| 5141 make_number (end_char)); | 5141 make_number (end_char)); |
| 5142 } | 5142 } |
| 5143 else | 5143 else |
| 5144 { | 5144 { |
| 5145 CHECK_BUFFER (object, 0); | 5145 CHECK_BUFFER (object); |
| 5146 | 5146 |
| 5147 bp = XBUFFER (object); | 5147 bp = XBUFFER (object); |
| 5148 | 5148 |
| 5149 if (NILP (start)) | 5149 if (NILP (start)) |
| 5150 b = BUF_BEGV (bp); | 5150 b = BUF_BEGV (bp); |
| 5151 else | 5151 else |
| 5152 { | 5152 { |
| 5153 CHECK_NUMBER_COERCE_MARKER (start, 0); | 5153 CHECK_NUMBER_COERCE_MARKER (start); |
| 5154 b = XINT (start); | 5154 b = XINT (start); |
| 5155 } | 5155 } |
| 5156 | 5156 |
| 5157 if (NILP (end)) | 5157 if (NILP (end)) |
| 5158 e = BUF_ZV (bp); | 5158 e = BUF_ZV (bp); |
| 5159 else | 5159 else |
| 5160 { | 5160 { |
| 5161 CHECK_NUMBER_COERCE_MARKER (end, 1); | 5161 CHECK_NUMBER_COERCE_MARKER (end); |
| 5162 e = XINT (end); | 5162 e = XINT (end); |
| 5163 } | 5163 } |
| 5164 | 5164 |
| 5165 if (b > e) | 5165 if (b > e) |
| 5166 temp = b, b = e, e = temp; | 5166 temp = b, b = e, e = temp; |
