comparison src/fontcolor-tty.c @ 5178:97eb4942aec8

merge
author Ben Wing <ben@xemacs.org>
date Mon, 29 Mar 2010 21:28:13 -0500
parents src/objects-tty.c@6c6d78781d59 src/objects-tty.c@8b2f75cecb89
children 308d34e9f07d
comparison
equal deleted inserted replaced
5177:b785049378e3 5178:97eb4942aec8
41 { XD_LISP_OBJECT, offsetof (struct tty_color_instance_data, symbol) }, 41 { XD_LISP_OBJECT, offsetof (struct tty_color_instance_data, symbol) },
42 { XD_END } 42 { XD_END }
43 }; 43 };
44 44
45 #ifdef NEW_GC 45 #ifdef NEW_GC
46 DEFINE_LRECORD_IMPLEMENTATION ("tty-color-instance-data", 46 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("tty-color-instance-data",
47 tty_color_instance_data, 47 tty_color_instance_data,
48 0, /*dumpable-flag*/ 48 0, tty_color_instance_data_description_1,
49 0, 0, 0, 0, 0, 49 struct tty_color_instance_data);
50 tty_color_instance_data_description_1,
51 struct tty_color_instance_data);
52 #else /* not NEW_GC */ 50 #else /* not NEW_GC */
53 const struct sized_memory_description tty_color_instance_data_description = { 51 const struct sized_memory_description tty_color_instance_data_description = {
54 sizeof (struct tty_color_instance_data), tty_color_instance_data_description_1 52 sizeof (struct tty_color_instance_data), tty_color_instance_data_description_1
55 }; 53 };
56 #endif /* not NEW_GC */ 54 #endif /* not NEW_GC */
59 { XD_LISP_OBJECT, offsetof (struct tty_font_instance_data, charset) }, 57 { XD_LISP_OBJECT, offsetof (struct tty_font_instance_data, charset) },
60 { XD_END } 58 { XD_END }
61 }; 59 };
62 60
63 #ifdef NEW_GC 61 #ifdef NEW_GC
64 DEFINE_LRECORD_IMPLEMENTATION ("tty-font-instance-data", 62 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("tty-font-instance-data",
65 tty_font_instance_data, 63 tty_font_instance_data, 0,
66 0, /*dumpable-flag*/ 64 tty_font_instance_data_description_1,
67 0, 0, 0, 0, 0, 65 struct tty_font_instance_data);
68 tty_font_instance_data_description_1,
69 struct tty_font_instance_data);
70 #else /* not NEW_GC */ 66 #else /* not NEW_GC */
71 const struct sized_memory_description tty_font_instance_data_description = { 67 const struct sized_memory_description tty_font_instance_data_description = {
72 sizeof (struct tty_font_instance_data), tty_font_instance_data_description_1 68 sizeof (struct tty_font_instance_data), tty_font_instance_data_description_1
73 }; 69 };
74 #endif /* not NEW_GC */ 70 #endif /* not NEW_GC */
193 return 0; 189 return 0;
194 } 190 }
195 191
196 /* Don't allocate the data until we're sure that we will succeed. */ 192 /* Don't allocate the data until we're sure that we will succeed. */
197 #ifdef NEW_GC 193 #ifdef NEW_GC
198 c->data = alloc_lrecord_type (struct tty_color_instance_data, 194 c->data =
199 &lrecord_tty_color_instance_data); 195 XTTY_COLOR_INSTANCE_DATA (ALLOC_NORMAL_LISP_OBJECT (tty_color_instance_data));
200 #else /* not NEW_GC */ 196 #else /* not NEW_GC */
201 c->data = xnew (struct tty_color_instance_data); 197 c->data = xnew (struct tty_color_instance_data);
202 #endif /* not NEW_GC */ 198 #endif /* not NEW_GC */
203 COLOR_INSTANCE_TTY_SYMBOL (c) = name; 199 COLOR_INSTANCE_TTY_SYMBOL (c) = name;
204 200
221 static void 217 static void
222 tty_finalize_color_instance (Lisp_Color_Instance *UNUSED_IF_NEW_GC (c)) 218 tty_finalize_color_instance (Lisp_Color_Instance *UNUSED_IF_NEW_GC (c))
223 { 219 {
224 #ifndef NEW_GC 220 #ifndef NEW_GC
225 if (c->data) 221 if (c->data)
226 xfree (c->data); 222 {
223 xfree (c->data);
224 c->data = 0;
225 }
227 #endif /* not NEW_GC */ 226 #endif /* not NEW_GC */
228 } 227 }
229 228
230 static int 229 static int
231 tty_color_instance_equal (Lisp_Color_Instance *c1, 230 tty_color_instance_equal (Lisp_Color_Instance *c1,
278 #endif 277 #endif
279 } 278 }
280 279
281 /* Don't allocate the data until we're sure that we will succeed. */ 280 /* Don't allocate the data until we're sure that we will succeed. */
282 #ifdef NEW_GC 281 #ifdef NEW_GC
283 f->data = alloc_lrecord_type (struct tty_font_instance_data, 282 f->data =
284 &lrecord_tty_font_instance_data); 283 XTTY_FONT_INSTANCE_DATA (ALLOC_NORMAL_LISP_OBJECT (tty_font_instance_data));
285 #else /* not NEW_GC */ 284 #else /* not NEW_GC */
286 f->data = xnew (struct tty_font_instance_data); 285 f->data = xnew (struct tty_font_instance_data);
287 #endif /* not NEW_GC */ 286 #endif /* not NEW_GC */
288 FONT_INSTANCE_TTY_CHARSET (f) = charset; 287 FONT_INSTANCE_TTY_CHARSET (f) = charset;
289 #ifdef MULE 288 #ifdef MULE
316 static void 315 static void
317 tty_finalize_font_instance (Lisp_Font_Instance *UNUSED_IF_NEW_GC (f)) 316 tty_finalize_font_instance (Lisp_Font_Instance *UNUSED_IF_NEW_GC (f))
318 { 317 {
319 #ifndef NEW_GC 318 #ifndef NEW_GC
320 if (f->data) 319 if (f->data)
321 xfree (f->data); 320 {
321 xfree (f->data);
322 f->data = 0;
323 }
322 #endif /* not NEW_GC */ 324 #endif /* not NEW_GC */
323 } 325 }
324 326
325 static Lisp_Object 327 static Lisp_Object
326 tty_font_list (Lisp_Object UNUSED (pattern), Lisp_Object UNUSED (device), 328 tty_font_list (Lisp_Object UNUSED (pattern), Lisp_Object UNUSED (device),
395 397
396 void 398 void
397 syms_of_fontcolor_tty (void) 399 syms_of_fontcolor_tty (void)
398 { 400 {
399 #ifdef NEW_GC 401 #ifdef NEW_GC
400 INIT_LRECORD_IMPLEMENTATION (tty_color_instance_data); 402 INIT_LISP_OBJECT (tty_color_instance_data);
401 INIT_LRECORD_IMPLEMENTATION (tty_font_instance_data); 403 INIT_LISP_OBJECT (tty_font_instance_data);
402 #endif /* NEW_GC */ 404 #endif /* NEW_GC */
403 405
404 DEFSUBR (Fregister_tty_color); 406 DEFSUBR (Fregister_tty_color);
405 DEFSUBR (Funregister_tty_color); 407 DEFSUBR (Funregister_tty_color);
406 DEFSUBR (Ffind_tty_color); 408 DEFSUBR (Ffind_tty_color);