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 */
25 #ifdef HAVE_SYS_TIME_H
26 # include <sys/time.h>
28 #include <sys/types.h>
30 #include <wine/windef16.h> /* HFILE16 */
33 #define MAX_PATHNAME_LEN 1024
35 /* Definition of a full DOS file name */
38 char long_name
[MAX_PATHNAME_LEN
]; /* Long pathname in Unix format */
39 WCHAR short_name
[MAX_PATHNAME_LEN
]; /* Short pathname in DOS 8.3 format */
43 #define IS_END_OF_NAME(ch) (!(ch) || ((ch) == '/') || ((ch) == '\\'))
45 /* DOS device descriptor */
53 /* locale-independent case conversion */
54 inline static char FILE_tolower( char c
)
56 if (c
>= 'A' && c
<= 'Z') c
+= 32;
59 inline static char FILE_toupper( char c
)
61 if (c
>= 'a' && c
<= 'z') c
-= 32;
65 inline static int FILE_contains_path (LPCSTR name
)
67 return ((*name
&& (name
[1] == ':')) ||
68 strchr (name
, '/') || strchr (name
, '\\'));
72 extern mode_t FILE_umask
;
73 extern int FILE_strcasecmp( const char *str1
, const char *str2
);
74 extern int FILE_strncasecmp( const char *str1
, const char *str2
, int len
);
75 extern void FILE_SetDosError(void);
76 extern int FILE_GetUnixHandle( HANDLE handle
, DWORD access
);
77 extern BOOL
FILE_Stat( LPCSTR unixName
, BY_HANDLE_FILE_INFORMATION
*info
, BOOL
*is_symlink
);
78 extern HFILE16
FILE_Dup2( HFILE16 hFile1
, HFILE16 hFile2
);
79 extern HANDLE
FILE_CreateFile( LPCSTR filename
, DWORD access
, DWORD sharing
,
80 LPSECURITY_ATTRIBUTES sa
, DWORD creation
,
81 DWORD attributes
, HANDLE
template, BOOL fail_read_only
,
83 extern HANDLE
FILE_CreateDevice( int client_id
, DWORD access
, LPSECURITY_ATTRIBUTES sa
);
85 extern LONG WINAPI
WIN16_hread(HFILE16
,SEGPTR
,LONG
);
87 /* files/directory.c */
88 extern int DIR_Init(void);
89 extern UINT
DIR_GetWindowsUnixDir( LPSTR path
, UINT count
);
90 extern UINT
DIR_GetSystemUnixDir( LPSTR path
, UINT count
);
91 extern DWORD
DIR_SearchAlternatePath( LPCSTR dll_path
, LPCSTR name
, LPCSTR ext
,
92 DWORD buflen
, LPSTR buffer
, LPSTR
*lastpart
);
93 extern DWORD
DIR_SearchPath( LPCWSTR path
, LPCWSTR name
, LPCWSTR ext
,
94 DOS_FULL_NAME
*full_name
, BOOL win32
);
97 extern BOOL
DOSFS_ToDosFCBFormat( LPCWSTR name
, LPWSTR buffer
);
98 extern const DOS_DEVICE
*DOSFS_GetDevice( LPCWSTR name
);
99 extern const DOS_DEVICE
*DOSFS_GetDeviceByHandle( HANDLE hFile
);
100 extern HANDLE
DOSFS_OpenDevice( LPCWSTR name
, DWORD access
, DWORD attributes
, LPSECURITY_ATTRIBUTES sa
);
101 extern BOOL
DOSFS_FindUnixName( const DOS_FULL_NAME
*path
, LPCWSTR name
, char *long_buf
,
102 INT long_len
, LPWSTR short_buf
, BOOL ignore_case
);
103 extern BOOL
DOSFS_GetFullName( LPCWSTR name
, BOOL check_last
,
104 DOS_FULL_NAME
*full
);
105 extern int DOSFS_FindNext( const char *path
, const char *short_mask
,
106 const char *long_mask
, int drive
, BYTE attr
,
107 int skip
, WIN32_FIND_DATAA
*entry
);
110 extern HANDLE
DEVICE_Open( LPCWSTR filename
, DWORD access
, LPSECURITY_ATTRIBUTES sa
);
112 #endif /* __WINE_FILE_H */