]> code.delx.au - gnu-emacs/blobdiff - src/lisp.h
Some changes from Michael K. Johnson for Linux.
[gnu-emacs] / src / lisp.h
index a770636c07460782206e2f214373e0e0091ad4a1..1fdcae2e62864ba6c215f92b91ad87080e197dc2 100644 (file)
@@ -153,12 +153,19 @@ enum Lisp_Type
     Lisp_Window,
 
     /* Used by save,set,restore-window-configuration */
-    Lisp_Window_Configuration
+    Lisp_Window_Configuration,
 
 #ifdef LISP_FLOAT_TYPE
-      ,
-    Lisp_Float
+    Lisp_Float,
 #endif /* LISP_FLOAT_TYPE */
+
+    /* The overlay type.
+       An overlay values is actually a retagged cons, the first in a
+       list of the form
+           ((START . END) nil . PLIST)
+       where START and END are markers in the overlay's buffer, and
+       PLIST is the overlay's property list.  */
+    Lisp_Overlay
   };
 
 #ifndef NO_UNION_TYPE
@@ -569,11 +576,38 @@ typedef unsigned char UCHAR;
 #define COMPILED_DOC_STRING 4
 #define COMPILED_INTERACTIVE 5
 
-/* Flag bits in a character.  */
+/* Flag bits in a character.  These also get used in termhooks.h.
+   Richard Stallman <rms@gnu.ai.mit.edu> thinks that MULE
+   (MUlti-Lingual Emacs) might need 18 bits for the character value
+   itself, so we probably shouldn't use any bits lower than 0x040000.  */
+#define CHAR_ALT   (0x040000)
+#define CHAR_SUPER (0x080000)
+#define CHAR_HYPER (0x100000)
+#define CHAR_SHIFT (0x200000)
+#define CHAR_CTL   (0x400000)
+#define CHAR_META  (0x800000)
+
+\f
+/* The glyph datatype, used to represent characters on the display.  */
+
+/* The low eight bits are the character code, and the bits above them
+   are the numeric face ID.  If FID is the face ID of a glyph on a
+   frame F, then F->display.x->faces[FID] contains the description of
+   that face.  This is an int instead of a short, so we can support a
+   good bunch of face ID's; given that we have no mechanism for
+   tossing unused frame face ID's yet, we'll probably run out of 255
+   pretty quickly.  */
+#define GLYPH unsigned int
+
+/* Given a character code and a face ID, return the appropriate glyph.  */
+#define MAKE_GLYPH(char, face) ((char) | ((face) << 8))
+
+/* Return a glyph's character code.  */
+#define GLYPH_CHAR(glyph) ((glyph) & 0xff)
+
+/* Return a glyph's face ID.  */
+#define GLYPH_FACE(glyph) (((glyph) >> 8) & 0xff)
 
-#define CHAR_META 0x800000
-#define CHAR_CTL  0x400000
-#define CHAR_SHIFT 0x200000
 \f
 /* Data type checking */
 
@@ -599,7 +633,12 @@ typedef unsigned char UCHAR;
 #define FRAMEP(x) (XTYPE ((x)) == Lisp_Frame)
 #define WINDOWP(x) (XTYPE ((x)) == Lisp_Window)
 #define WINDOW_CONFIGURATIONP(x) (XTYPE ((x)) == Lisp_Window_Configuration)
+#ifdef LISP_FLOAT_TYPE
 #define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
+#else
+#define FLOATP(x) (0)
+#endif
+#define OVERLAYP(x) (XTYPE ((x)) == Lisp_Overlay)
 
 #define EQ(x, y) (XFASTINT (x) == XFASTINT (y))
 #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y))
@@ -686,6 +725,9 @@ typedef unsigned char UCHAR;
 #define XFLOATINT(n) XINT((n))
 #endif /* LISP_FLOAT_TYPE */
 
+#define CHECK_OVERLAY(x, i) \
+  { if (XTYPE ((x)) != Lisp_Overlay) x = wrong_type_argument (Qoverlayp, (x));}
+
 /* Cast pointers to this type to compare them.  Some machines want int.  */
 #ifndef PNTR_COMPARISON_TYPE
 #define PNTR_COMPARISON_TYPE unsigned int
@@ -936,8 +978,8 @@ extern Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
 extern Lisp_Object Qend_of_file, Qarith_error;
 extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 
-Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error;
-Lisp_Object Qoverflow_error, Qunderflow_error;
+extern Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error;
+extern Lisp_Object Qoverflow_error, Qunderflow_error;
 
 extern Lisp_Object Qintegerp, Qnumberp, Qnatnump, Qsymbolp, Qlistp, Qconsp;
 extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
@@ -974,7 +1016,7 @@ extern Lisp_Object Fdefault_value (), Fset_default (), Fdefault_boundp ();
 
 extern Lisp_Object Faref (), Faset (), Farray_length ();
 
-extern Lisp_Object Fstring_to_number (), Fint_to_string ();
+extern Lisp_Object Fstring_to_number (), Fnumber_to_string ();
 extern Lisp_Object Feqlsign (), Fgtr (), Flss (), Fgeq (), Fleq ();
 extern Lisp_Object Fneq (), Fzerop ();
 extern Lisp_Object Fplus (), Fminus (), Ftimes (), Fquo (), Frem ();
@@ -985,6 +1027,8 @@ extern Lisp_Object Flsh (), Fash ();
 extern Lisp_Object Fadd1 (), Fsub1 ();
 
 extern Lisp_Object make_number ();
+extern Lisp_Object   long_to_cons ();
+extern unsigned long cons_to_long ();
 extern void args_out_of_range ();
 extern void args_out_of_range_3 ();
 extern Lisp_Object wrong_type_argument ();
@@ -1039,8 +1083,13 @@ extern Lisp_Object Vobarray, Vstandard_input;
 extern Lisp_Object Fread (), Fread_from_string ();
 extern Lisp_Object Fintern (), Fintern_soft (), Fload ();
 extern Lisp_Object Fget_file_char (), Fread_char ();
+extern Lisp_Object read_filtered_event ();
 extern Lisp_Object Feval_current_buffer (), Feval_region ();
 extern Lisp_Object intern (), oblookup ();
+#define LOADHIST_ATTACH(x) \
+ if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list)
+extern Lisp_Object Vcurrent_load_list;
+extern Lisp_Object Vload_history;
 
 /* Defined in eval.c */
 extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro;
@@ -1088,6 +1137,7 @@ extern Lisp_Object Fget_buffer (), Fget_buffer_create (), Fset_buffer ();
 extern Lisp_Object Fbarf_if_buffer_read_only ();
 extern Lisp_Object Fcurrent_buffer (), Fswitch_to_buffer (), Fpop_to_buffer ();
 extern Lisp_Object Fother_buffer ();
+extern Lisp_Object Qoverlayp;
 extern struct buffer *all_buffers;
 
 /* defined in marker.c */
@@ -1203,6 +1253,7 @@ extern Lisp_Object Frubber_band_rectangle ();
 
 /* defined in emacs.c */
 extern Lisp_Object decode_env_path ();
+extern Lisp_Object Vinvocation_name;
 void shut_down_emacs ( /* int signal */ );
 /* Nonzero means don't do interactive redisplay and don't change tty modes */
 extern int noninteractive;
@@ -1241,7 +1292,10 @@ extern int immediate_quit;           /* Nonzero means ^G can quit instantly */
 
 extern void debugger ();
 
-extern char *malloc (), *realloc (), *getenv (), *ctime (), *getwd ();
+extern void *malloc (), *realloc ();
+extern char *getenv (), *ctime (), *getwd ();
 extern long *xmalloc (), *xrealloc ();
+extern void xfree ();
 
 extern char *egetenv ();