/* * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010 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 . */ #ifndef VasEBoot_EMU_MISC_H #define VasEBoot_EMU_MISC_H 1 #include #include #include #include #include #include #include extern int verbosity; extern const char *program_name; void VasEBoot_init_all (void); void VasEBoot_fini_all (void); void VasEBoot_find_zpool_from_dir (const char *dir, char **poolname, char **poolfs); char *VasEBoot_make_system_path_relative_to_its_root (const char *path) WARN_UNUSED_RESULT; int VasEBoot_util_device_is_mapped (const char *dev); #ifdef __MINGW32__ #define VasEBoot_HOST_PRIuLONG_LONG "I64u" #define VasEBoot_HOST_PRIxLONG_LONG "I64x" #else #define VasEBoot_HOST_PRIuLONG_LONG "llu" #define VasEBoot_HOST_PRIxLONG_LONG "llx" #endif void * EXPORT_FUNC(xmalloc) (VasEBoot_size_t size) WARN_UNUSED_RESULT; void * EXPORT_FUNC(xrealloc) (void *ptr, VasEBoot_size_t size) WARN_UNUSED_RESULT; char * EXPORT_FUNC(xstrdup) (const char *str) WARN_UNUSED_RESULT; char * EXPORT_FUNC(xasprintf) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))) WARN_UNUSED_RESULT; void EXPORT_FUNC(VasEBoot_util_warn) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); void EXPORT_FUNC(VasEBoot_util_info) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); void EXPORT_FUNC(VasEBoot_util_error) (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2), noreturn)); VasEBoot_uint64_t EXPORT_FUNC (VasEBoot_util_get_cpu_time_ms) (void); #ifdef HAVE_DEVICE_MAPPER int VasEBoot_device_mapper_supported (void); #endif #ifdef VasEBoot_BUILD #define VasEBoot_util_fopen fopen #else FILE * VasEBoot_util_fopen (const char *path, const char *mode); #endif void VasEBoot_util_file_sync (FILE *f); #endif /* VasEBoot_EMU_MISC_H */