comparison src/lrecord.h @ 996:25e260cb7994

[xemacs-hg @ 2002-09-10 15:27:02 by james] Enable unloading of dynamic modules. Create the first two internal XEmacs modules: LDAP and postgreSQL. Update the sample directory to contain a sample internal XEmacs module and a sample external XEmacs module. Improve support for autoloading modules. Make internal module code compile into the XEmacs binary if XEmacs is configured without module support. Make the internal module directories self-contained so that they can be distributed separately from XEmacs.
author james
date Tue, 10 Sep 2002 15:27:39 +0000
parents c925bacdda60
children e22b0213b713
comparison
equal deleted inserted replaced
995:4575a219af58 996:25e260cb7994
768 lrecord_type_##type = lrecord_type_count++; \ 768 lrecord_type_##type = lrecord_type_count++; \
769 lrecord_##type.lrecord_type_index = lrecord_type_##type; \ 769 lrecord_##type.lrecord_type_index = lrecord_type_##type; \
770 INIT_LRECORD_IMPLEMENTATION(type); \ 770 INIT_LRECORD_IMPLEMENTATION(type); \
771 } while (0) 771 } while (0)
772 772
773 #ifdef HAVE_SHLIB
774 /* Allow undefining types in order to support module unloading. */
775
776 #define UNDEF_LRECORD_IMPLEMENTATION(type) do { \
777 lrecord_implementations_table[lrecord_type_##type] = NULL; \
778 lrecord_markers[lrecord_type_##type] = NULL; \
779 } while (0)
780
781 #define UNDEF_EXTERNAL_LRECORD_IMPLEMENTATION(type) do { \
782 if (lrecord_##type.lrecord_type_index == lrecord_type_count - 1) { \
783 /* This is the most recently defined type. Clean up nicely. */ \
784 lrecord_type_##type = lrecord_type_count--; \
785 } /* Else we can't help leaving a hole with this implementation. */ \
786 UNDEF_LRECORD_IMPLEMENTATION(type); \
787 } while (0)
788
789 #endif /* HAVE_SHLIB */
790
773 #define LRECORDP(a) (XTYPE (a) == Lisp_Type_Record) 791 #define LRECORDP(a) (XTYPE (a) == Lisp_Type_Record)
774 #define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a)) 792 #define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a))
775 793
776 #define RECORD_TYPEP(x, ty) \ 794 #define RECORD_TYPEP(x, ty) \
777 (LRECORDP (x) && (XRECORD_LHEADER (x)->type == (unsigned int) (ty))) 795 (LRECORDP (x) && (XRECORD_LHEADER (x)->type == (unsigned int) (ty)))