diff src/symeval.h @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 8626e4521993
children a86b2b5e0111
line wrap: on
line diff
--- a/src/symeval.h	Mon Aug 13 11:12:06 2007 +0200
+++ b/src/symeval.h	Mon Aug 13 11:13:30 2007 +0200
@@ -23,8 +23,8 @@
 /* Fsymbol_value checks whether XSYMBOL (sym)->value is one of these,
  *  and does weird magic stuff if so */
 
-#ifndef _XEMACS_SYMEVAL_H_
-#define _XEMACS_SYMEVAL_H_
+#ifndef INCLUDED_symeval_h_
+#define INCLUDED_symeval_h_
 
 enum symbol_value_type
 {
@@ -72,6 +72,7 @@
 struct symbol_value_magic
 {
   struct lcrecord_header lcheader;
+  void *value;
   enum symbol_value_type type;
 };
 #define SYMBOL_VALUE_MAGIC_P(x)				\
@@ -138,7 +139,7 @@
 DECLARE_LRECORD (symbol_value_forward, struct symbol_value_forward);
 #define XSYMBOL_VALUE_FORWARD(x) \
 	XRECORD (x, symbol_value_forward, struct symbol_value_forward)
-#define symbol_value_forward_forward(m) ((void *)((m)->magic.lcheader.next))
+#define symbol_value_forward_forward(m) ((void *)((m)->magic.value))
 #define symbol_value_forward_magicfun(m) ((m)->magicfun)
 
 /* 2. symbol-value-buffer-local */
@@ -281,33 +282,47 @@
 void defsubr_macro (Lisp_Subr *);
 #define DEFSUBR_MACRO(Fname) defsubr_macro (&S##Fname)
 
-void defsymbol (Lisp_Object *location, CONST char *name);
+void defsymbol (Lisp_Object *location, const char *name);
+void defsymbol_nodump (Lisp_Object *location, const char *name);
 
-void defkeyword (Lisp_Object *location, CONST char *name);
+void defkeyword (Lisp_Object *location, const char *name);
 
-void deferror (Lisp_Object *symbol, CONST char *name,
-	       CONST char *message, Lisp_Object inherits_from);
+void deferror (Lisp_Object *symbol, const char *name,
+	       const char *message, Lisp_Object inherits_from);
 
 /* Macros we use to define forwarded Lisp variables.
    These are used in the syms_of_FILENAME functions.  */
 
-void defvar_magic (CONST char *symbol_name, CONST struct symbol_value_forward *magic);
-
-#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
-# define symbol_value_forward_lheader_initializer { 1, 0, 0 }
-#else
-# define symbol_value_forward_lheader_initializer \
-   { lrecord_symbol_value_forward }
-#endif
+void defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic);
 
 #define DEFVAR_SYMVAL_FWD(lname, c_location, forward_type, magicfun) do {	\
-  static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C		\
-   = { { { symbol_value_forward_lheader_initializer,				\
-	   (struct lcrecord_header *) (c_location), 69 },			\
-         forward_type }, magicfun };						\
+  static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C =		\
+  { /* struct symbol_value_forward */						\
+    { /* struct symbol_value_magic */						\
+      { /* struct lcrecord_header */						\
+	{ /* struct lrecord_header */						\
+	  1, /* type - index into lrecord_implementations_table */		\
+	  0, /* mark bit */							\
+	  0, /* c_readonly bit */						\
+	  0  /* lisp_readonly bit */						\
+	},									\
+	0, /* next */								\
+	0, /* uid  */								\
+	0  /* free */								\
+      },									\
+      c_location,								\
+      forward_type								\
+    },										\
+    magicfun									\
+  };										\
   defvar_magic ((lname), &I_hate_C);						\
 } while (0)
 
+#define DEFVAR_SYMVAL_FWD_INT(lname, c_location, forward_type, magicfun) do{	\
+  DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun);		\
+  dumpopaque (c_location, sizeof(int));						\
+} while (0)
+
 #define DEFVAR_SYMVAL_FWD_OBJECT(lname, c_location, forward_type, magicfun) do{ \
   DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun);		\
   staticpro (c_location);							\
@@ -321,18 +336,18 @@
 #define DEFVAR_SPECIFIER(lname, c_location) \
 	DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_CONST_SPECIFIER_FORWARD, 0)
 #define DEFVAR_INT(lname, c_location) \
-	DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0)
+	DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, 0)
 #define DEFVAR_CONST_INT(lname, c_location) \
-	DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0)
+	DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_FIXNUM_FORWARD, 0)
 #define DEFVAR_BOOL(lname, c_location) \
-	DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0)
+	DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, 0)
 #define DEFVAR_CONST_BOOL(lname, c_location) \
-	DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_CONST_BOOLEAN_FORWARD, 0)
+	DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_CONST_BOOLEAN_FORWARD, 0)
 #define DEFVAR_LISP_MAGIC(lname, c_location, magicfun) \
-	DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun);
+	DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun)
 #define DEFVAR_INT_MAGIC(lname, c_location, magicfun) \
-	DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun);
+	DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun)
 #define DEFVAR_BOOL_MAGIC(lname, c_location, magicfun) \
-	DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun);
+	DEFVAR_SYMVAL_FWD_INT (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun)
 
-#endif /* _XEMACS_SYMEVAL_H_ */
+#endif /* INCLUDED_symeval_h_ */