LibIRCClient 1.10 Used by Probotic
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

55 lines
1.4KB

  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. static const char * libirc_strerror[LIBIRC_ERR_MAX] =
  15. {
  16. "No error",
  17. "Invalid argument",
  18. "Host not resolved",
  19. "Socket error",
  20. "Could not connect",
  21. "Remote connection closed",
  22. "Out of memory",
  23. "Could not accept new connection",
  24. "Object not found",
  25. "Could not DCC send this object",
  26. "Read error",
  27. "Write error",
  28. "Illegal operation for this state",
  29. "Timeout error",
  30. "Could not open file",
  31. "IRC session terminated",
  32. "IPv6 not supported",
  33. "SSL not supported",
  34. "SSL initialization failed",
  35. "SSL connection failed",
  36. "SSL certificate verify failed",
  37. };
  38. int irc_errno (irc_session_t * session)
  39. {
  40. return session->lasterror;
  41. }
  42. const char * irc_strerror (int ircerrno)
  43. {
  44. if ( ircerrno >= 0 && ircerrno < LIBIRC_ERR_MAX )
  45. return libirc_strerror[ircerrno];
  46. else
  47. return "Invalid irc_errno value";
  48. }