+\f
+/***********************************************************************
+ Symbols
+ ***********************************************************************/
+
+/* Interned state of a symbol. */
+
+enum symbol_interned
+{
+ SYMBOL_UNINTERNED = 0,
+ SYMBOL_INTERNED = 1,
+ SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2
+};
+
+/* In a symbol, the markbit of the plist is used as the gc mark bit */
+
+struct Lisp_Symbol
+{
+ /* Non-zero means symbol serves as a variable alias. The symbol
+ holding the real value is found in the value slot. */
+ unsigned indirect_variable : 1;
+
+ /* Non-zero means symbol is constant, i.e. changing its value
+ should signal an error. */
+ unsigned constant : 1;
+
+ /* Interned state of the symbol. This is an enumerator from
+ enum symbol_interned. */
+ unsigned interned : 2;
+
+ /* The symbol's name. This should become a Lisp_Object
+ some day; there's no need for the Lisp_String pointer nowadays. */
+ struct Lisp_String *name;
+
+ /* Value of the symbol or Qunbound if unbound. If this symbol is a
+ defvaralias, `value' contains the symbol for which it is an
+ alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get
+ and set a symbol's value, to take defvaralias into account. */
+ Lisp_Object value;
+
+ /* Function value of the symbol or Qunbound if not fcoundp. */
+ Lisp_Object function;
+
+ /* The symbol's property list. */
+ Lisp_Object plist;
+
+ /* Next symbol in obarray bucket, if the symbol is interned. */
+ struct Lisp_Symbol *next;
+};
+
+/* Value is non-zero if SYM is an interned symbol. */
+
+#define SYMBOL_INTERNED_P(sym) \
+ (XSYMBOL (sym)->interned != SYMBOL_UNINTERNED)
+
+/* Value is non-zero if SYM is interned in initial_obarray. */
+
+#define SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P(sym) \
+ (XSYMBOL (sym)->interned == SYMBOL_INTERNED_IN_INITIAL_OBARRAY)
+
+/* Value is non-zero if symbol is considered a constant, i.e. its
+ value cannot be changed (there is an exception for keyword symbols,
+ whose value can be set to the keyword symbol itself). */
+
+#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant
+
+/* Value is the value of SYM, with defvaralias taken into
+ account. */
+
+#define SYMBOL_VALUE(sym) \
+ (XSYMBOL (sym)->indirect_variable \
+ ? XSYMBOL (indirect_variable (sym))->value \
+ : XSYMBOL (sym)->value)
+
+/* Set SYM's value to VAL, taking defvaralias into account. */
+
+#define SET_SYMBOL_VALUE(sym, val) \
+ do { \
+ if (XSYMBOL (sym)->indirect_variable) \
+ XSYMBOL (indirect_variable ((sym)))->value = (val); \
+ else \
+ XSYMBOL (sym)->value = (val); \
+ } while (0)
+