Mercurial > hg > xemacs-beta
diff src/data.c @ 5117:3742ea8250b5 ben-lisp-object ben-lisp-object-final-ws-year-2005
Checking in final CVS version of workspace 'ben-lisp-object'
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 00:20:27 -0600 |
parents | 1e7cc382eb16 |
children | e0db3c197671 |
line wrap: on
line diff
--- a/src/data.c Sat Dec 26 00:20:16 2009 -0600 +++ b/src/data.c Sat Dec 26 00:20:27 2009 -0600 @@ -1,7 +1,7 @@ /* Primitive operations on Lisp data types for XEmacs Lisp interpreter. Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. - Copyright (C) 2000, 2001, 2002, 2003 Ben Wing. + Copyright (C) 2000, 2001, 2002, 2003, 2005 Ben Wing. This file is part of XEmacs. @@ -2575,13 +2575,11 @@ Lisp_Object make_weak_list (enum weak_list_type type) { - Lisp_Object result; - struct weak_list *wl = - ALLOC_LCRECORD_TYPE (struct weak_list, &lrecord_weak_list); + Lisp_Object result = ALLOC_LISP_OBJECT (weak_list); + struct weak_list *wl = XWEAK_LIST (result); wl->list = Qnil; wl->type = type; - result = wrap_weak_list (wl); wl->next_weak = Vall_weak_lists; Vall_weak_lists = result; return result; @@ -2595,8 +2593,7 @@ { XD_END } }; -DEFINE_LRECORD_IMPLEMENTATION ("weak-list", weak_list, - 1, /*dumpable-flag*/ +DEFINE_LISP_OBJECT ("weak-list", weak_list, mark_weak_list, print_weak_list, 0, weak_list_equal, weak_list_hash, weak_list_description, @@ -3049,10 +3046,8 @@ Lisp_Object make_weak_box (Lisp_Object value) { - Lisp_Object result; - - struct weak_box *wb = - ALLOC_LCRECORD_TYPE (struct weak_box, &lrecord_weak_box); + Lisp_Object result = ALLOC_LISP_OBJECT (weak_box); + struct weak_box *wb = XWEAK_BOX (result); wb->value = value; result = wrap_weak_box (wb); @@ -3066,12 +3061,10 @@ { XD_END} }; -DEFINE_LRECORD_IMPLEMENTATION ("weak_box", weak_box, - 0, /*dumpable-flag*/ - mark_weak_box, print_weak_box, - 0, weak_box_equal, weak_box_hash, - weak_box_description, - struct weak_box); +DEFINE_NONDUMPABLE_LISP_OBJECT ("weak-box", weak_box, mark_weak_box, + print_weak_box, 0, weak_box_equal, + weak_box_hash, weak_box_description, + struct weak_box); DEFUN ("make-weak-box", Fmake_weak_box, 1, 1, 0, /* Return a new weak box from value CONTENTS. @@ -3269,24 +3262,23 @@ } Lisp_Object -make_ephemeron(Lisp_Object key, Lisp_Object value, Lisp_Object finalizer) +make_ephemeron (Lisp_Object key, Lisp_Object value, Lisp_Object finalizer) { - Lisp_Object result, temp = Qnil; + Lisp_Object temp = Qnil; struct gcpro gcpro1, gcpro2; - - struct ephemeron *eph = - ALLOC_LCRECORD_TYPE (struct ephemeron, &lrecord_ephemeron); + Lisp_Object result = ALLOC_LISP_OBJECT (ephemeron); + struct ephemeron *eph = XEPHEMERON (result); eph->key = Qnil; eph->cons_chain = Qnil; eph->value = Qnil; - result = wrap_ephemeron(eph); + result = wrap_ephemeron (eph); GCPRO2 (result, temp); eph->key = key; - temp = Fcons(value, finalizer); - eph->cons_chain = Fcons(temp, Vall_ephemerons); + temp = Fcons (value, finalizer); + eph->cons_chain = Fcons (temp, Vall_ephemerons); eph->value = value; Vall_ephemerons = result; @@ -3307,12 +3299,11 @@ { XD_END } }; -DEFINE_LRECORD_IMPLEMENTATION ("ephemeron", ephemeron, - 0, /*dumpable-flag*/ - mark_ephemeron, print_ephemeron, - 0, ephemeron_equal, ephemeron_hash, - ephemeron_description, - struct ephemeron); +DEFINE_NONDUMPABLE_LISP_OBJECT ("ephemeron", ephemeron, + mark_ephemeron, print_ephemeron, + 0, ephemeron_equal, ephemeron_hash, + ephemeron_description, + struct ephemeron); DEFUN ("make-ephemeron", Fmake_ephemeron, 2, 3, 0, /* Return a new ephemeron with key KEY, value VALUE, and finalizer FINALIZER. @@ -3450,9 +3441,9 @@ void syms_of_data (void) { - INIT_LRECORD_IMPLEMENTATION (weak_list); - INIT_LRECORD_IMPLEMENTATION (ephemeron); - INIT_LRECORD_IMPLEMENTATION (weak_box); + INIT_LISP_OBJECT (weak_list); + INIT_LISP_OBJECT (ephemeron); + INIT_LISP_OBJECT (weak_box); DEFSYMBOL (Qquote); DEFSYMBOL (Qlambda);