2011-03-16 Paul Eggert <eggert@cs.ucla.edu>
+ New file unexec.h, the (simple) interface for unexec.
+ * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
+ (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
+ Depend on unexec.h.
+ * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
+ * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
+ * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
+
* syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
shadowing.
(back_comment, skip_chars): Mark vars as initialized.
emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
termhooks.h buffer.h atimer.h systime.h $(INTERVALS_H) lisp.h $(config_h) \
globals.h ../lib/unistd.h window.h dispextern.h keyboard.h keymap.h \
- frame.h coding.h gnutls.h msdos.h
+ frame.h coding.h gnutls.h msdos.h unexec.h
fileio.o: fileio.c window.h buffer.h systime.h $(INTERVALS_H) character.h \
coding.h msdos.h blockinput.h atimer.h lisp.h $(config_h) frame.h \
commands.h globals.h ../lib/unistd.h
tparam.o: tparam.c tparam.h lisp.h $(config_h)
undo.o: undo.c buffer.h commands.h window.h dispextern.h msdos.h \
lisp.h globals.h $(config_h)
-unexaix.o: unexaix.c lisp.h $(config_h)
+unexaix.o: unexaix.c lisp.h unexec.h $(config_h)
unexalpha.o: unexalpha.c $(config_h)
-unexcw.o: unexcw.c lisp.h $(config_h)
-unexcoff.o: unexcoff.c lisp.h $(config_h)
-unexelf.o: unexelf.c ../lib/unistd.h $(config_h)
-unexhp9k800.o: unexhp9k800.c $(config_h)
-unexmacosx.o: unexmacosx.c $(config_h)
-unexsol.o: unexsol.c lisp.h $(config_h)
-unexw32.o: unexw32.c $(config_h)
+unexcw.o: unexcw.c lisp.h unexec.h $(config_h)
+unexcoff.o: unexcoff.c lisp.h unexec.h $(config_h)
+unexelf.o: unexelf.c unexec.h ../lib/unistd.h $(config_h)
+unexhp9k800.o: unexhp9k800.c unexec.h $(config_h)
+unexmacosx.o: unexmacosx.c unexec.h $(config_h)
+unexsol.o: unexsol.c lisp.h unexec.h $(config_h)
+unexw32.o: unexw32.c unexec.h $(config_h)
w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
msdos.h buffer.h charset.h coding.h composite.h lisp.h $(config_h)
widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
\f
#ifndef CANNOT_DUMP
-/* FIXME: maybe this should go into header file, config.h seems the
- only one appropriate. */
-extern int unexec (const char *, const char *);
+#include "unexec.h"
DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0,
doc: /* Dump current state of Emacs into executable file FILENAME.
*/
#include <config.h>
+#include "unexec.h"
+
#define PERROR(file) report_error (file, new)
#include <a.out.h>
/* Define getpagesize () if the system does not.
*/
#include <config.h>
+#include "unexec.h"
+
#define PERROR(file) report_error (file, new)
#ifndef CANNOT_DUMP /* all rest of file! */
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include "unexec.h"
+
#include <setjmp.h>
#include <lisp.h>
#include <stdio.h>
return (0);
}
-
Instead we read the whole file, modify it, and write it out. */
#include <config.h>
+#include <unexec.h>
+
extern void fatal (const char *msgid, ...);
#include <sys/types.h>
*/
\f
#include <config.h>
+#include "unexec.h"
+
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
hdr->unloadable_sp_location, hdr->unloadable_sp_size);
}
#endif /* DEBUG */
-
#undef malloc
#undef realloc
#undef free
+
+#include "unexec.h"
+
#include <stdio.h>
#include <fcntl.h>
#include <stdarg.h>
/* Trivial unexec for Solaris. */
#include <config.h>
+#include "unexec.h"
+
#include <dlfcn.h>
#include <setjmp.h>
*/
#include <config.h>
+#include "unexec.h"
#include <stdio.h>
#include <fcntl.h>