Mercurial > hg > xemacs-beta
comparison src/lrecord.h @ 1632:64eaceca611d
[xemacs-hg @ 2003-08-19 02:07:03 by james]
Enable module building and running on Cygwin and MinGW.
author | james |
---|---|
date | Tue, 19 Aug 2003 02:07:16 +0000 |
parents | 969b7290edca |
children | 1ecc2785dce3 |
comparison
equal
deleted
inserted
replaced
1631:1bf7b032a45d | 1632:64eaceca611d |
---|---|
216 lrecord_type_free, /* only used for "free" lrecords */ | 216 lrecord_type_free, /* only used for "free" lrecords */ |
217 lrecord_type_undefined, /* only used for debugging */ | 217 lrecord_type_undefined, /* only used for debugging */ |
218 lrecord_type_last_built_in_type /* must be last */ | 218 lrecord_type_last_built_in_type /* must be last */ |
219 }; | 219 }; |
220 | 220 |
221 extern int lrecord_type_count; | 221 extern MODULE_API int lrecord_type_count; |
222 | 222 |
223 struct lrecord_implementation | 223 struct lrecord_implementation |
224 { | 224 { |
225 const char *name; | 225 const char *name; |
226 | 226 |
299 /* All the built-in lisp object types are enumerated in `enum lrecord_type'. | 299 /* All the built-in lisp object types are enumerated in `enum lrecord_type'. |
300 Additional ones may be defined by a module (none yet). We leave some | 300 Additional ones may be defined by a module (none yet). We leave some |
301 room in `lrecord_implementations_table' for such new lisp object types. */ | 301 room in `lrecord_implementations_table' for such new lisp object types. */ |
302 #define MODULE_DEFINABLE_TYPE_COUNT 32 | 302 #define MODULE_DEFINABLE_TYPE_COUNT 32 |
303 | 303 |
304 extern const struct lrecord_implementation *lrecord_implementations_table[lrecord_type_last_built_in_type + MODULE_DEFINABLE_TYPE_COUNT]; | 304 extern MODULE_API const struct lrecord_implementation * |
305 lrecord_implementations_table[lrecord_type_last_built_in_type + MODULE_DEFINABLE_TYPE_COUNT]; | |
305 | 306 |
306 #define XRECORD_LHEADER_IMPLEMENTATION(obj) \ | 307 #define XRECORD_LHEADER_IMPLEMENTATION(obj) \ |
307 LHEADER_IMPLEMENTATION (XRECORD_LHEADER (obj)) | 308 LHEADER_IMPLEMENTATION (XRECORD_LHEADER (obj)) |
308 #define LHEADER_IMPLEMENTATION(lh) lrecord_implementations_table[(lh)->type] | 309 #define LHEADER_IMPLEMENTATION(lh) lrecord_implementations_table[(lh)->type] |
309 | 310 |
917 struct lrecord_implementation lrecord_##c_name = \ | 918 struct lrecord_implementation lrecord_##c_name = \ |
918 { name, dumpable, marker, printer, nuker, equal, hash, desc, \ | 919 { name, dumpable, marker, printer, nuker, equal, hash, desc, \ |
919 getprop, putprop, remprop, plist, size, sizer, \ | 920 getprop, putprop, remprop, plist, size, sizer, \ |
920 lrecord_type_last_built_in_type, basic_p } | 921 lrecord_type_last_built_in_type, basic_p } |
921 | 922 |
922 extern Lisp_Object (*lrecord_markers[]) (Lisp_Object); | 923 extern MODULE_API Lisp_Object (*lrecord_markers[]) (Lisp_Object); |
923 | 924 |
924 #define INIT_LRECORD_IMPLEMENTATION(type) do { \ | 925 #define INIT_LRECORD_IMPLEMENTATION(type) do { \ |
925 lrecord_implementations_table[lrecord_type_##type] = &lrecord_##type; \ | 926 lrecord_implementations_table[lrecord_type_##type] = &lrecord_##type; \ |
926 lrecord_markers[lrecord_type_##type] = \ | 927 lrecord_markers[lrecord_type_##type] = \ |
927 lrecord_implementations_table[lrecord_type_##type]->marker; \ | 928 lrecord_implementations_table[lrecord_type_##type]->marker; \ |
1132 assert_at_line (RECORD_TYPEP (obj, lrecord_type_##c_name), file, line); \ | 1133 assert_at_line (RECORD_TYPEP (obj, lrecord_type_##c_name), file, line); \ |
1133 return (structtype *) XPNTR (obj); \ | 1134 return (structtype *) XPNTR (obj); \ |
1134 } \ | 1135 } \ |
1135 extern Lisp_Object Q##c_name##p | 1136 extern Lisp_Object Q##c_name##p |
1136 | 1137 |
1138 # define DECLARE_MODULE_API_LRECORD(c_name, structtype) \ | |
1139 extern MODULE_API const struct lrecord_implementation lrecord_##c_name; \ | |
1140 DECLARE_INLINE_HEADER ( \ | |
1141 structtype * \ | |
1142 error_check_##c_name (Lisp_Object obj, const char *file, int line) \ | |
1143 ) \ | |
1144 { \ | |
1145 assert_at_line (RECORD_TYPEP (obj, lrecord_type_##c_name), file, line); \ | |
1146 return (structtype *) XPNTR (obj); \ | |
1147 } \ | |
1148 extern MODULE_API Lisp_Object Q##c_name##p | |
1149 | |
1137 # define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ | 1150 # define DECLARE_EXTERNAL_LRECORD(c_name, structtype) \ |
1138 extern int lrecord_type_##c_name; \ | 1151 extern int lrecord_type_##c_name; \ |
1139 extern struct lrecord_implementation lrecord_##c_name; \ | 1152 extern struct lrecord_implementation lrecord_##c_name; \ |
1140 DECLARE_INLINE_HEADER ( \ | 1153 DECLARE_INLINE_HEADER ( \ |
1141 structtype * \ | 1154 structtype * \ |
1345 *implementation); | 1358 *implementation); |
1346 Lisp_Object alloc_managed_lcrecord (Lisp_Object lcrecord_list); | 1359 Lisp_Object alloc_managed_lcrecord (Lisp_Object lcrecord_list); |
1347 void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord); | 1360 void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord); |
1348 | 1361 |
1349 /* AUTO-MANAGED MODEL: */ | 1362 /* AUTO-MANAGED MODEL: */ |
1350 void *alloc_automanaged_lcrecord (Bytecount size, | 1363 MODULE_API void * |
1351 const struct lrecord_implementation *); | 1364 alloc_automanaged_lcrecord (Bytecount size, |
1365 const struct lrecord_implementation *); | |
1352 #define alloc_lcrecord_type(type, lrecord_implementation) \ | 1366 #define alloc_lcrecord_type(type, lrecord_implementation) \ |
1353 ((type *) alloc_automanaged_lcrecord (sizeof (type), lrecord_implementation)) | 1367 ((type *) alloc_automanaged_lcrecord (sizeof (type), lrecord_implementation)) |
1354 void free_lcrecord (Lisp_Object rec); | 1368 void free_lcrecord (Lisp_Object rec); |
1355 | 1369 |
1356 | 1370 |
1462 #define dump_add_weak_object_chain(varaddr) DO_NOTHING | 1476 #define dump_add_weak_object_chain(varaddr) DO_NOTHING |
1463 #endif | 1477 #endif |
1464 | 1478 |
1465 /* Nonzero means Emacs has already been initialized. | 1479 /* Nonzero means Emacs has already been initialized. |
1466 Used during startup to detect startup of dumped Emacs. */ | 1480 Used during startup to detect startup of dumped Emacs. */ |
1467 extern int initialized; | 1481 extern MODULE_API int initialized; |
1468 | 1482 |
1469 #ifdef PDUMP | 1483 #ifdef PDUMP |
1470 | 1484 |
1471 void pdump_objects_unmark (void); | 1485 void pdump_objects_unmark (void); |
1472 void pdump (void); | 1486 void pdump (void); |