Mercurial > hg > xemacs-beta
comparison src/ntplay.c @ 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 | ecf1ebac70d8 |
children | 16112448d484 4aebb0131297 |
comparison
equal
deleted
inserted
replaced
2525:52f00344a629 | 2526:902d5bd9b75c |
---|---|
33 | 33 |
34 static int play_sound_data_1 (Binbyte *data, int length, | 34 static int play_sound_data_1 (Binbyte *data, int length, |
35 int volume, int convert); | 35 int volume, int convert); |
36 | 36 |
37 void | 37 void |
38 play_sound_file (Extbyte *sound_file, int UNUSED (volume)) | 38 nt_play_sound_file (Lisp_Object path, int UNUSED (volume)) |
39 { | 39 { |
40 DWORD flags = SND_ASYNC | SND_NODEFAULT | SND_FILENAME; | 40 DWORD flags = SND_ASYNC | SND_NODEFAULT | SND_FILENAME; |
41 Lisp_Object fname = | 41 Lisp_Object fname = Ffile_name_nondirectory (path); |
42 Ffile_name_nondirectory (build_tstr_string (sound_file)); | |
43 Extbyte *fnameext; | 42 Extbyte *fnameext; |
44 | 43 |
45 CHECK_STRING (fname); | |
46 LISP_STRING_TO_TSTR (fname, fnameext); | 44 LISP_STRING_TO_TSTR (fname, fnameext); |
47 | 45 |
48 if (qxeSearchPath (NULL, fnameext, NULL, 0, NULL, NULL) == 0) | 46 if (qxeSearchPath (NULL, fnameext, NULL, 0, NULL, NULL) == 0) |
49 { | 47 { |
50 /* file isn't in the path so read it as data */ | 48 /* file isn't in the path so read it as data */ |
51 int size; | 49 int size; |
52 Binbyte *data; | 50 Binbyte *data; |
53 int ofd = qxe_open (XSTRING_DATA (fname), O_RDONLY | OPEN_BINARY, 0); | 51 int ofd = qxe_open (XSTRING_DATA (path), O_RDONLY | OPEN_BINARY, 0); |
54 | 52 |
55 if (ofd <0) | 53 if (ofd < 0) |
56 return; | 54 return; |
57 | 55 |
58 size = lseek (ofd, 0, SEEK_END); | 56 size = lseek (ofd, 0, SEEK_END); |
59 data = xnew_binbytes (size); | 57 data = xnew_binbytes (size); |
60 lseek (ofd, 0, SEEK_SET); | 58 lseek (ofd, 0, SEEK_SET); |