Mercurial > hg > xemacs-beta
comparison src/emacs.c @ 5178:97eb4942aec8
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 29 Mar 2010 21:28:13 -0500 |
parents | 8b2f75cecb89 5ddbab03b0e6 |
children | 4cd28c29a7a1 |
comparison
equal
deleted
inserted
replaced
5177:b785049378e3 | 5178:97eb4942aec8 |
---|---|
764 int elt = 0; | 764 int elt = 0; |
765 | 765 |
766 while (argv[elt]) | 766 while (argv[elt]) |
767 { | 767 { |
768 xfree (argv[elt]); | 768 xfree (argv[elt]); |
769 argv[elt] = 0; | |
769 elt++; | 770 elt++; |
770 } | 771 } |
771 xfree (argv); | 772 xfree (argv); |
772 } | 773 } |
773 | 774 |
1462 /* Make sure that hash tables can be created. */ | 1463 /* Make sure that hash tables can be created. */ |
1463 init_elhash_once_early (); | 1464 init_elhash_once_early (); |
1464 | 1465 |
1465 /* Make sure that eistrings can be created. */ | 1466 /* Make sure that eistrings can be created. */ |
1466 init_eistring_once_early (); | 1467 init_eistring_once_early (); |
1467 | 1468 } |
1469 #ifdef PDUMP | |
1470 else if (!restart) /* after successful pdump_load() | |
1471 (note, we are inside ifdef PDUMP) */ | |
1472 { | |
1473 reinit_alloc_early (); | |
1474 reinit_gc_early (); | |
1475 reinit_symbols_early (); | |
1476 #ifndef NEW_GC | |
1477 reinit_opaque_early (); | |
1478 #endif /* not NEW_GC */ | |
1479 reinit_eistring_early (); | |
1480 #ifdef WITH_NUMBER_TYPES | |
1481 reinit_vars_of_number (); | |
1482 #endif | |
1483 } | |
1484 #endif /* PDUMP */ | |
1485 | |
1486 if (!initialized) | |
1487 { | |
1468 /* Now declare all the symbols and define all the Lisp primitives. | 1488 /* Now declare all the symbols and define all the Lisp primitives. |
1469 | 1489 |
1470 The *only* thing that the syms_of_*() functions are allowed to do | 1490 The *only* thing that the syms_of_*() functions are allowed to do |
1471 is call one of the following: | 1491 is call one of the following: |
1472 | 1492 |
1473 INIT_LRECORD_IMPLEMENTATION() | 1493 INIT_LISP_OBJECT() |
1474 defsymbol(), DEFSYMBOL(), or DEFSYMBOL_MULTIWORD_PREDICATE() | 1494 defsymbol(), DEFSYMBOL(), or DEFSYMBOL_MULTIWORD_PREDICATE() |
1475 defsubr() (i.e. DEFSUBR) | 1495 defsubr() (i.e. DEFSUBR) |
1476 deferror(), DEFERROR(), or DEFERROR_STANDARD() | 1496 deferror(), DEFERROR(), or DEFERROR_STANDARD() |
1477 defkeyword() or DEFKEYWORD() | 1497 defkeyword() or DEFKEYWORD() |
1478 Fput() | 1498 Fput() |
1487 #endif /* NEW_GC */ | 1507 #endif /* NEW_GC */ |
1488 syms_of_gc (); | 1508 syms_of_gc (); |
1489 #ifdef NEW_GC | 1509 #ifdef NEW_GC |
1490 syms_of_vdb (); | 1510 syms_of_vdb (); |
1491 #endif /* NEW_GC */ | 1511 #endif /* NEW_GC */ |
1512 syms_of_array (); | |
1492 syms_of_buffer (); | 1513 syms_of_buffer (); |
1493 syms_of_bytecode (); | 1514 syms_of_bytecode (); |
1494 syms_of_callint (); | 1515 syms_of_callint (); |
1495 syms_of_casefiddle (); | 1516 syms_of_casefiddle (); |
1496 syms_of_casetab (); | 1517 syms_of_casetab (); |
1536 syms_of_font_lock (); | 1557 syms_of_font_lock (); |
1537 #endif /* USE_C_FONT_LOCK */ | 1558 #endif /* USE_C_FONT_LOCK */ |
1538 syms_of_frame (); | 1559 syms_of_frame (); |
1539 syms_of_general (); | 1560 syms_of_general (); |
1540 syms_of_glyphs (); | 1561 syms_of_glyphs (); |
1562 #ifdef HAVE_WINDOW_SYSTEM | |
1541 syms_of_glyphs_eimage (); | 1563 syms_of_glyphs_eimage (); |
1542 syms_of_glyphs_shared (); | 1564 syms_of_glyphs_shared (); |
1565 #endif | |
1543 syms_of_glyphs_widget (); | 1566 syms_of_glyphs_widget (); |
1544 syms_of_gui (); | 1567 syms_of_gui (); |
1545 syms_of_gutter (); | 1568 syms_of_gutter (); |
1546 syms_of_indent (); | 1569 syms_of_indent (); |
1547 syms_of_intl (); | 1570 syms_of_intl (); |
1548 syms_of_keymap (); | 1571 syms_of_keymap (); |
1549 syms_of_lread (); | 1572 syms_of_lread (); |
1573 syms_of_lstream (); | |
1550 syms_of_macros (); | 1574 syms_of_macros (); |
1551 syms_of_marker (); | 1575 syms_of_marker (); |
1552 syms_of_md5 (); | 1576 syms_of_md5 (); |
1553 #ifdef HAVE_DATABASE | 1577 #ifdef HAVE_DATABASE |
1554 syms_of_database (); | 1578 syms_of_database (); |
1728 #endif | 1752 #endif |
1729 | 1753 |
1730 #if defined (HAVE_POSTGRESQL) && !defined (HAVE_SHLIB) | 1754 #if defined (HAVE_POSTGRESQL) && !defined (HAVE_SHLIB) |
1731 syms_of_postgresql (); | 1755 syms_of_postgresql (); |
1732 #endif | 1756 #endif |
1733 | 1757 } |
1758 | |
1759 if (!initialized | |
1760 #ifdef PDUMP | |
1761 || !restart | |
1762 #endif | |
1763 ) | |
1764 { | |
1765 buffer_objects_create (); | |
1766 casetab_objects_create (); | |
1767 extent_objects_create (); | |
1768 face_objects_create (); | |
1769 frame_objects_create (); | |
1770 glyph_objects_create (); | |
1771 hash_table_objects_create (); | |
1772 lstream_objects_create (); | |
1773 #ifdef MULE | |
1774 mule_charset_objects_create (); | |
1775 #endif | |
1776 #ifdef HAVE_SCROLLBARS | |
1777 scrollbar_objects_create (); | |
1778 #endif | |
1779 #ifdef HAVE_GTK | |
1780 ui_gtk_objects_create (); | |
1781 #endif | |
1782 window_objects_create (); | |
1783 } | |
1784 | |
1785 if (!initialized) | |
1786 { | |
1734 /* Now create the subtypes for the types that have them. | 1787 /* Now create the subtypes for the types that have them. |
1735 We do this before the vars_*() because more symbols | 1788 We do this before the vars_*() because more symbols |
1736 may get initialized here. */ | 1789 may get initialized here. */ |
1737 | 1790 |
1738 /* Now initialize the console types and associated symbols. | 1791 /* Now initialize the console types and associated symbols. |
1871 | 1924 |
1872 For any given image instantiator format, the first macro must be | 1925 For any given image instantiator format, the first macro must be |
1873 called before the any calls to the other macros. */ | 1926 called before the any calls to the other macros. */ |
1874 | 1927 |
1875 image_instantiator_format_create (); | 1928 image_instantiator_format_create (); |
1929 #ifdef HAVE_WINDOW_SYSTEM | |
1876 image_instantiator_format_create_glyphs_eimage (); | 1930 image_instantiator_format_create_glyphs_eimage (); |
1931 #endif | |
1877 image_instantiator_format_create_glyphs_widget (); | 1932 image_instantiator_format_create_glyphs_widget (); |
1878 #ifdef HAVE_TTY | 1933 #ifdef HAVE_TTY |
1879 image_instantiator_format_create_glyphs_tty (); | 1934 image_instantiator_format_create_glyphs_tty (); |
1880 #endif | 1935 #endif |
1881 #ifdef HAVE_X_WINDOWS | 1936 #ifdef HAVE_X_WINDOWS |
1890 } | 1945 } |
1891 #ifdef PDUMP | 1946 #ifdef PDUMP |
1892 else if (!restart) /* after successful pdump_load() | 1947 else if (!restart) /* after successful pdump_load() |
1893 (note, we are inside ifdef PDUMP) */ | 1948 (note, we are inside ifdef PDUMP) */ |
1894 { | 1949 { |
1895 reinit_alloc_early (); | |
1896 reinit_gc_early (); | |
1897 reinit_symbols_early (); | |
1898 #ifndef NEW_GC | |
1899 reinit_opaque_early (); | |
1900 #endif /* not NEW_GC */ | |
1901 reinit_eistring_early (); | |
1902 #ifdef WITH_NUMBER_TYPES | |
1903 reinit_vars_of_number (); | |
1904 #endif | |
1905 | |
1906 reinit_console_type_create_stream (); | 1950 reinit_console_type_create_stream (); |
1907 #ifdef HAVE_TTY | 1951 #ifdef HAVE_TTY |
1908 reinit_console_type_create_tty (); | 1952 reinit_console_type_create_tty (); |
1909 #endif | 1953 #endif |
1910 #ifdef HAVE_X_WINDOWS | 1954 #ifdef HAVE_X_WINDOWS |
2019 - build_ascstring() | 2063 - build_ascstring() |
2020 - make_vector() | 2064 - make_vector() |
2021 - make_int() | 2065 - make_int() |
2022 - make_char() | 2066 - make_char() |
2023 - make_extent() | 2067 - make_extent() |
2024 - BASIC_ALLOC_LCRECORD() | 2068 - ALLOC_NORMAL_LISP_OBJECT() |
2025 - ALLOC_LCRECORD_TYPE() | 2069 - ALLOC_SIZED_LISP_OBJECT() |
2026 - Fcons() | 2070 - Fcons() |
2027 - listN() | 2071 - listN() |
2028 - make_lcrecord_list() | 2072 - make_lcrecord_list() |
2029 -- make_opaque_ptr() | 2073 -- make_opaque_ptr() |
2030 -- make_lisp_hash_table() (not allowed in 21.4!) | 2074 -- make_lisp_hash_table() (not allowed in 21.4!) |
2052 vars_of_abbrev (); | 2096 vars_of_abbrev (); |
2053 vars_of_alloc (); | 2097 vars_of_alloc (); |
2054 vars_of_buffer (); | 2098 vars_of_buffer (); |
2055 vars_of_bytecode (); | 2099 vars_of_bytecode (); |
2056 vars_of_callint (); | 2100 vars_of_callint (); |
2101 vars_of_casetab (); | |
2057 vars_of_chartab (); | 2102 vars_of_chartab (); |
2058 vars_of_cmdloop (); | 2103 vars_of_cmdloop (); |
2059 vars_of_cmds (); | 2104 vars_of_cmds (); |
2060 vars_of_console (); | 2105 vars_of_console (); |
2061 vars_of_data (); | 2106 vars_of_data (); |
2072 vars_of_doc (); | 2117 vars_of_doc (); |
2073 #ifdef HAVE_DRAGNDROP | 2118 #ifdef HAVE_DRAGNDROP |
2074 vars_of_dragdrop (); | 2119 vars_of_dragdrop (); |
2075 #endif | 2120 #endif |
2076 vars_of_editfns (); | 2121 vars_of_editfns (); |
2122 vars_of_elhash (); | |
2077 vars_of_emacs (); | 2123 vars_of_emacs (); |
2078 vars_of_eval (); | 2124 vars_of_eval (); |
2079 | 2125 |
2080 #ifdef HAVE_X_WINDOWS | 2126 #ifdef HAVE_X_WINDOWS |
2081 vars_of_event_Xt (); | 2127 vars_of_event_Xt (); |
2102 vars_of_font_lock (); | 2148 vars_of_font_lock (); |
2103 #endif /* USE_C_FONT_LOCK */ | 2149 #endif /* USE_C_FONT_LOCK */ |
2104 vars_of_frame (); | 2150 vars_of_frame (); |
2105 vars_of_gc (); | 2151 vars_of_gc (); |
2106 vars_of_glyphs (); | 2152 vars_of_glyphs (); |
2153 #ifdef HAVE_WINDOW_SYSTEM | |
2107 vars_of_glyphs_eimage (); | 2154 vars_of_glyphs_eimage (); |
2155 #endif | |
2108 vars_of_glyphs_widget (); | 2156 vars_of_glyphs_widget (); |
2109 vars_of_gui (); | 2157 vars_of_gui (); |
2110 vars_of_gutter (); | 2158 vars_of_gutter (); |
2111 vars_of_indent (); | 2159 vars_of_indent (); |
2112 vars_of_insdel (); | 2160 vars_of_insdel (); |
2297 #endif | 2345 #endif |
2298 ) | 2346 ) |
2299 { | 2347 { |
2300 /* Now do additional vars_of_*() initialization that happens both | 2348 /* Now do additional vars_of_*() initialization that happens both |
2301 at dump time and after pdump load. */ | 2349 at dump time and after pdump load. */ |
2350 reinit_vars_of_alloc (); | |
2302 reinit_vars_of_buffer (); | 2351 reinit_vars_of_buffer (); |
2303 reinit_vars_of_bytecode (); | 2352 reinit_vars_of_bytecode (); |
2304 reinit_vars_of_console (); | 2353 reinit_vars_of_console (); |
2305 #ifdef DEBUG_XEMACS | 2354 #ifdef DEBUG_XEMACS |
2306 reinit_vars_of_debug (); | 2355 reinit_vars_of_debug (); |
2310 #if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) | 2359 #if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) |
2311 reinit_vars_of_event_tty (); | 2360 reinit_vars_of_event_tty (); |
2312 #endif | 2361 #endif |
2313 reinit_vars_of_event_stream (); | 2362 reinit_vars_of_event_stream (); |
2314 reinit_vars_of_events (); | 2363 reinit_vars_of_events (); |
2315 reinit_vars_of_extents (); | |
2316 reinit_vars_of_file_coding (); | 2364 reinit_vars_of_file_coding (); |
2317 reinit_vars_of_fileio (); | 2365 reinit_vars_of_fileio (); |
2318 #ifdef USE_C_FONT_LOCK | 2366 #ifdef USE_C_FONT_LOCK |
2319 reinit_vars_of_font_lock (); | 2367 reinit_vars_of_font_lock (); |
2320 #endif /* USE_C_FONT_LOCK */ | 2368 #endif /* USE_C_FONT_LOCK */ |
4054 #endif /* !defined (ASSERTIONS_DONT_ABORT) */ | 4102 #endif /* !defined (ASSERTIONS_DONT_ABORT) */ |
4055 inhibit_non_essential_conversion_operations--; | 4103 inhibit_non_essential_conversion_operations--; |
4056 in_assert_failed--; | 4104 in_assert_failed--; |
4057 } | 4105 } |
4058 | 4106 |
4107 /* This is called when an assert() fails or when ABORT() is called -- both | |
4108 of those are defined in the preprocessor to an expansion involving | |
4109 assert_failed(). */ | |
4110 void | |
4111 assert_equal_failed (const Ascbyte *file, int line, EMACS_INT x, EMACS_INT y, | |
4112 const Ascbyte *exprx, const Ascbyte *expry) | |
4113 { | |
4114 Ascbyte bigstr[1000]; /* #### Could overflow, but avoids any need to do any | |
4115 allocation, even alloca(), hence safer */ | |
4116 sprintf (bigstr, "%s (%ld) should == %s (%ld) but doesn't", | |
4117 exprx, x, expry, y); | |
4118 assert_failed (file, line, bigstr); | |
4119 } | |
4120 | |
4059 /* -------------------------------------- */ | 4121 /* -------------------------------------- */ |
4060 /* low-memory notification */ | 4122 /* low-memory notification */ |
4061 /* -------------------------------------- */ | 4123 /* -------------------------------------- */ |
4062 | 4124 |
4063 #ifdef SIGDANGER | 4125 #ifdef SIGDANGER |