#endif
#endif
+/* Extra internal type checking? */
+extern int suppress_checking;
+#ifdef ENABLE_CHECKING
+extern void die P_((const char *, const char *, int));
+#define CHECK(check,msg) ((check || suppress_checking ? 0 : die (msg, __FILE__, __LINE__)), 0)
+#else
+/* Produce same side effects and result, but don't complain. */
+#define CHECK(check,msg) ((check),0)
+#endif
+/* Define an Emacs version of "assert", since some system ones are
+ flaky. */
+#if defined (__GNUC__) && __GNUC__ >= 2 && defined (__STDC__)
+#define eassert(cond) CHECK(cond,"assertion failed: " #cond)
+#else
+#define eassert(cond) CHECK(cond,"assertion failed")
+#endif
+
/* Define the fundamental Lisp data structures. */
/* This is the set of Lisp data types. */
/* Extract a value or address from a Lisp_Object. */
-#define XCONS(a) ((struct Lisp_Cons *) XPNTR(a))
+#define XCONS(a) (eassert (GC_CONSP(a)),(struct Lisp_Cons *) XPNTR(a))
#define XVECTOR(a) ((struct Lisp_Vector *) XPNTR(a))
-#define XSTRING(a) ((struct Lisp_String *) XPNTR(a))
-#define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a))
-#define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a))
+#define XSTRING(a) (eassert (GC_STRINGP(a)),(struct Lisp_String *) XPNTR(a))
+#define XSYMBOL(a) (eassert (GC_SYMBOLP(a)),(struct Lisp_Symbol *) XPNTR(a))
+#define XFLOAT(a) (eassert (GC_FLOATP(a)),(struct Lisp_Float *) XPNTR(a))
/* Misc types. */
#define XMISC(a) ((union Lisp_Misc *) XPNTR(a))
#define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd))
/* Pseudovector types. */
-#define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
-#define XWINDOW(a) ((struct window *) XPNTR(a))
-#define XSUBR(a) ((struct Lisp_Subr *) XPNTR(a))
-#define XBUFFER(a) ((struct buffer *) XPNTR(a))
+#define XPROCESS(a) (eassert (GC_PROCESSP(a)),(struct Lisp_Process *) XPNTR(a))
+#define XWINDOW(a) (eassert (GC_WINDOWP(a)),(struct window *) XPNTR(a))
+#define XSUBR(a) (eassert (GC_SUBRP(a)),(struct Lisp_Subr *) XPNTR(a))
+#define XBUFFER(a) (eassert (GC_BUFFERP(a)),(struct buffer *) XPNTR(a))
#define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a))
#define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a))
You'd think we could store this information in the parent object
somewhere (after all, that should be visited once and then
ignored too, right?), but strings are GC'd strangely. */
- struct interval *parent;
+ union
+ {
+ struct interval *interval;
+ Lisp_Object obj;
+ } up;
+ unsigned int up_obj : 1;
/* The remaining components are `properties' of the interval.
The first four are duplicates for things which can be on the list,
for purposes of speed. */
- unsigned char write_protect; /* Non-zero means can't modify. */
- unsigned char visible; /* Zero means don't display. */
- unsigned char front_sticky; /* Non-zero means text inserted just
+ unsigned int write_protect : 1; /* Non-zero means can't modify. */
+ unsigned int visible : 1; /* Zero means don't display. */
+ unsigned int front_sticky : 1; /* Non-zero means text inserted just
before this interval goes into it. */
- unsigned char rear_sticky; /* Likewise for just after it. */
+ unsigned int rear_sticky : 1; /* Likewise for just after it. */
/* Properties of this interval.
The mark bit on this field says whether this particular interval
extern char *getenv (), *ctime (), *getwd ();
extern long *xmalloc (), *xrealloc ();
extern void xfree ();
+extern char *xstrdup P_ ((char *));
extern char *egetenv P_ ((char *));