comparison extern/libircclient/src/errors.c @ 0:1158cffe5a5e

Initial import
author David Demelier <markand@malikania.fr>
date Mon, 08 Feb 2016 16:43:14 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1158cffe5a5e
1 /*
2 * Copyright (C) 2004-2012 George Yunaev gyunaev@ulduzsoft.com
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or (at your
7 * option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 * License for more details.
13 */
14
15 static const char * libirc_strerror[LIBIRC_ERR_MAX] =
16 {
17 "No error",
18 "Invalid argument",
19 "Host not resolved",
20 "Socket error",
21 "Could not connect",
22 "Remote connection closed",
23 "Out of memory",
24 "Could not accept new connection",
25 "Object not found",
26 "Could not DCC send this object",
27 "Read error",
28 "Write error",
29 "Illegal operation for this state",
30 "Timeout error",
31 "Could not open file",
32 "IRC session terminated",
33 "IPv6 not supported",
34 "SSL not supported",
35 "SSL initialization failed",
36 "SSL connection failed",
37 "SSL certificate verify failed",
38 };
39
40
41 int irc_errno (irc_session_t * session)
42 {
43 return session->lasterror;
44 }
45
46
47 const char * irc_strerror (int ircerrno)
48 {
49 if ( ircerrno >= 0 && ircerrno < LIBIRC_ERR_MAX )
50 return libirc_strerror[ircerrno];
51 else
52 return "Invalid irc_errno value";
53 }
54