2010-04-27 05:20:28 +00:00
|
|
|
#ifndef GRUB_EMU_MISC_H
|
|
|
|
#define GRUB_EMU_MISC_H 1
|
|
|
|
|
|
|
|
#include <grub/symbol.h>
|
|
|
|
#include <grub/types.h>
|
|
|
|
|
2010-05-06 03:15:39 +00:00
|
|
|
#ifdef __CYGWIN__
|
|
|
|
# include <sys/fcntl.h>
|
|
|
|
# include <sys/cygwin.h>
|
|
|
|
# include <limits.h>
|
|
|
|
# define DEV_CYGDRIVE_MAJOR 98
|
|
|
|
#endif
|
|
|
|
|
2010-04-27 05:20:28 +00:00
|
|
|
#ifdef __NetBSD__
|
|
|
|
/* NetBSD uses /boot for its boot block. */
|
|
|
|
# define DEFAULT_DIRECTORY "/grub"
|
|
|
|
#else
|
|
|
|
# define DEFAULT_DIRECTORY "/boot/grub"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map"
|
|
|
|
|
|
|
|
extern int verbosity;
|
|
|
|
extern const char *program_name;
|
|
|
|
|
2010-05-04 04:17:48 +00:00
|
|
|
void grub_emu_init (void);
|
2010-04-27 05:20:28 +00:00
|
|
|
void grub_init_all (void);
|
|
|
|
void grub_fini_all (void);
|
|
|
|
|
2010-05-04 03:39:03 +00:00
|
|
|
char *grub_make_system_path_relative_to_its_root (const char *path);
|
|
|
|
|
2010-04-27 05:20:28 +00:00
|
|
|
void * EXPORT_FUNC(xmalloc) (grub_size_t size);
|
|
|
|
void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size);
|
|
|
|
char * EXPORT_FUNC(xstrdup) (const char *str);
|
|
|
|
char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
|
|
|
|
|
|
|
|
void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...);
|
|
|
|
void EXPORT_FUNC(grub_util_info) (const char *fmt, ...);
|
|
|
|
void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((noreturn));
|
|
|
|
|
2010-04-27 15:25:12 +00:00
|
|
|
#ifndef HAVE_VASPRINTF
|
|
|
|
int EXPORT_FUNC(vasprintf) (char **buf, const char *fmt, va_list ap);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_ASPRINTF
|
|
|
|
int EXPORT_FUNC(asprintf) (char **buf, const char *fmt, ...);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
|
2010-05-26 04:26:59 +00:00
|
|
|
char * canonicalize_file_name (const char *path);
|
2010-04-27 15:25:12 +00:00
|
|
|
|
2010-04-27 05:20:28 +00:00
|
|
|
#endif /* GRUB_EMU_MISC_H */
|