2 * File handling declarations
4 * Copyright 1996 Alexandre Julliard
14 #define MAX_PATHNAME_LEN 1024
23 /* Definition of a full DOS file name */
26 char long_name
[MAX_PATHNAME_LEN
]; /* Long pathname in Unix format */
27 char short_name
[MAX_PATHNAME_LEN
]; /* Short pathname in DOS 8.3 format */
31 #define IS_END_OF_NAME(ch) (!(ch) || ((ch) == '/') || ((ch) == '\\'))
33 /* DOS device descriptor */
40 /* Macros to convert 16 bit to 32 bit file handles and back */
41 /* LZW handles are exempt as if not, could go below 0x400 */
42 #define HFILE16_TO_HFILE32(handle) \
43 (((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
44 ((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
45 ((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
46 ((handle)==3) ? GetStdHandle(STD_ERROR_HANDLE) : \
47 ((handle)==4) ? GetStdHandle(STD_ERROR_HANDLE) : \
48 ((handle)>=0x400) ? handle : \
51 #define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
52 ((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
53 ((hnd)>=0x400) ? hnd : \
58 extern FILE_OBJECT
*FILE_GetFile( HFILE32 handle
, DWORD access
,
60 extern void FILE_ReleaseFile( FILE_OBJECT
*file
);
61 extern void FILE_SetDosError(void);
62 extern HFILE32
FILE_DupUnixHandle( int fd
, DWORD access
);
63 extern BOOL32
FILE_Stat( LPCSTR unixName
, BY_HANDLE_FILE_INFORMATION
*info
);
64 extern HFILE32
FILE_Dup2( HFILE32 hFile1
, HFILE32 hFile2
);
65 extern HFILE32
FILE_CreateFile( LPCSTR filename
, DWORD access
, DWORD sharing
,
66 LPSECURITY_ATTRIBUTES sa
, DWORD creation
,
67 DWORD attributes
, HANDLE32
template );
68 extern LPVOID
FILE_dommap( int unix_handle
, LPVOID start
,
69 DWORD size_high
, DWORD size_low
,
70 DWORD offset_high
, DWORD offset_low
,
71 int prot
, int flags
);
72 extern int FILE_munmap( LPVOID start
, DWORD size_high
, DWORD size_low
);
73 extern HFILE32
_lcreat_uniq( LPCSTR path
, INT32 attr
);
75 /* files/directory.c */
76 extern int DIR_Init(void);
77 extern UINT32
DIR_GetWindowsUnixDir( LPSTR path
, UINT32 count
);
78 extern UINT32
DIR_GetSystemUnixDir( LPSTR path
, UINT32 count
);
79 extern DWORD
DIR_SearchPath( LPCSTR path
, LPCSTR name
, LPCSTR ext
,
80 DOS_FULL_NAME
*full_name
, BOOL32 win32
);
83 extern void DOSFS_UnixTimeToFileTime( time_t unixtime
, LPFILETIME ft
,
85 extern time_t DOSFS_FileTimeToUnixTime( const FILETIME
*ft
, DWORD
*remainder
);
86 extern BOOL32
DOSFS_ToDosFCBFormat( LPCSTR name
, LPSTR buffer
);
87 extern const DOS_DEVICE
*DOSFS_GetDevice( const char *name
);
88 extern HFILE32
DOSFS_OpenDevice( const char *name
, DWORD access
);
89 extern BOOL32
DOSFS_FindUnixName( LPCSTR path
, LPCSTR name
, LPSTR long_buf
,
90 INT32 long_len
, LPSTR short_buf
,
92 extern BOOL32
DOSFS_GetFullName( LPCSTR name
, BOOL32 check_last
,
93 DOS_FULL_NAME
*full
);
94 extern int DOSFS_FindNext( const char *path
, const char *short_mask
,
95 const char *long_mask
, int drive
, BYTE attr
,
96 int skip
, WIN32_FIND_DATA32A
*entry
);
98 #endif /* __WINE_FILE_H */