You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libsxmp/lib/error.c

74 lines
2.4 KiB
C

/*
* Secure X Message Passing Library v2 implementation.
* (sxmplv2) it superseed all versions before due to the:
* - memory consumption
* - new features such as pulse emitting
* - performance optimization
*
* (c) Askele Group 2013-2015 <http://askele.com>
* (c) Alexander Vdolainen 2013-2015 <avdolainen@gmail.com>
*
* libsxmp 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 of the License, or
* (at your option) any later version.
*
* libsxmp 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 this program. If not, see <http://www.gnu.org/licenses/>.";
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sxmp/limits.h>
#include <sxmp/sxmp.h>
/* errors */
struct __scerrcode {
int code;
const char *desc;
};
static struct __scerrcode __lerr[] = {
{SXE_SUCCESS, "Success"},
{SXE_FAILED, "Failed, invalid parameters given"},
{SXE_ENOMEM, "Not enough memory"},
{SXE_BADPROTO, "Bad protocol"},
{SXE_ENORPC, "No such RPC exists"},
{SXE_EPERM, "Permission denied"},
{SXE_TOOLONG, "Message data payload too long to be sent with one message pass"},
{SXE_EBUSY, "Index or working threads are busy"},
{SXE_WOULDBLOCK, "Call will block operation"},
{SXE_LINKERROR, "Connection link error"},
{SXE_NOSUCHMSG, "No such message"},
{SXE_NOSUCHCHAN, "No such channel"},
{SXE_ETIMEDOUT, "Timeout exceed"},
{SXE_IGNORED, "Function call was ignored"},
{SXE_REPLYREQ, "Reply required to the message"},
{SXE_RAPIDMSG, "Message is a rapid reply and dialog closed"},
{SXE_ESSL, "SSL error occurs on connection link"},
{SXE_NOCHANNELS, "No channels available"},
{SXE_MCHANNELS, "Active channels limit exceed"},
{SXE_MMESSAGES, "Active messages limit exceed"},
{SXE_LINKBROKEN, "Connection link was broken"},
{SXE_INVALINDEX, "Invalid index given"},
{SXE_NOSUCHSTREAMTYPE, "No such stream type exist"},
{SXE_EOS, "End of stream reached"},
{SXE_NILREPLY, "Reply contains no data"},
};
const char *sxmpl_errno2cstr(int ec)
{
return __lerr[ec - __SXMP_EPREFIX].desc;
}