diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-01-05 22:51:37 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-01-05 22:51:37 +0000 |
commit | 19d9fcbda8637099854f2d8147b402b4420d19f5 (patch) | |
tree | 993f0ebc9045bd893cd3039d0ae6277ee5806c05 /polyp/scache.c | |
parent | 2f74bb9d437fc165695e1d4bb7516ca979962a49 (diff) |
Port to Windows. This is mostly glue layers for the poor POSIX support
on Windows. A few notes
* Only sockets behave somewhat like file descriptors in UNIX.
* There are no fixed paths. Closes thing is environment variables that point
to system directories. We also figure out where the binary/dll is
located and use that as configuration directory.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@418 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/scache.c')
-rw-r--r-- | polyp/scache.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/polyp/scache.c b/polyp/scache.c index 0dec33ce..2953145d 100644 --- a/polyp/scache.c +++ b/polyp/scache.c @@ -37,6 +37,10 @@ #include <glob.h> #endif +#ifdef HAVE_WINDOWS_H +#include <windows.h> +#endif + #include "scache.h" #include "sink-input.h" #include "mainloop.h" @@ -147,6 +151,13 @@ int pa_scache_add_file(struct pa_core *c, const char *name, const char *filename struct pa_memchunk chunk; int r; +#ifdef OS_IS_WIN32 + char buf[MAX_PATH]; + + if (ExpandEnvironmentStrings(filename, buf, MAX_PATH)) + filename = buf; +#endif + if (pa_sound_file_load(filename, &ss, &chunk, c->memblock_stat) < 0) return -1; @@ -158,6 +169,14 @@ int pa_scache_add_file(struct pa_core *c, const char *name, const char *filename int pa_scache_add_file_lazy(struct pa_core *c, const char *name, const char *filename, uint32_t *index) { struct pa_scache_entry *e; + +#ifdef OS_IS_WIN32 + char buf[MAX_PATH]; + + if (ExpandEnvironmentStrings(filename, buf, MAX_PATH)) + filename = buf; +#endif + assert(c && name); if (!(e = scache_add_item(c, name))) @@ -313,7 +332,9 @@ static void add_file(struct pa_core *c, const char *pathname) { return; } +#if defined(S_ISREG) && defined(S_ISLNK) if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) +#endif pa_scache_add_file_lazy(c, e, pathname, NULL); } |