comparison src/objects-tty.c @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 131b0175ea99
children 8626e4521993
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
159 #endif 159 #endif
160 return 0; 160 return 0;
161 } 161 }
162 162
163 /* Don't allocate the data until we're sure that we will succeed. */ 163 /* Don't allocate the data until we're sure that we will succeed. */
164 c->data = malloc_type (struct tty_color_instance_data); 164 c->data = xnew (struct tty_color_instance_data);
165 COLOR_INSTANCE_TTY_SYMBOL (c) = name; 165 COLOR_INSTANCE_TTY_SYMBOL (c) = name;
166 166
167 return 1; 167 return 1;
168 } 168 }
169 169
237 return 0; 237 return 0;
238 #endif 238 #endif
239 } 239 }
240 240
241 /* Don't allocate the data until we're sure that we will succeed. */ 241 /* Don't allocate the data until we're sure that we will succeed. */
242 f->data = malloc_type (struct tty_font_instance_data); 242 f->data = xnew (struct tty_font_instance_data);
243 FONT_INSTANCE_TTY_CHARSET (f) = charset; 243 FONT_INSTANCE_TTY_CHARSET (f) = charset;
244 #ifdef MULE 244 #ifdef MULE
245 if (CHARSETP (charset)) 245 if (CHARSETP (charset))
246 f->width = XCHARSET_COLUMNS (charset); 246 f->width = XCHARSET_COLUMNS (charset);
247 else 247 else
288 tty_font_spec_matches_charset (struct device *d, Lisp_Object charset, 288 tty_font_spec_matches_charset (struct device *d, Lisp_Object charset,
289 CONST Bufbyte *nonreloc, Lisp_Object reloc, 289 CONST Bufbyte *nonreloc, Lisp_Object reloc,
290 Bytecount offset, Bytecount length) 290 Bytecount offset, Bytecount length)
291 { 291 {
292 CONST Bufbyte *the_nonreloc = nonreloc; 292 CONST Bufbyte *the_nonreloc = nonreloc;
293 293
294 if (!the_nonreloc) 294 if (!the_nonreloc)
295 the_nonreloc = XSTRING_DATA (reloc); 295 the_nonreloc = XSTRING_DATA (reloc);
296 fixup_internal_substring (nonreloc, reloc, offset, &length); 296 fixup_internal_substring (nonreloc, reloc, offset, &length);
297 the_nonreloc += offset; 297 the_nonreloc += offset;
298 298
299 if (UNBOUNDP (charset)) 299 if (UNBOUNDP (charset))
300 return !memchr (the_nonreloc, '/', length); 300 return !memchr (the_nonreloc, '/', length);
301 the_nonreloc = memchr (the_nonreloc, '/', length); 301 the_nonreloc = (CONST Bufbyte *) memchr (the_nonreloc, '/', length);
302 if (!the_nonreloc) 302 if (!the_nonreloc)
303 return 0; 303 return 0;
304 the_nonreloc++; 304 the_nonreloc++;
305 { 305 {
306 struct Lisp_String *s = 306 struct Lisp_String *s = symbol_name (XSYMBOL (XCHARSET_NAME (charset)));
307 symbol_name (XSYMBOL (XCHARSET_NAME (charset)));
308 return !strcmp ((CONST char *) the_nonreloc, 307 return !strcmp ((CONST char *) the_nonreloc,
309 (CONST char *) string_data (s)); 308 (CONST char *) string_data (s));
310 } 309 }
311 } 310 }
312 311