97 lines
3.0 KiB
C
97 lines
3.0 KiB
C
/* err.h - error numbers and prototypes */
|
|
/*
|
|
* VasEBoot -- GRand Unified Bootloader
|
|
* Copyright (C) 2002,2005,2007,2008 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_ERR_HEADER
|
|
#define VasEBoot_ERR_HEADER 1
|
|
|
|
#include <VasEBoot/symbol.h>
|
|
|
|
#define VasEBoot_MAX_ERRMSG 256
|
|
|
|
typedef enum
|
|
{
|
|
VasEBoot_ERR_NONE = 0,
|
|
VasEBoot_ERR_TEST_FAILURE,
|
|
VasEBoot_ERR_BAD_MODULE,
|
|
VasEBoot_ERR_OUT_OF_MEMORY,
|
|
VasEBoot_ERR_BAD_FILE_TYPE,
|
|
VasEBoot_ERR_FILE_NOT_FOUND,
|
|
VasEBoot_ERR_FILE_READ_ERROR,
|
|
VasEBoot_ERR_BAD_FILENAME,
|
|
VasEBoot_ERR_UNKNOWN_FS,
|
|
VasEBoot_ERR_BAD_FS,
|
|
VasEBoot_ERR_BAD_NUMBER,
|
|
VasEBoot_ERR_OUT_OF_RANGE,
|
|
VasEBoot_ERR_UNKNOWN_DEVICE,
|
|
VasEBoot_ERR_BAD_DEVICE,
|
|
VasEBoot_ERR_READ_ERROR,
|
|
VasEBoot_ERR_WRITE_ERROR,
|
|
VasEBoot_ERR_UNKNOWN_COMMAND,
|
|
VasEBoot_ERR_INVALID_COMMAND,
|
|
VasEBoot_ERR_BAD_ARGUMENT,
|
|
VasEBoot_ERR_BAD_PART_TABLE,
|
|
VasEBoot_ERR_UNKNOWN_OS,
|
|
VasEBoot_ERR_BAD_OS,
|
|
VasEBoot_ERR_NO_KERNEL,
|
|
VasEBoot_ERR_BAD_FONT,
|
|
VasEBoot_ERR_NOT_IMPLEMENTED_YET,
|
|
VasEBoot_ERR_SYMLINK_LOOP,
|
|
VasEBoot_ERR_BAD_COMPRESSED_DATA,
|
|
VasEBoot_ERR_MENU,
|
|
VasEBoot_ERR_TIMEOUT,
|
|
VasEBoot_ERR_IO,
|
|
VasEBoot_ERR_ACCESS_DENIED,
|
|
VasEBoot_ERR_EXTRACTOR,
|
|
VasEBoot_ERR_NET_BAD_ADDRESS,
|
|
VasEBoot_ERR_NET_ROUTE_LOOP,
|
|
VasEBoot_ERR_NET_NO_ROUTE,
|
|
VasEBoot_ERR_NET_NO_ANSWER,
|
|
VasEBoot_ERR_NET_NO_CARD,
|
|
VasEBoot_ERR_WAIT,
|
|
VasEBoot_ERR_BUG,
|
|
VasEBoot_ERR_NET_PORT_CLOSED,
|
|
VasEBoot_ERR_NET_INVALID_RESPONSE,
|
|
VasEBoot_ERR_NET_UNKNOWN_ERROR,
|
|
VasEBoot_ERR_NET_PACKET_TOO_BIG,
|
|
VasEBoot_ERR_NET_NO_DOMAIN,
|
|
VasEBoot_ERR_EOF,
|
|
VasEBoot_ERR_BAD_SIGNATURE
|
|
}
|
|
VasEBoot_err_t;
|
|
|
|
struct VasEBoot_error_saved
|
|
{
|
|
VasEBoot_err_t VasEBoot_errno;
|
|
char errmsg[VasEBoot_MAX_ERRMSG];
|
|
};
|
|
|
|
extern VasEBoot_err_t EXPORT_VAR(VasEBoot_errno);
|
|
extern char EXPORT_VAR(VasEBoot_errmsg)[VasEBoot_MAX_ERRMSG];
|
|
|
|
VasEBoot_err_t EXPORT_FUNC(VasEBoot_error) (VasEBoot_err_t n, const char *fmt, ...);
|
|
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 (__printf__, 1, 2)));
|
|
|
|
#endif /* ! VasEBoot_ERR_HEADER */
|