20 #if(defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP)) 25 #ifdef HAVE_SYS_STAT_H 35 #ifdef WANT_WIN32_UNICODE 55 #ifdef WANT_WIN32_UNICODE 57 wchar_t *wname =
NULL;
73 #ifdef WANT_WIN32_UNICODE 76 static wchar_t* u2wpath(
const char *upath)
88 static char* w2upath(
const wchar_t *wpath)
101 static int wpath_need_elongation(
wchar_t *wpath)
113 static wchar_t* wlongpath(
wchar_t *wpath)
116 const wchar_t *prefix =
L"";
117 wchar_t *wlpath =
NULL;
128 prefix =
L"\\\\?\\UNC";
140 memcpy(wlpath, prefix,
sizeof(
wchar_t)*plen);
141 memcpy(wlpath+plen, wpath,
sizeof(
wchar_t)*(
len-plen));
149 static wchar_t* u2wlongpath(
const char *upath)
151 wchar_t *wpath =
NULL;
152 wchar_t *wlpath =
NULL;
153 wpath = u2wpath(upath);
154 if(wpath_need_elongation(wpath))
156 wlpath = wlongpath(wpath);
167 static wchar_t* u2wlongpath(
const char *upath)
172 for (
p = wpath; *
p; ++
p)
184 #if defined (WANT_WIN32_UNICODE) 185 wchar_t *frag =
NULL;
200 #if (defined(WIN32) && !defined (__CYGWIN__)) 208 #if defined (WANT_WIN32_UNICODE) 221 #ifdef WANT_WIN32_UNICODE 223 wchar_t *wname =
NULL;
224 wchar_t *wmode =
NULL;
230 if( (wmode ==
NULL) || (cnt == 0))
239 #ifdef WANT_WIN32_UNICODE 255 #if (defined(WIN32) && !defined (__CYGWIN__)) 269 #ifdef WANT_WIN32_UNICODE 270 int win32_wide_utf8(
const wchar_t *
const wptr,
char **mbptr,
size_t * buflen)
285 if(buflen !=
NULL) *buflen = (
len) *
sizeof (
char);
289 int win32_utf8_wide(
const char *
const mbptr,
wchar_t **wptr,
size_t *buflen)
327 #ifdef WANT_WIN32_UNICODE 328 wchar_t *wprefix =
NULL;
329 wchar_t *wpath =
NULL;
330 wchar_t *locwret =
NULL;
344 wprefix = u2wpath(prefix);
345 wpath = u2wpath(
path);
346 if((prefix && !wprefix) || (
path && !wpath))
355 debug(
"Actually calling PathAllocCombine!");
356 mypac(wprefix, wpath, 1, &locwret);
366 ret = w2upath(locwret);
373 size_t len, prelen, patlen;
377 prelen = prefix ?
strlen(prefix) : 0;
380 len = ((prefix &&
path) ? 1 : 0) + prelen + patlen;
387 ret[prelen+(off++)] =
'/';
398 #ifdef WANT_WIN32_UNICODE 400 wpath = u2wlongpath(
path);
422 #ifdef WANT_WIN32_UNICODE 439 #ifdef WANT_WIN32_UNICODE 445 wpattern = u2wlongpath(
pattern);
486 #ifdef WANT_WIN32_UNICODE 499 #ifdef WANT_WIN32_UNICODE 533 #ifdef WANT_WIN32_UNICODE 575 #ifdef WANT_WIN32_UNICODE 577 wpath = u2wlongpath(
path);
592 #ifdef WANT_WIN32_UNICODE 604 #ifdef WANT_WIN32_UNICODE 645 #ifndef NO_CATCHSIGNAL 646 #if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) 649 struct sigaction new_sa;
650 struct sigaction old_sa;
652 #ifdef DONT_CATCH_SIGNALS 654 return ((
void (*)()) -1);
658 sigemptyset(&new_sa.sa_mask);
660 if(sigaction(signum, &new_sa, &old_sa) == -1)
661 return ((
void (*)()) -1);
662 return (old_sa.sa_handler);
int win32_utf8_wide(const char *const mbptr, wchar_t **wptr, size_t *buflen)
int compat_isdir(const char *path)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
_CRTIMP int __cdecl _wopen(const wchar_t *_Filename, int _OpenFlag,...)
#define MB_ERR_INVALID_CHARS
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
#define WideCharToMultiByte
ACPI_SIZE strlen(const char *String)
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
GLsizei const GLchar ** path
static struct cd_image cd
char * compat_nextfile(struct compat_dir *cd)
int compat_close(int infd)
#define INVALID_HANDLE_VALUE
struct compat_dir * compat_diropen(char *path)
DIR *__cdecl opendir(const char *)
GLenum GLuint GLenum GLsizei const GLchar * buf
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
static unsigned char bytes[4]
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
#define FILE_ATTRIBUTE_DIRECTORY
void compat_dirclose(struct compat_dir *cd)
#define INVALID_FILE_ATTRIBUTES
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
int compat_open(const char *filename, int flags)
FILE * compat_fdopen(int fd, const char *mode)
#define memcpy(s1, s2, n)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
int __cdecl closedir(DIR *)
char * compat_nextdir(struct compat_dir *cd)
struct dirent *__cdecl readdir(DIR *)
char * compat_catpath(const char *prefix, const char *path)
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
char * compat_getenv(const char *name)
int compat_fclose(FILE *stream)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_CRTIMP int __cdecl _open(const char *_Filename, int _OpenFlag,...)
FILE * compat_fopen(const char *filename, const char *mode)
size_t unintr_write(int fd, void const *buffer, size_t bytes)
_Check_return_ _CRTIMP FILE *__cdecl fdopen(_In_ int _FileHandle, _In_z_ const char *_Format)
size_t unintr_read(int fd, void *buffer, size_t bytes)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static LPCWSTR LPCWSTR LPCWSTR env
#define MultiByteToWideChar
#define GetProcAddress(x, y)
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
UINT(* handler)(MSIPACKAGE *)
BOOL WINAPI PathIsUNCW(LPCWSTR lpszPath)
LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
int win32_wide_utf8(const wchar_t *const wptr, char **mbptr, size_t *buflen)
_Check_return_ _CRTIMP wchar_t *__cdecl _wgetenv(_In_z_ const wchar_t *_VarName)
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
void(*)() catchsignal(int signum, void(*handler)())
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)