Mercurial > hg > xemacs-beta
comparison src/emacs.c @ 400:a86b2b5e0111 r21-2-30
Import from CVS: tag r21-2-30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:14:34 +0200 |
parents | 74fd4e045ea6 |
children | 2f8bb876ab1d |
comparison
equal
deleted
inserted
replaced
399:376370fb5946 | 400:a86b2b5e0111 |
---|---|
585 init_free_hook (); | 585 init_free_hook (); |
586 #endif | 586 #endif |
587 | 587 |
588 sort_args (argc, argv); | 588 sort_args (argc, argv); |
589 | 589 |
590 /* Map in shared memory, if we are using that. */ | |
591 #ifdef HAVE_SHM | |
592 if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args)) | |
593 { | |
594 map_in_data (0); | |
595 /* The shared memory was just restored, which clobbered this. */ | |
596 skip_args = 1; | |
597 } | |
598 else | |
599 { | |
600 map_in_data (1); | |
601 /* The shared memory was just restored, which clobbered this. */ | |
602 skip_args = 0; | |
603 } | |
604 #endif /* HAVE_SHM */ | |
605 | |
606 #if (defined (MSDOS) && defined (EMX)) || defined (WIN32) || defined (_SCO_DS) | 590 #if (defined (MSDOS) && defined (EMX)) || defined (WIN32) || defined (_SCO_DS) |
607 environ = envp; | 591 environ = envp; |
608 #endif | 592 #endif |
609 | 593 |
610 /* Record (approximately) where the stack begins. */ | 594 /* Record (approximately) where the stack begins. */ |
871 routines below create new objects. */ | 855 routines below create new objects. */ |
872 init_alloc_once_early (); | 856 init_alloc_once_early (); |
873 | 857 |
874 /* Initialize Qnil, Qt, Qunbound, and the | 858 /* Initialize Qnil, Qt, Qunbound, and the |
875 obarray. After this, symbols can be | 859 obarray. After this, symbols can be |
876 interned. This depends on init_alloc_once(). */ | 860 interned. This depends on init_alloc_once_early(). */ |
877 init_symbols_once_early (); | 861 init_symbols_once_early (); |
878 | 862 |
879 /* Declare the basic symbols pertaining to errors, | 863 /* Declare the basic symbols pertaining to errors, |
880 So that deferror() can be called. */ | 864 So that deferror() can be called. */ |
881 init_errors_once_early (); | 865 init_errors_once_early (); |
886 /* Now declare all the symbols and define all the Lisp primitives. | 870 /* Now declare all the symbols and define all the Lisp primitives. |
887 | 871 |
888 The *only* thing that the syms_of_*() functions are allowed to do | 872 The *only* thing that the syms_of_*() functions are allowed to do |
889 is call one of the following three functions: | 873 is call one of the following three functions: |
890 | 874 |
875 INIT_LRECORD_IMPLEMENTATION() | |
891 defsymbol() | 876 defsymbol() |
892 defsubr() (i.e. DEFSUBR) | 877 defsubr() (i.e. DEFSUBR) |
893 deferror() | 878 deferror() |
894 defkeyword() | 879 defkeyword() |
895 | 880 |
1901 | 1886 |
1902 /* First, here's a table of all the standard options. */ | 1887 /* First, here's a table of all the standard options. */ |
1903 | 1888 |
1904 struct standard_args | 1889 struct standard_args |
1905 { | 1890 { |
1906 const char * const name; | 1891 const char *name; |
1907 const char * const longname; | 1892 const char *longname; |
1908 int priority; | 1893 int priority; |
1909 int nargs; | 1894 int nargs; |
1910 }; | 1895 }; |
1911 | 1896 |
1912 static struct standard_args standard_args[] = | 1897 static const struct standard_args standard_args[] = |
1913 { | 1898 { |
1914 /* Handled by main_1 above: */ | 1899 /* Handled by main_1 above: */ |
1915 { "-nl", "--no-shared-memory", 100, 0 }, | 1900 { "-nl", "--no-shared-memory", 100, 0 }, |
1916 { "-t", "--terminal", 95, 1 }, | 1901 { "-t", "--terminal", 95, 1 }, |
1917 { "-nw", "--no-windows", 90, 0 }, | 1902 { "-nw", "--no-windows", 90, 0 }, |
2532 | 2517 |
2533 #if !defined(PDUMP) || !defined(SYSTEM_MALLOC) | 2518 #if !defined(PDUMP) || !defined(SYSTEM_MALLOC) |
2534 extern char my_edata[]; | 2519 extern char my_edata[]; |
2535 #endif | 2520 #endif |
2536 | 2521 |
2537 #ifdef HAVE_SHM | |
2538 | |
2539 DEFUN ("dump-emacs-data", Fdump_emacs_data, 1, 1, 0, /* | |
2540 Dump current state of XEmacs into data file FILENAME. | |
2541 This function exists on systems that use HAVE_SHM. | |
2542 */ | |
2543 (intoname)) | |
2544 { | |
2545 /* This function can GC */ | |
2546 int opurify; | |
2547 struct gcpro gcpro1; | |
2548 GCPRO1 (intoname); | |
2549 | |
2550 CHECK_STRING (intoname); | |
2551 intoname = Fexpand_file_name (intoname, Qnil); | |
2552 | |
2553 opurify = purify_flag; | |
2554 purify_flag = 0; | |
2555 | |
2556 fflush (stderr); | |
2557 fflush (stdout); | |
2558 | |
2559 disksave_object_finalization (); | |
2560 release_breathing_space (); | |
2561 | |
2562 /* Tell malloc where start of impure now is */ | |
2563 /* Also arrange for warnings when nearly out of space. */ | |
2564 #ifndef SYSTEM_MALLOC | |
2565 memory_warnings (my_edata, malloc_warning); | |
2566 #endif | |
2567 UNGCPRO; | |
2568 map_out_data (XSTRING_DATA (intoname)); | |
2569 | |
2570 purify_flag = opurify; | |
2571 | |
2572 return Qnil; | |
2573 } | |
2574 | |
2575 #else /* not HAVE_SHM */ | |
2576 extern void disable_free_hook (void); | 2522 extern void disable_free_hook (void); |
2577 | 2523 |
2578 DEFUN ("dump-emacs", Fdump_emacs, 2, 2, 0, /* | 2524 DEFUN ("dump-emacs", Fdump_emacs, 2, 2, 0, /* |
2579 Dump current state of XEmacs into executable file FILENAME. | 2525 Dump current state of XEmacs into executable file FILENAME. |
2580 Take symbols from SYMFILE (presumably the file you executed to run XEmacs). | 2526 Take symbols from SYMFILE (presumably the file you executed to run XEmacs). |
2685 | 2631 |
2686 purify_flag = opurify; | 2632 purify_flag = opurify; |
2687 | 2633 |
2688 return Qnil; | 2634 return Qnil; |
2689 } | 2635 } |
2690 | |
2691 #endif /* not HAVE_SHM */ | |
2692 | 2636 |
2693 #endif /* not CANNOT_DUMP */ | 2637 #endif /* not CANNOT_DUMP */ |
2694 | 2638 |
2695 #ifndef SEPCHAR | 2639 #ifndef SEPCHAR |
2696 #define SEPCHAR ':' | 2640 #define SEPCHAR ':' |
2861 | 2805 |
2862 void | 2806 void |
2863 syms_of_emacs (void) | 2807 syms_of_emacs (void) |
2864 { | 2808 { |
2865 #ifndef CANNOT_DUMP | 2809 #ifndef CANNOT_DUMP |
2866 #ifdef HAVE_SHM | |
2867 DEFSUBR (Fdump_emacs_data); | |
2868 #else | |
2869 DEFSUBR (Fdump_emacs); | 2810 DEFSUBR (Fdump_emacs); |
2870 #endif | |
2871 #endif /* !CANNOT_DUMP */ | 2811 #endif /* !CANNOT_DUMP */ |
2872 | 2812 |
2873 DEFSUBR (Frun_emacs_from_temacs); | 2813 DEFSUBR (Frun_emacs_from_temacs); |
2874 DEFSUBR (Frunning_temacs_p); | 2814 DEFSUBR (Frunning_temacs_p); |
2875 DEFSUBR (Finvocation_name); | 2815 DEFSUBR (Finvocation_name); |
3106 #endif | 3046 #endif |
3107 #ifdef HAVE_LOCKING | 3047 #ifdef HAVE_LOCKING |
3108 Vmail_lock_methods = Fcons (intern ("locking"), Vmail_lock_methods); | 3048 Vmail_lock_methods = Fcons (intern ("locking"), Vmail_lock_methods); |
3109 #endif | 3049 #endif |
3110 } | 3050 } |
3111 | 3051 |
3112 DEFVAR_CONST_LISP ("configure-mail-lock-method", &Vconfigure_mail_lock_method /* | 3052 DEFVAR_CONST_LISP ("configure-mail-lock-method", &Vconfigure_mail_lock_method /* |
3113 Mail spool locking method suggested by configure. This is one | 3053 Mail spool locking method suggested by configure. This is one |
3114 of the symbols in MAIL-LOCK-METHODS. | 3054 of the symbols in MAIL-LOCK-METHODS. |
3115 */ ); | 3055 */ ); |
3116 { | 3056 { |