lrecord_type_coding_system,
lrecord_type_char_table,
lrecord_type_char_table_entry,
+ lrecord_type_byte_table,
+ lrecord_type_uint16_byte_table,
+ lrecord_type_uint8_byte_table,
lrecord_type_range_table,
lrecord_type_opaque,
lrecord_type_opaque_ptr,
lrecord_type_pgresult,
lrecord_type_devmode,
lrecord_type_mswindows_dialog_id,
+ lrecord_type_case_table,
+ lrecord_type_free, /* only used for "free" lrecords */
+ lrecord_type_undefined, /* only used for debugging */
lrecord_type_last_built_in_type /* must be last */
};
An array of Lisp objects or pointers to lrecords.
The third element is the count.
- XD_LO_RESET_NIL
- Lisp objects which will be reset to Qnil when dumping. Useful for cleaning
- up caches.
-
XD_LO_LINK
Link in a linked list of objects of the same type.
enum lrecord_description_type {
XD_LISP_OBJECT_ARRAY,
XD_LISP_OBJECT,
- XD_LO_RESET_NIL,
XD_LO_LINK,
XD_OPAQUE_PTR,
XD_STRUCT_PTR,
#define MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \
DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype) \
-unsigned int lrecord_type_##c_name = lrecord_type_count++; \
-const struct lrecord_implementation lrecord_##c_name = \
+unsigned int lrecord_type_##c_name; \
+struct lrecord_implementation lrecord_##c_name = \
{ name, marker, printer, nuker, equal, hash, desc, \
getprop, putprop, remprop, plist, size, sizer, \
- (enum lrecord_type)lrecord_type_##c_name, basic_p }
+ lrecord_type_last_built_in_type, basic_p }
extern Lisp_Object (*lrecord_markers[]) (Lisp_Object);
lrecord_implementations_table[lrecord_type_##type]->marker; \
} while (0)
+#define INIT_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \
+ lrecord_type_##type = lrecord_type_count++; \
+ lrecord_##type.lrecord_type_index = lrecord_type_##type; \
+ INIT_LRECORD_IMPLEMENTATION(type); \
+} while (0)
+
#define LRECORDP(a) (XTYPE (a) == Lisp_Type_Record)
#define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a))
# define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \
extern unsigned int lrecord_type_##c_name; \
-DECLARE_LRECORD(c_name, structtype)
+extern struct lrecord_implementation lrecord_##c_name; \
+INLINE_HEADER structtype * \
+error_check_##c_name (Lisp_Object obj); \
+INLINE_HEADER structtype * \
+error_check_##c_name (Lisp_Object obj) \
+{ \
+ assert (RECORD_TYPEP (obj, lrecord_type_##c_name)); \
+ return (structtype *) XPNTR (obj); \
+} \
+extern Lisp_Object Q##c_name##p
# define DECLARE_NONRECORD(c_name, type_enum, structtype) \
INLINE_HEADER structtype * \
# define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \
extern Lisp_Object Q##c_name##p; \
extern unsigned int lrecord_type_##c_name; \
-extern const struct lrecord_implementation lrecord_##c_name
+extern struct lrecord_implementation lrecord_##c_name
# define DECLARE_NONRECORD(c_name, type_enum, structtype) \
extern Lisp_Object Q##c_name##p
# define XRECORD(x, c_name, structtype) ((structtype *) XPNTR (x))