1 /* SXEmacs -- Fully extensible Emacs, running on Unix and other platforms.
2 Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994
3 Free Software Foundation, Inc.
4 Copyright (C) 1995 Sun Microsystems, Inc.
5 Copyright (C) 2000, 2002 Ben Wing.
6 Copyright (C) 2004 Steve Youngs.
8 This file is part of SXEmacs
10 SXEmacs is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
15 SXEmacs is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 /* Synched up with: Mule 2.0, FSF 19.28. */
26 /* Capsule summary of the various releases of Lucid Emacs/SXEmacs and
27 FSF/GNU Emacs. Provided here for use in cross-referencing version
28 releases and dates in comments, esp. in the authorship comments at
29 the beginning of each file. More information about history can be
30 found in the beginning of the Internals Manual and in the About page.
32 -- A time line for Lucid Emacs/XEmacs is
34 version 19.0 shipped with Energize 1.0, April 1992.
35 version 19.1 released June 4, 1992.
36 version 19.2 released June 19, 1992.
37 version 19.3 released September 9, 1992.
38 version 19.4 released January 21, 1993.
39 version 19.5 was a repackaging of 19.4 with a few bug fixes and
40 shipped with Energize 2.0. Never released to the net.
41 version 19.6 released April 9, 1993.
42 version 19.7 was a repackaging of 19.6 with a few bug fixes and
43 shipped with Energize 2.1. Never released to the net.
44 version 19.8 released September 6, 1993.
45 version 19.9 released January 12, 1994.
46 version 19.10 released May 27, 1994.
47 version 19.11 (first XEmacs) released September 13, 1994.
48 version 19.12 released June 23, 1995.
49 version 19.13 released September 1, 1995.
50 version 19.14 released June 23, 1996.
51 version 20.0 released February 9, 1997.
52 version 19.15 released March 28, 1997.
53 version 20.1 (not released to the net) April 15, 1997.
54 version 20.2 released May 16, 1997.
55 version 19.16 released October 31, 1997.
56 version 20.3 (the first stable version of XEmacs 20.x) released
58 version 20.4 released February 28, 1998.
60 -- A time line for GNU Emacs version 19 is
62 version 19.7 (beta) (first beta release) released May 22, 1993.
63 version 19.8 (beta) released May 27, 1993.
64 version 19.9 (beta) released May 27, 1993.
65 version 19.10 (beta) released May 30, 1993.
66 version 19.11 (beta) released June 1, 1993.
67 version 19.12 (beta) released June 2, 1993.
68 version 19.13 (beta) released June 8, 1993.
69 version 19.14 (beta) released June 17, 1993.
70 version 19.15 (beta) released June 19, 1993.
71 version 19.16 (beta) released July 6, 1993.
72 version 19.17 (beta) released late July, 1993.
73 version 19.18 (beta) released August 9, 1993.
74 version 19.19 (beta) released August 15, 1993.
75 version 19.20 (beta) released November 17, 1993.
76 version 19.21 (beta) released November 17, 1993.
77 version 19.22 (beta) released November 28, 1993.
78 version 19.23 (beta) released May 17, 1994.
79 version 19.24 (beta) released May 16, 1994.
80 version 19.25 (beta) released June 3, 1994.
81 version 19.26 (beta) released September 11, 1994.
82 version 19.27 (beta) released September 14, 1994.
83 version 19.28 (first ``official'' release) released November 1, 1994.
84 version 19.29 released June 21, 1995.
85 version 19.30 released November 24, 1995.
86 version 19.31 released May 25, 1996.
87 version 19.32 released July 31, 1996.
88 version 19.33 released August 11, 1996.
89 version 19.34 released August 21, 1996.
90 version 19.34b released September 6, 1996.
92 -- A time line for GNU Emacs version 20 is
94 version 20.1 released September 17, 1997.
95 version 20.2 released September 20, 1997.
96 version 20.3 released August 19, 1998.
98 -- A time line for GNU Emacs version 18 and older is
100 GNU Emacs version 13 (the first public release) was released on
102 GNU Emacs version 15 (15.34) was released on May 7, 1985 and
103 shared some code with a version of Emacs written by James Gosling (the
104 same James Gosling who later created the Java language).
105 GNU Emacs version 16 (first released version was 16.56) was released on
106 July 15, 1985. All Gosling code was removed due to potential copyright
107 problems with the code.
108 version 16.57: released on September 16, 1985.
109 versions 16.58, 16.59: released on September 17, 1985.
110 version 16.60: released on September 19, 1985. These later version 16's
111 incorporated patches from the net, esp. for getting Emacs to work under
113 version 17.36 (first official v17 release) released on December 20, 1985.
114 Included a TeX-able user manual. First official unpatched version that
115 worked on vanilla System V machines.
116 version 17.43 (second official v17 release) released on January 25, 1986.
117 version 17.45 released on January 30, 1986.
118 version 17.46 released on February 4, 1986.
119 version 17.48 released on February 10, 1986.
120 version 17.49 released on February 12, 1986.
121 version 17.55 released on March 18, 1986.
122 version 17.57 released on March 27, 1986.
123 version 17.58 released on April 4, 1986.
124 version 17.61 released on April 12, 1986.
125 version 17.63 released on May 7, 1986.
126 version 17.64 released on May 12, 1986.
127 version 18.24 (a beta version) released on October 2, 1986.
128 version 18.30 (a beta version) released on November 15, 1986.
129 version 18.31 (a beta version) released on November 23, 1986.
130 version 18.32 (a beta version) released on December 7, 1986.
131 version 18.33 (a beta version) released on December 12, 1986.
132 version 18.35 (a beta version) released on January 5, 1987.
133 version 18.36 (a beta version) released on January 21, 1987.
134 January 27, 1987: The Great Usenet Renaming. net.emacs is now comp.emacs.
135 version 18.37 (a beta version) released on February 12, 1987.
136 version 18.38 (a beta version) released on March 3, 1987.
137 version 18.39 (a beta version) released on March 14, 1987.
138 version 18.40 (a beta version) released on March 18, 1987.
139 version 18.41 (the first ``official'' release) released on March 22, 1987.
140 version 18.45 released on June 2, 1987.
141 version 18.46 released on June 9, 1987.
142 version 18.47 released on June 18, 1987.
143 version 18.48 released on September 3, 1987.
144 version 18.49 released on September 18, 1987.
145 version 18.50 released on February 13, 1988.
146 version 18.51 released on May 7, 1988.
147 version 18.52 released on September 1, 1988.
148 version 18.53 released on February 24, 1989.
149 version 18.54 released on April 26, 1989.
150 version 18.55 released on August 23, 1989. This is the earliest version
151 that is still available by FTP.
152 version 18.56 released on January 17, 1991.
153 version 18.57 released late January, 1991.
154 version 18.58 released ?????.
155 version 18.59 released October 31, 1992.
159 /* Note: It is necessary to specify <config.h> and not "config.h" in
160 order for the --srcdir type of compilation to work properly.
161 Otherwise the config.h from the srcdir, rather than the one from
162 the build dir, will be used. */
167 #include "backtrace.h" /* run-emacs-from-temacs needs this */
169 #include "commands.h"
170 #include "ui/console.h"
172 #include "ui/redisplay.h"
173 #include "ui/frame.h"
176 #include "syssignal.h" /* Always include before systty.h */
177 #include "ui/systty.h"
181 #if defined WITH_EMODULES && defined HAVE_EMODULES
182 # include "emodules-ng.h"
194 #include <quantify.h>
197 #if defined WITH_EMODULES && defined HAVE_EMODULES && 0
201 #if defined (HAVE_LOCALE_H) && \
202 (defined (I18N2) || defined (I18N3) || defined (I18N4))
207 #include <sxe-paths.h>
209 /* for stack exploitation */
210 #if defined HAVE_SYS_RESOURCE_H
211 # include <sys/resource.h>
214 /* for the reinit funs */
215 #include "skiplist.h"
219 #if defined HAVE_BDWGC && defined EF_USE_BDWGC
220 # if defined HAVE_GC_GC_H
222 # elif defined HAVE_GC_H
225 /* declare the 3 funs we need */
226 extern void *GC_init(void);
228 # error Go back to your planet!
230 #endif /* HAVE_BDWGC */
232 #if defined (HEAP_IN_DATA) && !defined(PDUMP)
233 void report_sheap_usage(int die_if_pure_storage_exceeded);
236 #if !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
237 extern void *(*__malloc_hook) (size_t);
238 extern void *(*__realloc_hook) (void *, size_t);
239 extern void (*__free_hook) (void *);
240 #endif /* not SYSTEM_MALLOC && not DOUG_LEA_MALLOC */
242 /* Command line args from shell, as list of strings */
243 Lisp_Object Vcommand_line_args;
245 /* Set nonzero after SXEmacs has started up the first time.
246 Prevents reinitialization of the Lisp world and keymaps
247 on subsequent starts. */
250 #ifdef DOUG_LEA_MALLOC
252 /* Preserves a pointer to the memory allocated that copies that
253 static data inside glibc's malloc. */
254 static void *malloc_state_ptr;
255 #endif /* DOUG_LEA_MALLOC */
258 void r_alloc_reinit(void);
262 void console_type_create_select_gtk(void);
265 /* Variable whose value is symbol giving operating system type. */
266 Lisp_Object Vsystem_type;
268 /* Variable whose value is string giving configuration built for. */
269 Lisp_Object Vsystem_configuration;
271 /* Variable whose value is string containing the configuration options
272 SXEmacs was built with. */
273 Lisp_Object Vsystem_configuration_options;
275 /* Version numbers and strings */
276 Lisp_Object Vemacs_major_version;
277 Lisp_Object Vemacs_minor_version;
278 Lisp_Object Vemacs_patch_level;
279 Lisp_Object Vemacs_beta_version;
280 Lisp_Object Vsxemacs_git_version;
281 Lisp_Object Vsxemacs_codename;
283 Lisp_Object Vinfodock_major_version;
284 Lisp_Object Vinfodock_minor_version;
285 Lisp_Object Vinfodock_build_version;
288 /* The path under which SXEmacs was invoked. */
289 Lisp_Object Vinvocation_path;
291 /* The name under which SXEmacs was invoked, with any leading directory
293 Lisp_Object Vinvocation_name;
295 /* The directory name from which SXEmacs was invoked. */
296 Lisp_Object Vinvocation_directory;
299 /* The directory name in which to find subdirs such as lisp and etc.
300 nil means get them only from PATH_LOADSEARCH. */
301 Lisp_Object Vinstallation_directory;
304 Lisp_Object Vemacs_program_name, Vemacs_program_version;
305 Lisp_Object Vexec_path;
306 Lisp_Object Vexec_directory, Vconfigure_exec_directory;
307 Lisp_Object Vlisp_directory, Vconfigure_lisp_directory;
308 Lisp_Object Vmule_lisp_directory, Vconfigure_mule_lisp_directory;
309 Lisp_Object Vmodule_directory, Vconfigure_module_directory;
310 Lisp_Object Vsite_module_directory, Vconfigure_site_module_directory;
311 Lisp_Object Vconfigure_package_path;
312 Lisp_Object Vdata_directory, Vconfigure_data_directory;
313 Lisp_Object Vdoc_directory, Vconfigure_doc_directory;
314 Lisp_Object Vconfigure_lock_directory;
315 Lisp_Object Vdata_directory_list;
316 Lisp_Object Vconfigure_info_directory;
317 Lisp_Object Vconfigure_info_path;
318 Lisp_Object Vinternal_error_checking;
319 Lisp_Object Vmail_lock_methods, Vconfigure_mail_lock_method;
320 Lisp_Object Vpath_separator;
322 /* The default base directory SXEmacs is installed under. */
323 Lisp_Object Vconfigure_exec_prefix_directory, Vconfigure_prefix_directory;
325 /* If nonzero, set SXEmacs to run at this priority. This is also used
326 in child_setup and sys_suspend to make sure subshells run at normal
328 Fixnum emacs_priority;
330 /* Some FSF junk with running_asynch_code, to preserve the match
331 data. Not necessary because we don't call process filters
332 asynchronously (i.e. from within QUIT). */
333 /* #### Delete this when merging the rest of my code */
334 int running_asynch_code;
336 /* If non-zero, a window-system was specified on the command line. */
339 /* Type of display specified. We cannot use a Lisp symbol here because
340 Lisp symbols may not initialized at the time that we set this
342 const char *display_use;
344 /* If non-zero, then the early error handler will only print the error
346 int suppress_early_error_handler_backtrace;
348 /* An address near the bottom of the stack.
349 Tells GC how to save a copy of the stack. */
351 /* the stack size as imposed by the system */
352 size_t sys_stk_sz = 0;
354 #ifdef USG_SHARED_LIBRARIES
355 /* If nonzero, this is the place to put the end of the writable segment
358 uintptr_t bss_end = 0;
361 /* Number of bytes of writable memory we can expect to be able to get */
362 #ifdef _RLIM_T_DECLARED
365 unsigned long lim_data;
370 Some LISP-visible command-line options are set by SXEmacs _before_ the
371 data is dumped in building a --pdump SXEmacs, but used _after_ it is
372 restored in normal operation. Thus the dump-time values overwrite the
373 values SXEmacs is getting at runtime. Such variables must be saved
374 before loading the dumpfile, and restored afterward.
376 Therefore these variables may not be initialized in vars_of_emacs().
378 The save/restore is done immediately before and after pdump_load() in
379 main_1(). See that function for the current list of protected variables.
381 Note that saving/restoring is only necessary for a few variables that are
382 o command line arguments effective at runtime (as opposed to dump-time),
383 o parsed before pdump_load, and
384 o exported to Lisp via a DEFVAR.
387 /* Nonzero means running SXEmacs without interactive terminal. */
391 /* Value of Lisp variable `noninteractive'.
392 Normally same as C variable `noninteractive'
393 but nothing terrible happens if user sets this one.
395 Shadowed from the pdumper by `noninteractive'. */
399 /* Nonzero means don't perform site-modules searches at startup */
400 int inhibit_site_modules;
402 /* Nonzero means don't respect early packages at startup */
403 int inhibit_early_packages;
405 /* Nonzero means we warn about early packages shadowing late packages at startup */
406 int warn_early_package_shadows;
408 /* Nonzero means don't load package autoloads at startup */
409 int inhibit_autoloads;
411 /* Nonzero means don't load the dump file (ignored if not PDUMP) */
414 /* Nonzero means we assume all ttys are 8 color ANSI terminals */
415 int assume_colorterm;
417 /* Nonzero means print debug information about path searching */
420 /* Save argv and argc. */
421 static Extbyte **initial_argv; /* #### currently unused */
422 static int initial_argc; /* #### currently unused */
424 static void sort_args(int argc, char **argv);
426 Lisp_Object Qkill_emacs_hook;
427 Lisp_Object Qsave_buffers_kill_emacs;
429 extern Lisp_Object Vlisp_EXEC_SUFFIXES;
431 /* Ben's capsule summary about expected and unexpected exits from SXEmacs.
433 Expected exits occur when the user directs SXEmacs to exit, for example
434 by pressing the close button on the only frame in SXEmacs, or by typing
435 C-x C-c. This runs `save-buffers-kill-emacs', which saves any necessary
436 buffers, and then exits using the primitive `kill-emacs'.
438 However, unexpected exits occur in a few different ways:
440 -- a memory access violation or other hardware-generated exception
441 occurs. This is the worst possible problem to deal with, because
442 the fault can occur while SXEmacs is in any state whatsoever, even
443 quite unstable ones. As a result, we need to be *extremely* careful
445 -- we are using one X display (or if we've used more, we've closed the
446 others already), and some hardware or other problem happens and
447 suddenly we've lost our connection to the display. In this situation,
448 things are not so dire as in the last one; our code itself isn't
449 trashed, so we can continue execution as normal, after having set
450 things up so that we can exit at the appropriate time. Our exit
451 still needs to be of the emergency nature; we have no displays, so
452 any attempts to use them will fail. We simply want to auto-save
453 (the single most important thing to do during shut-down), do minimal
454 cleanup of stuff that has an independent existence outside of SXEmacs,
457 Currently, both unexpected exit scenarios described above set
458 preparing_for_armageddon to indicate that nonessential and possibly
459 dangerous things should not be done, specifically:
461 -- no garbage collection.
463 -- no messages of any sort from autosaving.
464 -- autosaving tries harder, ignoring certain failures.
465 -- existing frames are not deleted.
467 (Also, all places that set preparing_for_armageddon also
468 set dont_check_for_quit. This happens separately because it's
469 also necessary to set other variables to make absolutely sure
470 no quitting happens.)
472 In the first scenario above (the access violation), we also set
473 fatal_error_in_progress. This causes more things to not happen:
475 -- assertion failures do not abort.
476 -- printing code does not do code conversion or gettext when
477 printing to stdout/stderr.
480 /* Nonzero if handling a fatal error already. */
481 int fatal_error_in_progress;
483 /* Non-nil means we're going down, so we better not run any hooks
484 or do other non-essential stuff. */
485 int preparing_for_armageddon;
487 /* Nonzero means we're in an unstable situation and need to skip
488 i18n conversions and such during printing. */
489 int inhibit_non_essential_printing_operations;
491 static JMP_BUF run_temacs_catch;
493 static int run_temacs_argc;
494 static char **run_temacs_argv;
495 static char *run_temacs_args;
496 static EMACS_INT run_temacs_argv_size;
497 static EMACS_INT run_temacs_args_size;
499 static void shut_down_emacs(int sig, Lisp_Object stuff, int no_auto_save);
501 /* ------------------------------- */
502 /* low-level debugging functions */
503 /* ------------------------------- */
505 #define debugging_breakpoint()
510 debugging_breakpoint();
513 /* #### There must be a better way!!!! */
515 static JMP_BUF memory_error_jump;
519 debug_memory_error(int signum)
521 EMACS_REESTABLISH_SIGNAL(signum, debug_memory_error);
522 EMACS_UNBLOCK_SIGNAL(signum);
523 LONGJMP(memory_error_jump, 1);
527 static char dummy_char;
529 /* Return whether all bytes in the specified memory block can be read. */
531 debug_can_access_memory(void *ptr, Bytecount len)
533 /* Use volatile to protect variables from being clobbered by longjmp. */
534 SIGTYPE(*volatile old_sigbus) (int);
535 SIGTYPE(*volatile old_sigsegv) (int);
536 volatile int old_errno = errno;
537 volatile int retval = 1;
539 if (!SETJMP(memory_error_jump)) {
542 (SIGTYPE(*)(int))signal(SIGBUS, debug_memory_error);
544 (SIGTYPE(*)(int))signal(SIGSEGV, debug_memory_error);
547 * Examine memory pool at PTR, trying to cheat
548 * compiler's optimisations.
551 dummy_char = ((char*)ptr)[len];
556 signal(SIGBUS, old_sigbus);
557 signal(SIGSEGV, old_sigsegv);
565 DEFUN("force-debugging-signal", Fforce_debugging_signal, 0, 1, 0, /*
566 Cause SXEmacs to enter the debugger.
567 On some systems, there may be no way to do this gracefully; if so,
568 nothing happens unless ABORT is non-nil, in which case SXEmacs will
569 abort() -- a sure-fire way to immediately get back to the debugger,
570 but also a sure-fire way to kill SXEmacs (and dump core on Unix
575 debugging_breakpoint();
581 #endif /* DEBUG_SXEMACS */
584 ensure_no_quitting_from_now_on(void)
586 /* make sure no quitting from now on!! */
587 dont_check_for_quit = 1;
593 /* Handle bus errors, illegal instruction, etc. */
595 fatal_error_signal(int sig)
597 fatal_error_in_progress++;
598 inhibit_non_essential_printing_operations = 1;
599 preparing_for_armageddon = 1;
601 ensure_no_quitting_from_now_on();
603 /* Unblock the signal so that if the same signal gets sent in the
604 code below, we avoid a deadlock. */
605 EMACS_UNBLOCK_SIGNAL(sig);
607 /* Only try auto-saving first time through. If we crash in auto-saving,
608 don't do it again. */
609 if (fatal_error_in_progress == 1) {
610 Fdo_auto_save(Qt, Qnil); /* do this before anything hazardous */
611 /* Do this so that the variable has the same value of 2 regardless of
612 whether we made it through auto-saving correctly. */
613 fatal_error_in_progress++;
614 } else if (fatal_error_in_progress == 2)
615 stderr_out("WARNING: Unable to auto-save your files properly.\n"
616 "Some or all may in fact have been auto-saved.\n"
619 /* Now, reset our signal handler, so the next time, we just die.
620 Don't do this before auto-saving. */
621 signal(sig, SIG_DFL);
623 /* Keep in mind that there's more than one signal that we can crash
625 /* If fatal error occurs in code below, avoid infinite recursion. */
626 if (fatal_error_in_progress <= 2) {
627 shut_down_emacs(sig, Qnil, 1);
628 stderr_out("\nLisp backtrace follows:\n\n");
629 Fbacktrace(Qexternal_debugging_output, Qt);
630 # if 0 /* This is evil, rarely useful, and causes grief in some cases. */
631 /* Check for Sun-style stack printing via /proc */
633 const char *pstack = "/usr/proc/bin/pstack";
634 if (access(pstack, X_OK) == 0) {
636 int sz = snprintf(buf, sizeof(buf), "%s %d >&2", pstack,
638 stderr_out("\nC backtrace follows:\n"
639 "(A real debugger may provide better information)\n\n");
640 if ( sz >= 0 && sz < sizeof(buf)) {
643 stderr_out("\nStacktrace utility execution error code: %d\n", sz);
645 stderr_out("\nCould not build command line for stacktrace utility.\n");
651 /* Signal the same code; this time it will really be fatal. */
660 /* Handler for SIGDANGER. */
662 memory_warning_signal(int sig)
664 /* #### bad bad bad; this function shouldn't do anything except
665 set a flag, or weird corruption could happen. */
666 signal(sig, memory_warning_signal);
670 ("Operating system warns that virtual memory is running low.\n"));
672 /* It might be unsafe to call do_auto_save now. */
673 force_auto_save_soon();
675 #endif /* SIGDANGER */
677 /* Code for dealing with Lisp access to the Unix command line */
680 make_arg_list_1(int argc, Extbyte ** argv, int skip_args)
682 Lisp_Object result = Qnil;
685 for (i = argc - 1; i >= 0; i--) {
686 if (i != 0 && i <= skip_args)
689 result = Fcons(build_ext_string(argv[i], Qcommand_argument_encoding), result);
695 make_arg_list(int argc, Extbyte ** argv)
697 return make_arg_list_1(argc, argv, 0);
700 /* Calling functions are also responsible for calling free_argc_argv
701 when they are done with the generated list. */
703 make_argc_argv(Lisp_Object argv_list, int *argc, Extbyte *** argv)
706 int n = XINT(Flength(argv_list));
708 *argv = (Extbyte **) malloc((n + 1) * sizeof(Extbyte *));
710 for (i = 0, next = argv_list; i < n; i++, next = XCDR(next)) {
712 CHECK_STRING(XCAR(next));
714 LISP_STRING_TO_EXTERNAL(XCAR(next), temp,
715 Qcommand_argument_encoding);
716 (*argv)[i] = strdup(temp);
722 void free_argc_argv(Extbyte ** argv)
733 static void init_cmdargs(int argc, Extbyte ** argv, int skip_args)
738 Vcommand_line_args = make_arg_list_1(argc, argv, skip_args);
741 DEFUN("invocation-name", Finvocation_name, 0, 0, 0, /*
742 Return the program name that was used to run SXEmacs.
743 Any directory names are omitted.
747 return Fcopy_sequence(Vinvocation_name);
750 DEFUN("invocation-directory", Finvocation_directory, 0, 0, 0, /*
751 Return the directory name in which the Emacs executable was located.
755 return Fcopy_sequence(Vinvocation_directory);
759 /* #### - don't know why I18N4 on SunOS/JLE
760 can't deal with this. It's a potential
761 bug that needs to be looked at. */
762 # undef RUN_TIME_REMAP
765 /* Test whether the next argument in ARGV matches SSTR or a prefix of
766 LSTR (at least MINLEN characters). If so, then if VALPTR is non-null
767 (the argument is supposed to have a value) store in *VALPTR either
768 the next argument or the portion of this one after the equal sign.
769 ARGV is read starting at position *SKIPPTR; this index is advanced
770 by the number of arguments used.
772 Too bad we can't just use getopt for all of this, but we don't have
773 enough information to do it right. */
776 argmatch(char **argv, int argc, char *sstr, char *lstr,
777 int minlen, char **valptr, int *skipptr)
783 /* Don't access argv[argc]; give up in advance. */
784 if (argc <= *skipptr + 1)
787 arg = argv[*skipptr + 1];
790 if (strcmp(arg, sstr) == 0) {
791 if (valptr != NULL) {
792 *valptr = argv[*skipptr + 2];
798 arglen = (valptr != NULL && (p = strchr(arg, '=')) != NULL
799 ? p - arg : (int)strlen(arg));
800 if (lstr == 0 || arglen < minlen || strncmp(arg, lstr, arglen) != 0)
802 else if (valptr == NULL) {
805 } else if (p != NULL) {
809 } else if (argv[*skipptr + 2] != NULL) {
810 *valptr = argv[*skipptr + 2];
819 make_docfile(int c, char **v)
821 #define make_docfile_prog "make-docfile\0"
822 #define make_docfile_opt "--make-docfile"
823 /* C99 we need you */
824 size_t edlen = XSTRING_LENGTH(Vexec_directory);
825 char mdocfile[edlen+countof(make_docfile_prog)];
826 char **newargv = xnew_array_and_zero(char*, c), **p;
829 /* set up the program call */
831 (char*)XSTRING_DATA(Vexec_directory),
832 XSTRING_LENGTH(Vexec_directory));
833 xstrncpy(mdocfile+XSTRING_LENGTH(Vexec_directory),
834 make_docfile_prog, countof(make_docfile_prog));
836 /* find the --make-docfile option */
837 for (p = v; *p; p++) {
838 if (strncmp(*p, make_docfile_opt,
839 countof(make_docfile_opt)) == 0) {
845 /* fill the new argv array */
846 newargv[0] = make_docfile_prog;
847 for (char **o = p, **n = &newargv[1]; *o;) {
850 ret = execv(mdocfile, newargv);
861 /* we need some checks whether this is supported! */
862 __asm__ __volatile__ (
863 "movl %%esp, %[stkptr]\n\t"
864 : [stkptr] "=m" (sp));
873 /* return the stack size limit */
874 #if defined HAVE_GETRLIMIT64
876 (void)getrlimit64(RLIMIT_STACK, &foo);
877 #elif defined HAVE_GETRLIMIT
879 (void)getrlimit(RLIMIT_STACK, &foo);
881 /* bollocks, maybe just a small one? 64k? */
882 struct {size_t rlim_cur;} foo = {65536};
888 /* Make stack traces always identify version + configuration */
889 #define main_1 STACK_TRACE_EYE_CATCHER
891 /* This function is not static, so that the compiler is less likely to
892 inline it, which would make it not show up in stack traces.
894 The restart argument is a flag that indicates that main_1 is now
895 being called for the second time in this invocation of sxemacs; this can
896 only happen in an sxemacs that is not loaded with dumped data (temacs
897 with the conventional dumper or sxemacs -nd with the pdumper). See
898 Frun_emacs_from_temacs().
900 restart interacts with initialized as follows (per Olivier Galibert):
904 initialized==0 => temacs
905 initialized!=0 && restart!=0 => run-temacs
906 initialized!=0 && restart==0 => sxemacs/post pdump_load()
908 DECLARE_DOESNT_RETURN(main_1(int, char **, char **, int));
909 DOESNT_RETURN main_1(int argc, char **argv, char **envp, int restart)
911 char stack_bottom_variable;
914 int inhibit_window_system;
916 extern int malloc_cookie;
919 #if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK) \
920 && !defined (DOUG_LEA_MALLOC))
921 /* Make sure that any libraries we link against haven't installed a
922 hook for a gmalloc of a potentially incompatible version. */
923 /* If we're using libmcheck, the hooks have already been initialized, */
924 /* don't touch them. -slb */
925 __malloc_hook = NULL;
926 __realloc_hook = NULL;
928 #endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */
931 inhibit_non_essential_printing_operations = 1;
935 * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman
936 * <cedman@princeton.edu>. Note that even Carl doesn't know what this
937 * does; it was provided by NeXT, and it presumable makes NS's mallocator
938 * work with dumping. But malloc_jumpstart() and malloc_freezedry() in
939 * unexnext.c are both completely undocumented, even in NS header files!
940 * But hey, it solves all NS related memory problems, so who's
942 if (initialized && malloc_jumpstart(malloc_cookie) != 0)
943 stderr_out("malloc jumpstart failed!\n");
947 #if defined (GNU_MALLOC) && \
948 defined (ERROR_CHECK_MALLOC) && \
949 !defined (HAVE_LIBMCHECK)
951 #if defined(LOSING_GCC_DESTRUCTOR_FREE_BUG)
952 /* Prior to SXEmacs 21, this was `#if 0'ed out. */
953 /* I'm enabling this because it is the only reliable way I've found to */
954 /* prevent a very annoying problem where GCC will attempt to free(3) */
955 /* memory at exit() and cause a coredump. */
961 sort_args(argc, argv);
967 /* Record (approximately) where the stack begins. */
968 stack_bottom = &stack_bottom_variable;
969 /* and determine the system's stack limit */
970 sys_stk_sz = __sys_stk_sz();
972 #ifdef USG_SHARED_LIBRARIES
974 brk((void *)bss_end);
979 #if defined (HAVE_MMAP) && defined (REL_ALLOC)
980 /* ralloc can only be used if using the GNU memory allocator. */
982 #elif defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC)
990 #endif /* HAVE_SOCKS */
992 #if !defined SYSTEM_MALLOC && !(defined HAVE_BDWGC && defined EF_USE_BDWGC)
994 /* Arrange to get warning messages as memory fills up. */
995 memory_warnings(0, malloc_warning);
996 #endif /* not SYSTEM_MALLOC */
998 #ifdef SET_EMACS_PRIORITY
999 if (emacs_priority != 0)
1000 nice(-emacs_priority);
1002 #endif /* SET_EMACS_PRIORITY */
1004 #ifdef EXTRA_INITIALIZE
1008 #ifdef HAVE_WINDOW_SYSTEM
1009 inhibit_window_system = 0;
1011 inhibit_window_system = 1;
1014 /* Handle the --make-docfile argument */
1015 if (argmatch(argv, argc,
1016 "--make-docfile", 0, 9, NULL, &skip_args)) {
1018 /* we need load the dump file as the exec-directory is in
1020 if (UNLIKELY(!pdump_load(argv[0]))) {
1024 exit(make_docfile(argc, argv));
1027 /* Handle the -sd/--show-dump-id switch, which means show the hex
1029 if (argmatch(argv, argc,
1030 "-sd", "--show-dump-id",
1031 9, NULL, &skip_args)) {
1033 printf("%08x\n", dump_id);
1036 ("Portable dumper not configured; -sd just forces exit.\n");
1041 /* Handle the -t switch, which specifies filename to use as terminal */
1045 (argv, argc, "-t", "--terminal", 4, &term, &skip_args)) {
1048 if (open(term, O_RDWR | OPEN_BINARY, 2) < 0)
1049 fatal("%s: %s", term, strerror(errno));
1051 fatal("dup failed %s: %s", term, strerror(errno));
1053 fatal("%s: not a tty", term);
1056 stderr_out("Using %s", ttyname(0));
1058 stderr_out("Using %s", term);
1059 inhibit_window_system = 1; /* -t => -nw */
1063 /* Handle the --no-dump-file/-nd switch, which means don't
1064 * load the dump file (ignored when not using pdump) */
1065 if (argmatch(argv, argc, "-nd", "--no-dump-file", 7,
1066 NULL, &skip_args)) {
1070 if (argmatch(argv, argc, "-ct", "--color-terminal", 5,
1071 NULL, &skip_args)) {
1072 assume_colorterm = 1;
1075 /* Handle -nw switch */
1076 if (argmatch(argv, argc, "-nw", "--no-windows", 6, NULL, &skip_args))
1077 inhibit_window_system = 1;
1079 /* Handle the -batch switch, which means don't do interactive display */
1080 if (argmatch(argv, argc, "-batch", "--batch", 5, NULL, &skip_args)) {
1081 #if 0 /* I don't think this is correct. */
1082 inhibit_autoloads = 1;
1087 if (argmatch(argv, argc, "-debug-paths", "--debug-paths",
1088 11, NULL, &skip_args))
1091 /* Partially handle -no-autoloads, -no-early-packages and -vanilla.
1093 /* are searched prior to the rest of the command line being parsed in */
1095 if (argmatch(argv, argc, "-no-early-packages", "--no-early-packages",
1096 6, NULL, &skip_args)) {
1097 inhibit_early_packages = 1;
1100 #if defined WITH_EMODULES && defined HAVE_EMODULES
1101 if (argmatch(argv, argc, "-no-site-modules", "--no-site-modules",
1102 9, NULL, &skip_args)) {
1103 inhibit_site_modules = 1;
1107 inhibit_site_modules = 1;
1109 if (argmatch(argv, argc, "-vanilla", "--vanilla", 7, NULL, &skip_args)) {
1110 inhibit_early_packages = 1;
1114 if (argmatch(argv, argc, "-no-autoloads", "--no-autoloads",
1115 7, NULL, &skip_args)) {
1116 /* Inhibit everything */
1117 inhibit_autoloads = 1;
1121 if (argmatch(argv, argc, "-debug-paths", "--debug-paths",
1122 6, NULL, &skip_args)) {
1127 /* Partially handle the -version and -help switches: they imply -batch,
1128 but are not removed from the list. */
1129 if (argmatch(argv, argc, "-help", "--help", 3, NULL, &skip_args))
1130 noninteractive = 1, skip_args--;
1132 if (argmatch(argv, argc, "-version", "--version", 3, NULL, &skip_args)
1133 || argmatch(argv, argc, "-V", 0, 2, NULL, &skip_args))
1134 noninteractive = 1, skip_args--;
1136 /* Now, figure out which type of console is our first console. */
1141 display_use = "stream";
1143 display_use = "tty";
1146 if (inhibit_window_system)
1147 fatal("Sorry, this SXEmacs was not compiled with TTY support");
1150 #ifdef HAVE_WINDOW_SYSTEM
1151 /* Stupid kludge to catch command-line display spec. We can't
1152 handle this argument entirely in window-system-dependent code
1153 because we don't even know which window-system-dependent code
1154 to run until we've recognized this argument. */
1155 if (!inhibit_window_system && !noninteractive) {
1156 #ifdef HAVE_X_WINDOWS
1158 int count_before = skip_args;
1160 if (argmatch(argv, argc, "-d", "--display", 3, &dpy, &skip_args)
1161 || argmatch(argv, argc, "-display", 0, 3, &dpy,
1166 /* If we have the form --display=NAME,
1167 convert it into -d name.
1168 This requires inserting a new element into argv. */
1169 if (dpy != 0 && skip_args - count_before == 1) {
1171 (char **)xmalloc(sizeof(char *) * (argc + 2));
1174 for (j = 0; j < count_before + 1; j++)
1176 new[count_before + 1] = "-d";
1177 new[count_before + 2] = dpy;
1178 for (j = count_before + 2; j < argc; j++)
1179 new[j + 1] = argv[j];
1183 /* Change --display to -d, when its arg is separate. */
1184 else if (dpy != 0 && skip_args > count_before
1185 && argv[count_before + 1][1] == '-')
1186 argv[count_before + 1] = "-d";
1188 /* Don't actually discard this arg. */
1189 skip_args = count_before;
1191 /* If there is a non-empty environment var DISPLAY, set
1192 `display_use', but not `display_arg', which is only to be set
1193 if the display was specified on the command line. */
1194 if ((dpy = getenv("DISPLAY")) && dpy[0])
1197 #endif /* HAVE_X_WINDOWS */
1200 char *dpy = getenv("DISPLAY");
1202 display_use = "gtk";
1206 #endif /* HAVE_WINDOW_SYSTEM */
1208 noninteractive1 = noninteractive;
1210 /****** Now initialize everything *******/
1212 /* First, do really basic environment initialization -- catching signals
1213 and the like. These functions have no dependence on any part of
1214 the Lisp engine and need to be done both at dump time and at run time. */
1216 init_signals_very_early();
1217 init_data_very_early(); /* Catch math errors. */
1219 init_floatfns_very_early(); /* Catch floating-point math errors. */
1221 init_process_times_very_early(); /* Initialize our process timers.
1222 As early as possible, of course,
1223 so we can be fairly accurate. */
1224 init_intl_very_early(); /* set up the locale and domain for gettext and
1227 /* Now initialize the Lisp engine and the like. Done only during
1228 dumping. No dependence on anything that may be in the user's
1229 environment when the dumped SXEmacs is run.
1231 We try to do things in an order that minimizes the non-obvious
1232 dependencies between functions. */
1234 /* purify_flag 1 is correct even if CANNOT_DUMP.
1235 * loadup.el will set to nil at end. */
1241 } else if (nodumpfile) {
1246 /* Keep command options from getting stomped.
1248 Some LISP-visible options are changed by SXEmacs _after_ the data is
1249 dumped in building a --pdump SXEmacs, but _before_ it is restored in
1250 normal operation. Thus the restored values overwrite the values
1251 SXEmacs is getting at run-time. Such variables must be saved here,
1252 and restored after loading the dumped data.
1254 Boy, this is ugly, but how else to do it?
1257 /* noninteractive1 is saved in noninteractive, which isn't
1259 int inhibit_early_packages_save = inhibit_early_packages;
1260 int inhibit_autoloads_save = inhibit_autoloads;
1261 int debug_paths_save = debug_paths;
1262 int inhibit_site_modules_save = inhibit_site_modules;
1264 initialized = pdump_load(argv[0]);
1266 /* Now unstomp everything */
1267 noninteractive1 = noninteractive;
1268 inhibit_early_packages = inhibit_early_packages_save;
1269 inhibit_autoloads = inhibit_autoloads_save;
1270 debug_paths = debug_paths_save;
1271 inhibit_site_modules = inhibit_site_modules_save;
1274 run_temacs_argc = -1;
1284 /* Initialize things so that new Lisp objects
1285 can be created and objects can be staticpro'd.
1286 Must be basically the very first thing done
1287 because pretty much all of the initialization
1288 routines below create new objects. */
1289 init_alloc_once_early();
1291 /* Initialize Qnil, Qt, Qunbound, and the
1292 obarray. After this, symbols can be
1293 interned. This depends on init_alloc_once_early(). */
1294 init_symbols_once_early();
1296 /* Declare the basic symbols pertaining to errors,
1297 So that DEFERROR*() can be called. */
1298 init_errors_once_early();
1300 /* Make sure that opaque pointers can be created. */
1301 init_opaque_once_early();
1303 /* Now declare all the symbols and define all the Lisp primitives.
1305 The *only* thing that the syms_of_*() functions are allowed to do
1306 is call one of the following:
1308 INIT_LRECORD_IMPLEMENTATION()
1309 defsymbol(), DEFSYMBOL(), or DEFSYMBOL_MULTIWORD_PREDICATE()
1310 defsubr() (i.e. DEFSUBR)
1311 deferror(), DEFERROR(), or DEFERROR_STANDARD()
1312 defkeyword() or DEFKEYWORD()
1314 Order does not matter in these functions.
1323 syms_of_casefiddle();
1330 #ifdef DEBUG_SXEMACS
1333 #endif /* DEBUG_SXEMACS */
1344 #ifdef HAVE_X_WINDOWS
1348 syms_of_event_gtk();
1350 #ifdef HAVE_DRAGNDROP
1353 #ifdef EF_USE_ASYNEQ
1354 syms_of_event_queue();
1356 syms_of_worker_asyneq();
1358 syms_of_event_stream();
1363 #ifdef CLASH_DETECTION
1365 #endif /* CLASH_DETECTION */
1368 syms_of_font_lock();
1372 syms_of_glyphs_eimage();
1373 syms_of_glyphs_widget();
1383 #ifdef HAVE_DATABASE
1386 #ifdef HAVE_MENUBARS
1392 #if defined WITH_EMODULES && defined HAVE_EMODULES && 0
1394 #elif defined WITH_EMODULES && defined HAVE_EMODULES
1399 #if !defined (NO_SUBPROCESSES)
1403 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC)
1405 #endif /* HAVE_MMAP && REL_ALLOC */
1407 syms_of_redisplay();
1412 syms_of_specifier();
1415 #ifdef HAVE_SCROLLBARS
1416 syms_of_scrollbar();
1418 #ifdef HAVE_TOOLBARS
1426 syms_of_console_tty();
1427 syms_of_device_tty();
1428 syms_of_objects_tty();
1432 syms_of_device_gtk();
1433 syms_of_frame_gtk();
1434 syms_of_glyphs_gtk();
1435 syms_of_objects_gtk();
1437 syms_of_select_gtk();
1439 syms_of_dialog_gtk();
1441 #ifdef HAVE_MENUBARS
1442 syms_of_menubar_gtk();
1444 syms_of_select_gtk();
1446 #if defined (HAVE_MENUBARS) || defined(HAVE_SCROLLBARS) || defined(HAVE_DIALOGS) || defined(HAVE_TOOLBARS)
1449 #endif /* HAVE_GTK */
1451 #ifdef HAVE_X_WINDOWS
1452 #ifdef HAVE_BALLOON_HELP
1453 syms_of_balloon_x();
1461 syms_of_objects_x();
1462 #ifdef HAVE_MENUBARS
1463 syms_of_menubar_x();
1466 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS)
1471 syms_of_input_method_xlib();
1473 #endif /* HAVE_XIM */
1474 #endif /* HAVE_X_WINDOWS */
1479 syms_of_mule_charset();
1482 syms_of_file_coding();
1489 syms_of_mule_canna();
1490 #endif /* HAVE_CANNA */
1502 #if defined (GNU_MALLOC) && \
1503 defined (ERROR_CHECK_MALLOC) && \
1504 !defined (HAVE_LIBMCHECK)
1506 /* Prior to SXEmacs 21, this was `#if 0'ed out. -slb */
1507 #if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG)
1508 syms_of_free_hook();
1523 #ifdef HAVE_POSTGRESQL
1524 syms_of_postgresql();
1531 #ifdef WITH_NUMBER_TYPES
1543 /* Now create the subtypes for the types that have them.
1544 We do this before the vars_*() because more symbols
1545 may get initialized here. */
1547 /* Now initialize the console types and associated symbols.
1548 Other than the first function below, the functions may
1549 make exactly the following function/macro calls:
1551 INITIALIZE_CONSOLE_TYPE()
1552 CONSOLE_HAS_METHOD()
1554 For any given console type, the former macro must be called
1555 before the any calls to the latter macro. */
1557 console_type_create();
1559 console_type_create_stream();
1562 console_type_create_tty();
1563 console_type_create_device_tty();
1564 console_type_create_frame_tty();
1565 console_type_create_objects_tty();
1566 console_type_create_redisplay_tty();
1570 console_type_create_gtk();
1571 console_type_create_select_gtk();
1572 console_type_create_device_gtk();
1573 console_type_create_frame_gtk();
1574 console_type_create_objects_gtk();
1575 console_type_create_glyphs_gtk();
1576 console_type_create_redisplay_gtk();
1577 #ifdef HAVE_MENUBARS
1578 console_type_create_menubar_gtk();
1580 #ifdef HAVE_SCROLLBARS
1581 console_type_create_scrollbar_gtk();
1583 #ifdef HAVE_TOOLBARS
1584 console_type_create_toolbar_gtk();
1587 console_type_create_dialog_gtk();
1589 #endif /* HAVE_GTK */
1591 #ifdef HAVE_X_WINDOWS
1592 console_type_create_x();
1593 console_type_create_device_x();
1594 console_type_create_frame_x();
1595 console_type_create_glyphs_x();
1596 console_type_create_select_x();
1597 #ifdef HAVE_MENUBARS
1598 console_type_create_menubar_x();
1600 console_type_create_objects_x();
1601 console_type_create_redisplay_x();
1602 #ifdef HAVE_SCROLLBARS
1603 console_type_create_scrollbar_x();
1605 #ifdef HAVE_TOOLBARS
1606 console_type_create_toolbar_x();
1609 console_type_create_dialog_x();
1611 #endif /* HAVE_X_WINDOWS */
1613 /* Now initialize the specifier types and associated symbols.
1614 Other than the first function below, the functions may
1615 make exactly the following function/macro calls:
1617 INITIALIZE_SPECIFIER_TYPE()
1618 SPECIFIER_HAS_METHOD()
1620 For any given specifier type, the former macro must be called
1621 before the any calls to the latter macro. */
1623 specifier_type_create();
1625 specifier_type_create_image();
1626 specifier_type_create_gutter();
1627 specifier_type_create_objects();
1628 #ifdef HAVE_TOOLBARS
1629 specifier_type_create_toolbar();
1632 /* Now initialize the structure types and associated symbols.
1633 Other than the first function below, the functions may
1634 make exactly the following function/macro calls:
1636 define_structure_type()
1637 define_structure_type_keyword()
1641 structure_type_create();
1643 structure_type_create_chartab();
1644 structure_type_create_faces();
1645 structure_type_create_rangetab();
1646 structure_type_create_hash_table();
1648 /* Now initialize the image instantiator formats and associated symbols.
1649 Other than the first function below, the functions may
1650 make exactly the following function/macro calls:
1652 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT()
1653 IIFORMAT_HAS_METHOD()
1654 IIFORMAT_VALID_KEYWORD()
1656 For any given image instantiator format, the first macro must be
1657 called before the any calls to the other macros. */
1659 image_instantiator_format_create();
1660 image_instantiator_format_create_glyphs_eimage();
1661 image_instantiator_format_create_glyphs_widget();
1663 image_instantiator_format_create_glyphs_tty();
1665 #ifdef HAVE_X_WINDOWS
1666 image_instantiator_format_create_glyphs_x();
1667 #endif /* HAVE_X_WINDOWS */
1669 image_instantiator_format_create_glyphs_gtk();
1672 /* Now initialize the lstream types and associated symbols.
1673 Other than the first function below, the functions may
1674 make exactly the following function/macro calls:
1676 LSTREAM_HAS_METHOD()
1680 lstream_type_create();
1682 lstream_type_create_file_coding();
1685 /* Initialize processes implementation.
1686 The functions may make exactly the following function/macro calls:
1688 PROCESS_HAS_METHOD()
1690 #ifdef HAVE_UNIX_PROCESSES
1691 process_type_create_unix();
1694 /* Now initialize most variables.
1696 These functions may do exactly the following:
1709 defsymbol(), if it's absolutely necessary and you're sure that
1710 the symbol isn't referenced anywhere else in the initialization
1712 Fset() on a symbol that is unbound
1713 assigning a symbol or constant value to a variable
1714 using a global variable that has been initialized
1715 earlier on in the same function
1717 Any of the object-creating functions in alloc.c: e.g.
1730 perhaps a few others.
1732 NB: Initialization or assignment should not be done here to certain
1733 variables settable from the command line. See the comment above
1734 the call to pdump_load() in main_1(). This caveat should only
1735 apply to vars_of_emacs().
1738 /* Now allow Fprovide() statements to be made. */
1739 init_provide_once();
1741 /* Do that before any specifier creation (esp. vars_of_glyphs()) */
1742 vars_of_specifier();
1755 #ifdef DEBUG_SXEMACS
1759 vars_of_console_stream();
1766 #ifdef HAVE_DRAGNDROP
1774 #ifdef HAVE_X_WINDOWS
1777 #if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS))
1778 vars_of_event_tty();
1780 vars_of_event_stream();
1781 #ifdef EF_USE_ASYNEQ
1783 vars_of_worker_asyneq();
1790 #ifdef CLASH_DETECTION
1794 vars_of_font_lock();
1797 vars_of_glyphs_eimage();
1798 vars_of_glyphs_widget();
1806 vars_of_input_method_motif();
1807 #else /* XIM_XLIB */
1808 vars_of_input_method_xlib();
1810 #endif /* HAVE_XIM */
1816 #ifdef HAVE_DATABASE
1819 #ifdef HAVE_MENUBARS
1825 #if defined WITH_EMODULES && defined HAVE_EMODULES && 0
1827 #elif defined WITH_EMODULES && defined HAVE_EMODULES
1833 #ifndef NO_SUBPROCESSES
1835 #ifdef HAVE_UNIX_PROCESSES
1836 vars_of_process_unix();
1841 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC)
1843 #endif /* HAVE_MMAP && REL_ALLOC */
1844 vars_of_redisplay();
1845 #ifdef HAVE_SCROLLBARS
1846 vars_of_scrollbar();
1853 #ifdef HAVE_TOOLBARS
1860 vars_of_console_tty();
1861 vars_of_frame_tty();
1862 vars_of_objects_tty();
1866 vars_of_device_gtk();
1868 vars_of_dialog_gtk();
1870 vars_of_event_gtk();
1871 vars_of_frame_gtk();
1872 vars_of_glyphs_gtk();
1874 #ifdef HAVE_MENUBARS
1875 vars_of_menubar_gtk();