vaseboot/include/VasEBoot/osdep/hostfile_windows.h

86 lines
2.3 KiB
C

/*
* VasEBoot -- GRand Unified Bootloader
* Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc.
*
* VasEBoot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VasEBoot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VasEBoot. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VasEBoot_EMU_HOSTFILE_H
#define VasEBoot_EMU_HOSTFILE_H 1
#include <config.h>
#include <stdarg.h>
#include <windows.h>
typedef HANDLE VasEBoot_util_fd_t;
#define VasEBoot_UTIL_FD_INVALID INVALID_HANDLE_VALUE
#define VasEBoot_UTIL_FD_IS_VALID(x) ((x) != VasEBoot_UTIL_FD_INVALID)
#define VasEBoot_UTIL_FD_STAT_IS_FUNCTIONAL 0
#define DEFAULT_DIRECTORY "C:\\"VasEBoot_BOOT_DIR_NAME"\\"VasEBoot_DIR_NAME
#define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map"
struct VasEBoot_util_fd_dirent
{
char d_name[0];
};
struct VasEBoot_util_fd_dir;
typedef struct VasEBoot_util_fd_dirent *VasEBoot_util_fd_dirent_t;
typedef struct VasEBoot_util_fd_dir *VasEBoot_util_fd_dir_t;
int
VasEBoot_util_rename (const char *from, const char *to);
int
VasEBoot_util_unlink (const char *name);
void
VasEBoot_util_mkdir (const char *dir);
VasEBoot_util_fd_dir_t
VasEBoot_util_fd_opendir (const char *name);
void
VasEBoot_util_fd_closedir (VasEBoot_util_fd_dir_t dirp);
VasEBoot_util_fd_dirent_t
VasEBoot_util_fd_readdir (VasEBoot_util_fd_dir_t dirp);
int
VasEBoot_util_rmdir (const char *pathname);
enum VasEBoot_util_fd_open_flags_t
{
VasEBoot_UTIL_FD_O_RDONLY = 1,
VasEBoot_UTIL_FD_O_WRONLY = 2,
VasEBoot_UTIL_FD_O_RDWR = 3,
VasEBoot_UTIL_FD_O_CREATTRUNC = 4,
VasEBoot_UTIL_FD_O_SYNC = 0,
};
#if defined (__MINGW32__) && !defined (__MINGW64__)
/* 32 bit on Mingw-w64 already redefines them if _FILE_OFFSET_BITS=64 */
#ifndef _W64
#define fseeko fseeko64
#define ftello ftello64
#endif
#endif
LPTSTR
VasEBoot_util_utf8_to_tchar (const char *in);
char *
VasEBoot_util_tchar_to_utf8 (LPCTSTR in);
#endif