Mercurial > hg > xemacs-beta
diff src/syswindows.h @ 2526:902d5bd9b75c
[xemacs-hg @ 2005-01-28 02:36:11 by ben]
Support symlinks under Windows
nt.c, fileio.c: Fix sync comments.
config.h.in, dired-msw.c, emacs.c, event-msw.c, fileio.c, glyphs.c, lisp.h, nt.c, process-nt.c, realpath.c, sound.c, symsinit.h, sysdep.c, sysfile.h, syswindows.h, win32.c: Add support for treating shortcuts under Windows as symbolic links.
Enabled with mswindows-shortcuts-are-links (t by default). Rewrite
lots of places to use PATHNAME_CONVERT_OUT, which is moved to
sysfile.h. Add PATHNAME_RESOLVE_LINKS, which only does things
under Windows.
Add profiling section for expand_file_name calls.
nt.c, sysdep.c: Unicode-ize.
realpath.c: Renamed from readlink_and_correct_case. Fix some problems with
Windows implementation due to incorrect understanding of workings
of the function.
sound.c, ntplay.c, sound.h: Rename play_sound_file to nt_play_sound_file and pass
internally-formatted data to it to avoid converting out and back
again.
text.h: is_c -> is_ascii.
author | ben |
---|---|
date | Fri, 28 Jan 2005 02:36:28 +0000 |
parents | 3d8143fc88e1 |
children | facf3239ba30 |
line wrap: on
line diff
--- a/src/syswindows.h Fri Jan 28 02:05:05 2005 +0000 +++ b/src/syswindows.h Fri Jan 28 02:36:28 2005 +0000 @@ -939,10 +939,10 @@ #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ do { \ - Ibyte *lttff; \ + Ibyte *lttff; \ \ LOCAL_TO_WIN32_FILE_FORMAT (XSTRING_DATA (path), lttff); \ - C_STRING_TO_TSTR (lttff, out); \ + PATHNAME_CONVERT_OUT (lttff, out); \ } while (0) Lisp_Object tstr_to_local_file_format (Extbyte *pathout); @@ -1006,40 +1006,40 @@ #ifdef CYGWIN -#define LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ -do \ -{ \ - Ibyte *lffmutt_fname1; \ - Ibyte *lffmutt_pathint = XSTRING_DATA (lispstr); \ - \ - if ((lffmutt_fname1 = qxestrchr (lffmutt_pathint, ':')) != NULL \ - && *++lffmutt_fname1 == '/' && *++lffmutt_fname1 == '/') \ - { \ - /* If URL style file, the innards may have Cygwin mount points and \ - the like. so separate out the innards, process them, and put back \ - together. */ \ - if (qxestrncasecmp_ascii (lffmutt_pathint, "file://", 7) == 0) \ - { \ - Ibyte *lffmutt_path1, *lffmutt_path2; \ - LOCAL_TO_WIN32_FILE_FORMAT (lffmutt_pathint + 7, lffmutt_path1); \ - if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */ \ - lffmutt_path2 = lffmutt_pathint; \ - else \ - { \ +#define LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ +do \ +{ \ + Ibyte *lffmutt_fname1; \ + Ibyte *lffmutt_pathint = XSTRING_DATA (lispstr); \ + \ + if ((lffmutt_fname1 = qxestrchr (lffmutt_pathint, ':')) != NULL \ + && *++lffmutt_fname1 == '/' && *++lffmutt_fname1 == '/') \ + { \ + /* If URL style file, the innards may have Cygwin mount points and \ + the like. so separate out the innards, process them, and put back \ + together. */ \ + if (qxestrncasecmp_ascii (lffmutt_pathint, "file://", 7) == 0) \ + { \ + Ibyte *lffmutt_path1, *lffmutt_path2; \ + LOCAL_TO_WIN32_FILE_FORMAT (lffmutt_pathint + 7, lffmutt_path1); \ + if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */ \ + lffmutt_path2 = lffmutt_pathint; \ + else \ + { \ lffmutt_path2 = alloca_ibytes (7 + qxestrlen (lffmutt_path1) \ - + 1); \ - qxestrncpy (lffmutt_path2, lffmutt_pathint, 7); \ - qxestrcpy (lffmutt_path2 + 7, lffmutt_path1); \ - } \ - C_STRING_TO_TSTR (lffmutt_path2, pathout); \ - } \ - else \ - /* A straight URL, just convert */ \ - LISP_STRING_TO_TSTR (lispstr, pathout); \ - } \ - else \ - /* Not URL-style, must be a straight filename. */ \ - LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout); \ + + 1); \ + qxestrncpy (lffmutt_path2, lffmutt_pathint, 7); \ + qxestrcpy (lffmutt_path2 + 7, lffmutt_path1); \ + } \ + C_STRING_TO_TSTR (lffmutt_path2, pathout); \ + } \ + else \ + /* A straight URL, just convert */ \ + LISP_STRING_TO_TSTR (lispstr, pathout); \ + } \ + else \ + /* Not URL-style, must be a straight filename. */ \ + LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout); \ } while (0) #else /* not CYGWIN */ @@ -1176,6 +1176,7 @@ Lisp_Object data, int errnum)); Lisp_Object mswindows_lisp_error (int errnum); +Ibyte *mswindows_read_link (const Ibyte *fname); /* in intl-win32.c */ extern Lisp_Object Qmswindows_tstr, Qmswindows_unicode;