comparison src/objects-tty.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 190b164ddcac
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
218 Lisp_Object device, Error_behavior errb) 218 Lisp_Object device, Error_behavior errb)
219 { 219 {
220 Bufbyte *str = XSTRING_DATA (name); 220 Bufbyte *str = XSTRING_DATA (name);
221 Lisp_Object charset = Qnil; 221 Lisp_Object charset = Qnil;
222 222
223 if (strncmp ((CONST char *) str, "normal", 6)) 223 if (strncmp ((const char *) str, "normal", 6))
224 return 0; 224 return 0;
225 str += 6; 225 str += 6;
226 if (*str) 226 if (*str)
227 { 227 {
228 #ifdef MULE 228 #ifdef MULE
229 if (*str != '/') 229 if (*str != '/')
230 return 0; 230 return 0;
231 str++; 231 str++;
232 charset = Ffind_charset (intern ((CONST char *) str)); 232 charset = Ffind_charset (intern ((const char *) str));
233 if (NILP (charset)) 233 if (NILP (charset))
234 return 0; 234 return 0;
235 #else 235 #else
236 return 0; 236 return 0;
237 #endif 237 #endif
282 282
283 #ifdef MULE 283 #ifdef MULE
284 284
285 static int 285 static int
286 tty_font_spec_matches_charset (struct device *d, Lisp_Object charset, 286 tty_font_spec_matches_charset (struct device *d, Lisp_Object charset,
287 CONST Bufbyte *nonreloc, Lisp_Object reloc, 287 const Bufbyte *nonreloc, Lisp_Object reloc,
288 Bytecount offset, Bytecount length) 288 Bytecount offset, Bytecount length)
289 { 289 {
290 CONST Bufbyte *the_nonreloc = nonreloc; 290 const Bufbyte *the_nonreloc = nonreloc;
291 291
292 if (!the_nonreloc) 292 if (!the_nonreloc)
293 the_nonreloc = XSTRING_DATA (reloc); 293 the_nonreloc = XSTRING_DATA (reloc);
294 fixup_internal_substring (nonreloc, reloc, offset, &length); 294 fixup_internal_substring (nonreloc, reloc, offset, &length);
295 the_nonreloc += offset; 295 the_nonreloc += offset;
296 296
297 if (UNBOUNDP (charset)) 297 if (UNBOUNDP (charset))
298 return !memchr (the_nonreloc, '/', length); 298 return !memchr (the_nonreloc, '/', length);
299 the_nonreloc = (CONST Bufbyte *) memchr (the_nonreloc, '/', length); 299 the_nonreloc = (const Bufbyte *) memchr (the_nonreloc, '/', length);
300 if (!the_nonreloc) 300 if (!the_nonreloc)
301 return 0; 301 return 0;
302 the_nonreloc++; 302 the_nonreloc++;
303 { 303 {
304 Lisp_String *s = symbol_name (XSYMBOL (XCHARSET_NAME (charset))); 304 Lisp_String *s = symbol_name (XSYMBOL (XCHARSET_NAME (charset)));
305 return !strcmp ((CONST char *) the_nonreloc, 305 return !strcmp ((const char *) the_nonreloc,
306 (CONST char *) string_data (s)); 306 (const char *) string_data (s));
307 } 307 }
308 } 308 }
309 309
310 /* find a font spec that matches font spec FONT and also matches 310 /* find a font spec that matches font spec FONT and also matches
311 (the registry of) CHARSET. */ 311 (the registry of) CHARSET. */
313 tty_find_charset_font (Lisp_Object device, Lisp_Object font, 313 tty_find_charset_font (Lisp_Object device, Lisp_Object font,
314 Lisp_Object charset) 314 Lisp_Object charset)
315 { 315 {
316 Bufbyte *fontname = XSTRING_DATA (font); 316 Bufbyte *fontname = XSTRING_DATA (font);
317 317
318 if (strchr ((CONST char *) fontname, '/')) 318 if (strchr ((const char *) fontname, '/'))
319 { 319 {
320 if (tty_font_spec_matches_charset (XDEVICE (device), charset, 0, 320 if (tty_font_spec_matches_charset (XDEVICE (device), charset, 0,
321 font, 0, -1)) 321 font, 0, -1))
322 return font; 322 return font;
323 return Qnil; 323 return Qnil;