Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.16 KB | None | 0 0
  1. var LIBIRC_ERR_ACCEPT: Swift.Int32 {
  2. get {}
  3. }
  4. var LIBIRC_ERR_CLOSED: Swift.Int32 {
  5. get {}
  6. }
  7. var LIBIRC_ERR_CONNECT: Swift.Int32 {
  8. get {}
  9. }
  10. var LIBIRC_ERR_CONNECT_SSL_FAILED: Swift.Int32 {
  11. get {}
  12. }
  13. var LIBIRC_ERR_INVAL: Swift.Int32 {
  14. get {}
  15. }
  16. var LIBIRC_ERR_MAX: Swift.Int32 {
  17. get {}
  18. }
  19. var LIBIRC_ERR_NODCCSEND: Swift.Int32 {
  20. get {}
  21. }
  22. var LIBIRC_ERR_NOIPV6: Swift.Int32 {
  23. get {}
  24. }
  25. var LIBIRC_ERR_NOMEM: Swift.Int32 {
  26. get {}
  27. }
  28. var LIBIRC_ERR_OK: Swift.Int32 {
  29. get {}
  30. }
  31. var LIBIRC_ERR_OPENFILE: Swift.Int32 {
  32. get {}
  33. }
  34. var LIBIRC_ERR_READ: Swift.Int32 {
  35. get {}
  36. }
  37. var LIBIRC_ERR_RESOLV: Swift.Int32 {
  38. get {}
  39. }
  40. var LIBIRC_ERR_SOCKET: Swift.Int32 {
  41. get {}
  42. }
  43. var LIBIRC_ERR_SSL_CERT_VERIFY_FAILED: Swift.Int32 {
  44. get {}
  45. }
  46. var LIBIRC_ERR_SSL_INIT_FAILED: Swift.Int32 {
  47. get {}
  48. }
  49. var LIBIRC_ERR_SSL_NOT_SUPPORTED: Swift.Int32 {
  50. get {}
  51. }
  52. var LIBIRC_ERR_STATE: Swift.Int32 {
  53. get {}
  54. }
  55. var LIBIRC_ERR_TERMINATED: Swift.Int32 {
  56. get {}
  57. }
  58. var LIBIRC_ERR_TIMEOUT: Swift.Int32 {
  59. get {}
  60. }
  61. var LIBIRC_ERR_WRITE: Swift.Int32 {
  62. get {}
  63. }
  64. var LIBIRC_OPTION_DEBUG: Swift.Int32 {
  65. get {}
  66. }
  67. var LIBIRC_OPTION_SSL_NO_VERIFY: Swift.Int32 {
  68. get {}
  69. }
  70. var LIBIRC_OPTION_STRIPNICKS: Swift.Int32 {
  71. get {}
  72. }
  73. var LIBIRC_RFC_ERR_ALREADYREGISTRED: Swift.Int32 {
  74. get {}
  75. }
  76. var LIBIRC_RFC_ERR_BADCHANMASK: Swift.Int32 {
  77. get {}
  78. }
  79. var LIBIRC_RFC_ERR_BADCHANNELKEY: Swift.Int32 {
  80. get {}
  81. }
  82. var LIBIRC_RFC_ERR_BADMASK: Swift.Int32 {
  83. get {}
  84. }
  85. var LIBIRC_RFC_ERR_BANLISTFULL: Swift.Int32 {
  86. get {}
  87. }
  88. var LIBIRC_RFC_ERR_BANNEDFROMCHAN: Swift.Int32 {
  89. get {}
  90. }
  91. var LIBIRC_RFC_ERR_CANNOTSENDTOCHAN: Swift.Int32 {
  92. get {}
  93. }
  94. var LIBIRC_RFC_ERR_CANTKILLSERVER: Swift.Int32 {
  95. get {}
  96. }
  97. var LIBIRC_RFC_ERR_CHANNELISFULL: Swift.Int32 {
  98. get {}
  99. }
  100. var LIBIRC_RFC_ERR_CHANOPRIVSNEEDED: Swift.Int32 {
  101. get {}
  102. }
  103. var LIBIRC_RFC_ERR_ERRONEUSNICKNAME: Swift.Int32 {
  104. get {}
  105. }
  106. var LIBIRC_RFC_ERR_FILEERROR: Swift.Int32 {
  107. get {}
  108. }
  109. var LIBIRC_RFC_ERR_INVITEONLYCHAN: Swift.Int32 {
  110. get {}
  111. }
  112. var LIBIRC_RFC_ERR_KEYSET: Swift.Int32 {
  113. get {}
  114. }
  115. var LIBIRC_RFC_ERR_NEEDMOREPARAMS: Swift.Int32 {
  116. get {}
  117. }
  118. var LIBIRC_RFC_ERR_NICKCOLLISION: Swift.Int32 {
  119. get {}
  120. }
  121. var LIBIRC_RFC_ERR_NICKNAMEINUSE: Swift.Int32 {
  122. get {}
  123. }
  124. var LIBIRC_RFC_ERR_NOADMININFO: Swift.Int32 {
  125. get {}
  126. }
  127. var LIBIRC_RFC_ERR_NOCHANMODES: Swift.Int32 {
  128. get {}
  129. }
  130. var LIBIRC_RFC_ERR_NOLOGIN: Swift.Int32 {
  131. get {}
  132. }
  133. var LIBIRC_RFC_ERR_NOMOTD: Swift.Int32 {
  134. get {}
  135. }
  136. var LIBIRC_RFC_ERR_NONICKNAMEGIVEN: Swift.Int32 {
  137. get {}
  138. }
  139. var LIBIRC_RFC_ERR_NOOPERHOST: Swift.Int32 {
  140. get {}
  141. }
  142. var LIBIRC_RFC_ERR_NOORIGIN: Swift.Int32 {
  143. get {}
  144. }
  145. var LIBIRC_RFC_ERR_NOPERMFORHOST: Swift.Int32 {
  146. get {}
  147. }
  148. var LIBIRC_RFC_ERR_NOPRIVILEGES: Swift.Int32 {
  149. get {}
  150. }
  151. var LIBIRC_RFC_ERR_NORECIPIENT: Swift.Int32 {
  152. get {}
  153. }
  154. var LIBIRC_RFC_ERR_NOSUCHCHANNEL: Swift.Int32 {
  155. get {}
  156. }
  157. var LIBIRC_RFC_ERR_NOSUCHNICK: Swift.Int32 {
  158. get {}
  159. }
  160. var LIBIRC_RFC_ERR_NOSUCHSERVER: Swift.Int32 {
  161. get {}
  162. }
  163. var LIBIRC_RFC_ERR_NOSUCHSERVICE: Swift.Int32 {
  164. get {}
  165. }
  166. var LIBIRC_RFC_ERR_NOTEXTTOSEND: Swift.Int32 {
  167. get {}
  168. }
  169. var LIBIRC_RFC_ERR_NOTONCHANNEL: Swift.Int32 {
  170. get {}
  171. }
  172. var LIBIRC_RFC_ERR_NOTOPLEVEL: Swift.Int32 {
  173. get {}
  174. }
  175. var LIBIRC_RFC_ERR_NOTREGISTERED: Swift.Int32 {
  176. get {}
  177. }
  178. var LIBIRC_RFC_ERR_PASSWDMISMATCH: Swift.Int32 {
  179. get {}
  180. }
  181. var LIBIRC_RFC_ERR_RESTRICTED: Swift.Int32 {
  182. get {}
  183. }
  184. var LIBIRC_RFC_ERR_SUMMONDISABLED: Swift.Int32 {
  185. get {}
  186. }
  187. var LIBIRC_RFC_ERR_TOOMANYCHANNELS: Swift.Int32 {
  188. get {}
  189. }
  190. var LIBIRC_RFC_ERR_TOOMANYTARGETS: Swift.Int32 {
  191. get {}
  192. }
  193. var LIBIRC_RFC_ERR_UMODEUNKNOWNFLAG: Swift.Int32 {
  194. get {}
  195. }
  196. var LIBIRC_RFC_ERR_UNAVAILRESOURCE: Swift.Int32 {
  197. get {}
  198. }
  199. var LIBIRC_RFC_ERR_UNIQOPPRIVSNEEDED: Swift.Int32 {
  200. get {}
  201. }
  202. var LIBIRC_RFC_ERR_UNKNOWNCOMMAND: Swift.Int32 {
  203. get {}
  204. }
  205. var LIBIRC_RFC_ERR_UNKNOWNMODE: Swift.Int32 {
  206. get {}
  207. }
  208. var LIBIRC_RFC_ERR_USERNOTINCHANNEL: Swift.Int32 {
  209. get {}
  210. }
  211. var LIBIRC_RFC_ERR_USERONCHANNEL: Swift.Int32 {
  212. get {}
  213. }
  214. var LIBIRC_RFC_ERR_USERSDISABLED: Swift.Int32 {
  215. get {}
  216. }
  217. var LIBIRC_RFC_ERR_USERSDONTMATCH: Swift.Int32 {
  218. get {}
  219. }
  220. var LIBIRC_RFC_ERR_WASNOSUCHNICK: Swift.Int32 {
  221. get {}
  222. }
  223. var LIBIRC_RFC_ERR_WILDTOPLEVEL: Swift.Int32 {
  224. get {}
  225. }
  226. var LIBIRC_RFC_ERR_YOUREBANNEDCREEP: Swift.Int32 {
  227. get {}
  228. }
  229. var LIBIRC_RFC_ERR_YOUWILLBEBANNED: Swift.Int32 {
  230. get {}
  231. }
  232. var LIBIRC_RFC_RPL_ADMINEMAIL: Swift.Int32 {
  233. get {}
  234. }
  235. var LIBIRC_RFC_RPL_ADMINLOC1: Swift.Int32 {
  236. get {}
  237. }
  238. var LIBIRC_RFC_RPL_ADMINLOC2: Swift.Int32 {
  239. get {}
  240. }
  241. var LIBIRC_RFC_RPL_ADMINME: Swift.Int32 {
  242. get {}
  243. }
  244. var LIBIRC_RFC_RPL_AWAY: Swift.Int32 {
  245. get {}
  246. }
  247. var LIBIRC_RFC_RPL_BANLIST: Swift.Int32 {
  248. get {}
  249. }
  250. var LIBIRC_RFC_RPL_BOUNCE: Swift.Int32 {
  251. get {}
  252. }
  253. var LIBIRC_RFC_RPL_CHANNELMODEIS: Swift.Int32 {
  254. get {}
  255. }
  256. var LIBIRC_RFC_RPL_CREATED: Swift.Int32 {
  257. get {}
  258. }
  259. var LIBIRC_RFC_RPL_ENDOFBANLIST: Swift.Int32 {
  260. get {}
  261. }
  262. var LIBIRC_RFC_RPL_ENDOFEXCEPTLIST: Swift.Int32 {
  263. get {}
  264. }
  265. var LIBIRC_RFC_RPL_ENDOFINFO: Swift.Int32 {
  266. get {}
  267. }
  268. var LIBIRC_RFC_RPL_ENDOFINVITELIST: Swift.Int32 {
  269. get {}
  270. }
  271. var LIBIRC_RFC_RPL_ENDOFLINKS: Swift.Int32 {
  272. get {}
  273. }
  274. var LIBIRC_RFC_RPL_ENDOFMOTD: Swift.Int32 {
  275. get {}
  276. }
  277. var LIBIRC_RFC_RPL_ENDOFNAMES: Swift.Int32 {
  278. get {}
  279. }
  280. var LIBIRC_RFC_RPL_ENDOFSTATS: Swift.Int32 {
  281. get {}
  282. }
  283. var LIBIRC_RFC_RPL_ENDOFUSERS: Swift.Int32 {
  284. get {}
  285. }
  286. var LIBIRC_RFC_RPL_ENDOFWHO: Swift.Int32 {
  287. get {}
  288. }
  289. var LIBIRC_RFC_RPL_ENDOFWHOIS: Swift.Int32 {
  290. get {}
  291. }
  292. var LIBIRC_RFC_RPL_ENDOFWHOWAS: Swift.Int32 {
  293. get {}
  294. }
  295. var LIBIRC_RFC_RPL_EXCEPTLIST: Swift.Int32 {
  296. get {}
  297. }
  298. var LIBIRC_RFC_RPL_INFO: Swift.Int32 {
  299. get {}
  300. }
  301. var LIBIRC_RFC_RPL_INVITELIST: Swift.Int32 {
  302. get {}
  303. }
  304. var LIBIRC_RFC_RPL_INVITING: Swift.Int32 {
  305. get {}
  306. }
  307. var LIBIRC_RFC_RPL_ISON: Swift.Int32 {
  308. get {}
  309. }
  310. var LIBIRC_RFC_RPL_LINKS: Swift.Int32 {
  311. get {}
  312. }
  313. var LIBIRC_RFC_RPL_LIST: Swift.Int32 {
  314. get {}
  315. }
  316. var LIBIRC_RFC_RPL_LISTEND: Swift.Int32 {
  317. get {}
  318. }
  319. var LIBIRC_RFC_RPL_LUSERCHANNELS: Swift.Int32 {
  320. get {}
  321. }
  322. var LIBIRC_RFC_RPL_LUSERCLIENT: Swift.Int32 {
  323. get {}
  324. }
  325. var LIBIRC_RFC_RPL_LUSERME: Swift.Int32 {
  326. get {}
  327. }
  328. var LIBIRC_RFC_RPL_LUSEROP: Swift.Int32 {
  329. get {}
  330. }
  331. var LIBIRC_RFC_RPL_LUSERUNKNOWN: Swift.Int32 {
  332. get {}
  333. }
  334. var LIBIRC_RFC_RPL_MOTD: Swift.Int32 {
  335. get {}
  336. }
  337. var LIBIRC_RFC_RPL_MOTDSTART: Swift.Int32 {
  338. get {}
  339. }
  340. var LIBIRC_RFC_RPL_MYINFO: Swift.Int32 {
  341. get {}
  342. }
  343. var LIBIRC_RFC_RPL_NAMREPLY: Swift.Int32 {
  344. get {}
  345. }
  346. var LIBIRC_RFC_RPL_NOTOPIC: Swift.Int32 {
  347. get {}
  348. }
  349. var LIBIRC_RFC_RPL_NOUSERS: Swift.Int32 {
  350. get {}
  351. }
  352. var LIBIRC_RFC_RPL_NOWAWAY: Swift.Int32 {
  353. get {}
  354. }
  355. var LIBIRC_RFC_RPL_REHASHING: Swift.Int32 {
  356. get {}
  357. }
  358. var LIBIRC_RFC_RPL_SERVLIST: Swift.Int32 {
  359. get {}
  360. }
  361. var LIBIRC_RFC_RPL_SERVLISTEND: Swift.Int32 {
  362. get {}
  363. }
  364. var LIBIRC_RFC_RPL_STATSCOMMANDS: Swift.Int32 {
  365. get {}
  366. }
  367. var LIBIRC_RFC_RPL_STATSLINKINFO: Swift.Int32 {
  368. get {}
  369. }
  370. var LIBIRC_RFC_RPL_STATSOLINE: Swift.Int32 {
  371. get {}
  372. }
  373. var LIBIRC_RFC_RPL_STATSUPTIME: Swift.Int32 {
  374. get {}
  375. }
  376. var LIBIRC_RFC_RPL_SUMMONING: Swift.Int32 {
  377. get {}
  378. }
  379. var LIBIRC_RFC_RPL_TIME: Swift.Int32 {
  380. get {}
  381. }
  382. var LIBIRC_RFC_RPL_TOPIC: Swift.Int32 {
  383. get {}
  384. }
  385. var LIBIRC_RFC_RPL_TRACECLASS: Swift.Int32 {
  386. get {}
  387. }
  388. var LIBIRC_RFC_RPL_TRACECONNECTING: Swift.Int32 {
  389. get {}
  390. }
  391. var LIBIRC_RFC_RPL_TRACEEND: Swift.Int32 {
  392. get {}
  393. }
  394. var LIBIRC_RFC_RPL_TRACEHANDSHAKE: Swift.Int32 {
  395. get {}
  396. }
  397. var LIBIRC_RFC_RPL_TRACELINK: Swift.Int32 {
  398. get {}
  399. }
  400. var LIBIRC_RFC_RPL_TRACELOG: Swift.Int32 {
  401. get {}
  402. }
  403. var LIBIRC_RFC_RPL_TRACENEWTYPE: Swift.Int32 {
  404. get {}
  405. }
  406. var LIBIRC_RFC_RPL_TRACEOPERATOR: Swift.Int32 {
  407. get {}
  408. }
  409. var LIBIRC_RFC_RPL_TRACESERVER: Swift.Int32 {
  410. get {}
  411. }
  412. var LIBIRC_RFC_RPL_TRACESERVICE: Swift.Int32 {
  413. get {}
  414. }
  415. var LIBIRC_RFC_RPL_TRACEUNKNOWN: Swift.Int32 {
  416. get {}
  417. }
  418. var LIBIRC_RFC_RPL_TRACEUSER: Swift.Int32 {
  419. get {}
  420. }
  421. var LIBIRC_RFC_RPL_TRYAGAIN: Swift.Int32 {
  422. get {}
  423. }
  424. var LIBIRC_RFC_RPL_UMODEIS: Swift.Int32 {
  425. get {}
  426. }
  427. var LIBIRC_RFC_RPL_UNAWAY: Swift.Int32 {
  428. get {}
  429. }
  430. var LIBIRC_RFC_RPL_UNIQOPIS: Swift.Int32 {
  431. get {}
  432. }
  433. var LIBIRC_RFC_RPL_USERHOST: Swift.Int32 {
  434. get {}
  435. }
  436. var LIBIRC_RFC_RPL_USERS: Swift.Int32 {
  437. get {}
  438. }
  439. var LIBIRC_RFC_RPL_USERSSTART: Swift.Int32 {
  440. get {}
  441. }
  442. var LIBIRC_RFC_RPL_VERSION: Swift.Int32 {
  443. get {}
  444. }
  445. var LIBIRC_RFC_RPL_WELCOME: Swift.Int32 {
  446. get {}
  447. }
  448. var LIBIRC_RFC_RPL_WHOISCHANNELS: Swift.Int32 {
  449. get {}
  450. }
  451. var LIBIRC_RFC_RPL_WHOISIDLE: Swift.Int32 {
  452. get {}
  453. }
  454. var LIBIRC_RFC_RPL_WHOISOPERATOR: Swift.Int32 {
  455. get {}
  456. }
  457. var LIBIRC_RFC_RPL_WHOISSERVER: Swift.Int32 {
  458. get {}
  459. }
  460. var LIBIRC_RFC_RPL_WHOISUSER: Swift.Int32 {
  461. get {}
  462. }
  463. var LIBIRC_RFC_RPL_WHOREPLY: Swift.Int32 {
  464. get {}
  465. }
  466. var LIBIRC_RFC_RPL_WHOWASUSER: Swift.Int32 {
  467. get {}
  468. }
  469. var LIBIRC_RFC_RPL_YOUREOPER: Swift.Int32 {
  470. get {}
  471. }
  472. var LIBIRC_RFC_RPL_YOURESERVICE: Swift.Int32 {
  473. get {}
  474. }
  475. var LIBIRC_RFC_RPL_YOURHOST: Swift.Int32 {
  476. get {}
  477. }
  478. /*!
  479. * \fn int irc_add_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set, int * maxfd)
  480. * \brief Adds IRC socket(s) for the descriptor set to use in select().
  481. *
  482. * \param session An initiated and connected session.
  483. * \param in_set A FD_IN descriptor set for select()
  484. * \param out_set A FD_OUT descriptor set for select()
  485. * \param maxfd A max descriptor found.
  486. *
  487. * \return Return code 0 means success. Other value means error, the error
  488. * code may be obtained through irc_errno().
  489. *
  490. * This function should be used when you already have a program with select()
  491. * based data processing. You prepare your descriptors, call this function
  492. * to add session's descriptor(s) into set, and then call select(). When it
  493. * returns, you should call irc_add_select_descriptors, which sends/recvs all
  494. * available data, parses received data, calls your callbacks(!), and returns.
  495. * Then you can process your sockets from set. See the example.
  496. *
  497. * \sa irc_process_select_descriptors
  498. * \ingroup running
  499. */
  500. @discardableResult func irc_add_select_descriptors(_ session: Swift.OpaquePointer!, _ in_set: Swift.UnsafeMutablePointer<Darwin.fd_set>!, _ out_set: Swift.UnsafeMutablePointer<Darwin.fd_set>!, _ maxfd: Swift.UnsafeMutablePointer<Swift.Int32>!) -> Swift.Int32
  501. /*! \brief Event callbacks structure.
  502. *
  503. * All the communication with the IRC network is based on events. Generally
  504. * speaking, event is anything generated by someone else in the network,
  505. * or by the IRC server itself. "Someone sends you a message", "Someone
  506. * has joined the channel", "Someone has quits IRC" - all these messages
  507. * are events.
  508. *
  509. * Every event has its own event handler, which is called when the
  510. * appropriate event is received. You don't have to define all the event
  511. * handlers; define only the handlers for the events you need to intercept.
  512. *
  513. * Most event callbacks are the types of ::irc_event_callback_t. There are
  514. * also events, which generate ::irc_eventcode_callback_t,
  515. * ::irc_event_dcc_chat_t and ::irc_event_dcc_send_t callbacks.
  516. *
  517. * \ingroup events
  518. */
  519. struct irc_callbacks_t {
  520. /*!
  521. * The "on_connect" event is triggered when the client successfully
  522. * connects to the server, and could send commands to the server.
  523. * No extra params supplied; \a params is 0.
  524. */
  525. var event_connect: IRC.irc_event_callback_t!
  526. /*!
  527. * The "nick" event is triggered when the client receives a NICK message,
  528. * meaning that someone (including you) on a channel with the client has
  529. * changed their nickname.
  530. *
  531. * \param origin the person, who changes the nick. Note that it can be you!
  532. * \param params[0] mandatory, contains the new nick.
  533. */
  534. var event_nick: IRC.irc_event_callback_t!
  535. /*!
  536. * The "quit" event is triggered upon receipt of a QUIT message, which
  537. * means that someone on a channel with the client has disconnected.
  538. *
  539. * \param origin the person, who is disconnected
  540. * \param params[0] optional, contains the reason message (user-specified).
  541. */
  542. var event_quit: IRC.irc_event_callback_t!
  543. /*!
  544. * The "join" event is triggered upon receipt of a JOIN message, which
  545. * means that someone has entered a channel that the client is on.
  546. *
  547. * \param origin the person, who joins the channel. By comparing it with
  548. * your own nickname, you can check whether your JOIN
  549. * command succeed.
  550. * \param params[0] mandatory, contains the channel name.
  551. */
  552. var event_join: IRC.irc_event_callback_t!
  553. /*!
  554. * The "part" event is triggered upon receipt of a PART message, which
  555. * means that someone has left a channel that the client is on.
  556. *
  557. * \param origin the person, who leaves the channel. By comparing it with
  558. * your own nickname, you can check whether your PART
  559. * command succeed.
  560. * \param params[0] mandatory, contains the channel name.
  561. * \param params[1] optional, contains the reason message (user-defined).
  562. */
  563. var event_part: IRC.irc_event_callback_t!
  564. /*!
  565. * The "mode" event is triggered upon receipt of a channel MODE message,
  566. * which means that someone on a channel with the client has changed the
  567. * channel's parameters.
  568. *
  569. * \param origin the person, who changed the channel mode.
  570. * \param params[0] mandatory, contains the channel name.
  571. * \param params[1] mandatory, contains the changed channel mode, like
  572. * '+t', '-i' and so on.
  573. * \param params[2] optional, contains the mode argument (for example, a
  574. * key for +k mode, or user who got the channel operator status for
  575. * +o mode)
  576. */
  577. var event_mode: IRC.irc_event_callback_t!
  578. /*!
  579. * The "umode" event is triggered upon receipt of a user MODE message,
  580. * which means that your user mode has been changed.
  581. *
  582. * \param origin the person, who changed the channel mode.
  583. * \param params[0] mandatory, contains the user changed mode, like
  584. * '+t', '-i' and so on.
  585. */
  586. var event_umode: IRC.irc_event_callback_t!
  587. /*!
  588. * The "topic" event is triggered upon receipt of a TOPIC message, which
  589. * means that someone on a channel with the client has changed the
  590. * channel's topic.
  591. *
  592. * \param origin the person, who changes the channel topic.
  593. * \param params[0] mandatory, contains the channel name.
  594. * \param params[1] optional, contains the new topic.
  595. */
  596. var event_topic: IRC.irc_event_callback_t!
  597. /*!
  598. * The "kick" event is triggered upon receipt of a KICK message, which
  599. * means that someone on a channel with the client (or possibly the
  600. * client itself!) has been forcibly ejected.
  601. *
  602. * \param origin the person, who kicked the poor.
  603. * \param params[0] mandatory, contains the channel name.
  604. * \param params[0] optional, contains the nick of kicked person.
  605. * \param params[1] optional, contains the kick text
  606. */
  607. var event_kick: IRC.irc_event_callback_t!
  608. /*!
  609. * The "channel" event is triggered upon receipt of a PRIVMSG message
  610. * to an entire channel, which means that someone on a channel with
  611. * the client has said something aloud. Your own messages don't trigger
  612. * PRIVMSG event.
  613. *
  614. * \param origin the person, who generates the message.
  615. * \param params[0] mandatory, contains the channel name.
  616. * \param params[1] optional, contains the message text
  617. */
  618. var event_channel: IRC.irc_event_callback_t!
  619. /*!
  620. * The "privmsg" event is triggered upon receipt of a PRIVMSG message
  621. * which is addressed to one or more clients, which means that someone
  622. * is sending the client a private message.
  623. *
  624. * \param origin the person, who generates the message.
  625. * \param params[0] mandatory, contains your nick.
  626. * \param params[1] optional, contains the message text
  627. */
  628. var event_privmsg: IRC.irc_event_callback_t!
  629. /*!
  630. * The "notice" event is triggered upon receipt of a NOTICE message
  631. * which means that someone has sent the client a public or private
  632. * notice. According to RFC 1459, the only difference between NOTICE
  633. * and PRIVMSG is that you should NEVER automatically reply to NOTICE
  634. * messages. Unfortunately, this rule is frequently violated by IRC
  635. * servers itself - for example, NICKSERV messages require reply, and
  636. * are NOTICEs.
  637. *
  638. * \param origin the person, who generates the message.
  639. * \param params[0] mandatory, contains the target nick name.
  640. * \param params[1] optional, contains the message text
  641. */
  642. var event_notice: IRC.irc_event_callback_t!
  643. /*!
  644. * The "channel_notice" event is triggered upon receipt of a NOTICE
  645. * message which means that someone has sent the client a public
  646. * notice. According to RFC 1459, the only difference between NOTICE
  647. * and PRIVMSG is that you should NEVER automatically reply to NOTICE
  648. * messages. Unfortunately, this rule is frequently violated by IRC
  649. * servers itself - for example, NICKSERV messages require reply, and
  650. * are NOTICEs.
  651. *
  652. * \param origin the person, who generates the message.
  653. * \param params[0] mandatory, contains the channel name.
  654. * \param params[1] optional, contains the message text
  655. */
  656. var event_channel_notice: IRC.irc_event_callback_t!
  657. /*!
  658. * The "invite" event is triggered upon receipt of an INVITE message,
  659. * which means that someone is permitting the client's entry into a +i
  660. * channel.
  661. *
  662. * \param origin the person, who INVITEs you.
  663. * \param params[0] mandatory, contains your nick.
  664. * \param params[1] mandatory, contains the channel name you're invited into.
  665. *
  666. * \sa irc_cmd_invite irc_cmd_chanmode_invite
  667. */
  668. var event_invite: IRC.irc_event_callback_t!
  669. /*!
  670. * The "ctcp" event is triggered when the client receives the CTCP
  671. * request. By default, the built-in CTCP request handler is used. The
  672. * build-in handler automatically replies on most CTCP messages, so you
  673. * will rarely need to override it.
  674. *
  675. * \param origin the person, who generates the message.
  676. * \param params[0] mandatory, the complete CTCP message, including its
  677. * arguments.
  678. *
  679. * Mirc generates PING, FINGER, VERSION, TIME and ACTION messages,
  680. * check the source code of \c libirc_event_ctcp_internal function to
  681. * see how to write your own CTCP request handler. Also you may find
  682. * useful this question in FAQ: \ref faq4
  683. */
  684. var event_ctcp_req: IRC.irc_event_callback_t!
  685. /*!
  686. * The "ctcp" event is triggered when the client receives the CTCP reply.
  687. *
  688. * \param origin the person, who generates the message.
  689. * \param params[0] mandatory, the CTCP message itself with its arguments.
  690. */
  691. var event_ctcp_rep: IRC.irc_event_callback_t!
  692. /*!
  693. * The "action" event is triggered when the client receives the CTCP
  694. * ACTION message. These messages usually looks like:\n
  695. * \code
  696. * [23:32:55] * Tim gonna sleep.
  697. * \endcode
  698. *
  699. * \param origin the person, who generates the message.
  700. * \param params[0] mandatory, the ACTION message.
  701. */
  702. var event_ctcp_action: IRC.irc_event_callback_t!
  703. /*!
  704. * The "unknown" event is triggered upon receipt of any number of
  705. * unclassifiable miscellaneous messages, which aren't handled by the
  706. * library.
  707. */
  708. var event_unknown: IRC.irc_event_callback_t!
  709. /*!
  710. * The "numeric" event is triggered upon receipt of any numeric response
  711. * from the server. There is a lot of such responses, see the full list
  712. * here: \ref rfcnumbers.
  713. *
  714. * See the params in ::irc_eventcode_callback_t specification.
  715. */
  716. var event_numeric: IRC.irc_eventcode_callback_t!
  717. /*!
  718. * The "dcc chat" event is triggered when someone requests a DCC CHAT from
  719. * you.
  720. *
  721. * See the params in ::irc_event_dcc_chat_t specification.
  722. */
  723. var event_dcc_chat_req: IRC.irc_event_dcc_chat_t!
  724. /*!
  725. * The "dcc chat" event is triggered when someone wants to send a file
  726. * to you via DCC SEND request.
  727. *
  728. * See the params in ::irc_event_dcc_send_t specification.
  729. */
  730. var event_dcc_send_req: IRC.irc_event_dcc_send_t!
  731. init() {
  732.  
  733. }
  734. init(event_connect: IRC.irc_event_callback_t!, event_nick: IRC.irc_event_callback_t!, event_quit: IRC.irc_event_callback_t!, event_join: IRC.irc_event_callback_t!, event_part: IRC.irc_event_callback_t!, event_mode: IRC.irc_event_callback_t!, event_umode: IRC.irc_event_callback_t!, event_topic: IRC.irc_event_callback_t!, event_kick: IRC.irc_event_callback_t!, event_channel: IRC.irc_event_callback_t!, event_privmsg: IRC.irc_event_callback_t!, event_notice: IRC.irc_event_callback_t!, event_channel_notice: IRC.irc_event_callback_t!, event_invite: IRC.irc_event_callback_t!, event_ctcp_req: IRC.irc_event_callback_t!, event_ctcp_rep: IRC.irc_event_callback_t!, event_ctcp_action: IRC.irc_event_callback_t!, event_unknown: IRC.irc_event_callback_t!, event_numeric: IRC.irc_eventcode_callback_t!, event_dcc_chat_req: IRC.irc_event_dcc_chat_t!, event_dcc_send_req: IRC.irc_event_dcc_send_t!)
  735. }
  736. /*!
  737. * \fn int irc_cmd_channel_mode (irc_session_t * session, const char * channel, const char * mode)
  738. * \brief Views or changes the channel mode.
  739. *
  740. * \param session An initiated and connected session.
  741. * \param channel A channel name to invite to. Must not be NULL.
  742. * \param mode A channel mode, described below. If NULL, the channel mode is
  743. * not changed, just the old mode is returned.
  744. *
  745. * \return Return code 0 means success. Other value means error, the error
  746. * code may be obtained through irc_errno(). Any error, generated by the
  747. * IRC server, is available through irc_callbacks_t::event_numeric.
  748. *
  749. * The irc_cmd_channel_mode() is used to change or view the channel modes.
  750. * The \a channel mode is returned if the \a mode is NULL. If the \a mode
  751. * is not NULL, the mode for the \a channel will be changed. Note that,
  752. * only channel operators can change the channel modes.
  753. *
  754. * Channel mode is represended by the letters combination. Every letter has
  755. * its own meaning in channel modes. Most channel mode letters are boolean
  756. * (i.e. could only be set or reset), but a few channel mode letters accept a
  757. * parameter. All channel options are set by adding a plus sign before the
  758. * letter, and reset by adding a minus sign before the letter.
  759. *
  760. * Here is the list of 'standard' channel modes:
  761. *
  762. * - \a o \a nickname - gives (+o nick) or takes (-o nick) the channel
  763. * operator privileges from a \a nickname. This mode affects the
  764. * users in channel, not the channel itself.
  765. * Examples: "+o tim", "-o watson".
  766. *
  767. * - \a p - sets (+p) or resets (-p) private channel flag.
  768. * Private channels are shown in channel list as 'Prv', without the topic.
  769. *
  770. * - \a s - sets (+p) or resets (-p) secret channel flag.
  771. * Secret channels aren't shown in channel list at all.
  772. *
  773. * - \a i - sets (+i) or resets (-i) invite-only channel flag. When the flag
  774. * is set, only the people who are invited by irc_cmd_invite(), can
  775. * join this channel.
  776. *
  777. * - \a t - sets (+t) or resets (-t) topic settable by channel operator only
  778. * flag. When the flag is set, only the channel operators can change the
  779. * channel topic.
  780. *
  781. * - \a n - sets (+n) or resets (-n) the protection from the clients outside
  782. * the channel. When the \a +n mode is set, only the clients, who are in
  783. * channel, can send the messages to the channel.
  784. *
  785. * - \a m - sets (+m) or resets (-m) the moderation of the channel. When the
  786. * moderation mode is set, only channel operators and the users who have
  787. * the \a +v user mode can speak in the channel.
  788. *
  789. * - \a v \a nickname - gives (+v nick) or takes (-v nick) from user the
  790. * ability to speak on a moderated channel.
  791. * Examples: "+v tim", "-v watson".
  792. *
  793. * - \a l \a number - sets (+l 20) or removes (-l) the restriction of maximum
  794. * users in channel. When the restriction is set, and there is a number
  795. * of users in the channel, no one can join the channel anymore.
  796. *
  797. * - \a k \a key - sets (+k secret) or removes (-k) the password from the
  798. * channel. When the restriction is set, any user joining the channel
  799. * required to provide a channel key.
  800. *
  801. * - \a b \a mask - sets (+b *!*@*.mil) or removes (-b *!*@*.mil) the ban mask
  802. * on a user to keep him out of channel. Note that to remove the ban you
  803. * must specify the ban mask to remove, not just "-b".
  804. *
  805. * Note that the actual list of channel modes depends on the IRC server, and
  806. * can be bigger. If you know the popular channel modes, which aren't
  807. * mentioned here - please contact me at tim@krasnogorsk.ru
  808. *
  809. * Possible error responces for this command from the RFC1459:
  810. * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
  811. * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED
  812. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  813. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  814. * - ::LIBIRC_RFC_ERR_KEYSET
  815. * - ::LIBIRC_RFC_ERR_UNKNOWNMODE
  816. * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
  817. *
  818. * And the mode information is given using following reply codes:
  819. * - ::LIBIRC_RFC_RPL_CHANNELMODEIS
  820. * - ::LIBIRC_RFC_RPL_BANLIST
  821. * - ::LIBIRC_RFC_RPL_ENDOFBANLIST
  822. *
  823. * \sa irc_cmd_topic irc_cmd_list
  824. * \ingroup ircmd_ch
  825. */
  826. @discardableResult func irc_cmd_channel_mode(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!, _ mode: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  827. /*!
  828. * \fn int irc_cmd_ctcp_reply (irc_session_t * session, const char * nick, const char * reply)
  829. * \brief Generates a reply to the CTCP request.
  830. *
  831. * \param session An initiated and connected session.
  832. * \param nick A target nick to send request to. Must not be NULL.
  833. * \param reply A reply string. Must not be NULL.
  834. *
  835. * \return Return code 0 means success. Other value means error, the error
  836. * code may be obtained through irc_errno(). Any error, generated by the
  837. * IRC server, is available through irc_callbacks_t::event_numeric.
  838. *
  839. * This function is used to send a reply to the CTCP request, generated by
  840. * irc_callbacks_t::event_ctcp_req. Note that you will not receive this event
  841. * unless you specify your own handler as \c event_ctcp_req callback during
  842. * the IRC session initialization.
  843. *
  844. * Possible error responces for this command from the RFC1459:
  845. * - ::LIBIRC_RFC_ERR_NORECIPIENT
  846. * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
  847. * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
  848. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  849. * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
  850. * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
  851. * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
  852. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  853. *
  854. * \ingroup ctcp
  855. */
  856. @discardableResult func irc_cmd_ctcp_reply(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ reply: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  857. /*!
  858. * \fn int irc_cmd_ctcp_request (irc_session_t * session, const char * nick, const char * request)
  859. * \brief Generates a CTCP request.
  860. *
  861. * \param session An initiated and connected session.
  862. * \param nick A target nick to send request to. Must not be NULL.
  863. * \param request A request string. Must not be NULL.
  864. *
  865. * \return Return code 0 means success. Other value means error, the error
  866. * code may be obtained through irc_errno(). Any error, generated by the
  867. * IRC server, is available through irc_callbacks_t::event_numeric.
  868. *
  869. * This function is used to send a CTCP request. There are four CTCP requests
  870. * supported by Mirc:
  871. * VERSION - get the client software name and version
  872. * FINGER - get the client username, host and real name.
  873. * PING - get the client delay.
  874. * TIME - get the client local time.
  875. *
  876. * A reply to the CTCP request will be sent by the irc_callbacks_t::event_ctcp_rep callback;
  877. * be sure to define it.
  878. *
  879. * Possible error responces for this command from the RFC1459:
  880. * - ::LIBIRC_RFC_ERR_NORECIPIENT
  881. * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
  882. * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
  883. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  884. * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
  885. * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
  886. * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
  887. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  888. *
  889. * \sa irc_callbacks_t::event_ctcp_rep irc_callbacks_t::event_numeric
  890. * \ingroup ctcp
  891. */
  892. @discardableResult func irc_cmd_ctcp_request(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ request: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  893. /*!
  894. * \fn int irc_cmd_invite (irc_session_t * session, const char * nick, const char * channel)
  895. * \brief Invites a user to invite-only channel.
  896. *
  897. * \param session An initiated and connected session.
  898. * \param nick A nick to invite. Must not be NULL.
  899. * \param channel A channel name to invite to. Must not be NULL.
  900. *
  901. * \return Return code 0 means success. Other value means error, the error
  902. * code may be obtained through irc_errno(). Any error, generated by the
  903. * IRC server, is available through irc_callbacks_t::event_numeric.
  904. *
  905. * This function is used to invite someone to invite-only channel.
  906. * "Invite-only" is a channel mode, which restricts anyone, except invided,
  907. * to join this channel. After invitation, the user could join this channel.
  908. * The user, who is invited, will receive the irc_callbacks_t::event_invite event.
  909. * Note that you must be a channel operator to INVITE the users.
  910. *
  911. * Possible error responces for this command from the RFC1459:
  912. * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
  913. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  914. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  915. * - ::LIBIRC_RFC_ERR_ERR_USERONCHANNEL
  916. * - ::LIBIRC_RFC_ERR_ERR_CHANOPRIVSNEEDED
  917. *
  918. * And on success one of the following replies returned:
  919. * - ::LIBIRC_RFC_RPL_INVITING
  920. * - ::LIBIRC_RFC_RPL_AWAY
  921. *
  922. * \sa irc_callbacks_t::event_invite irc_cmd_channel_mode
  923. * \ingroup ircmd_ch
  924. */
  925. @discardableResult func irc_cmd_invite(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  926. /*!
  927. * \fn int irc_cmd_join (irc_session_t * session, const char * channel, const char * key)
  928. * \brief Joins the new IRC channel.
  929. *
  930. * \param session An initiated and connected session.
  931. * \param channel A channel name to join to. Must not be NULL.
  932. * \param key Channel password. May be NULL.
  933. *
  934. * \return Return code 0 means success. Other value means error, the error
  935. * code may be obtained through irc_errno(). Any error, generated by the
  936. * IRC server, is available through irc_callbacks_t::event_numeric.
  937. *
  938. * This function is used to JOIN the IRC channel. If the channel is not exist,
  939. * it will be automatically created by the IRC server. Note that to JOIN the
  940. * password-protected channel, you must know the password, and specify it in
  941. * the \a key argument.
  942. *
  943. * If join is successful, the irc_callbacks_t::event_join is called (with \a origin ==
  944. * your nickname), then you are sent the channel's topic
  945. * (using ::LIBIRC_RFC_RPL_TOPIC) and the list of users who are on the
  946. * channel (using ::LIBIRC_RFC_RPL_NAMREPLY), which includes the user
  947. * joining - namely you.
  948. *
  949. * Possible error responces for this command from the RFC1459:
  950. * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
  951. * - ::LIBIRC_RFC_ERR_BANNEDFROMCHAN
  952. * - ::LIBIRC_RFC_ERR_INVITEONLYCHAN
  953. * - ::LIBIRC_RFC_ERR_BADCHANNELKEY
  954. * - ::LIBIRC_RFC_ERR_CHANNELISFULL
  955. * - ::LIBIRC_RFC_ERR_BADCHANMASK
  956. * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
  957. * - ::LIBIRC_RFC_ERR_TOOMANYCHANNELS
  958. *
  959. * And on success the following replies returned:
  960. * - ::LIBIRC_RFC_RPL_TOPIC
  961. * - ::LIBIRC_RFC_RPL_NAMREPLY
  962. *
  963. * \ingroup ircmd_ch
  964. */
  965. @discardableResult func irc_cmd_join(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!, _ key: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  966. /*!
  967. * \fn int irc_cmd_kick (irc_session_t * session, const char * nick, const char * channel, const char * reason)
  968. * \brief Kick some lazy ass out of channel.
  969. *
  970. * \param session An initiated and connected session.
  971. * \param nick A nick to kick. Must not be NULL.
  972. * \param channel A channel to kick this nick out of. Must not be NULL.
  973. * \param reason A reason to kick. May be NULL.
  974. *
  975. * \return Return code 0 means success. Other value means error, the error
  976. * code may be obtained through irc_errno(). Any error, generated by the
  977. * IRC server, is available through irc_callbacks_t::event_numeric.
  978. *
  979. * This function is used to kick a person out of channel. Note that you must
  980. * be a channel operator to kick anyone.
  981. *
  982. * Possible error responces for this command from the RFC1459:
  983. * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
  984. * - ::LIBIRC_RFC_ERR_BADCHANMASK
  985. * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
  986. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  987. * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED
  988. *
  989. * On success the irc_callbacks_t::event_kick event will be generated.
  990. *
  991. * \sa irc_callbacks_t::event_numeric
  992. * \ingroup ircmd_ch
  993. */
  994. @discardableResult func irc_cmd_kick(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ channel: Swift.UnsafePointer<Swift.Int8>!, _ reason: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  995. /*!
  996. * \fn int irc_cmd_list (irc_session_t * session, const char * channel)
  997. * \brief Obtains a list of active server channels with their topics.
  998. *
  999. * \param session An initiated and connected session.
  1000. * \param channel A channel name(s) to list. May be NULL, in which case all the
  1001. * channels will be listed. It is possible to specify more than
  1002. * a single channel, but several channel names should be
  1003. * separated by a comma.
  1004. *
  1005. * \return Return code 0 means success. Other value means error, the error
  1006. * code may be obtained through irc_errno(). Any error, generated by the
  1007. * IRC server, is available through irc_callbacks_t::event_numeric.
  1008. *
  1009. * This function is used to ask the IRC server for the active (existing)
  1010. * channels list. The list will be returned using ::LIBIRC_RFC_RPL_LISTSTART -
  1011. * ::LIBIRC_RFC_RPL_LIST - ::LIBIRC_RFC_RPL_LISTEND sequence.
  1012. * Note that "private" channels are listed (without their topics) as channel
  1013. * "Prv" unless the client generating the LIST query is actually on that
  1014. * channel. Likewise, secret channels are
  1015. * not listed at all unless the client is a member of the channel in question.
  1016. *
  1017. * Possible error responces for this command from the RFC1459:
  1018. * - ::LIBIRC_RFC_ERR_NOSUCHSERVER
  1019. *
  1020. * And the channel list is returned using the following reply codes:
  1021. * - ::LIBIRC_RFC_RPL_LISTSTART
  1022. * - ::LIBIRC_RFC_RPL_LISTEND
  1023. * - ::LIBIRC_RFC_RPL_LIST
  1024. *
  1025. * \ingroup ircmd_ch
  1026. */
  1027. @discardableResult func irc_cmd_list(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1028. /*!
  1029. * \fn int irc_cmd_me (irc_session_t * session, const char * nch, const char * text)
  1030. * \brief Sends the /me (CTCP ACTION) message to the nick or to the channel.
  1031. *
  1032. * \param session An initiated and connected session.
  1033. * \param nch A target nick or channel. Must not be NULL.
  1034. * \param text Action message text. Must not be NULL.
  1035. *
  1036. * \return Return code 0 means success. Other value means error, the error
  1037. * code may be obtained through irc_errno(). Any error, generated by the
  1038. * IRC server, is available through irc_callbacks_t::event_numeric.
  1039. *
  1040. * This function is used to send the /me message to channel or private.
  1041. * As for irc_cmd_msg, the target is determined by \a nch argument.
  1042. *
  1043. * Possible error responces for this command from the RFC1459:
  1044. * - ::LIBIRC_RFC_ERR_NORECIPIENT
  1045. * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
  1046. * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
  1047. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1048. * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
  1049. * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
  1050. * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
  1051. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  1052. *
  1053. * On success there is NOTHING generated.
  1054. * However, a ::LIBIRC_RFC_RPL_AWAY reply can be also generated.
  1055. *
  1056. * \sa irc_cmd_msg
  1057. * \ingroup ircmd_msg
  1058. */
  1059. @discardableResult func irc_cmd_me(_ session: Swift.OpaquePointer!, _ nch: Swift.UnsafePointer<Swift.Int8>!, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1060. /*!
  1061. * \fn irc_cmd_msg (irc_session_t * session, const char * nch, const char * text)
  1062. * \brief Sends the message to the nick or to the channel.
  1063. *
  1064. * \param session An initiated and connected session.
  1065. * \param nch A target nick or channel. Must not be NULL.
  1066. * \param text Message text. Must not be NULL.
  1067. *
  1068. * \return Return code 0 means success. Other value means error, the error
  1069. * code may be obtained through irc_errno(). Any error, generated by the
  1070. * IRC server, is available through irc_callbacks_t::event_numeric.
  1071. *
  1072. * This function is used to send the channel or private messages. The target
  1073. * is determined by \a nch argument: if it describes nick, this will be a
  1074. * private message, if a channel name - public (channel) message. Note that
  1075. * depending on channel modes, you may be required to join the channel to
  1076. * send the channel messages.
  1077. *
  1078. * Possible error responces for this command from the RFC1459:
  1079. * - ::LIBIRC_RFC_ERR_NORECIPIENT
  1080. * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
  1081. * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
  1082. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1083. * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
  1084. * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
  1085. * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
  1086. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  1087. *
  1088. * On success there is NOTHING generated.
  1089. *
  1090. * \ingroup ircmd_msg
  1091. */
  1092. @discardableResult func irc_cmd_msg(_ session: Swift.OpaquePointer!, _ nch: Swift.UnsafePointer<Swift.Int8>!, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1093. /*!
  1094. * \fn int irc_cmd_names (irc_session_t * session, const char * channel)
  1095. * \brief Obtains a list of users who're in channel.
  1096. *
  1097. * \param session An initiated and connected session.
  1098. * \param channel A channel name(s) to obtain user list. Must not be NULL.
  1099. * It is possible to specify more than a single channel, but
  1100. * several channel names should be separated by a comma.
  1101. *
  1102. * \return Return code 0 means success. Other value means error, the error
  1103. * code may be obtained through irc_errno(). Any error, generated by the
  1104. * IRC server, is available through irc_callbacks_t::event_numeric.
  1105. *
  1106. * This function is used to ask the IRC server for the list of the users
  1107. * who're in specified channel. You can list all nicknames that are visible
  1108. * to you on any channel that you can see. The list of users will be returned
  1109. * using ::RPL_NAMREPLY and ::RPL_ENDOFNAMES numeric codes.
  1110. *
  1111. * The channel names are returned by irc_callbacks_t::event_numeric
  1112. * using the following reply codes:
  1113. * - ::LIBIRC_RFC_RPL_NAMREPLY
  1114. * - ::LIBIRC_RFC_RPL_ENDOFNAMES
  1115. *
  1116. * \ingroup ircmd_ch
  1117. */
  1118. @discardableResult func irc_cmd_names(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1119. /*!
  1120. * \fn int irc_cmd_nick (irc_session_t * session, const char * newnick)
  1121. * \brief Changes your nick.
  1122. *
  1123. * \param session An initiated and connected session.
  1124. * \param newnick A new nick. Must not be NULL.
  1125. *
  1126. * \return Return code 0 means success. Other value means error, the error
  1127. * code may be obtained through irc_errno(). Any error, generated by the
  1128. * IRC server, is available through irc_callbacks_t::event_numeric.
  1129. *
  1130. * This function is used to change your current nick to another nick. Note
  1131. * that such a change is not always possible; for example you cannot change
  1132. * nick to the existing nick, or (on some servers) to the registered nick.
  1133. *
  1134. * Possible error responces for this command from the RFC1459:
  1135. * - ::LIBIRC_RFC_ERR_NONICKNAMEGIVEN
  1136. * - ::LIBIRC_RFC_ERR_ERRONEUSNICKNAME
  1137. * - ::LIBIRC_RFC_ERR_NICKNAMEINUSE
  1138. * - ::LIBIRC_RFC_ERR_NICKCOLLISION
  1139. *
  1140. * \ingroup ircmd_oth
  1141. */
  1142. @discardableResult func irc_cmd_nick(_ session: Swift.OpaquePointer!, _ newnick: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1143. /*!
  1144. * \fn int irc_cmd_notice (irc_session_t * session, const char * nch, const char * text)
  1145. * \brief Sends the notice to the nick or to the channel.
  1146. *
  1147. * \param session An initiated and connected session.
  1148. * \param nch A target nick or channel. Must not be NULL.
  1149. * \param text Notice text. Must not be NULL.
  1150. *
  1151. * \return Return code 0 means success. Other value means error, the error
  1152. * code may be obtained through irc_errno(). Any error, generated by the
  1153. * IRC server, is available through irc_callbacks_t::event_numeric.
  1154. *
  1155. * This function is used to send the channel or private notices. The target
  1156. * is determined by \a nch argument: if it describes nick, this will be a
  1157. * private message, if a channel name - public (channel) message. Note that
  1158. * depending on channel modes, you may be required to join the channel to
  1159. * send the channel notices.
  1160. *
  1161. * The only difference between message and notice is that, according to RFC
  1162. * 1459, you must not automatically reply to NOTICE messages.
  1163. *
  1164. * Possible error responces for this command from the RFC1459:
  1165. * - ::LIBIRC_RFC_ERR_NORECIPIENT
  1166. * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
  1167. * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
  1168. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1169. * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
  1170. * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
  1171. * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
  1172. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  1173. *
  1174. * On success there is NOTHING generated. On notices sent to target nick,
  1175. * a ::LIBIRC_RFC_RPL_AWAY reply may be generated.
  1176. *
  1177. * \sa irc_cmd_msg
  1178. * \ingroup ircmd_msg
  1179. */
  1180. @discardableResult func irc_cmd_notice(_ session: Swift.OpaquePointer!, _ nch: Swift.UnsafePointer<Swift.Int8>!, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1181. /*!
  1182. * \fn int irc_cmd_part (irc_session_t * session, const char * channel)
  1183. * \brief Leaves the IRC channel.
  1184. *
  1185. * \param session An initiated and connected session.
  1186. * \param channel A channel name to leave. Must not be NULL.
  1187. *
  1188. * \return Return code 0 means success. Other value means error, the error
  1189. * code may be obtained through irc_errno(). Any error, generated by the
  1190. * IRC server, is available through irc_callbacks_t::event_numeric.
  1191. *
  1192. * This function is used to leave the IRC channel you've already joined to.
  1193. * An attempt to leave the channel you aren't in results a ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1194. * server error.
  1195. *
  1196. * Possible error responces for this command from the RFC1459:
  1197. * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
  1198. * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
  1199. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1200. *
  1201. * \ingroup ircmd_ch
  1202. */
  1203. @discardableResult func irc_cmd_part(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1204. /*!
  1205. * \fn int irc_cmd_quit (irc_session_t * session, const char * reason)
  1206. * \brief Sends QUIT command to the IRC server.
  1207. *
  1208. * \param session An initiated and connected session.
  1209. * \param reason A reason to quit. May be NULL.
  1210. *
  1211. * \return Return code 0 means success. Other value means error, the error
  1212. * code may be obtained through irc_errno(). Any error, generated by the
  1213. * IRC server, is available through irc_callbacks_t::event_numeric.
  1214. *
  1215. * This function sends the QUIT command to the IRC server. This command
  1216. * forces the IRC server to close the IRC connection, and terminate the
  1217. * session.
  1218. *
  1219. * \ingroup ircmd_oth
  1220. */
  1221. @discardableResult func irc_cmd_quit(_ session: Swift.OpaquePointer!, _ reason: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1222. /*!
  1223. * \fn int irc_cmd_topic (irc_session_t * session, const char * channel, const char * topic)
  1224. * \brief Views or changes the channel topic.
  1225. *
  1226. * \param session An initiated and connected session.
  1227. * \param channel A channel name to invite to. Must not be NULL.
  1228. * \param topic A new topic to change. If NULL, the old topic will be
  1229. * returned, and topic won't changed.
  1230. *
  1231. * \return Return code 0 means success. Other value means error, the error
  1232. * code may be obtained through irc_errno(). Any error, generated by the
  1233. * IRC server, is available through irc_callbacks_t::event_numeric.
  1234. *
  1235. * The irc_cmd_topic() is used to change or view the topic of a channel.
  1236. * The topic for \a channel is returned if \a topic is NULL. If the \a topic
  1237. * is not NULL, the topic for the \a channel will be changed. Note that,
  1238. * depending on \a +t channel mode, you may be required to be a channel
  1239. * operator to change the channel topic.
  1240. *
  1241. * If the command succeed, the IRC server will generate a ::RPL_NOTOPIC or
  1242. * ::RPL_TOPIC message, containing either old or changed topic. Also the IRC
  1243. * server can (but not have to) generate the non-RFC ::RPL_TOPIC_EXTRA message,
  1244. * containing the nick of person, who's changed the topic, and the time of
  1245. * latest topic change.
  1246. *
  1247. * Possible error responces for this command from the RFC1459:
  1248. * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
  1249. * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED
  1250. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1251. *
  1252. * And the topic information is returned using one of following reply codes:
  1253. * - ::LIBIRC_RFC_RPL_NOTOPIC
  1254. * - ::LIBIRC_RFC_RPL_TOPIC
  1255. *
  1256. * \sa irc_callbacks_t::event_topic irc_cmd_channel_mode
  1257. * \ingroup ircmd_ch
  1258. */
  1259. @discardableResult func irc_cmd_topic(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!, _ topic: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1260. /*!
  1261. * \fn int irc_cmd_user_mode (irc_session_t * session, const char * mode)
  1262. * \brief Views or changes your own user mode.
  1263. *
  1264. * \param session An initiated and connected session.
  1265. * \param mode A user mode, described below. If NULL, the user mode is
  1266. * not changed, just the old mode is returned.
  1267. *
  1268. * \return Return code 0 means success. Other value means error, the error
  1269. * code may be obtained through irc_errno(). Any error, generated by the
  1270. * IRC server, is available through irc_callbacks_t::event_numeric.
  1271. *
  1272. * The irc_cmd_user_mode() is used to change or view the user modes.
  1273. * Note that, unlike channel modes, not all user modes can be changed.
  1274. * The user mode is returned if the \a mode is NULL. If the \a mode
  1275. * is not NULL, the mode for you will be changed, and new mode will be
  1276. * returned.
  1277. *
  1278. * Like channel mode, user mode is also represended by the letters combination.
  1279. * All the user mode letters are boolean (i.e. could only be set or reset),
  1280. * they are set by adding a plus sign before the letter, and reset by adding
  1281. * a minus sign before the letter.
  1282. *
  1283. * Here is the list of 'standard' user modes:
  1284. *
  1285. * - \a o - represents an IRC operator status. Could not be set directly (but
  1286. * can be reset though), to set it use the IRC \a OPER command.
  1287. *
  1288. * - \a i - if set, marks a user as 'invisible' - that is, not seen by lookups
  1289. * if the user is not in a channel.
  1290. *
  1291. * - \a w - if set, marks a user as 'receiving wallops' - special messages
  1292. * generated by IRC operators using WALLOPS command.
  1293. *
  1294. * - \a s - if set, marks a user for receipt of server notices.
  1295. *
  1296. * - \a r - NON-STANDARD MODE. If set, user has been authenticated with
  1297. * NICKSERV IRC service.
  1298. *
  1299. * - \a x - NON-STANDARD MODE. If set, user's real IP is hidden by IRC
  1300. * servers, to prevent scriptkiddies to do nasty things to the user's
  1301. * computer.
  1302. *
  1303. * Note that the actual list of user modes depends on the IRC server, and
  1304. * can be bigger. If you know the popular user modes, which aren't
  1305. * mentioned here - please contact me at tim@krasnogorsk.ru
  1306. *
  1307. * Possible error responces for this command from the RFC1459:
  1308. * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
  1309. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  1310. * - ::LIBIRC_RFC_ERR_UNKNOWNMODE
  1311. * - ::LIBIRC_RFC_ERR_USERSDONTMATCH
  1312. * - ::LIBIRC_RFC_ERR_UMODEUNKNOWNFLAG
  1313. *
  1314. * And the mode information is given using reply code ::LIBIRC_RFC_RPL_UMODEIS
  1315. *
  1316. * \ingroup ircmd_oth
  1317. */
  1318. @discardableResult func irc_cmd_user_mode(_ session: Swift.OpaquePointer!, _ mode: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1319. /*!
  1320. * \fn int irc_cmd_whois (irc_session_t * session, const char * nick)
  1321. * \brief Queries the information about the nick.
  1322. *
  1323. * \param session An initiated and connected session.
  1324. * \param nick A nick to query the information abour. Must not be NULL.
  1325. * A comma-separated list of several nicknames may be given.
  1326. *
  1327. * \return Return code 0 means success. Other value means error, the error
  1328. * code may be obtained through irc_errno(). Any error, generated by the
  1329. * IRC server, is available through irc_callbacks_t::event_numeric.
  1330. *
  1331. * This function queries various information about the nick: username, real
  1332. * name, the IRC server used, the channels user is in, idle time, away mode and so on.
  1333. *
  1334. * Possible error responces for this command from the RFC1459:
  1335. * - ::LIBIRC_RFC_ERR_NOSUCHSERVER
  1336. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  1337. * - ::LIBIRC_RFC_ERR_NONICKNAMEGIVEN
  1338. *
  1339. * And the information is returned using the following reply codes. The whois
  1340. * query is completed when ::LIBIRC_RFC_RPL_ENDOFWHOIS message is received.
  1341. * - ::LIBIRC_RFC_RPL_WHOISUSER
  1342. * - ::LIBIRC_RFC_RPL_WHOISCHANNELS
  1343. * - ::LIBIRC_RFC_RPL_WHOISSERVER
  1344. * - ::LIBIRC_RFC_RPL_AWAY
  1345. * - ::LIBIRC_RFC_RPL_WHOISOPERATOR
  1346. * - ::LIBIRC_RFC_RPL_WHOISIDLE
  1347. * - ::LIBIRC_RFC_RPL_ENDOFWHOIS
  1348. *
  1349. * \ingroup ircmd_oth
  1350. */
  1351. @discardableResult func irc_cmd_whois(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1352. /*!
  1353. * \fn char * irc_color_convert_from_mirc (const char * message)
  1354. * \brief Converts all the color codes and format options to libircclient colors.
  1355. *
  1356. * \param message A message from IRC
  1357. *
  1358. * \return Returns a new message with converted mIRC color codes and format
  1359. * options. See the irc_color_convert_to_mirc() help to see how the colors
  1360. * are converted.\n
  1361. * Note that the memory for the new message is allocated using malloc(), so
  1362. * you should free it using free() when it is not used anymore. If memory
  1363. * allocation failed, returns 0.
  1364. *
  1365. * \sa irc_color_strip_from_mirc irc_color_convert_to_mirc
  1366. * \ingroup colors
  1367. */
  1368. @discardableResult func irc_color_convert_from_mirc(_ message: Swift.UnsafePointer<Swift.Int8>!) -> Swift.UnsafeMutablePointer<Swift.Int8>!
  1369. /*!
  1370. * \fn char * irc_color_convert_to_mirc (const char * message)
  1371. * \brief Converts all the color codes from libircclient format to mIRC.
  1372. *
  1373. * \param message A message with color codes
  1374. *
  1375. * \return Returns a new message with converted color codes and format
  1376. * options, or 0 if memory could not be allocated. Note that the memory for
  1377. * the new message is allocated using malloc(), so you should free it using
  1378. * free() when it is not used anymore.
  1379. *
  1380. * The color system of libircclient is designed to be easy to use, and
  1381. * portable between different IRC clients. Every color or format option is
  1382. * described using plain text commands written between square brackets. The
  1383. * possible codes are:
  1384. * - [B] ... [/B] - bold format mode. Everything between [B] and [/B] is written in \b bold.
  1385. * - [I] ... [/I] - italic/reverse format mode. Everything between [I] and [/I] is written in \c italic, or reversed (however, because some clients are incapable of rendering italic text, most clients display this as normal text with the background and foreground colors swapped).
  1386. * - [U] ... [/U] - underline format mode. Everything between [U] and [/U] is written underlined.
  1387. * - [COLOR=RED] ... [/COLOR] - write the text using specified foreground color. The color is set by using the \c COLOR keyword, and equal sign followed by text color code (see below).
  1388. * - [COLOR=RED/BLUE] ... [/COLOR] - write the text using specified foreground and background color. The color is set by using the \c COLOR keyword, an equal sign followed by text foreground color code, a dash and a text background color code.
  1389. *
  1390. * The supported text colors are:
  1391. * - WHITE
  1392. * - BLACK
  1393. * - DARKBLUE
  1394. * - DARKGREEN
  1395. * - RED
  1396. * - BROWN
  1397. * - PURPLE
  1398. * - OLIVE
  1399. * - YELLOW
  1400. * - GREEN
  1401. * - TEAL
  1402. * - CYAN
  1403. * - BLUE
  1404. * - MAGENTA
  1405. * - DARKGRAY
  1406. * - LIGHTGRAY
  1407. *
  1408. * Examples of color sequences:
  1409. * \code
  1410. * Hello, [B]Tim[/B].
  1411. * [U]Arsenal[/U] got a [COLOR=RED]red card[/COLOR]
  1412. * The tree[U]s[/U] are [COLOR=GREEN/BLACK]green[/COLOR]
  1413. * \endcode
  1414. *
  1415. * \sa irc_color_strip_from_mirc irc_color_convert_from_mirc
  1416. * \ingroup colors
  1417. */
  1418. @discardableResult func irc_color_convert_to_mirc(_ message: Swift.UnsafePointer<Swift.Int8>!) -> Swift.UnsafeMutablePointer<Swift.Int8>!
  1419. /*!
  1420. * \fn char * irc_color_strip_from_mirc (const char * message)
  1421. * \brief Removes all the color codes and format options.
  1422. *
  1423. * \param message A message from IRC
  1424. *
  1425. * \return Returns a new plain text message with stripped mIRC color codes.
  1426. * Note that the memory for the new message is allocated using malloc(), so
  1427. * you should free it using free() when it is not used anymore. If memory
  1428. * allocation failed, returns 0.
  1429. *
  1430. * \sa irc_color_convert_from_mirc irc_color_convert_to_mirc
  1431. * \ingroup colors
  1432. */
  1433. @discardableResult func irc_color_strip_from_mirc(_ message: Swift.UnsafePointer<Swift.Int8>!) -> Swift.UnsafeMutablePointer<Swift.Int8>!
  1434. /*!
  1435. * \fn int irc_connect (irc_session_t * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname);
  1436. * \brief Initiates a connection to IRC server.
  1437. *
  1438. * \param session A session to initiate connections on. Must not be NULL.
  1439. * \param server A domain name or an IP address of the IRC server to connect to. Cannot be NULL.
  1440. * If the library is built with SSL support and the first character is hash, tries to establish the SSL connection.
  1441. * For example, the connection to "irc.example.com" is assumed to be plaintext, and connection to "#irc.example.com"
  1442. * is assumed to be secured by SSL. Note that SSL will only work if the library is built with the SSL support.
  1443. * \param port An IRC server port, usually 6667.
  1444. * \param server_password An IRC server password, if the server requires it.
  1445. * May be NULL, in this case password will not be send to the
  1446. * IRC server. Vast majority of IRC servers do not require passwords.
  1447. * \param nick A nick, which libircclient will use to login to the IRC server.
  1448. * Must not be NULL.
  1449. * \param username A username of the account, which is used to connect to the
  1450. * IRC server. This is for information only, will be shown in
  1451. * "user properties" dialogs and returned by /whois request.
  1452. * May be NULL, in this case 'nobody' will be sent as username.
  1453. * \param realname A real name of the person, who connects to the IRC. Usually
  1454. * people put some wide-available information here (URL, small
  1455. * description or something else). This information also will
  1456. * be shown in "user properties" dialogs and returned by /whois
  1457. * request. May be NULL, in this case 'noname' will be sent as
  1458. * username.
  1459. *
  1460. * \return Return code 0 means success. Other value means error, the error
  1461. * code may be obtained through irc_errno(). Any error, generated by the
  1462. * IRC server, is available through irc_callbacks_t::event_numeric.
  1463. *
  1464. * This function prepares and initiates a connection to the IRC server. The
  1465. * connection is done asynchronously (see irc_callbacks_t::event_connect), so the success
  1466. * return value means that connection was initiated (but not completed!)
  1467. * successfully.
  1468. *
  1469. * \sa irc_run
  1470. * \ingroup conndisc
  1471. */
  1472. @discardableResult func irc_connect(_ session: Swift.OpaquePointer!, _ server: Swift.UnsafePointer<Swift.Int8>!, _ port: Swift.UInt16, _ server_password: Swift.UnsafePointer<Swift.Int8>!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ username: Swift.UnsafePointer<Swift.Int8>!, _ realname: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1473. /*!
  1474. * \fn int irc_connect6 (irc_session_t * session, const char * server, unsigned short port, const char * server_password, const char * nick, const char * username, const char * realname);
  1475. * \brief Initiates a connection to IRC server using IPv6.
  1476. *
  1477. * \param session A session to initiate connections on. Must not be NULL.
  1478. * \param server A domain name or an IP address of the IRC server to connect to. Cannot be NULL.
  1479. * If the library is built with SSL support and the first character is hash, tries to establish the SSL connection.
  1480. * For example, the connection to "irc.example.com" is assumed to be plaintext, and connection to "#irc.example.com"
  1481. * is assumed to be secured by SSL. Note that SSL will only work if the library is built with the SSL support.
  1482. * \param port An IRC server port, usually 6667.
  1483. * \param server_password An IRC server password, if the server requires it.
  1484. * May be NULL, in this case password will not be send to the
  1485. * IRC server. Vast majority of IRC servers do not require passwords.
  1486. * \param nick A nick, which libircclient will use to login to the IRC server.
  1487. * Must not be NULL.
  1488. * \param username A username of the account, which is used to connect to the
  1489. * IRC server. This is for information only, will be shown in
  1490. * "user properties" dialogs and returned by /whois request.
  1491. * May be NULL, in this case 'nobody' will be sent as username.
  1492. * \param realname A real name of the person, who connects to the IRC. Usually
  1493. * people put some wide-available information here (URL, small
  1494. * description or something else). This information also will
  1495. * be shown in "user properties" dialogs and returned by /whois
  1496. * request. May be NULL, in this case 'noname' will be sent as
  1497. * username.
  1498. *
  1499. * \return Return code 0 means success. Other value means error, the error
  1500. * code may be obtained through irc_errno(). Any error, generated by the
  1501. * IRC server, is available through irc_callbacks_t::event_numeric.
  1502. *
  1503. * This function prepares and initiates a connection to the IRC server. The
  1504. * connection is done asynchronously (see irc_callbacks_t::event_connect), so the success
  1505. * return value means that connection was initiated (but not completed!)
  1506. * successfully.
  1507. *
  1508. * \sa irc_run
  1509. * \ingroup conndisc
  1510. */
  1511. @discardableResult func irc_connect6(_ session: Swift.OpaquePointer!, _ server: Swift.UnsafePointer<Swift.Int8>!, _ port: Swift.UInt16, _ server_password: Swift.UnsafePointer<Swift.Int8>!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ username: Swift.UnsafePointer<Swift.Int8>!, _ realname: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1512. /*!
  1513. * \fn irc_session_t * irc_create_session (irc_callbacks_t * callbacks)
  1514. * \brief Creates and initiates a new IRC session.
  1515. *
  1516. * \param callbacks A structure, which defines several callbacks, which will
  1517. * be called on appropriate events. Must not be NULL.
  1518. *
  1519. * \return An ::irc_session_t object, or 0 if creation failed. Usually,
  1520. * failure is caused by out of memory error.
  1521. *
  1522. * Every ::irc_session_t object describes a single IRC session - a connection
  1523. * to an IRC server, and possibly to some DCC clients. Almost every irc_*
  1524. * function requires this object to be passed to, and therefore this function
  1525. * should be called first.
  1526. *
  1527. * Every session created must be destroyed when it is not needed anymore
  1528. * by calling irc_destroy_session().
  1529. *
  1530. * The most common function sequence is:
  1531. * \code
  1532. * ... prepare irc_callbacks_t structure ...
  1533. * irc_create_session();
  1534. * irc_connect();
  1535. * irc_run();
  1536. * irc_destroy_session();
  1537. * \endcode
  1538. *
  1539. * \sa irc_destroy_session
  1540. * \ingroup initclose
  1541. */
  1542. @discardableResult func irc_create_session(_ callbacks: Swift.UnsafeMutablePointer<IRC.irc_callbacks_t>!) -> Swift.OpaquePointer!
  1543. /*!
  1544. * \fn int irc_dcc_accept (irc_session_t * session, irc_dcc_t dccid, void * ctx, irc_dcc_callback_t callback)
  1545. * \brief Accepts a remote DCC CHAT or DCC RECVFILE request.
  1546. *
  1547. * \param session An initiated and connected session.
  1548. * \param dccid A DCC session ID, returned by appropriate callback.
  1549. * \param ctx A user-supplied DCC session context, which will be passed
  1550. * to the DCC callback function. May be NULL.
  1551. * \param callback A DCC callback function, which will be called when
  1552. * anything is said by other party. Must not be NULL.
  1553. *
  1554. * \return Return code 0 means success. Other value means error, the error
  1555. * code may be obtained through irc_errno().
  1556. *
  1557. * This function accepts a remote DCC request - either DCC CHAT or DCC FILE.
  1558. * After the request is accepted, the supplied callback will be called,
  1559. * and you can start sending messages or receiving the file.
  1560. *
  1561. * This function should be called only after either event_dcc_chat_req or
  1562. * event_dcc_send_req events are generated, and should react to them. It is
  1563. * possible not to call irc_dcc_accept or irc_dcc_decline immediately in
  1564. * callback function - you may just return, and call it later. However, to
  1565. * prevent memory leaks, you must call either irc_dcc_decline or
  1566. * irc_dcc_accept for any incoming DCC request.
  1567. *
  1568. * \sa irc_dcc_decline event_dcc_chat_req event_dcc_send_req
  1569. * \ingroup dccstuff
  1570. */
  1571. @discardableResult func irc_dcc_accept(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t, _ ctx: Swift.UnsafeMutableRawPointer!, _ callback: IRC.irc_dcc_callback_t!) -> Swift.Int32
  1572. @convention(c) (Swift.OpaquePointer?, Swift.UInt32, Swift.Int32, Swift.UnsafeMutableRawPointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UInt32) -> ()
  1573. /*!
  1574. * \fn int irc_dcc_chat(irc_session_t * session, void * ctx, const char * nick, irc_dcc_callback_t callback, irc_dcc_t * dccid)
  1575. * \brief Initiates a DCC CHAT.
  1576. *
  1577. * \param session An initiated and connected session.
  1578. * \param ctx A user-supplied DCC session context, which will be passed to
  1579. * the DCC callback function. May be NULL.
  1580. * \param nick A nick to DCC CHAT with.
  1581. * \param callback A DCC callback function, which will be called when
  1582. * anything is said by other party. Must not be NULL.
  1583. * \param dccid On success, DCC session ID will be stored in this var.
  1584. *
  1585. * \return Return code 0 means success. Other value means error, the error
  1586. * code may be obtained through irc_errno(). Any error, generated by the
  1587. * IRC server, is available through irc_callbacks_t::event_numeric.
  1588. *
  1589. * This function requests a DCC CHAT between you and other user. For
  1590. * newbies, DCC chat is like private chat, but it goes directly between
  1591. * two users, and bypasses IRC server. DCC CHAT request must be accepted
  1592. * by other side before you can send anything.
  1593. *
  1594. * When the chat is accepted, terminated, or some data is received, the
  1595. * callback function is called. See the details in irc_dcc_callback_t
  1596. * declaration.
  1597. *
  1598. * Possible error responces for this command from the RFC1459:
  1599. * - ::LIBIRC_RFC_ERR_NORECIPIENT
  1600. * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
  1601. * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
  1602. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1603. * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
  1604. * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
  1605. * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
  1606. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  1607. *
  1608. * \sa irc_dcc_callback_t irc_dcc_msg
  1609. * \ingroup dccstuff
  1610. */
  1611. @discardableResult func irc_dcc_chat(_ session: Swift.OpaquePointer!, _ ctx: Swift.UnsafeMutableRawPointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ callback: IRC.irc_dcc_callback_t!, _ dccid: Swift.UnsafeMutablePointer<IRC.irc_dcc_t>!) -> Swift.Int32
  1612. /*!
  1613. * \fn int irc_dcc_decline (irc_session_t * session, irc_dcc_t dccid)
  1614. * \brief Declines a remote DCC CHAT or DCC RECVFILE request.
  1615. *
  1616. * \param session An initiated and connected session.
  1617. * \param dccid A DCC session ID, returned by appropriate callback.
  1618. *
  1619. * \return Return code 0 means success. Other value means error, the error
  1620. * code may be obtained through irc_errno().
  1621. *
  1622. * This function declines a remote DCC request - either DCC CHAT or DCC FILE.
  1623. *
  1624. * This function should be called only after either event_dcc_chat_req or
  1625. * event_dcc_send_req events are generated, and should react to them. It is
  1626. * possible not to call irc_dcc_accept or irc_dcc_decline immediately in
  1627. * callback function - you may just return, and call it later. However, to
  1628. * prevent memory leaks, you must call either irc_dcc_decline or
  1629. * irc_dcc_accept for any incoming DCC request.
  1630. *
  1631. * Do not use this function to close the accepted or initiated DCC session.
  1632. * Use irc_dcc_destroy instead.
  1633. *
  1634. * \sa irc_dcc_accept irc_callbacks_t::event_dcc_chat_req irc_callbacks_t::event_dcc_send_req irc_dcc_destroy
  1635. * \ingroup dccstuff
  1636. */
  1637. @discardableResult func irc_dcc_decline(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t) -> Swift.Int32
  1638. /*!
  1639. * \fn int irc_dcc_destroy (irc_session_t * session, irc_dcc_t dccid)
  1640. * \brief Destroys a DCC session.
  1641. *
  1642. * \param session An initiated and connected session.
  1643. * \param dccid A DCC session ID.
  1644. *
  1645. * \return Return code 0 means success. Other value means error, the error
  1646. * code may be obtained through irc_errno().
  1647. *
  1648. * This function closes the DCC connection (if available), and destroys
  1649. * the DCC session, freeing the used resources. It can be called in any
  1650. * moment, even from callbacks or from different threads.
  1651. *
  1652. * Note that when DCC session is finished (either with success or failure),
  1653. * you should not destroy it - it will be destroyed automatically.
  1654. *
  1655. * \ingroup dccstuff
  1656. */
  1657. @discardableResult func irc_dcc_destroy(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t) -> Swift.Int32
  1658. /*!
  1659. * \fn int irc_dcc_msg (irc_session_t * session, irc_dcc_t dccid, const char * text)
  1660. * \brief Sends the message to the specific DCC CHAT
  1661. *
  1662. * \param session An IRC session.
  1663. * \param dccid A DCC session ID, which chat request must have been accepted.
  1664. * \param text Message text. Must not be NULL.
  1665. *
  1666. * \return Return code 0 means success. Other value means error, the error
  1667. * code may be obtained through irc_errno().
  1668. *
  1669. * This function is used to send the DCC CHAT messages. DCC CHAT request
  1670. * must be initiated and accepted first (or just accepted, if initiated by
  1671. * other side).
  1672. *
  1673. * \sa irc_dcc_chat
  1674. * \ingroup dccstuff
  1675. */
  1676. @discardableResult func irc_dcc_msg(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
  1677. /*!
  1678. * \fn int irc_dcc_sendfile (irc_session_t * session, void * ctx, const char * nick, const char * filename, irc_dcc_callback_t callback, irc_dcc_t * dccid)
  1679. * \brief Sends a file via DCC.
  1680. *
  1681. * \param session An initiated and connected session.
  1682. * \param ctx A user-supplied DCC session context, which will be passed to
  1683. * the DCC callback function. May be NULL.
  1684. * \param nick A nick to send file via DCC to.
  1685. * \param filename A file name to sent. Must be an existing file.
  1686. * \param callback A DCC callback function, which will be called when
  1687. * file sent operation is failed, progressed or completed.
  1688. * \param dccid On success, DCC session ID will be stored in this var.
  1689. *
  1690. * \return Return code 0 means success. Other value means error, the error
  1691. * code may be obtained through irc_errno(). Any error, generated by the
  1692. * IRC server, is available through irc_callbacks_t::event_numeric.
  1693. *
  1694. * This function generates a DCC SEND request to send the file. When it is
  1695. * accepted, the file is sent to the remote party, and the DCC session is
  1696. * closed. The send operation progress and result can be checked in
  1697. * callback. See the details in irc_dcc_callback_t declaration.
  1698. *
  1699. * Possible error responces for this command from the RFC1459:
  1700. * - ::LIBIRC_RFC_ERR_NORECIPIENT
  1701. * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
  1702. * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
  1703. * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
  1704. * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
  1705. * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
  1706. * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
  1707. * - ::LIBIRC_RFC_ERR_NOSUCHNICK
  1708. *
  1709. * \sa irc_dcc_callback_t
  1710. * \ingroup dccstuff
  1711. */
  1712. @discardableResult func irc_dcc_sendfile(_ session: Swift.OpaquePointer!, _ ctx: Swift.UnsafeMutableRawPointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ filename: Swift.UnsafePointer<Swift.Int8>!, _ callback: IRC.irc_dcc_callback_t!, _ dccid: Swift.UnsafeMutablePointer<IRC.irc_dcc_t>!) -> Swift.Int32
  1713. /// A 32-bit unsigned integer value
  1714. /// type.
  1715. struct UInt32 : UnsignedInteger, Comparable, Equatable {
  1716. var _value: Builtin.Int32
  1717. /// Create an instance initialized to zero.
  1718. init()
  1719. init(_ _v: Builtin.Int32)
  1720. init(_bits: Builtin.Int32)
  1721. /// Creates an integer from its big-endian representation, changing the
  1722. /// byte order if necessary.
  1723. init(bigEndian value: Swift.UInt32)
  1724. /// Creates an integer from its little-endian representation, changing the
  1725. /// byte order if necessary.
  1726. init(littleEndian value: Swift.UInt32)
  1727. init(_builtinIntegerLiteral value: Builtin.Int2048)
  1728. /// Create an instance initialized to `value`.
  1729. init(integerLiteral value: Swift.UInt32)
  1730. /// Returns the big-endian representation of the integer, changing the
  1731. /// byte order if necessary.
  1732. var bigEndian: Swift.UInt32 {
  1733. get {}
  1734. }
  1735. /// Returns the little-endian representation of the integer, changing the
  1736. /// byte order if necessary.
  1737. var littleEndian: Swift.UInt32 {
  1738. get {}
  1739. }
  1740. /// Returns the current integer with the byte order swapped.
  1741. var byteSwapped: Swift.UInt32 {
  1742. get {}
  1743. }
  1744. static var max: Swift.UInt32 {
  1745. get {}
  1746. }
  1747. static var min: Swift.UInt32 {
  1748. get {}
  1749. }
  1750. static var _sizeInBits: Swift.UInt32 {
  1751. get {}
  1752. }
  1753. static var _sizeInBytes: Swift.UInt32 {
  1754. get {}
  1755. }
  1756. typealias IntegerLiteralType = Swift.UInt32
  1757. typealias Stride = Swift.Int
  1758. typealias _DisallowMixedSignArithmetic = Swift.Int
  1759. }
  1760. extension UInt32 : Hashable {
  1761. /// The hash value.
  1762. ///
  1763. /// **Axiom:** `x == y` implies `x.hashValue == y.hashValue`.
  1764. ///
  1765. /// - Note: The hash value is not guaranteed to be stable across
  1766. /// different invocations of the same program. Do not persist the
  1767. /// hash value across program runs.
  1768. var hashValue: Swift.Int {
  1769. @inline(__always) get {}
  1770. }
  1771. }
  1772. extension UInt32 : CustomStringConvertible {
  1773. /// A textual representation of `self`.
  1774. var description: Swift.String {
  1775. get {}
  1776. }
  1777. }
  1778. extension UInt32 {
  1779. /// Add `lhs` and `rhs`, returning a result and a
  1780. /// `Bool` that is `true` iff the operation caused an arithmetic
  1781. /// overflow.
  1782. static func addWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
  1783. /// Subtract `lhs` and `rhs`, returning a result and a
  1784. /// `Bool` that is `true` iff the operation caused an arithmetic
  1785. /// overflow.
  1786. static func subtractWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
  1787. /// Multiply `lhs` and `rhs`, returning a result and a
  1788. /// `Bool` that is `true` iff the operation caused an arithmetic
  1789. /// overflow.
  1790. static func multiplyWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
  1791. /// Divide `lhs` and `rhs`, returning
  1792. /// a result and a `Bool`
  1793. /// that is `true` iff the operation caused an arithmetic overflow.
  1794. static func divideWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
  1795. /// Divide `lhs` and `rhs`, returning
  1796. /// the remainder and a `Bool`
  1797. /// that is `true` iff the operation caused an arithmetic overflow.
  1798. static func remainderWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
  1799. /// Represent this number using Swift's widest native unsigned
  1800. /// integer type.
  1801. func toUIntMax() -> Swift.UIntMax
  1802. /// Explicitly convert to `IntMax`.
  1803. func toIntMax() -> Swift.IntMax
  1804. }
  1805. extension UInt32 {
  1806. init(_ value: Swift.UInt8)
  1807. @available(*, message: "Converting UInt8 to UInt32 will always succeed.") init?(exactly value: Swift.UInt8)
  1808. }
  1809. extension UInt32 {
  1810. init(_ value: Swift.Int8)
  1811. init?(exactly value: Swift.Int8)
  1812. }
  1813. extension UInt32 {
  1814. init(_ value: Swift.UInt16)
  1815. @available(*, message: "Converting UInt16 to UInt32 will always succeed.") init?(exactly value: Swift.UInt16)
  1816. }
  1817. extension UInt32 {
  1818. init(_ value: Swift.Int16)
  1819. init?(exactly value: Swift.Int16)
  1820. }
  1821. extension UInt32 {
  1822. init(_ value: Swift.UInt32)
  1823. @available(*, message: "Converting UInt32 to UInt32 will always succeed.") init?(exactly value: Swift.UInt32)
  1824. }
  1825. extension UInt32 {
  1826. init(_ value: Swift.Int32)
  1827. init?(exactly value: Swift.Int32)
  1828. }
  1829. extension UInt32 {
  1830. init(_ value: Swift.UInt64)
  1831. init?(exactly value: Swift.UInt64)
  1832. /// Construct a `UInt32` having the same bitwise representation as
  1833. /// the least significant bits of the provided bit pattern.
  1834. ///
  1835. /// No range or overflow checking occurs.
  1836. init(truncatingBitPattern: Swift.UInt64)
  1837. }
  1838. extension UInt32 {
  1839. init(_ value: Swift.Int64)
  1840. init?(exactly value: Swift.Int64)
  1841. /// Construct a `UInt32` having the same bitwise representation as
  1842. /// the least significant bits of the provided bit pattern.
  1843. ///
  1844. /// No range or overflow checking occurs.
  1845. init(truncatingBitPattern: Swift.Int64)
  1846. }
  1847. extension UInt32 {
  1848. init(_ value: Swift.UInt)
  1849. init?(exactly value: Swift.UInt)
  1850. /// Construct a `UInt32` having the same bitwise representation as
  1851. /// the least significant bits of the provided bit pattern.
  1852. ///
  1853. /// No range or overflow checking occurs.
  1854. init(truncatingBitPattern: Swift.UInt)
  1855. }
  1856. extension UInt32 {
  1857. init(_ value: Swift.Int)
  1858. init?(exactly value: Swift.Int)
  1859. /// Construct a `UInt32` having the same bitwise representation as
  1860. /// the least significant bits of the provided bit pattern.
  1861. ///
  1862. /// No range or overflow checking occurs.
  1863. init(truncatingBitPattern: Swift.Int)
  1864. }
  1865. extension UInt32 {
  1866. /// Construct a `UInt32` having the same memory representation as
  1867. /// the `Int32` `bitPattern`. No range or overflow checking
  1868. /// occurs, and the resulting `UInt32` may not have the same numeric
  1869. /// value as `bitPattern`--it is only guaranteed to use the same
  1870. /// pattern of bits.
  1871. init(bitPattern: Swift.Int32)
  1872. }
  1873. extension UInt32 : BitwiseOperations {
  1874. /// The empty bitset of type `UInt32`.
  1875. static var allZeros: Swift.UInt32 {
  1876. get {}
  1877. }
  1878. }
  1879. extension UInt32 {
  1880. typealias _DisabledRangeIndex = Swift.UInt32
  1881. }
  1882. extension UInt32 {
  1883. var signBitIndex: Swift.Int {
  1884. get {}
  1885. }
  1886. var countTrailingZeros: Swift.Int {
  1887. get {}
  1888. }
  1889. }
  1890. extension UInt32 {
  1891. /// Creates a new instance by rounding the given floating-point value toward
  1892. /// zero.
  1893. ///
  1894. /// - Parameter other: A floating-point value. When `other` is rounded toward
  1895. /// zero, the result must be within the range `UInt32.min...UInt32.max`.
  1896. init(_ other: Swift.Float)
  1897. /// Creates a new instance by rounding the given floating-point value toward
  1898. /// zero.
  1899. ///
  1900. /// - Parameter other: A floating-point value. When `other` is rounded toward
  1901. /// zero, the result must be within the range `UInt32.min...UInt32.max`.
  1902. init(_ other: Swift.Double)
  1903. /// Creates a new instance by rounding the given floating-point value toward
  1904. /// zero.
  1905. ///
  1906. /// - Parameter other: A floating-point value. When `other` is rounded toward
  1907. /// zero, the result must be within the range `UInt32.min...UInt32.max`.
  1908. init(_ other: Swift.Float80)
  1909. }
  1910. extension UInt32 {
  1911. /// Construct from an ASCII representation in the given `radix`.
  1912. ///
  1913. /// If `text` does not match the regular expression
  1914. /// "[+-]?[0-9a-zA-Z]+", or the value it denotes in the given `radix`
  1915. /// is not representable, the result is `nil`.
  1916. init?(_ text: Swift.String, radix: Swift.Int = default)
  1917. }
  1918. extension UInt32 : CustomReflectable {
  1919. /// A mirror that reflects the `UInt32` instance.
  1920. var customMirror: Swift.Mirror {
  1921. get {}
  1922. }
  1923. }
  1924. extension UInt32 : CustomPlaygroundQuickLookable {
  1925. var customPlaygroundQuickLook: Swift.PlaygroundQuickLook {
  1926. get {}
  1927. }
  1928. }
  1929. extension UInt32 {
  1930. /// Construct with value `v.value`.
  1931. ///
  1932. /// - Precondition: `v.value` can be represented as UInt32.
  1933. init(_ v: Swift.UnicodeScalar)
  1934. }
  1935. extension UInt32 : CVarArg {
  1936. /// Transform `self` into a series of machine words that can be
  1937. /// appropriately interpreted by C varargs.
  1938. var _cVarArgEncoding: [Swift.Int] {
  1939. get {}
  1940. }
  1941. }
  1942. /*!
  1943. * \fn void irc_destroy_session (irc_session_t * session)
  1944. * \brief Destroys previously created IRC session.
  1945. *
  1946. * \param session A session to destroy. Must not be NULL.
  1947. *
  1948. * This function should be used to destroy an IRC session, close the
  1949. * connection to the IRC server, and free all the used resources. After
  1950. * calling this function, you should not use this session object anymore.
  1951. *
  1952. * \ingroup initclose
  1953. */
  1954. func irc_destroy_session(_ session: Swift.OpaquePointer!)
  1955. /*!
  1956. * \fn void irc_disconnect (irc_session_t * session)
  1957. * \brief Disconnects a connection to IRC server.
  1958. *
  1959. * \param session An IRC session.
  1960. *
  1961. * \return Return code 0 means success. Other value means error, the error
  1962. * code may be obtained through irc_errno().
  1963. *
  1964. * This function closes the IRC connection. After that connection is closed,
  1965. * libircclient automatically leaves irc_run loop.
  1966. *
  1967. * \sa irc_connect irc_run
  1968. * \ingroup conndisc
  1969. */
  1970. func irc_disconnect(_ session: Swift.OpaquePointer!)
  1971. /*!
  1972. * \fn int irc_errno (irc_session_t * session)
  1973. * \brief Returns the last error code.
  1974. *
  1975. * \param session An initiated session.
  1976. *
  1977. * This function returns the last error code associated with last operation
  1978. * of this IRC session. Possible error codes are defined in libirc_errors.h
  1979. *
  1980. * As usual, next errno rules apply:
  1981. * - irc_errno() should be called ONLY if the called function fails;
  1982. * - irc_errno() doesn't return 0 if function succeed; actually, the return
  1983. * value will be undefined.
  1984. * - you should call irc_errno() IMMEDIATELY after function fails, before
  1985. * calling any other libircclient function.
  1986. *
  1987. * \sa irc_strerror
  1988. * \ingroup errors
  1989. */
  1990. @discardableResult func irc_errno(_ session: Swift.OpaquePointer!) -> Swift.Int32
  1991. @convention(c) (Swift.OpaquePointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafeMutablePointer<Swift.UnsafePointer<Swift.Int8>?>?, Swift.UInt32) -> ()
  1992. @convention(c) (Swift.OpaquePointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UInt32) -> ()
  1993. @convention(c) (Swift.OpaquePointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UInt, Swift.UInt32) -> ()
  1994. @convention(c) (Swift.OpaquePointer?, Swift.UInt32, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafeMutablePointer<Swift.UnsafePointer<Swift.Int8>?>?, Swift.UInt32) -> ()
  1995. /*!
  1996. * \fn void * irc_get_ctx (irc_session_t * session)
  1997. * \brief Returns the IRC session context.
  1998. *
  1999. * \param session An initiated session.
  2000. *
  2001. * This function returns the IRC session context, which was set by
  2002. * irc_set_ctx(). If no context was set, this function returns NULL.
  2003. *
  2004. * \sa irc_set_ctx
  2005. * \ingroup contexts
  2006. */
  2007. @discardableResult func irc_get_ctx(_ session: Swift.OpaquePointer!) -> Swift.UnsafeMutableRawPointer!
  2008. /*!
  2009. * \fn void irc_get_version (unsigned int * high, unsigned int * low)
  2010. * \brief Obtains a libircclient version.
  2011. *
  2012. * \param high A pointer to receive the high version part.
  2013. * \param low A pointer to receive the low version part.
  2014. *
  2015. * This function returns the libircclient version. You can use the version either
  2016. * to check whether required options are available, or to output the version.
  2017. * The preferred printf-like format string to output the version is:
  2018. *
  2019. * printf ("Version: %d.%02d", high, low);
  2020. *
  2021. * \ingroup common
  2022. */
  2023. func irc_get_version(_ high: Swift.UnsafeMutablePointer<Swift.UInt32>!, _ low: Swift.UnsafeMutablePointer<Swift.UInt32>!)
  2024. /*!
  2025. * \fn int irc_is_connected (irc_session_t * session)
  2026. * \brief Checks whether the session is connecting/connected to the IRC server.
  2027. *
  2028. * \param session An initialized IRC session.
  2029. *
  2030. * \return Return code 1 means that session is connecting or connected to the
  2031. * IRC server, zero value means that the session has been disconnected.
  2032. *
  2033. * \sa irc_connect irc_run
  2034. * \ingroup conndisc
  2035. */
  2036. @discardableResult func irc_is_connected(_ session: Swift.OpaquePointer!) -> Swift.Int32
  2037. /*!
  2038. * \fn void irc_option_reset (irc_session_t * session, unsigned int option)
  2039. * \brief Resets the libircclient option.
  2040. *
  2041. * \param session An initiated session.
  2042. * \param option An option from libirc_options.h
  2043. *
  2044. * This function removes the previously set libircclient option, changing libircclient
  2045. * behavior. See the option list for the meaning for every option.
  2046. *
  2047. * \sa irc_option_set
  2048. * \ingroup options
  2049. */
  2050. func irc_option_reset(_ session: Swift.OpaquePointer!, _ option: Swift.UInt32)
  2051. /*!
  2052. * \fn void irc_option_set (irc_session_t * session, unsigned int option)
  2053. * \brief Sets the libircclient option.
  2054. *
  2055. * \param session An initiated session.
  2056. * \param option An option from libirc_options.h
  2057. *
  2058. * This function sets the libircclient option, changing libircclient behavior. See the
  2059. * option list for the meaning for every option.
  2060. *
  2061. * \sa irc_option_reset
  2062. * \ingroup options
  2063. */
  2064. func irc_option_set(_ session: Swift.OpaquePointer!, _ option: Swift.UInt32)
  2065. /*!
  2066. * \fn int irc_process_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set)
  2067. * \brief Processes the IRC socket(s), which descriptor(s) are set.
  2068. *
  2069. * \param session An initiated and connected session.
  2070. * \param in_set A FD_IN descriptor set for select()
  2071. * \param out_set A FD_OUT descriptor set for select()
  2072. *
  2073. * \return Return code 0 means success. Other value means error, the error
  2074. * code may be obtained through irc_errno().
  2075. *
  2076. * This function should be used in pair with irc_add_select_descriptors
  2077. * function. See irc_add_select_descriptors description.
  2078. *
  2079. * \sa irc_add_select_descriptors
  2080. * \ingroup running
  2081. */
  2082. @discardableResult func irc_process_select_descriptors(_ session: Swift.OpaquePointer!, _ in_set: Swift.UnsafeMutablePointer<Darwin.fd_set>!, _ out_set: Swift.UnsafeMutablePointer<Darwin.fd_set>!) -> Swift.Int32
  2083. /*!
  2084. * \fn int irc_run (irc_session_t * session)
  2085. * \brief Goes into forever-loop, processing IRC events and generating
  2086. * callbacks.
  2087. *
  2088. * \param session An initiated and connected session.
  2089. *
  2090. * \return Return code 0 means success. Other value means error, the error
  2091. * code may be obtained through irc_errno().
  2092. *
  2093. * This function goes into forever loop, processing the IRC events, and
  2094. * calling appropriate callbacks. This function will not return until the
  2095. * server connection is terminated - either by server, or by calling
  2096. * irc_cmd_quit. This function should be used, if you don't need asynchronous
  2097. * request processing (i.e. your bot just reacts on the events, and doesn't
  2098. * generate it asynchronously). Even in last case, you still can call irc_run,
  2099. * and start the asynchronous thread in event_connect handler. See examples.
  2100. *
  2101. * \ingroup running
  2102. */
  2103. @discardableResult func irc_run(_ session: Swift.OpaquePointer!) -> Swift.Int32
  2104. /*!
  2105. * \fn int irc_send_raw (irc_session_t * session, const char * format, ...)
  2106. * \brief Sends raw data to the IRC server.
  2107. *
  2108. * \param session An initiated and connected session.
  2109. * \param format A printf-formatted string, followed by function args.
  2110. *
  2111. * \return Return code 0 means success. Other value means error, the error
  2112. * code may be obtained through irc_errno(). Any error, generated by the
  2113. * IRC server, is available through irc_callbacks_t::event_numeric.
  2114. *
  2115. * This function sends the raw data as-is to the IRC server. Use it to
  2116. * generate a server command, which is not (yet) provided by libircclient
  2117. * directly.
  2118. *
  2119. * \ingroup ircmd_oth
  2120. */
  2121. @available(*, unavailable, message: "Variadic function is unavailable") func irc_send_raw(_ session: Swift.OpaquePointer!, _ format: Swift.UnsafePointer<Swift.Int8>!, _ varargs: Any...) -> Swift.Int32
  2122. /*!
  2123. * \fn void irc_set_ctcp_version (irc_session_t * session, const char *version)
  2124. * \brief Sets the internal CTCP VERSION
  2125. *
  2126. * \param session an Initiated session.
  2127. * \param version the version to reply
  2128. *
  2129. * This function sets an internal user-defined version to reply on CTCP
  2130. * VERSION request. If none is given, a default one is provided. The parameter
  2131. * version is copied and can be freed by the user.
  2132. *
  2133. * \ingroup contexts
  2134. */
  2135. func irc_set_ctcp_version(_ session: Swift.OpaquePointer!, _ version: Swift.UnsafePointer<Swift.Int8>!)
  2136. /*!
  2137. * \fn void irc_set_ctx (irc_session_t * session, void * ctx)
  2138. * \brief Sets the IRC session context.
  2139. *
  2140. * \param session An initiated session.
  2141. * \param ctx A context.
  2142. *
  2143. * This function sets the user-defined context for this IRC session. This
  2144. * context is not used by libircclient. Its purpose is to store session-specific
  2145. * user data, which may be obtained later by calling irc_get_ctx().
  2146. * Note that libircclient just 'carries out' this pointer. If you allocate some
  2147. * memory, and store its address in ctx (most common usage), it is your
  2148. * responsibility to free it before calling irc_destroy_session().
  2149. *
  2150. * \sa irc_get_ctx
  2151. * \ingroup contexts
  2152. */
  2153. func irc_set_ctx(_ session: Swift.OpaquePointer!, _ ctx: Swift.UnsafeMutableRawPointer!)
  2154. /*!
  2155. * \fn const char * irc_strerror (int ircerrno)
  2156. * \brief Returns the text error message associated with this error code.
  2157. *
  2158. * \param ircerrno A numeric error code returned by irc_errno()
  2159. *
  2160. * This function returns the text representation of the given error code.
  2161. *
  2162. * \sa irc_errno()
  2163. * \ingroup errors
  2164. */
  2165. @discardableResult func irc_strerror(_ ircerrno: Swift.Int32) -> Swift.UnsafePointer<Swift.Int8>!
  2166. /*!
  2167. * \fn void irc_target_get_host (const char * target, char *nick, size_t size)
  2168. * \brief Gets the host part from the target
  2169. *
  2170. * \param target A nick in common IRC server form like tim!root\@mydomain.com
  2171. * \param nick A buffer to hold the nickname.
  2172. * \param size A buffer size. If nick is longer than buffer size, it will
  2173. * be truncated.
  2174. *
  2175. * For most events IRC server returns 'origin' (i.e. the person, who
  2176. * generated this event) in i.e. "common" form, like nick!host\@domain.
  2177. * I don't know any command, which requires host, but it may be useful :)
  2178. * This function parses this origin, and gets the host, storing it into
  2179. * user-provided buffer.
  2180. *
  2181. * \ingroup nnparse
  2182. */
  2183. func irc_target_get_host(_ target: Swift.UnsafePointer<Swift.Int8>!, _ nick: Swift.UnsafeMutablePointer<Swift.Int8>!, _ size: Swift.Int)
  2184. /*!
  2185. * \fn void irc_target_get_nick (const char * target, char *nick, size_t size)
  2186. * \brief Gets the nick part from the target
  2187. *
  2188. * \param target A nick in common IRC server form like tim!root\@mycomain.com
  2189. * \param nick A buffer to hold the nickname.
  2190. * \param size A buffer size. If nick is longer than buffer size, it will
  2191. * be truncated.
  2192. *
  2193. * For most events IRC server returns 'origin' (i.e. the person, who
  2194. * generated this event) in i.e. "common" form, like nick!host\@domain.
  2195. * However, all the irc_cmd_* functions require just a nick/
  2196. * This function parses this origin, and gets the nick, storing it into
  2197. * user-provided buffer.
  2198. * A buffer of size 90 should be enough for most nicks :)
  2199. *
  2200. * \ingroup nnparse
  2201. */
  2202. func irc_target_get_nick(_ target: Swift.UnsafePointer<Swift.Int8>!, _ nick: Swift.UnsafeMutablePointer<Swift.Int8>!, _ size: Swift.Int)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement