Mercurial > hg > xemacs-beta
comparison src/emacs.c @ 14:9ee227acff29 r19-15b90
Import from CVS: tag r19-15b90
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:48:42 +0200 |
parents | ac2d302a0011 |
children | 0293115a14e9 |
comparison
equal
deleted
inserted
replaced
13:13c6d0aaafe5 | 14:9ee227acff29 |
---|---|
41 #include "syssignal.h" /* Always include before systty.h */ | 41 #include "syssignal.h" /* Always include before systty.h */ |
42 #include "systty.h" | 42 #include "systty.h" |
43 #include "sysfile.h" | 43 #include "sysfile.h" |
44 #include "systime.h" | 44 #include "systime.h" |
45 | 45 |
46 #if defined (I18N2) || defined (I18N3) || defined (I18N4) | 46 #if defined (HAVE_LOCALE_H) && \ |
47 (defined (I18N2) || defined (I18N3) || defined (I18N4)) | |
47 #include <locale.h> | 48 #include <locale.h> |
48 #endif | 49 #endif |
49 | 50 |
50 #ifdef TOOLTALK | 51 #ifdef TOOLTALK |
51 #include <tt_c.h> | 52 #include <tt_c.h> |
263 (GETTEXT ("Operating system warns that virtual memory is running low.\n")); | 264 (GETTEXT ("Operating system warns that virtual memory is running low.\n")); |
264 | 265 |
265 /* It might be unsafe to call do_auto_save now. */ | 266 /* It might be unsafe to call do_auto_save now. */ |
266 force_auto_save_soon (); | 267 force_auto_save_soon (); |
267 } | 268 } |
268 #endif | 269 #endif /* SIGDANGER */ |
269 | 270 |
270 /* Code for dealing with Lisp access to the Unix command line */ | 271 /* Code for dealing with Lisp access to the Unix command line */ |
271 | 272 |
272 static Lisp_Object | 273 static Lisp_Object |
273 make_arg_list_1 (int argc, char **argv, int skip_args) | 274 make_arg_list_1 (int argc, char **argv, int skip_args) |
361 #ifdef NeXT | 362 #ifdef NeXT |
362 extern int malloc_cookie; | 363 extern int malloc_cookie; |
363 | 364 |
364 /* 19-Jun-1995 -baw | 365 /* 19-Jun-1995 -baw |
365 * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman | 366 * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman |
366 * <cedman@princton.edu>. Note that even Carl doesn't know what this | 367 * <cedman@princeton.edu>. Note that even Carl doesn't know what this |
367 * does; it was provided by NeXT, and it presumable makes NS's mallocator | 368 * does; it was provided by NeXT, and it presumable makes NS's mallocator |
368 * work with dumping. But malloc_jumpstart() and malloc_freezedry() in | 369 * work with dumping. But malloc_jumpstart() and malloc_freezedry() in |
369 * unexnext.c are both completely undocumented, even in NS header files! | 370 * unexnext.c are both completely undocumented, even in NS header files! |
370 * But hey, it solves all NS related memory problems, so who's | 371 * But hey, it solves all NS related memory problems, so who's |
371 * complaining? | 372 * complaining? |
407 } | 408 } |
408 | 409 |
409 #ifdef LINK_CRTL_SHARE | 410 #ifdef LINK_CRTL_SHARE |
410 #ifdef SHAREABLE_LIB_BUG | 411 #ifdef SHAREABLE_LIB_BUG |
411 /* Bletcherous shared libraries! */ | 412 /* Bletcherous shared libraries! */ |
412 if (!stdin) | 413 if (!stdin) stdin = fdopen (0, "r"); |
413 stdin = fdopen (0, "r"); | 414 if (!stdout) stdout = fdopen (1, "w"); |
414 if (!stdout) | 415 if (!stderr) stderr = fdopen (2, "w"); |
415 stdout = fdopen (1, "w"); | 416 if (!environ) environ = envp; |
416 if (!stderr) | |
417 stderr = fdopen (2, "w"); | |
418 if (!environ) | |
419 environ = envp; | |
420 #endif /* SHAREABLE_LIB_BUG */ | 417 #endif /* SHAREABLE_LIB_BUG */ |
421 #endif /* LINK_CRTL_SHARE */ | 418 #endif /* LINK_CRTL_SHARE */ |
422 #endif /* VMS */ | 419 #endif /* VMS */ |
423 #if (defined (MSDOS) && defined (EMX)) || defined (WIN32) || defined (_SCO_DS) | 420 #if (defined (MSDOS) && defined (EMX)) || defined (WIN32) || defined (_SCO_DS) |
424 environ = envp; | 421 environ = envp; |
1581 | 1578 |
1582 /* Now try to determine the actual path to the executable, | 1579 /* Now try to determine the actual path to the executable, |
1583 to try to make the backtrace-determination process as foolproof | 1580 to try to make the backtrace-determination process as foolproof |
1584 as possible. */ | 1581 as possible. */ |
1585 if (GC_STRINGP (Vinvocation_name)) | 1582 if (GC_STRINGP (Vinvocation_name)) |
1586 name = (char *) string_data (XSTRING (Vinvocation_name)); | 1583 name = (char *) XSTRING_DATA (Vinvocation_name); |
1587 else | 1584 else |
1588 name = "xemacs"; | 1585 name = "xemacs"; |
1589 if (GC_STRINGP (Vinvocation_directory)) | 1586 if (GC_STRINGP (Vinvocation_directory)) |
1590 dir = (char *) string_data (XSTRING (Vinvocation_directory)); | 1587 dir = (char *) XSTRING_DATA (Vinvocation_directory); |
1591 if (!dir || dir[0] != '/') | 1588 if (!dir || dir[0] != '/') |
1592 stderr_out ("`which %s`", name); | 1589 stderr_out ("`which %s`", name); |
1593 else if (dir[strlen (dir) - 1] != '/') | 1590 else if (dir[strlen (dir) - 1] != '/') |
1594 stderr_out ("%s/%s", dir, name); | 1591 stderr_out ("%s/%s", dir, name); |
1595 else | 1592 else |
1661 /* Also arrange for warnings when nearly out of space. */ | 1658 /* Also arrange for warnings when nearly out of space. */ |
1662 #ifndef SYSTEM_MALLOC | 1659 #ifndef SYSTEM_MALLOC |
1663 memory_warnings (&my_edata, malloc_warning); | 1660 memory_warnings (&my_edata, malloc_warning); |
1664 #endif | 1661 #endif |
1665 UNGCPRO; | 1662 UNGCPRO; |
1666 map_out_data (string_data (XSTRING (intoname))); | 1663 map_out_data (XSTRING_DATA (intoname)); |
1667 | 1664 |
1668 purify_flag = opurify; | 1665 purify_flag = opurify; |
1669 | 1666 |
1670 return Qnil; | 1667 return Qnil; |
1671 } | 1668 } |
1701 CHECK_STRING (intoname); | 1698 CHECK_STRING (intoname); |
1702 intoname = Fexpand_file_name (intoname, Qnil); | 1699 intoname = Fexpand_file_name (intoname, Qnil); |
1703 if (!NILP (symname)) | 1700 if (!NILP (symname)) |
1704 { | 1701 { |
1705 CHECK_STRING (symname); | 1702 CHECK_STRING (symname); |
1706 if (string_length (XSTRING (symname)) > 0) | 1703 if (XSTRING_LENGTH (symname) > 0) |
1707 symname = Fexpand_file_name (symname, Qnil); | 1704 symname = Fexpand_file_name (symname, Qnil); |
1708 else | 1705 else |
1709 symname = Qnil; | 1706 symname = Qnil; |
1710 } | 1707 } |
1711 | 1708 |
1719 | 1716 |
1720 disksave_object_finalization (); | 1717 disksave_object_finalization (); |
1721 release_breathing_space (); | 1718 release_breathing_space (); |
1722 | 1719 |
1723 #ifdef VMS | 1720 #ifdef VMS |
1724 mapout_data (string_data (XSTRING (intoname))); | 1721 mapout_data (XSTRING_DATA (intoname)); |
1725 #else | 1722 #else |
1726 /* Tell malloc where start of impure now is */ | 1723 /* Tell malloc where start of impure now is */ |
1727 /* Also arrange for warnings when nearly out of space. */ | 1724 /* Also arrange for warnings when nearly out of space. */ |
1728 #ifndef SYSTEM_MALLOC | 1725 #ifndef SYSTEM_MALLOC |
1729 memory_warnings (&my_edata, malloc_warning); | 1726 memory_warnings (&my_edata, malloc_warning); |
1731 | 1728 |
1732 UNGCPRO; | 1729 UNGCPRO; |
1733 | 1730 |
1734 #if defined (MSDOS) && defined (EMX) | 1731 #if defined (MSDOS) && defined (EMX) |
1735 { | 1732 { |
1736 int fd = open ((char *) string_data (XSTRING (intoname)), | 1733 int fd = open ((char *) XSTRING_DATA (intoname), |
1737 O_WRONLY|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE); | 1734 O_WRONLY|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE); |
1738 if (!fd) { | 1735 if (!fd) { |
1739 error ("Failure operating on %s", string_data (XSTRING (intoname))); | 1736 error ("Failure operating on %s", XSTRING_DATA (intoname)); |
1740 } else { | 1737 } else { |
1741 _core (fd); | 1738 _core (fd); |
1742 close (fd); | 1739 close (fd); |
1743 } | 1740 } |
1744 } | 1741 } |