Started implementation of ShellExecuteEx32A.
[wine.git] / include / file.h
blobb727a209ec033f40fb93522dda43ef94f811a6f4
1 /*
2 * File handling declarations
4 * Copyright 1996 Alexandre Julliard
5 */
7 #ifndef __WINE_FILE_H
8 #define __WINE_FILE_H
10 #include <time.h>
11 #include "windows.h"
12 #include "k32obj.h"
14 #define MAX_PATHNAME_LEN 1024
16 /* The file object */
17 typedef struct
19 K32OBJ header;
20 int unix_handle;
21 int mode;
22 char *unix_name;
23 DWORD type; /* Type for win32 apps */
24 DWORD pos; /* workaround to emulate weird DOS error handling */
25 } FILE_OBJECT;
27 /* Definition of a full DOS file name */
28 typedef struct
30 char long_name[MAX_PATHNAME_LEN]; /* Long pathname in Unix format */
31 char short_name[MAX_PATHNAME_LEN]; /* Short pathname in DOS 8.3 format */
32 int drive;
33 } DOS_FULL_NAME;
35 #define IS_END_OF_NAME(ch) (!(ch) || ((ch) == '/') || ((ch) == '\\'))
37 /* DOS device descriptor */
38 typedef struct
40 char *name;
41 int flags;
42 } DOS_DEVICE;
44 /* Macros to convert 16 bit to 32 bit file handles and back */
45 /* LZW handles are exempt as if not, could go below 0x400 */
46 #define HFILE16_TO_HFILE32(handle) \
47 (((handle)==0) ? GetStdHandle(STD_INPUT_HANDLE) : \
48 ((handle)==1) ? GetStdHandle(STD_OUTPUT_HANDLE) : \
49 ((handle)==2) ? GetStdHandle(STD_ERROR_HANDLE) : \
50 ((handle)==3) ? GetStdHandle(STD_ERROR_HANDLE) : \
51 ((handle)==4) ? GetStdHandle(STD_ERROR_HANDLE) : \
52 ((handle)>=0x400) ? handle : \
53 (handle)-5)
55 #define HFILE32_TO_HFILE16(handle) ({ HFILE32 hnd=handle; \
56 ((hnd==HFILE_ERROR32) ? HFILE_ERROR16 : \
57 ((hnd)>=0x400) ? hnd : \
58 (HFILE16)hnd+5); })
61 /* files/file.c */
62 extern FILE_OBJECT *FILE_GetFile( HFILE32 handle );
63 extern void FILE_ReleaseFile( FILE_OBJECT *file );
64 extern HFILE32 FILE_Alloc( FILE_OBJECT **file );
65 extern void FILE_SetDosError(void);
66 extern int FILE_GetUnixHandle( HFILE32 hFile );
67 extern HFILE32 FILE_DupUnixHandle( int fd );
68 extern BOOL32 FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info );
69 extern HFILE32 FILE_Dup( HFILE32 hFile );
70 extern HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 );
71 extern HFILE32 FILE_Open( LPCSTR path, INT32 mode ,INT32 sharemode);
72 extern HFILE32 FILE_OpenUnixFile( LPCSTR path, INT32 mode );
73 extern BOOL32 FILE_SetFileType( HFILE32 hFile, DWORD type );
74 extern LPVOID FILE_mmap( HFILE32 hFile, LPVOID start,
75 DWORD size_high, DWORD size_low,
76 DWORD offset_high, DWORD offset_low,
77 int prot, int flags );
78 extern LPVOID FILE_dommap( FILE_OBJECT *file, LPVOID start,
79 DWORD size_high, DWORD size_low,
80 DWORD offset_high, DWORD offset_low,
81 int prot, int flags );
82 extern int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low );
83 extern HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr );
85 /* files/directory.c */
86 extern int DIR_Init(void);
87 extern UINT32 DIR_GetWindowsUnixDir( LPSTR path, UINT32 count );
88 extern UINT32 DIR_GetSystemUnixDir( LPSTR path, UINT32 count );
89 extern DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext,
90 DOS_FULL_NAME *full_name, BOOL32 win32 );
92 /* files/dos_fs.c */
93 extern void DOSFS_UnixTimeToFileTime( time_t unixtime, LPFILETIME ft,
94 DWORD remainder );
95 extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder );
96 extern BOOL32 DOSFS_ToDosFCBFormat( LPCSTR name, LPSTR buffer );
97 extern const DOS_DEVICE *DOSFS_GetDevice( const char *name );
98 extern HFILE32 DOSFS_OpenDevice( const char *name, INT32 mode );
99 extern BOOL32 DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
100 INT32 long_len, LPSTR short_buf,
101 BOOL32 ignore_case );
102 extern BOOL32 DOSFS_GetFullName( LPCSTR name, BOOL32 check_last,
103 DOS_FULL_NAME *full );
104 extern int DOSFS_FindNext( const char *path, const char *short_mask,
105 const char *long_mask, int drive, BYTE attr,
106 int skip, WIN32_FIND_DATA32A *entry );
108 #endif /* __WINE_FILE_H */