/* Fundamental definitions for GNU Emacs Lisp interpreter.
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GNU Emacs.
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef EMACS_LISP_H
#define EMACS_LISP_H
#endif
-/* Used for making sure that Emacs is compilable in all
- configurations. */
-
-#ifdef USE_LISP_UNION_TYPE
-#undef NO_UNION_TYPE
-#endif
-
/* Define an Emacs version of "assert", since some system ones are
flaky. */
#ifndef ENABLE_CHECKING
#endif
#endif /* ENABLE_CHECKING */
\f
+/* Define this to make Lisp_Object use a union type instead of the
+ default int. FIXME: It might be better to add a flag to configure
+ to do this. */
+/* #define USE_LISP_UNION_TYPE */
+
/***** Select the tagging scheme. *****/
/* There are basically two options that control the tagging scheme:
- - NO_UNION_TYPE says that Lisp_Object should be an integer instead
- of a union.
+ - USE_LISP_UNION_TYPE says that Lisp_Object should be a union instead
+ of an integer.
- USE_LSB_TAG means that we can assume the least 3 bits of pointers are
always 0, and we can thus use them to hold tag bits, without
restricting our addressing space.
#endif
/* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */
-#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined MAC_OSX
+#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined DARWIN_OS
/* We also need to be able to specify mult-of-8 alignment on static vars. */
# if defined DECL_ALIGN
/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */
-# if defined NO_UNION_TYPE
+# ifndef USE_LISP_UNION_TYPE
# define USE_LSB_TAG
# endif
# endif
#define VALBITS (BITS_PER_EMACS_INT - GCTYPEBITS)
#endif
-#ifndef NO_UNION_TYPE
+#ifdef USE_LISP_UNION_TYPE
#ifndef WORDS_BIG_ENDIAN
#define LISP_MAKE_RVALUE(o) (o)
#endif
-#else /* NO_UNION_TYPE */
+#else /* USE_LISP_UNION_TYPE */
/* If union type is not wanted, define Lisp_Object as just a number. */
typedef EMACS_INT Lisp_Object;
#define LISP_MAKE_RVALUE(o) (0+(o))
-#endif /* NO_UNION_TYPE */
+#endif /* USE_LISP_UNION_TYPE */
/* In the size word of a vector, this bit means the vector has been marked. */
PVEC_HASH_TABLE = 0x40000,
PVEC_TERMINAL = 0x80000,
PVEC_SUB_CHAR_TABLE = 0x100000,
- PVEC_OTHER = 0x200000,
- PVEC_TYPE_MASK = 0x2ffe00
+ PVEC_FONT = 0x200000,
+ PVEC_OTHER = 0x400000,
+ PVEC_TYPE_MASK = 0x7ffe00
#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
For example, if tem is a Lisp_Object whose type is Lisp_Cons,
XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */
-#ifdef NO_UNION_TYPE
+#ifndef USE_LISP_UNION_TYPE
/* Return a perfect hash of the Lisp_Object representation. */
#define XHASH(a) (a)
#endif /* not USE_LSB_TAG */
-#else /* not NO_UNION_TYPE */
+#else /* USE_LISP_UNION_TYPE */
#define XHASH(a) ((a).i)
extern Lisp_Object make_number P_ ((EMACS_INT));
#endif
-#endif /* NO_UNION_TYPE */
+#endif /* USE_LISP_UNION_TYPE */
#define EQ(x, y) (XHASH (x) == XHASH (y))
#define SYMBOL_VALUE(sym) \
(XSYMBOL (sym)->indirect_variable \
- ? XSYMBOL (indirect_variable (sym))->value \
+ ? indirect_variable (XSYMBOL (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); \
+ indirect_variable (XSYMBOL (sym))->value = (val); \
else \
XSYMBOL (sym)->value = (val); \
} while (0)
} while (0)
/* Cast pointers to this type to compare them. Some machines want int. */
-#ifndef PNTR_COMPARISON_TYPE
#define PNTR_COMPARISON_TYPE EMACS_UINT
-#endif
\f
/* Define a built-in function for calling from Lisp.
`lname' should be the name to give the function in Lisp,
and (in particular) cannot call arbitrary Lisp code. */
#ifdef SYNC_INPUT
-extern void handle_async_input P_ ((void));
-extern int interrupt_input_pending;
+extern void process_pending_signals P_ ((void));
+extern int pending_signals;
#define QUIT \
do { \
Fthrow (Vthrow_on_input, Qt); \
Fsignal (Qquit, Qnil); \
} \
- else if (interrupt_input_pending) \
- handle_async_input (); \
+ else if (pending_signals) \
+ process_pending_signals (); \
} while (0)
#else /* not SYNC_INPUT */
EXFUN (Fsub1, 1);
EXFUN (Fmake_variable_buffer_local, 1);
-extern Lisp_Object indirect_variable P_ ((Lisp_Object));
+extern struct Lisp_Symbol *indirect_variable (struct Lisp_Symbol *);
extern Lisp_Object long_to_cons P_ ((unsigned long));
extern unsigned long cons_to_long P_ ((Lisp_Object));
extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
int hash_lookup P_ ((struct Lisp_Hash_Table *, Lisp_Object, unsigned *));
int hash_put P_ ((struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
unsigned));
-void hash_remove P_ ((struct Lisp_Hash_Table *, Lisp_Object));
void hash_clear P_ ((struct Lisp_Hash_Table *));
-void remove_hash_entry P_ ((struct Lisp_Hash_Table *, int));
+void init_weak_hash_tables P_ ((void));
extern void init_fns P_ ((void));
EXFUN (Fsxhash, 1);
EXFUN (Fmake_hash_table, MANY);
EXFUN (Fstring_as_multibyte, 1);
EXFUN (Fstring_as_unibyte, 1);
EXFUN (Fstring_to_multibyte, 1);
+EXFUN (Fstring_to_unibyte, 1);
EXFUN (Fsubstring, 3);
extern Lisp_Object substring_both P_ ((Lisp_Object, int, int, int, int));
EXFUN (Fnth, 2);
EXFUN (Fchar_table_range, 2);
EXFUN (Fset_char_table_range, 3);
EXFUN (Fset_char_table_default, 3);
-EXFUN (Foptimize_char_table, 1);
+EXFUN (Foptimize_char_table, 2);
EXFUN (Fmap_char_table, 2);
extern Lisp_Object copy_char_table P_ ((Lisp_Object));
extern Lisp_Object sub_char_table_ref P_ ((Lisp_Object, int));
/* defined in buffer.c */
extern int mouse_face_overlay_overlaps P_ ((Lisp_Object));
extern void nsberror P_ ((Lisp_Object)) NO_RETURN;
-extern char *no_switch_window P_ ((Lisp_Object window));
EXFUN (Fset_buffer_multibyte, 1);
EXFUN (Foverlay_start, 1);
EXFUN (Foverlay_end, 1);
+EXFUN (Foverlay_buffer, 1);
extern void adjust_overlays_for_insert P_ ((EMACS_INT, EMACS_INT));
extern void adjust_overlays_for_delete P_ ((EMACS_INT, EMACS_INT));
extern void fix_start_end_in_overlays P_ ((int, int));
EXFUN (Fbarf_if_buffer_read_only, 0);
EXFUN (Fcurrent_buffer, 0);
EXFUN (Fswitch_to_buffer, 2);
-EXFUN (Fpop_to_buffer, 3);
EXFUN (Fother_buffer, 3);
EXFUN (Foverlay_get, 2);
EXFUN (Fbuffer_modified_p, 1);
extern void init_fileio_once P_ ((void));
extern Lisp_Object make_temp_name P_ ((Lisp_Object, int));
EXFUN (Fmake_symbolic_link, 3);
+extern Lisp_Object Qdelete_directory;
+extern Lisp_Object Qdelete_file;
/* Defined in abbrev.c */
EXFUN (Feval_minibuffer, 2);
EXFUN (Fread_string, 5);
EXFUN (Fread_no_blanks_input, 3);
+EXFUN (Fassoc_string, 3);
extern Lisp_Object get_minibuffer P_ ((int));
extern void temp_echo_area_glyphs P_ ((Lisp_Object));
extern void init_minibuf_once P_ ((void));
extern void syms_of_minibuf P_ ((void));
-extern void keys_of_minibuf P_ ((void));
/* Defined in callint.c */
extern Lisp_Object Qvisible;
extern void store_frame_param P_ ((struct frame *, Lisp_Object, Lisp_Object));
extern void store_in_alist P_ ((Lisp_Object *, Lisp_Object, Lisp_Object));
-extern Lisp_Object do_switch_frame P_ ((Lisp_Object, int, int));
+extern Lisp_Object do_switch_frame P_ ((Lisp_Object, int, int, Lisp_Object));
extern Lisp_Object get_frame_param P_ ((struct frame *, Lisp_Object));
extern Lisp_Object frame_buffer_predicate P_ ((Lisp_Object));
EXFUN (Fframep, 1);
-EXFUN (Fselect_frame, 1);
+EXFUN (Fselect_frame, 2);
EXFUN (Fselected_frame, 0);
EXFUN (Fwindow_frame, 1);
EXFUN (Fframe_root_window, 1);
EXFUN (Fset_frame_position, 3);
EXFUN (Fraise_frame, 1);
EXFUN (Fredirect_frame_focus, 2);
-EXFUN (Fset_frame_selected_window, 2);
+EXFUN (Fset_frame_selected_window, 3);
extern Lisp_Object frame_buffer_list P_ ((Lisp_Object));
extern void frames_discard_buffer P_ ((Lisp_Object));
extern void set_frame_buffer_list P_ ((Lisp_Object, Lisp_Object));
/* defined in emacs.c */
extern Lisp_Object decode_env_path P_ ((char *, char *));
extern Lisp_Object Vinvocation_name, Vinvocation_directory;
+extern Lisp_Object Vbefore_init_time, Vafter_init_time;
extern Lisp_Object Vinstallation_directory;
extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
EXFUN (Fkill_emacs, 1);
void shut_down_emacs P_ ((int, int, Lisp_Object));
/* Nonzero means don't do interactive redisplay and don't change tty modes */
extern int noninteractive;
+
+/* Pipe used to send exit notification to the daemon parent at
+ startup. */
+extern int daemon_pipe[2];
+#define IS_DAEMON (daemon_pipe[1] != 0)
+
/* Nonzero means don't do use window-system-specific display code */
extern int inhibit_window_system;
/* Nonzero means that a filter or a sentinel is running. */
Lisp_Object,
Lisp_Object));
+/* defined in menu.c */
+extern void syms_of_menu P_ ((void));
+
/* defined in xmenu.c */
EXFUN (Fx_popup_menu, 2);
EXFUN (Fx_popup_dialog, 3);
/* Defined in dired.c */
EXFUN (Ffile_attributes, 2);
extern void syms_of_dired P_ ((void));
+extern Lisp_Object directory_files_internal P_ ((Lisp_Object, Lisp_Object,
+ Lisp_Object, Lisp_Object,
+ int, Lisp_Object));
/* Defined in term.c */
extern void syms_of_term P_ ((void));
EXFUN (Fdelete_terminal, 2);
extern void syms_of_terminal P_ ((void));
+/* Defined in font.c */
+extern void syms_of_font P_ ((void));
+
#ifdef HAVE_WINDOW_SYSTEM
/* Defined in fontset.c */
extern void syms_of_fontset P_ ((void));
EXFUN (Fmsdos_downcase_filename, 1);
#endif
-#ifdef MAC_OS
-/* Defined in macfns.c */
-extern void syms_of_macfns P_ ((void));
-
-/* Defined in macselect.c */
-extern void syms_of_macselect P_ ((void));
-
-/* Defined in macterm.c */
-extern void syms_of_macterm P_ ((void));
-
-/* Defined in macmenu.c */
-extern void syms_of_macmenu P_ ((void));
-
-/* Defined in mac.c */
-extern void syms_of_mac P_ ((void));
-#ifdef MAC_OSX
-extern void init_mac_osx_environment P_ ((void));
-#endif /* MAC_OSX */
-#endif /* MAC_OS */
-
#ifdef HAVE_MENUS
-/* Defined in (x|mac|w32)fns.c... */
+/* Defined in (x|w32)fns.c, nsfns.m... */
extern int have_menus_p P_ ((void));
#endif
+
+#ifdef HAVE_DBUS
+/* Defined in dbusbind.c */
+void xd_read_queued_messages P_ ((void));
+void syms_of_dbusbind P_ ((void));
+#endif
\f
/* Nonzero means Emacs has already been initialized.
Used during startup to detect startup of dumped Emacs. */