/* err.h - error numbers and prototypes */ /* * VAS_EBOOT -- GRand Unified Bootloader * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * * VAS_EBOOT 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. * * VAS_EBOOT 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 VAS_EBOOT. If not, see . */ #ifndef VAS_EBOOT_ERR_HEADER #define VAS_EBOOT_ERR_HEADER 1 #include #include #define VAS_EBOOT_MAX_ERRMSG 256 typedef enum { VAS_EBOOT_ERR_NONE = 0, VAS_EBOOT_ERR_TEST_FAILURE, VAS_EBOOT_ERR_BAD_MODULE, VAS_EBOOT_ERR_OUT_OF_MEMORY, VAS_EBOOT_ERR_BAD_FILE_TYPE, VAS_EBOOT_ERR_FILE_NOT_FOUND, VAS_EBOOT_ERR_FILE_READ_ERROR, VAS_EBOOT_ERR_BAD_FILENAME, VAS_EBOOT_ERR_UNKNOWN_FS, VAS_EBOOT_ERR_BAD_FS, VAS_EBOOT_ERR_BAD_NUMBER, VAS_EBOOT_ERR_OUT_OF_RANGE, VAS_EBOOT_ERR_UNKNOWN_DEVICE, VAS_EBOOT_ERR_BAD_DEVICE, VAS_EBOOT_ERR_READ_ERROR, VAS_EBOOT_ERR_WRITE_ERROR, VAS_EBOOT_ERR_UNKNOWN_COMMAND, VAS_EBOOT_ERR_INVALID_COMMAND, VAS_EBOOT_ERR_BAD_ARGUMENT, VAS_EBOOT_ERR_BAD_PART_TABLE, VAS_EBOOT_ERR_UNKNOWN_OS, VAS_EBOOT_ERR_BAD_OS, VAS_EBOOT_ERR_NO_KERNEL, VAS_EBOOT_ERR_BAD_FONT, VAS_EBOOT_ERR_NOT_IMPLEMENTED_YET, VAS_EBOOT_ERR_SYMLINK_LOOP, VAS_EBOOT_ERR_BAD_COMPRESSED_DATA, VAS_EBOOT_ERR_MENU, VAS_EBOOT_ERR_TIMEOUT, VAS_EBOOT_ERR_IO, VAS_EBOOT_ERR_ACCESS_DENIED, VAS_EBOOT_ERR_EXTRACTOR, VAS_EBOOT_ERR_NET_BAD_ADDRESS, VAS_EBOOT_ERR_NET_ROUTE_LOOP, VAS_EBOOT_ERR_NET_NO_ROUTE, VAS_EBOOT_ERR_NET_NO_ANSWER, VAS_EBOOT_ERR_NET_NO_CARD, VAS_EBOOT_ERR_WAIT, VAS_EBOOT_ERR_BUG, VAS_EBOOT_ERR_NET_PORT_CLOSED, VAS_EBOOT_ERR_NET_INVALID_RESPONSE, VAS_EBOOT_ERR_NET_UNKNOWN_ERROR, VAS_EBOOT_ERR_NET_PACKET_TOO_BIG, VAS_EBOOT_ERR_NET_NO_DOMAIN, VAS_EBOOT_ERR_EOF, VAS_EBOOT_ERR_BAD_SIGNATURE, VAS_EBOOT_ERR_BAD_FIRMWARE, VAS_EBOOT_ERR_STILL_REFERENCED, VAS_EBOOT_ERR_RECURSION_DEPTH, VAS_EBOOT_ERR_EXISTS } VasEBoot_err_t; struct VasEBoot_error_saved { VasEBoot_err_t VasEBoot_errno; char errmsg[VAS_EBOOT_MAX_ERRMSG]; }; extern VasEBoot_err_t EXPORT_VAR(VasEBoot_errno); extern char EXPORT_VAR(VasEBoot_errmsg)[VAS_EBOOT_MAX_ERRMSG]; VasEBoot_err_t EXPORT_FUNC(VasEBoot_error) (VasEBoot_err_t n, const char *file, const char *function, const int line, const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 5, 6))); #define VasEBoot_error(n, fmt, ...) VasEBoot_error (n, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__) void EXPORT_FUNC(VasEBoot_fatal) (const char *fmt, ...) __attribute__ ((noreturn)); void EXPORT_FUNC(VasEBoot_error_push) (void); int EXPORT_FUNC(VasEBoot_error_pop) (void); void EXPORT_FUNC(VasEBoot_print_error) (void); extern int EXPORT_VAR(VasEBoot_err_printed_errors); int VasEBoot_err_printf (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))); #endif /* ! VAS_EBOOT_ERR_HEADER */