comparison src/mule-charset.c @ 5133:444a448b2f53

Merge branch ben-lisp-object into default branch
author Ben Wing <ben@xemacs.org>
date Sun, 07 Mar 2010 06:47:37 -0600
parents a9c41067dd88
children f965e31a35f0
comparison
equal deleted inserted replaced
5113:b2dcf6a6d8ab 5133:444a448b2f53
1 /* Functions to handle multilingual characters. 1 /* Functions to handle multilingual characters.
2 Copyright (C) 1992, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1992, 1995 Free Software Foundation, Inc.
3 Copyright (C) 1995 Sun Microsystems, Inc. 3 Copyright (C) 1995 Sun Microsystems, Inc.
4 Copyright (C) 2001, 2002, 2004, 2005 Ben Wing. 4 Copyright (C) 2001, 2002, 2004, 2005, 2010 Ben Wing.
5 5
6 This file is part of XEmacs. 6 This file is part of XEmacs.
7 7
8 XEmacs is free software; you can redistribute it and/or modify it 8 XEmacs is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
176 { XD_UNION, offsetof (Lisp_Charset, from_unicode_table), 176 { XD_UNION, offsetof (Lisp_Charset, from_unicode_table),
177 XD_INDIRECT (1, 0), { &from_unicode_description }, XD_FLAG_NO_KKCC }, 177 XD_INDIRECT (1, 0), { &from_unicode_description }, XD_FLAG_NO_KKCC },
178 { XD_END } 178 { XD_END }
179 }; 179 };
180 180
181 DEFINE_LRECORD_IMPLEMENTATION ("charset", charset, 181 DEFINE_DUMPABLE_LISP_OBJECT ("charset", charset,
182 1, /* dumpable flag */ 182 mark_charset, print_charset, 0,
183 mark_charset, print_charset, 0, 183 0, 0, charset_description, Lisp_Charset);
184 0, 0, charset_description, Lisp_Charset);
185 /* Make a new charset. */ 184 /* Make a new charset. */
186 /* #### SJT Should generic properties be allowed? */ 185 /* #### SJT Should generic properties be allowed? */
187 static Lisp_Object 186 static Lisp_Object
188 make_charset (int id, Lisp_Object name, int rep_bytes, 187 make_charset (int id, Lisp_Object name, int rep_bytes,
189 int type, int columns, int graphic, 188 int type, int columns, int graphic,
194 Lisp_Object obj; 193 Lisp_Object obj;
195 Lisp_Charset *cs; 194 Lisp_Charset *cs;
196 195
197 if (!overwrite) 196 if (!overwrite)
198 { 197 {
199 cs = ALLOC_LCRECORD_TYPE (Lisp_Charset, &lrecord_charset); 198 obj = ALLOC_NORMAL_LISP_OBJECT (charset);
200 obj = wrap_charset (cs); 199 cs = XCHARSET (obj);
201 200
202 if (final) 201 if (final)
203 { 202 {
204 /* some charsets do not have final characters. This includes 203 /* some charsets do not have final characters. This includes
205 ASCII, Control-1, Composite, and the two faux private 204 ASCII, Control-1, Composite, and the two faux private
998 997
999 static void 998 static void
1000 compute_charset_usage (Lisp_Object charset, struct charset_stats *stats, 999 compute_charset_usage (Lisp_Object charset, struct charset_stats *stats,
1001 struct overhead_stats *ovstats) 1000 struct overhead_stats *ovstats)
1002 { 1001 {
1003 struct Lisp_Charset *c = XCHARSET (charset);
1004 xzero (*stats); 1002 xzero (*stats);
1005 stats->other += LISPOBJ_STORAGE_SIZE (c, sizeof (*c), ovstats); 1003 stats->other += lisp_object_storage_size (charset, ovstats);
1006 stats->from_unicode += compute_from_unicode_table_size (charset, ovstats); 1004 stats->from_unicode += compute_from_unicode_table_size (charset, ovstats);
1007 stats->to_unicode += compute_to_unicode_table_size (charset, ovstats); 1005 stats->to_unicode += compute_to_unicode_table_size (charset, ovstats);
1008 } 1006 }
1009 1007
1010 DEFUN ("charset-memory-usage", Fcharset_memory_usage, 1, 1, 0, /* 1008 DEFUN ("charset-memory-usage", Fcharset_memory_usage, 1, 1, 0, /*
1053 /************************************************************************/ 1051 /************************************************************************/
1054 1052
1055 void 1053 void
1056 syms_of_mule_charset (void) 1054 syms_of_mule_charset (void)
1057 { 1055 {
1058 INIT_LRECORD_IMPLEMENTATION (charset); 1056 INIT_LISP_OBJECT (charset);
1059 1057
1060 DEFSUBR (Fcharsetp); 1058 DEFSUBR (Fcharsetp);
1061 DEFSUBR (Ffind_charset); 1059 DEFSUBR (Ffind_charset);
1062 DEFSUBR (Fget_charset); 1060 DEFSUBR (Fget_charset);
1063 DEFSUBR (Fcharset_list); 1061 DEFSUBR (Fcharset_list);