IRC client framework (wrapper around libircclient library).
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

libirc_errors.h 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. #ifndef INCLUDE_IRC_ERRORS_H
  15. #define INCLUDE_IRC_ERRORS_H
  16. #ifndef IN_INCLUDE_LIBIRC_H
  17. #error This file should not be included directly, include just libircclient.h
  18. #endif
  19. /*! brief No error
  20. * \ingroup errorcodes
  21. */
  22. #define LIBIRC_ERR_OK 0
  23. /*! \brief Invalid argument
  24. *
  25. * An invalid value was given for one of the arguments to a function.
  26. * For example, supplying the NULL value for \a channel argument of
  27. * irc_cmd_join() produces LIBIRC_ERR_INVAL error. You should fix the code.
  28. *
  29. * \ingroup errorcodes
  30. */
  31. #define LIBIRC_ERR_INVAL 1
  32. /*! \brief Could not resolve host.
  33. *
  34. * The host name supplied for irc_connect() function could not be resolved
  35. * into valid IP address. Usually means that host name is invalid.
  36. *
  37. * \ingroup errorcodes
  38. */
  39. #define LIBIRC_ERR_RESOLV 2
  40. /*! \brief Could not create socket.
  41. *
  42. * The new socket could not be created or made non-blocking. Usually means
  43. * that the server is out of resources, or (rarely :) a bug in libircclient.
  44. *
  45. * \ingroup errorcodes
  46. */
  47. #define LIBIRC_ERR_SOCKET 3
  48. /*! \brief Could not connect.
  49. *
  50. * The socket could not connect to the IRC server, or to the destination DCC
  51. * part. Usually means that either the IRC server is down or its address is
  52. * invalid. For DCC the reason usually is the firewall on your or destination
  53. * computer, which refuses DCC transfer.
  54. *
  55. * \sa irc_run irc_connect
  56. * \ingroup errorcodes
  57. */
  58. #define LIBIRC_ERR_CONNECT 4
  59. /*! \brief Connection closed by remote peer.
  60. *
  61. * The IRC connection was closed by the IRC server (which could mean that an
  62. * IRC operator just have banned you from the server :)), or the DCC connection
  63. * was closed by remote peer - for example, the other side just quits his mIrc.
  64. * Usually it is not an error.
  65. *
  66. * \sa irc_run irc_connect irc_dcc_callback_t
  67. * \ingroup errorcodes
  68. */
  69. #define LIBIRC_ERR_CLOSED 5
  70. /*! \brief Out of memory
  71. *
  72. * There are two possible reasons for this error. First is that memory could
  73. * not be allocated for libircclient use, and this error usually is fatal.
  74. * Second reason is that the command queue (which keeps command ready to be
  75. * sent to the IRC server) is full, and could not accept more commands yet.
  76. * In this case you should just wait, and repeat the command later.
  77. *
  78. * \ingroup errorcodes
  79. */
  80. #define LIBIRC_ERR_NOMEM 6
  81. /*! \brief Could not accept new connection
  82. *
  83. * A DCC chat/send connection from the remote peer could not be accepted.
  84. * Either the connection was just terminated before it is accepted, or there
  85. * is a bug in libircclient.
  86. *
  87. * \ingroup errorcodes
  88. */
  89. #define LIBIRC_ERR_ACCEPT 7
  90. /*! \brief Could not send this
  91. *
  92. * A \a filename supplied to irc_dcc_sendfile() could not be sent. Either is
  93. * is not a file (a directory or a socket, for example), or it is not readable. *
  94. *
  95. * \sa LIBIRC_ERR_OPENFILE
  96. * \ingroup errorcodes
  97. */
  98. #define LIBIRC_ERR_NODCCSEND 9
  99. /*! \brief Could not read DCC file or socket
  100. *
  101. * Either a DCC file could not be read (for example, was truncated during
  102. * sending), or a DCC socket returns a read error, which usually means that
  103. * the network connection is terminated.
  104. *
  105. * \ingroup errorcodes
  106. */
  107. #define LIBIRC_ERR_READ 10
  108. /*! \brief Could not write DCC file or socket
  109. *
  110. * Either a DCC file could not be written (for example, there is no free space
  111. * on disk), or a DCC socket returns a write error, which usually means that
  112. * the network connection is terminated.
  113. *
  114. * \ingroup errorcodes
  115. */
  116. #define LIBIRC_ERR_WRITE 11
  117. /*! \brief Invalid state
  118. *
  119. * The function is called when it is not allowed to be called. For example,
  120. * irc_cmd_join() was called before the connection to IRC server succeed, and
  121. * ::event_connect is called.
  122. *
  123. * \ingroup errorcodes
  124. */
  125. #define LIBIRC_ERR_STATE 12
  126. /*! \brief Operation timed out
  127. *
  128. * The DCC request is timed out.
  129. * There is a timer for each DCC request, which tracks connecting, accepting
  130. * and non-accepted/declined DCC requests. For every request this timer
  131. * is currently 60 seconds. If the DCC request was not connected, accepted
  132. * or declined during this time, it will be terminated with this error.
  133. *
  134. * \ingroup errorcodes
  135. */
  136. #define LIBIRC_ERR_TIMEOUT 13
  137. /*! \brief Could not open file for DCC send
  138. *
  139. * The file specified in irc_dcc_sendfile() could not be opened.
  140. *
  141. * \ingroup errorcodes
  142. */
  143. #define LIBIRC_ERR_OPENFILE 14
  144. /*! \brief IRC server connection terminated
  145. *
  146. * The connection to the IRC server was terminated - possibly, by network
  147. * error. Try to irc_connect() again.
  148. *
  149. * \ingroup errorcodes
  150. */
  151. #define LIBIRC_ERR_TERMINATED 15
  152. /*! \brief IPv6 not supported
  153. *
  154. * The function which requires IPv6 support was called, but the IPv6 support was not compiled
  155. * into the application
  156. *
  157. * \ingroup errorcodes
  158. */
  159. #define LIBIRC_ERR_NOIPV6 16
  160. /*! \brief SSL not supported
  161. *
  162. * The SSL connection was required but the library was not compiled with SSL support
  163. *
  164. * \ingroup errorcodes
  165. */
  166. #define LIBIRC_ERR_SSL_NOT_SUPPORTED 17
  167. /*! \brief SSL initialization failed
  168. *
  169. * The SSL connection was required but the library was not compiled with SSL support
  170. *
  171. * \ingroup errorcodes
  172. */
  173. #define LIBIRC_ERR_SSL_INIT_FAILED 18
  174. /*! \brief SSL connection failed
  175. *
  176. * SSL handshare failed when attempting to connect to the server. Typically this means you're trying
  177. * to use SSL but attempting to connect to a non-SSL port.
  178. * \ingroup errorcodes
  179. */
  180. #define LIBIRC_ERR_CONNECT_SSL_FAILED 19
  181. /*! \brief SSL certificate verify failed
  182. *
  183. * The server is using the self-signed certificate. Use LIBIRC_OPTION_SSL_NO_VERIFY option to connect to it.
  184. * \ingroup errorcodes
  185. */
  186. #define LIBIRC_ERR_SSL_CERT_VERIFY_FAILED 20
  187. // Internal max error value count.
  188. // If you added more errors, add them to errors.c too!
  189. #define LIBIRC_ERR_MAX 21
  190. #endif /* INCLUDE_IRC_ERRORS_H */