]> code.delx.au - gnu-emacs/blobdiff - src/lisp.h
(regi-interpret): Use `mapc' rather than `mapcar'.
[gnu-emacs] / src / lisp.h
index 2273015d6436828fdb5493ec7dbbc21146bd4e87..65ea46fae1f603c4c3f89f740378ebf2bbc77675 100644 (file)
@@ -84,14 +84,14 @@ extern void die P_((const char *, const char *, int)) NO_RETURN;
 
 #ifdef ENABLE_CHECKING
 
-#define CHECK(check,msg) ((void)((check) || suppress_checking           \
-                                 ? (void) 0                             \
-                                 : die ((msg), __FILE__, __LINE__)),   \
+#define CHECK(check,msg) (((check) || suppress_checking                \
+                          ? (void) 0                           \
+                          : die ((msg), __FILE__, __LINE__)),  \
                          0)
 #else
 
 /* Produce same side effects and result, but don't complain.  */
-#define CHECK(check,msg) ((void)(check),0)
+#define CHECK(check,msg) ((check),0)
 
 #endif
 
@@ -274,7 +274,8 @@ typedef EMACS_INT Lisp_Object;
 
 /* In a pseudovector, the size field actually contains a word with one
    PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to
-   indicate the actual type.  */
+   indicate the actual type.
+   FIXME: Why a bitset if only one of the bits can ever be set at a time?  */
 enum pvec_type
 {
   PVEC_NORMAL_VECTOR = 0,
@@ -288,7 +289,8 @@ enum pvec_type
   PVEC_BOOL_VECTOR = 0x10000,
   PVEC_BUFFER = 0x20000,
   PVEC_HASH_TABLE = 0x40000,
-  PVEC_TYPE_MASK = 0x7fe00
+  PVEC_TERMINAL = 0x80000,
+  PVEC_TYPE_MASK = 0xffe00
 
 #if 0 /* This is used to make the value of PSEUDOVECTOR_FLAG available to
         GDB.  It doesn't work on OS Alpha.  Moved to a variable in
@@ -538,6 +540,7 @@ extern size_t pure_size;
 
 #define XPROCESS(a) (eassert (GC_PROCESSP(a)),(struct Lisp_Process *) XPNTR(a))
 #define XWINDOW(a) (eassert (GC_WINDOWP(a)),(struct window *) XPNTR(a))
+#define XTERMINAL(a) (eassert (GC_TERMINALP(a)),(struct terminal *) 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))
@@ -565,6 +568,7 @@ extern size_t pure_size;
   (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION))
 #define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS))
 #define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW))
+#define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL))
 #define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR))
 #define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED))
 #define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER))
@@ -891,7 +895,7 @@ struct Lisp_Subr
     Lisp_Object (*function) ();
     short min_args, max_args;
     char *symbol_name;
-    char *prompt;
+    char *intspec;
     char *doc;
   };
 
@@ -1517,6 +1521,8 @@ typedef unsigned char UCHAR;
 #define GC_PROCESSP(x) GC_PSEUDOVECTORP (x, PVEC_PROCESS)
 #define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW)
 #define GC_WINDOWP(x) GC_PSEUDOVECTORP (x, PVEC_WINDOW)
+#define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL)
+#define GC_TERMINALP(x) GC_PSEUDOVECTORP (x, PVEC_TERMINAL)
 #define SUBRP(x) PSEUDOVECTORP (x, PVEC_SUBR)
 #define GC_SUBRP(x) GC_PSEUDOVECTORP (x, PVEC_SUBR)
 #define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED)
@@ -1669,30 +1675,33 @@ typedef unsigned char UCHAR;
         followed by the address of a vector of Lisp_Objects
         which contains the argument values.
     UNEVALLED means pass the list of unevaluated arguments
- `prompt' says how to read arguments for an interactive call.
-    See the doc string for `interactive'.
+ `intspec' says how interactive arguments are to be fetched.
+    If the string starts with a `(', `intspec' is evaluated and the resulting
+    list is the list of arguments.
+    If it's a string that doesn't start with `(', the value should follow
+    the one of the doc string for `interactive'.
     A null string means call interactively with no arguments.
  `doc' is documentation for the user.  */
 
 #if (!defined (__STDC__) && !defined (PROTOTYPES)) \
     || defined (USE_NONANSI_DEFUN)
 
-#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc)     \
+#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)    \
   Lisp_Object fnname ();                                               \
   DECL_ALIGN (struct Lisp_Subr, sname) =                               \
     { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)),    \
-      fnname, minargs, maxargs, lname, prompt, 0};                     \
+      fnname, minargs, maxargs, lname, intspec, 0};                    \
   Lisp_Object fnname
 
 #else
 
 /* This version of DEFUN declares a function prototype with the right
    arguments, so we can catch errors with maxargs at compile-time.  */
-#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc)     \
+#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)    \
   Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                          \
   DECL_ALIGN (struct Lisp_Subr, sname) =                               \
     { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)),    \
-      fnname, minargs, maxargs, lname, prompt, 0};                     \
+      fnname, minargs, maxargs, lname, intspec, 0};                    \
   Lisp_Object fnname
 
 /* Note that the weird token-substitution semantics of ANSI C makes
@@ -2597,6 +2606,7 @@ extern struct Lisp_Hash_Table *allocate_hash_table P_ ((void));
 extern struct window *allocate_window P_ ((void));
 extern struct frame *allocate_frame P_ ((void));
 extern struct Lisp_Process *allocate_process P_ ((void));
+extern struct terminal *allocate_terminal P_ ((void));
 extern int gc_in_progress;
 extern int abort_on_gc;
 extern Lisp_Object make_float P_ ((double));
@@ -3009,6 +3019,7 @@ extern void init_keyboard P_ ((void));
 extern void syms_of_keyboard P_ ((void));
 extern void keys_of_keyboard P_ ((void));
 extern char *push_key_description P_ ((unsigned int, char *, int));
+extern void add_user_signal P_ ((int sig, const char *name));
 
 
 /* defined in indent.c */
@@ -3120,7 +3131,7 @@ EXFUN (Fcall_process, MANY);
 extern int child_setup P_ ((int, int, int, char **, int, Lisp_Object));
 extern void init_callproc_1 P_ ((void));
 extern void init_callproc P_ ((void));
-extern void set_global_environment P_ ((void));
+extern void set_initial_environment P_ ((void));
 extern void syms_of_callproc P_ ((void));
 
 /* defined in doc.c */
@@ -3388,6 +3399,11 @@ extern Lisp_Object Vdirectory_sep_char;
 #define min(a, b)      ((a) < (b) ? (a) : (b))
 #define max(a, b)      ((a) > (b) ? (a) : (b))
 
+/* Make sure we have abs defined */
+#if !defined(abs)
+#define abs(x)         ((x) < 0 ? -(x) : (x))
+#endif
+
 /* Return a fixnum or float, depending on whether VAL fits in a Lisp
    fixnum.  */