comparison src/dumper.c @ 2421:ab71ad6ff3dd

[xemacs-hg @ 2004-12-06 03:50:53 by ben] (none) README.packages: Document use of --package-prefix. Fix error in specifying standard package location. make-docfile.c: Use QXE_PATH_MAX. info.el: Correct doc string giving example package path. menubar-items.el: Move Prefix Rectangle command up one level. xemacs/packages.texi: Add long form of Lisp Reference Manual to links. Add links pointing to Lisp Reference Manual for more detailed package discussion. lispref/range-tables.texi: Document range-table changes. internals/internals.texi: Update history section. elhash.c, elhash.h, profile.c: Create inchash_eq() to allow direct incrementing of hash-table entry. Use in profile.c to try to reduce profiling overhead. Increase initial size of profile hash tables to reduce profiling overhead. buffer.c, device-msw.c, dialog-msw.c, dired-msw.c, editfns.c, event-msw.c, events.c, glyphs-msw.c, keymap.c, objects-msw.c, process-nt.c, syswindows.h, text.c, text.h, unexnt.c: Rename xetcs* -> qxetcs* for consistency with qxestr*. Rename ei*_c(_*) -> ei*_ascii(_*) since they work with ASCII-only strings not "C strings", whatever those are. This is the last place where "c" was incorrectly being used for "ascii". dialog-msw.c, dumper.c, event-msw.c, fileio.c, glyphs-gtk.c, glyphs-x.c, nt.c, process-nt.c, realpath.c, sysdep.c, sysfile.h, unexcw.c, unexnext.c, unexnt.c: Try to avoid differences in systems that do or do not include final null byte in PATH_MAX. Create PATH_MAX_INTERNAL and PATH_MAX_EXTERNAL and use them everywhere. Rewrite code in dumper.c to avoid use of PATH_MAX. When necessary in nt.c, use _MAX_PATH instead of MAX_PATH to be consistent with other places. text.c: Code to short-circuit when binary or Unicode was not working due to EOL wrapping. Fix this code to work when either no EOL autodetection or no CR's or LF's in the text. lisp.h, rangetab.c, rangetab.h, regex.c, search.c: Implement different types of ranges (open/closed start and end). Change default to be start-closed, end-open.
author ben
date Mon, 06 Dec 2004 03:52:23 +0000
parents ecf1ebac70d8
children 3d8143fc88e1
comparison
equal deleted inserted replaced
2420:ad56e5a6d09f 2421:ab71ad6ff3dd
1871 } 1871 }
1872 1872
1873 int 1873 int
1874 pdump_load (const Wexttext *argv0) 1874 pdump_load (const Wexttext *argv0)
1875 { 1875 {
1876 Wexttext exe_path[PATH_MAX];
1877 #ifdef WIN32_NATIVE 1876 #ifdef WIN32_NATIVE
1878 qxeGetModuleFileName (NULL, (Extbyte *) exe_path, PATH_MAX); 1877 Wexttext *exe_path = NULL;
1878 int bufsize = 4096;
1879 int cchpathsize;
1880
1881 /* Copied from mswindows_get_module_file_name (). Not clear if it's
1882 kosher to malloc() yet. */
1883 while (1)
1884 {
1885 exe_path = alloca_array (Wexttext, bufsize);
1886 cchpathsize = qxeGetModuleFileName (NULL, (Extbyte *) exe_path,
1887 bufsize);
1888 if (!cchpathsize)
1889 goto fail;
1890 if (cchpathsize + 1 <= bufsize)
1891 break;
1892 bufsize *= 2;
1893 }
1894
1879 if (!XEUNICODE_P) 1895 if (!XEUNICODE_P)
1880 { 1896 {
1881 Wexttext *wexe = MULTIBYTE_TO_WEXTTEXT ((Extbyte *) exe_path); 1897 Wexttext *wexe = MULTIBYTE_TO_WEXTTEXT ((Extbyte *) exe_path);
1882 wext_strcpy (exe_path, wexe); 1898 wext_strcpy (exe_path, wexe);
1883 } 1899 }
1884 #else /* !WIN32_NATIVE */ 1900 #else /* !WIN32_NATIVE */
1901 Wexttext *exe_path;
1885 Wexttext *w; 1902 Wexttext *w;
1886 const Wexttext *dir, *p; 1903 const Wexttext *dir, *p;
1887 1904
1888 if (pdump_ram_try ()) 1905 if (pdump_ram_try ())
1889 { 1906 {
1912 1929
1913 if (p != dir) 1930 if (p != dir)
1914 { 1931 {
1915 /* invocation-name includes a directory component -- presumably it 1932 /* invocation-name includes a directory component -- presumably it
1916 is relative to cwd, not $PATH */ 1933 is relative to cwd, not $PATH */
1934 exe_path = alloca_array (Wexttext, 1 + wext_strlen (dir));
1917 wext_strcpy (exe_path, dir); 1935 wext_strcpy (exe_path, dir);
1918 } 1936 }
1919 else 1937 else
1920 { 1938 {
1921 const Wexttext *path = wext_getenv ("PATH"); /* not egetenv -- 1939 const Wexttext *path = wext_getenv ("PATH"); /* not egetenv --
1922 not yet init. */ 1940 not yet init. */
1923 const Wexttext *name = p; 1941 const Wexttext *name = p;
1942 exe_path = alloca_array (Wexttext,
1943 10 + max (wext_strlen (name),
1944 wext_strlen (path)));
1924 for (;;) 1945 for (;;)
1925 { 1946 {
1926 p = path; 1947 p = path;
1927 while (*p && *p != SEPCHAR) 1948 while (*p && *p != SEPCHAR)
1928 p++; 1949 p++;
1952 { 1973 {
1953 /* Oh well, let's have some kind of default */ 1974 /* Oh well, let's have some kind of default */
1954 wext_sprintf (exe_path, "./%s", name); 1975 wext_sprintf (exe_path, "./%s", name);
1955 break; 1976 break;
1956 } 1977 }
1957 path = p+1; 1978 path = p + 1;
1958 } 1979 }
1959 } 1980 }
1960 #endif /* WIN32_NATIVE */ 1981 #endif /* WIN32_NATIVE */
1961 1982
1962 if (pdump_file_try (exe_path)) 1983 if (pdump_file_try (exe_path))
1975 in_pdump = 0; 1996 in_pdump = 0;
1976 return 1; 1997 return 1;
1977 } 1998 }
1978 pdump_free (); 1999 pdump_free ();
1979 } 2000 }
2001
2002 fail:
1980 #endif 2003 #endif
1981 2004
1982 in_pdump = 0; 2005 in_pdump = 0;
1983 return 0; 2006 return 0;
1984 } 2007 }