2 * File handling declarations
4 * Copyright 1996 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <time.h> /* time_t */
27 #include "wine/windef16.h" /* HFILE16 */
29 #define MAX_PATHNAME_LEN 1024
31 /* Definition of a full DOS file name */
34 char long_name[MAX_PATHNAME_LEN]; /* Long pathname in Unix format */
35 char short_name[MAX_PATHNAME_LEN]; /* Short pathname in DOS 8.3 format */
39 #define IS_END_OF_NAME(ch) (!(ch) || ((ch) == '/') || ((ch) == '\\'))
41 /* DOS device descriptor */
48 /* overlapped private structure */
50 typedef void (*async_handler)(struct async_private *ovp);
51 typedef struct async_private
53 LPOVERLAPPED lpOverlapped;
61 LPOVERLAPPED_COMPLETION_ROUTINE completion_func;
62 struct async_private *next;
63 struct async_private *prev;
66 extern void WINAPI check_async_list(LPOVERLAPPED ov, DWORD status);
67 extern void finish_async(struct async_private *ovp, DWORD status);
69 /* locale-independent case conversion */
70 inline static char FILE_tolower( char c )
72 if (c >= 'A' && c <= 'Z') c += 32;
75 inline static char FILE_toupper( char c )
77 if (c >= 'a' && c <= 'z') c -= 32;
81 inline static int FILE_contains_path (LPCSTR name)
83 return ((*name && (name[1] == ':')) ||
84 strchr (name, '/') || strchr (name, '\\'));
88 extern int FILE_strcasecmp( const char *str1, const char *str2 );
89 extern int FILE_strncasecmp( const char *str1, const char *str2, int len );
90 extern void FILE_SetDosError(void);
91 extern HANDLE FILE_DupUnixHandle( int fd, DWORD access, BOOL inherit );
92 extern int FILE_GetUnixHandle( HANDLE handle, DWORD access );
93 extern BOOL FILE_Stat( LPCSTR unixName, BY_HANDLE_FILE_INFORMATION *info );
94 extern HFILE16 FILE_Dup2( HFILE16 hFile1, HFILE16 hFile2 );
95 extern HANDLE FILE_CreateFile( LPCSTR filename, DWORD access, DWORD sharing,
96 LPSECURITY_ATTRIBUTES sa, DWORD creation,
97 DWORD attributes, HANDLE template, BOOL fail_read_only,
99 extern HANDLE FILE_CreateDevice( int client_id, DWORD access, LPSECURITY_ATTRIBUTES sa );
100 extern BOOL FILE_StartAsync(HANDLE handle, LPOVERLAPPED lpOverlapped, DWORD type, DWORD count, DWORD status);
102 extern LONG WINAPI WIN16_hread(HFILE16,SEGPTR,LONG);
104 /* files/directory.c */
105 extern int DIR_Init(void);
106 extern UINT DIR_GetWindowsUnixDir( LPSTR path, UINT count );
107 extern UINT DIR_GetSystemUnixDir( LPSTR path, UINT count );
108 extern DWORD DIR_SearchAlternatePath( LPCSTR dll_path, LPCSTR name, LPCSTR ext,
109 DWORD buflen, LPSTR buffer, LPSTR *lastpart);
110 extern DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext,
111 DOS_FULL_NAME *full_name, BOOL win32 );
114 extern void DOSFS_UnixTimeToFileTime( time_t unixtime, LPFILETIME ft,
116 extern time_t DOSFS_FileTimeToUnixTime( const FILETIME *ft, DWORD *remainder );
117 extern BOOL DOSFS_ToDosFCBFormat( LPCSTR name, LPSTR buffer );
118 extern const DOS_DEVICE *DOSFS_GetDevice( const char *name );
119 extern const DOS_DEVICE *DOSFS_GetDeviceByHandle( HFILE hFile );
120 extern HANDLE DOSFS_OpenDevice( const char *name, DWORD access, DWORD attributes, LPSECURITY_ATTRIBUTES sa);
121 extern BOOL DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
122 INT long_len, LPSTR short_buf,
124 extern BOOL DOSFS_GetFullName( LPCSTR name, BOOL check_last,
125 DOS_FULL_NAME *full );
126 extern int DOSFS_FindNext( const char *path, const char *short_mask,
127 const char *long_mask, int drive, BYTE attr,
128 int skip, WIN32_FIND_DATAA *entry );
131 extern HANDLE DEVICE_Open( LPCSTR filename, DWORD access, LPSECURITY_ATTRIBUTES sa );
133 /* ntdll/cdrom.c.c */
134 extern BOOL CDROM_DeviceIoControl(DWORD clientID, HANDLE hDevice, DWORD dwIoControlCode,
135 LPVOID lpInBuffer, DWORD nInBufferSize,
136 LPVOID lpOutBuffer, DWORD nOutBufferSize,
137 LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);
139 #endif /* __WINE_FILE_H */