This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
corelibs/src/types/error/error.h

52 lines
1.3 KiB
C

/*
* This file is part of corelibs. (https://git.redxen.eu/corelibs)
* Copyright (c) 2021 Alex-David Denes
*
* corelibs 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
* any later version.
*
* corelibs 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 corelibs. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdint.h> // int_least16_t
#ifndef CORELIBS_GUARD_ERROR
#define CORELIBS_GUARD_ERROR
typedef int_least16_t cl_error_t;
typedef uint_least8_t cl_error_lang;
struct corelibs_error_tree {
const char *(*const string) (cl_error_lang language, cl_error_t errno);
const struct {
const cl_error_t ok,
unk,
undef;
const struct {
const cl_error_t null,
alloc,
oob;
} mem;
const struct {
const cl_error_t immut,
incompat,
inval;
} data;
const struct {
const cl_error_t mis;
} args;
} err;
};
extern const struct corelibs_error_tree cl_error;
#endif /* CORELIBS_GUARD_ERROR */