2 * File handling declarations
4 * Copyright 1996 Alexandre Julliard
15 #define MAX_PATHNAME_LEN 1024
24 DWORD type
; /* Type for win32 apps */
25 DWORD pos
; /* workaround to emulate weird DOS error handling */
27 THREAD_QUEUE wait_queue
;
30 /* Definition of a full DOS file name */
33 char long_name
[MAX_PATHNAME_LEN
]; /* Long pathname in Unix format */
34 char short_name
[MAX_PATHNAME_LEN
]; /* Short pathname in DOS 8.3 format */
38 #define IS_END_OF_NAME(ch) (!(ch) || ((ch) == '/') || ((ch) == '\\'))
40 /* DOS device descriptor */
47 /* Macros to convert 16 bit to 32 bit file handles and back */
48 /* LZW handles are exempt as if not, could go below 0x400 */
49 #define HFILE16_TO_HFILE32(handle) \
50 (((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
51 ((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
52 ((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
53 ((handle)==3) ? GetStdHandle(STD_ERROR_HANDLE) : \
54 ((handle)==4) ? GetStdHandle(STD_ERROR_HANDLE) : \
55 ((handle)>=0x400) ? handle : \
58 #define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
59 ((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
60 ((hnd)>=0x400) ? hnd : \
65 extern FILE_OBJECT
*FILE_GetFile( HFILE32 handle
, DWORD access
,
67 extern void FILE_ReleaseFile( FILE_OBJECT
*file
);
68 extern HFILE32
FILE_Alloc( FILE_OBJECT
**file
, int unix_handle
);
69 extern void FILE_SetDosError(void);
70 extern int FILE_GetUnixHandle( HFILE32 hFile
, DWORD access
);
71 extern HFILE32
FILE_DupUnixHandle( int fd
);
72 extern BOOL32
FILE_Stat( LPCSTR unixName
, BY_HANDLE_FILE_INFORMATION
*info
);
73 extern HFILE32
FILE_Dup( HFILE32 hFile
);
74 extern HFILE32
FILE_Dup2( HFILE32 hFile1
, HFILE32 hFile2
);
75 extern HFILE32
FILE_Open( LPCSTR path
, INT32 mode
,INT32 sharemode
);
76 extern HFILE32
FILE_OpenUnixFile( LPCSTR path
, INT32 mode
);
77 extern BOOL32
FILE_SetFileType( HFILE32 hFile
, DWORD type
);
78 extern LPVOID
FILE_mmap( HFILE32 hFile
, LPVOID start
,
79 DWORD size_high
, DWORD size_low
,
80 DWORD offset_high
, DWORD offset_low
,
81 int prot
, int flags
);
82 extern LPVOID
FILE_dommap( FILE_OBJECT
*file
, int unix_handle
, LPVOID start
,
83 DWORD size_high
, DWORD size_low
,
84 DWORD offset_high
, DWORD offset_low
,
85 int prot
, int flags
);
86 extern int FILE_munmap( LPVOID start
, DWORD size_high
, DWORD size_low
);
87 extern HFILE32
_lcreat_uniq( LPCSTR path
, INT32 attr
);
89 /* files/directory.c */
90 extern int DIR_Init(void);
91 extern UINT32
DIR_GetWindowsUnixDir( LPSTR path
, UINT32 count
);
92 extern UINT32
DIR_GetSystemUnixDir( LPSTR path
, UINT32 count
);
93 extern DWORD
DIR_SearchPath( LPCSTR path
, LPCSTR name
, LPCSTR ext
,
94 DOS_FULL_NAME
*full_name
, BOOL32 win32
);
97 extern void DOSFS_UnixTimeToFileTime( time_t unixtime
, LPFILETIME ft
,
99 extern time_t DOSFS_FileTimeToUnixTime( const FILETIME
*ft
, DWORD
*remainder
);
100 extern BOOL32
DOSFS_ToDosFCBFormat( LPCSTR name
, LPSTR buffer
);
101 extern const DOS_DEVICE
*DOSFS_GetDevice( const char *name
);
102 extern HFILE32
DOSFS_OpenDevice( const char *name
, INT32 mode
);
103 extern BOOL32
DOSFS_FindUnixName( LPCSTR path
, LPCSTR name
, LPSTR long_buf
,
104 INT32 long_len
, LPSTR short_buf
,
105 BOOL32 ignore_case
);
106 extern BOOL32
DOSFS_GetFullName( LPCSTR name
, BOOL32 check_last
,
107 DOS_FULL_NAME
*full
);
108 extern int DOSFS_FindNext( const char *path
, const char *short_mask
,
109 const char *long_mask
, int drive
, BYTE attr
,
110 int skip
, WIN32_FIND_DATA32A
*entry
);
112 #endif /* __WINE_FILE_H */