err.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* err.h - error numbers and prototypes */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB 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
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GRUB_ERR_HEADER
  20. #define GRUB_ERR_HEADER 1
  21. #include <grub/symbol.h>
  22. typedef enum
  23. {
  24. GRUB_ERR_NONE = 0,
  25. GRUB_ERR_TEST_FAILURE,
  26. GRUB_ERR_BAD_MODULE,
  27. GRUB_ERR_OUT_OF_MEMORY,
  28. GRUB_ERR_BAD_FILE_TYPE,
  29. GRUB_ERR_FILE_NOT_FOUND,
  30. GRUB_ERR_FILE_READ_ERROR,
  31. GRUB_ERR_BAD_FILENAME,
  32. GRUB_ERR_UNKNOWN_FS,
  33. GRUB_ERR_BAD_FS,
  34. GRUB_ERR_BAD_NUMBER,
  35. GRUB_ERR_OUT_OF_RANGE,
  36. GRUB_ERR_UNKNOWN_DEVICE,
  37. GRUB_ERR_BAD_DEVICE,
  38. GRUB_ERR_READ_ERROR,
  39. GRUB_ERR_WRITE_ERROR,
  40. GRUB_ERR_UNKNOWN_COMMAND,
  41. GRUB_ERR_INVALID_COMMAND,
  42. GRUB_ERR_BAD_ARGUMENT,
  43. GRUB_ERR_BAD_PART_TABLE,
  44. GRUB_ERR_UNKNOWN_OS,
  45. GRUB_ERR_BAD_OS,
  46. GRUB_ERR_NO_KERNEL,
  47. GRUB_ERR_BAD_FONT,
  48. GRUB_ERR_NOT_IMPLEMENTED_YET,
  49. GRUB_ERR_SYMLINK_LOOP,
  50. GRUB_ERR_BAD_GZIP_DATA,
  51. GRUB_ERR_MENU,
  52. GRUB_ERR_TIMEOUT,
  53. GRUB_ERR_IO,
  54. GRUB_ERR_ACCESS_DENIED,
  55. GRUB_ERR_MENU_ESCAPE
  56. }
  57. grub_err_t;
  58. extern grub_err_t grub_errno;
  59. extern char grub_errmsg[];
  60. grub_err_t grub_error (grub_err_t n, const char *fmt, ...);
  61. void grub_fatal (const char *fmt, ...) __attribute__ ((noreturn));
  62. void grub_error_push (void);
  63. int grub_error_pop (void);
  64. void grub_print_error (void);
  65. int grub_err_printf (const char *fmt, ...)
  66. __attribute__ ((format (printf, 1, 2)));
  67. #endif /* ! GRUB_ERR_HEADER */