cake
/
libp7
Archived
1
0
Fork 1
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libp7/src/core/strerror.c

91 lines
2.8 KiB
C

/* *****************************************************************************
* core/strerror.c -- libp7 error strings.
* Copyright (C) 2016-2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of libp7.
* libp7 is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3.0 of the License,
* or (at your option) any later version.
*
* libp7 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libp7; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************** */
#include <libp7/internals.h>
/**
* p7_error_strings:
* String descriptions of libp7 errors.
*
* This list MUST evolve whenever the p7_error_t enumeration
* is updated. Could cause invalid error strings otherwise,
* or segfaults!
*/
/* error strings */
const char *p7_error_strings[] = {
[p7_noerror] =
"no error have been encountered",
/* others */
[p7_error_unsupported] =
"unsupported command",
[p7_error_unsupported_device] =
"unsupported device",
[p7_error_alloc] =
"an allocation has failed",
[p7_error_unknown] =
"an unknown error has occurred",
[p7_error_invalid] =
"one of the arguments you gave was invalid",
[p7_error_op] =
"invalid operation, wrong protocol?",
/* streams */
[p7_error_nostream] =
"provided stream/buffer was NULL or virtual",
[p7_error_noread] =
"provided stream/buffer was not readable",
[p7_error_nowrite] =
"provided stream/buffer was not writable",
[p7_error_noseek] =
"provided stream/buffer was not seekable",
/* communication errors */
[p7_error_uninitialized] =
"handle is uninitialized",
[p7_error_nocalc] =
"device was disconnected",
[p7_error_nochar] /* sherlock */ =
"a char device was expected",
[p7_error_noaccess] =
"could not get access to device",
[p7_error_timeout] =
"transmission timed out",
[p7_error_checksum] =
"checksum was invalid",
[p7_error_irrecoverable] =
"irrecoverable (bad luck), try again",
[p7_error_interrupted] =
"user has interrupted the communication",
[p7_error_terminated] =
"communication was terminated",
[p7_error_active] =
"wrong mode (was active when passive is required, or the other way round)",
[p7_error_doubleshift] =
"could not shift, we're already shifted",
[p7_error_empty] =
"filestream musn't be empty",
[p7_error_fullmem] =
"not enough space left",
[p7_error_notfound] =
"file not found",
[p7_error_denied_overwrite] =
"we denied overwrite",
};