2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_EMU_HOSTFILE_H
20 #define GRUB_EMU_HOSTFILE_H 1
26 typedef HANDLE grub_util_fd_t
;
27 #define GRUB_UTIL_FD_INVALID INVALID_HANDLE_VALUE
28 #define GRUB_UTIL_FD_IS_VALID(x) ((x) != GRUB_UTIL_FD_INVALID)
29 #define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 0
31 #define DEFAULT_DIRECTORY "C:\\"GRUB_BOOT_DIR_NAME"\\"GRUB_DIR_NAME
32 #define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map"
34 struct grub_util_fd_dirent
38 struct grub_util_fd_dir
;
39 typedef struct grub_util_fd_dirent
*grub_util_fd_dirent_t
;
40 typedef struct grub_util_fd_dir
*grub_util_fd_dir_t
;
43 grub_util_rename (const char *from
, const char *to
);
45 grub_util_unlink (const char *name
);
47 grub_util_mkdir (const char *dir
);
50 grub_util_fd_opendir (const char *name
);
53 grub_util_fd_closedir (grub_util_fd_dir_t dirp
);
56 grub_util_fd_readdir (grub_util_fd_dir_t dirp
);
59 grub_util_rmdir (const char *pathname
);
61 enum grub_util_fd_open_flags_t
63 GRUB_UTIL_FD_O_RDONLY
= 1,
64 GRUB_UTIL_FD_O_WRONLY
= 2,
65 GRUB_UTIL_FD_O_RDWR
= 3,
66 GRUB_UTIL_FD_O_CREATTRUNC
= 4,
67 GRUB_UTIL_FD_O_SYNC
= 0,
70 #if defined (__MINGW32__) && !defined (__MINGW64__)
72 /* 32 bit on Mingw-w64 already redefines them if _FILE_OFFSET_BITS=64 */
74 #define fseeko fseeko64
75 #define ftello ftello64
81 grub_util_utf8_to_tchar (const char *in
);
83 grub_util_tchar_to_utf8 (LPCTSTR in
);