Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var LIBIRC_ERR_ACCEPT: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_CLOSED: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_CONNECT: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_CONNECT_SSL_FAILED: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_INVAL: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_MAX: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_NODCCSEND: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_NOIPV6: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_NOMEM: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_OK: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_OPENFILE: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_READ: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_RESOLV: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_SOCKET: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_SSL_CERT_VERIFY_FAILED: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_SSL_INIT_FAILED: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_SSL_NOT_SUPPORTED: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_STATE: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_TERMINATED: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_TIMEOUT: Swift.Int32 {
- get {}
- }
- var LIBIRC_ERR_WRITE: Swift.Int32 {
- get {}
- }
- var LIBIRC_OPTION_DEBUG: Swift.Int32 {
- get {}
- }
- var LIBIRC_OPTION_SSL_NO_VERIFY: Swift.Int32 {
- get {}
- }
- var LIBIRC_OPTION_STRIPNICKS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_ALREADYREGISTRED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_BADCHANMASK: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_BADCHANNELKEY: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_BADMASK: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_BANLISTFULL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_BANNEDFROMCHAN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_CANNOTSENDTOCHAN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_CANTKILLSERVER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_CHANNELISFULL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_CHANOPRIVSNEEDED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_ERRONEUSNICKNAME: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_FILEERROR: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_INVITEONLYCHAN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_KEYSET: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NEEDMOREPARAMS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NICKCOLLISION: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NICKNAMEINUSE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOADMININFO: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOCHANMODES: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOLOGIN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOMOTD: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NONICKNAMEGIVEN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOOPERHOST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOORIGIN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOPERMFORHOST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOPRIVILEGES: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NORECIPIENT: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOSUCHCHANNEL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOSUCHNICK: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOSUCHSERVER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOSUCHSERVICE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOTEXTTOSEND: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOTONCHANNEL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOTOPLEVEL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_NOTREGISTERED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_PASSWDMISMATCH: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_RESTRICTED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_SUMMONDISABLED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_TOOMANYCHANNELS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_TOOMANYTARGETS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_UMODEUNKNOWNFLAG: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_UNAVAILRESOURCE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_UNIQOPPRIVSNEEDED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_UNKNOWNCOMMAND: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_UNKNOWNMODE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_USERNOTINCHANNEL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_USERONCHANNEL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_USERSDISABLED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_USERSDONTMATCH: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_WASNOSUCHNICK: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_WILDTOPLEVEL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_YOUREBANNEDCREEP: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_ERR_YOUWILLBEBANNED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ADMINEMAIL: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ADMINLOC1: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ADMINLOC2: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ADMINME: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_AWAY: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_BANLIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_BOUNCE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_CHANNELMODEIS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_CREATED: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFBANLIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFEXCEPTLIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFINFO: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFINVITELIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFLINKS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFMOTD: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFNAMES: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFSTATS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFUSERS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFWHO: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFWHOIS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ENDOFWHOWAS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_EXCEPTLIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_INFO: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_INVITELIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_INVITING: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_ISON: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LINKS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LISTEND: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LUSERCHANNELS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LUSERCLIENT: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LUSERME: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LUSEROP: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_LUSERUNKNOWN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_MOTD: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_MOTDSTART: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_MYINFO: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_NAMREPLY: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_NOTOPIC: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_NOUSERS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_NOWAWAY: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_REHASHING: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_SERVLIST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_SERVLISTEND: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_STATSCOMMANDS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_STATSLINKINFO: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_STATSOLINE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_STATSUPTIME: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_SUMMONING: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TIME: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TOPIC: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACECLASS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACECONNECTING: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACEEND: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACEHANDSHAKE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACELINK: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACELOG: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACENEWTYPE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACEOPERATOR: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACESERVER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACESERVICE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACEUNKNOWN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRACEUSER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_TRYAGAIN: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_UMODEIS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_UNAWAY: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_UNIQOPIS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_USERHOST: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_USERS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_USERSSTART: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_VERSION: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WELCOME: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WHOISCHANNELS: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WHOISIDLE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WHOISOPERATOR: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WHOISSERVER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WHOISUSER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WHOREPLY: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_WHOWASUSER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_YOUREOPER: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_YOURESERVICE: Swift.Int32 {
- get {}
- }
- var LIBIRC_RFC_RPL_YOURHOST: Swift.Int32 {
- get {}
- }
- /*!
- * \fn int irc_add_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set, int * maxfd)
- * \brief Adds IRC socket(s) for the descriptor set to use in select().
- *
- * \param session An initiated and connected session.
- * \param in_set A FD_IN descriptor set for select()
- * \param out_set A FD_OUT descriptor set for select()
- * \param maxfd A max descriptor found.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function should be used when you already have a program with select()
- * based data processing. You prepare your descriptors, call this function
- * to add session's descriptor(s) into set, and then call select(). When it
- * returns, you should call irc_add_select_descriptors, which sends/recvs all
- * available data, parses received data, calls your callbacks(!), and returns.
- * Then you can process your sockets from set. See the example.
- *
- * \sa irc_process_select_descriptors
- * \ingroup running
- */
- @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
- /*! \brief Event callbacks structure.
- *
- * All the communication with the IRC network is based on events. Generally
- * speaking, event is anything generated by someone else in the network,
- * or by the IRC server itself. "Someone sends you a message", "Someone
- * has joined the channel", "Someone has quits IRC" - all these messages
- * are events.
- *
- * Every event has its own event handler, which is called when the
- * appropriate event is received. You don't have to define all the event
- * handlers; define only the handlers for the events you need to intercept.
- *
- * Most event callbacks are the types of ::irc_event_callback_t. There are
- * also events, which generate ::irc_eventcode_callback_t,
- * ::irc_event_dcc_chat_t and ::irc_event_dcc_send_t callbacks.
- *
- * \ingroup events
- */
- struct irc_callbacks_t {
- /*!
- * The "on_connect" event is triggered when the client successfully
- * connects to the server, and could send commands to the server.
- * No extra params supplied; \a params is 0.
- */
- var event_connect: IRC.irc_event_callback_t!
- /*!
- * The "nick" event is triggered when the client receives a NICK message,
- * meaning that someone (including you) on a channel with the client has
- * changed their nickname.
- *
- * \param origin the person, who changes the nick. Note that it can be you!
- * \param params[0] mandatory, contains the new nick.
- */
- var event_nick: IRC.irc_event_callback_t!
- /*!
- * The "quit" event is triggered upon receipt of a QUIT message, which
- * means that someone on a channel with the client has disconnected.
- *
- * \param origin the person, who is disconnected
- * \param params[0] optional, contains the reason message (user-specified).
- */
- var event_quit: IRC.irc_event_callback_t!
- /*!
- * The "join" event is triggered upon receipt of a JOIN message, which
- * means that someone has entered a channel that the client is on.
- *
- * \param origin the person, who joins the channel. By comparing it with
- * your own nickname, you can check whether your JOIN
- * command succeed.
- * \param params[0] mandatory, contains the channel name.
- */
- var event_join: IRC.irc_event_callback_t!
- /*!
- * The "part" event is triggered upon receipt of a PART message, which
- * means that someone has left a channel that the client is on.
- *
- * \param origin the person, who leaves the channel. By comparing it with
- * your own nickname, you can check whether your PART
- * command succeed.
- * \param params[0] mandatory, contains the channel name.
- * \param params[1] optional, contains the reason message (user-defined).
- */
- var event_part: IRC.irc_event_callback_t!
- /*!
- * The "mode" event is triggered upon receipt of a channel MODE message,
- * which means that someone on a channel with the client has changed the
- * channel's parameters.
- *
- * \param origin the person, who changed the channel mode.
- * \param params[0] mandatory, contains the channel name.
- * \param params[1] mandatory, contains the changed channel mode, like
- * '+t', '-i' and so on.
- * \param params[2] optional, contains the mode argument (for example, a
- * key for +k mode, or user who got the channel operator status for
- * +o mode)
- */
- var event_mode: IRC.irc_event_callback_t!
- /*!
- * The "umode" event is triggered upon receipt of a user MODE message,
- * which means that your user mode has been changed.
- *
- * \param origin the person, who changed the channel mode.
- * \param params[0] mandatory, contains the user changed mode, like
- * '+t', '-i' and so on.
- */
- var event_umode: IRC.irc_event_callback_t!
- /*!
- * The "topic" event is triggered upon receipt of a TOPIC message, which
- * means that someone on a channel with the client has changed the
- * channel's topic.
- *
- * \param origin the person, who changes the channel topic.
- * \param params[0] mandatory, contains the channel name.
- * \param params[1] optional, contains the new topic.
- */
- var event_topic: IRC.irc_event_callback_t!
- /*!
- * The "kick" event is triggered upon receipt of a KICK message, which
- * means that someone on a channel with the client (or possibly the
- * client itself!) has been forcibly ejected.
- *
- * \param origin the person, who kicked the poor.
- * \param params[0] mandatory, contains the channel name.
- * \param params[0] optional, contains the nick of kicked person.
- * \param params[1] optional, contains the kick text
- */
- var event_kick: IRC.irc_event_callback_t!
- /*!
- * The "channel" event is triggered upon receipt of a PRIVMSG message
- * to an entire channel, which means that someone on a channel with
- * the client has said something aloud. Your own messages don't trigger
- * PRIVMSG event.
- *
- * \param origin the person, who generates the message.
- * \param params[0] mandatory, contains the channel name.
- * \param params[1] optional, contains the message text
- */
- var event_channel: IRC.irc_event_callback_t!
- /*!
- * The "privmsg" event is triggered upon receipt of a PRIVMSG message
- * which is addressed to one or more clients, which means that someone
- * is sending the client a private message.
- *
- * \param origin the person, who generates the message.
- * \param params[0] mandatory, contains your nick.
- * \param params[1] optional, contains the message text
- */
- var event_privmsg: IRC.irc_event_callback_t!
- /*!
- * The "notice" event is triggered upon receipt of a NOTICE message
- * which means that someone has sent the client a public or private
- * notice. According to RFC 1459, the only difference between NOTICE
- * and PRIVMSG is that you should NEVER automatically reply to NOTICE
- * messages. Unfortunately, this rule is frequently violated by IRC
- * servers itself - for example, NICKSERV messages require reply, and
- * are NOTICEs.
- *
- * \param origin the person, who generates the message.
- * \param params[0] mandatory, contains the target nick name.
- * \param params[1] optional, contains the message text
- */
- var event_notice: IRC.irc_event_callback_t!
- /*!
- * The "channel_notice" event is triggered upon receipt of a NOTICE
- * message which means that someone has sent the client a public
- * notice. According to RFC 1459, the only difference between NOTICE
- * and PRIVMSG is that you should NEVER automatically reply to NOTICE
- * messages. Unfortunately, this rule is frequently violated by IRC
- * servers itself - for example, NICKSERV messages require reply, and
- * are NOTICEs.
- *
- * \param origin the person, who generates the message.
- * \param params[0] mandatory, contains the channel name.
- * \param params[1] optional, contains the message text
- */
- var event_channel_notice: IRC.irc_event_callback_t!
- /*!
- * The "invite" event is triggered upon receipt of an INVITE message,
- * which means that someone is permitting the client's entry into a +i
- * channel.
- *
- * \param origin the person, who INVITEs you.
- * \param params[0] mandatory, contains your nick.
- * \param params[1] mandatory, contains the channel name you're invited into.
- *
- * \sa irc_cmd_invite irc_cmd_chanmode_invite
- */
- var event_invite: IRC.irc_event_callback_t!
- /*!
- * The "ctcp" event is triggered when the client receives the CTCP
- * request. By default, the built-in CTCP request handler is used. The
- * build-in handler automatically replies on most CTCP messages, so you
- * will rarely need to override it.
- *
- * \param origin the person, who generates the message.
- * \param params[0] mandatory, the complete CTCP message, including its
- * arguments.
- *
- * Mirc generates PING, FINGER, VERSION, TIME and ACTION messages,
- * check the source code of \c libirc_event_ctcp_internal function to
- * see how to write your own CTCP request handler. Also you may find
- * useful this question in FAQ: \ref faq4
- */
- var event_ctcp_req: IRC.irc_event_callback_t!
- /*!
- * The "ctcp" event is triggered when the client receives the CTCP reply.
- *
- * \param origin the person, who generates the message.
- * \param params[0] mandatory, the CTCP message itself with its arguments.
- */
- var event_ctcp_rep: IRC.irc_event_callback_t!
- /*!
- * The "action" event is triggered when the client receives the CTCP
- * ACTION message. These messages usually looks like:\n
- * \code
- * [23:32:55] * Tim gonna sleep.
- * \endcode
- *
- * \param origin the person, who generates the message.
- * \param params[0] mandatory, the ACTION message.
- */
- var event_ctcp_action: IRC.irc_event_callback_t!
- /*!
- * The "unknown" event is triggered upon receipt of any number of
- * unclassifiable miscellaneous messages, which aren't handled by the
- * library.
- */
- var event_unknown: IRC.irc_event_callback_t!
- /*!
- * The "numeric" event is triggered upon receipt of any numeric response
- * from the server. There is a lot of such responses, see the full list
- * here: \ref rfcnumbers.
- *
- * See the params in ::irc_eventcode_callback_t specification.
- */
- var event_numeric: IRC.irc_eventcode_callback_t!
- /*!
- * The "dcc chat" event is triggered when someone requests a DCC CHAT from
- * you.
- *
- * See the params in ::irc_event_dcc_chat_t specification.
- */
- var event_dcc_chat_req: IRC.irc_event_dcc_chat_t!
- /*!
- * The "dcc chat" event is triggered when someone wants to send a file
- * to you via DCC SEND request.
- *
- * See the params in ::irc_event_dcc_send_t specification.
- */
- var event_dcc_send_req: IRC.irc_event_dcc_send_t!
- init() {
- }
- 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!)
- }
- /*!
- * \fn int irc_cmd_channel_mode (irc_session_t * session, const char * channel, const char * mode)
- * \brief Views or changes the channel mode.
- *
- * \param session An initiated and connected session.
- * \param channel A channel name to invite to. Must not be NULL.
- * \param mode A channel mode, described below. If NULL, the channel mode is
- * not changed, just the old mode is returned.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * The irc_cmd_channel_mode() is used to change or view the channel modes.
- * The \a channel mode is returned if the \a mode is NULL. If the \a mode
- * is not NULL, the mode for the \a channel will be changed. Note that,
- * only channel operators can change the channel modes.
- *
- * Channel mode is represended by the letters combination. Every letter has
- * its own meaning in channel modes. Most channel mode letters are boolean
- * (i.e. could only be set or reset), but a few channel mode letters accept a
- * parameter. All channel options are set by adding a plus sign before the
- * letter, and reset by adding a minus sign before the letter.
- *
- * Here is the list of 'standard' channel modes:
- *
- * - \a o \a nickname - gives (+o nick) or takes (-o nick) the channel
- * operator privileges from a \a nickname. This mode affects the
- * users in channel, not the channel itself.
- * Examples: "+o tim", "-o watson".
- *
- * - \a p - sets (+p) or resets (-p) private channel flag.
- * Private channels are shown in channel list as 'Prv', without the topic.
- *
- * - \a s - sets (+p) or resets (-p) secret channel flag.
- * Secret channels aren't shown in channel list at all.
- *
- * - \a i - sets (+i) or resets (-i) invite-only channel flag. When the flag
- * is set, only the people who are invited by irc_cmd_invite(), can
- * join this channel.
- *
- * - \a t - sets (+t) or resets (-t) topic settable by channel operator only
- * flag. When the flag is set, only the channel operators can change the
- * channel topic.
- *
- * - \a n - sets (+n) or resets (-n) the protection from the clients outside
- * the channel. When the \a +n mode is set, only the clients, who are in
- * channel, can send the messages to the channel.
- *
- * - \a m - sets (+m) or resets (-m) the moderation of the channel. When the
- * moderation mode is set, only channel operators and the users who have
- * the \a +v user mode can speak in the channel.
- *
- * - \a v \a nickname - gives (+v nick) or takes (-v nick) from user the
- * ability to speak on a moderated channel.
- * Examples: "+v tim", "-v watson".
- *
- * - \a l \a number - sets (+l 20) or removes (-l) the restriction of maximum
- * users in channel. When the restriction is set, and there is a number
- * of users in the channel, no one can join the channel anymore.
- *
- * - \a k \a key - sets (+k secret) or removes (-k) the password from the
- * channel. When the restriction is set, any user joining the channel
- * required to provide a channel key.
- *
- * - \a b \a mask - sets (+b *!*@*.mil) or removes (-b *!*@*.mil) the ban mask
- * on a user to keep him out of channel. Note that to remove the ban you
- * must specify the ban mask to remove, not just "-b".
- *
- * Note that the actual list of channel modes depends on the IRC server, and
- * can be bigger. If you know the popular channel modes, which aren't
- * mentioned here - please contact me at tim@krasnogorsk.ru
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
- * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_KEYSET
- * - ::LIBIRC_RFC_ERR_UNKNOWNMODE
- * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
- *
- * And the mode information is given using following reply codes:
- * - ::LIBIRC_RFC_RPL_CHANNELMODEIS
- * - ::LIBIRC_RFC_RPL_BANLIST
- * - ::LIBIRC_RFC_RPL_ENDOFBANLIST
- *
- * \sa irc_cmd_topic irc_cmd_list
- * \ingroup ircmd_ch
- */
- @discardableResult func irc_cmd_channel_mode(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!, _ mode: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_ctcp_reply (irc_session_t * session, const char * nick, const char * reply)
- * \brief Generates a reply to the CTCP request.
- *
- * \param session An initiated and connected session.
- * \param nick A target nick to send request to. Must not be NULL.
- * \param reply A reply string. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to send a reply to the CTCP request, generated by
- * irc_callbacks_t::event_ctcp_req. Note that you will not receive this event
- * unless you specify your own handler as \c event_ctcp_req callback during
- * the IRC session initialization.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NORECIPIENT
- * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
- * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
- * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
- * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- *
- * \ingroup ctcp
- */
- @discardableResult func irc_cmd_ctcp_reply(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ reply: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_ctcp_request (irc_session_t * session, const char * nick, const char * request)
- * \brief Generates a CTCP request.
- *
- * \param session An initiated and connected session.
- * \param nick A target nick to send request to. Must not be NULL.
- * \param request A request string. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to send a CTCP request. There are four CTCP requests
- * supported by Mirc:
- * VERSION - get the client software name and version
- * FINGER - get the client username, host and real name.
- * PING - get the client delay.
- * TIME - get the client local time.
- *
- * A reply to the CTCP request will be sent by the irc_callbacks_t::event_ctcp_rep callback;
- * be sure to define it.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NORECIPIENT
- * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
- * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
- * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
- * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- *
- * \sa irc_callbacks_t::event_ctcp_rep irc_callbacks_t::event_numeric
- * \ingroup ctcp
- */
- @discardableResult func irc_cmd_ctcp_request(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ request: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_invite (irc_session_t * session, const char * nick, const char * channel)
- * \brief Invites a user to invite-only channel.
- *
- * \param session An initiated and connected session.
- * \param nick A nick to invite. Must not be NULL.
- * \param channel A channel name to invite to. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to invite someone to invite-only channel.
- * "Invite-only" is a channel mode, which restricts anyone, except invided,
- * to join this channel. After invitation, the user could join this channel.
- * The user, who is invited, will receive the irc_callbacks_t::event_invite event.
- * Note that you must be a channel operator to INVITE the users.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_ERR_USERONCHANNEL
- * - ::LIBIRC_RFC_ERR_ERR_CHANOPRIVSNEEDED
- *
- * And on success one of the following replies returned:
- * - ::LIBIRC_RFC_RPL_INVITING
- * - ::LIBIRC_RFC_RPL_AWAY
- *
- * \sa irc_callbacks_t::event_invite irc_cmd_channel_mode
- * \ingroup ircmd_ch
- */
- @discardableResult func irc_cmd_invite(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_join (irc_session_t * session, const char * channel, const char * key)
- * \brief Joins the new IRC channel.
- *
- * \param session An initiated and connected session.
- * \param channel A channel name to join to. Must not be NULL.
- * \param key Channel password. May be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to JOIN the IRC channel. If the channel is not exist,
- * it will be automatically created by the IRC server. Note that to JOIN the
- * password-protected channel, you must know the password, and specify it in
- * the \a key argument.
- *
- * If join is successful, the irc_callbacks_t::event_join is called (with \a origin ==
- * your nickname), then you are sent the channel's topic
- * (using ::LIBIRC_RFC_RPL_TOPIC) and the list of users who are on the
- * channel (using ::LIBIRC_RFC_RPL_NAMREPLY), which includes the user
- * joining - namely you.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
- * - ::LIBIRC_RFC_ERR_BANNEDFROMCHAN
- * - ::LIBIRC_RFC_ERR_INVITEONLYCHAN
- * - ::LIBIRC_RFC_ERR_BADCHANNELKEY
- * - ::LIBIRC_RFC_ERR_CHANNELISFULL
- * - ::LIBIRC_RFC_ERR_BADCHANMASK
- * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
- * - ::LIBIRC_RFC_ERR_TOOMANYCHANNELS
- *
- * And on success the following replies returned:
- * - ::LIBIRC_RFC_RPL_TOPIC
- * - ::LIBIRC_RFC_RPL_NAMREPLY
- *
- * \ingroup ircmd_ch
- */
- @discardableResult func irc_cmd_join(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!, _ key: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_kick (irc_session_t * session, const char * nick, const char * channel, const char * reason)
- * \brief Kick some lazy ass out of channel.
- *
- * \param session An initiated and connected session.
- * \param nick A nick to kick. Must not be NULL.
- * \param channel A channel to kick this nick out of. Must not be NULL.
- * \param reason A reason to kick. May be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to kick a person out of channel. Note that you must
- * be a channel operator to kick anyone.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
- * - ::LIBIRC_RFC_ERR_BADCHANMASK
- * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED
- *
- * On success the irc_callbacks_t::event_kick event will be generated.
- *
- * \sa irc_callbacks_t::event_numeric
- * \ingroup ircmd_ch
- */
- @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
- /*!
- * \fn int irc_cmd_list (irc_session_t * session, const char * channel)
- * \brief Obtains a list of active server channels with their topics.
- *
- * \param session An initiated and connected session.
- * \param channel A channel name(s) to list. May be NULL, in which case all the
- * channels will be listed. It is possible to specify more than
- * a single channel, but several channel names should be
- * separated by a comma.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to ask the IRC server for the active (existing)
- * channels list. The list will be returned using ::LIBIRC_RFC_RPL_LISTSTART -
- * ::LIBIRC_RFC_RPL_LIST - ::LIBIRC_RFC_RPL_LISTEND sequence.
- * Note that "private" channels are listed (without their topics) as channel
- * "Prv" unless the client generating the LIST query is actually on that
- * channel. Likewise, secret channels are
- * not listed at all unless the client is a member of the channel in question.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NOSUCHSERVER
- *
- * And the channel list is returned using the following reply codes:
- * - ::LIBIRC_RFC_RPL_LISTSTART
- * - ::LIBIRC_RFC_RPL_LISTEND
- * - ::LIBIRC_RFC_RPL_LIST
- *
- * \ingroup ircmd_ch
- */
- @discardableResult func irc_cmd_list(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_me (irc_session_t * session, const char * nch, const char * text)
- * \brief Sends the /me (CTCP ACTION) message to the nick or to the channel.
- *
- * \param session An initiated and connected session.
- * \param nch A target nick or channel. Must not be NULL.
- * \param text Action message text. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to send the /me message to channel or private.
- * As for irc_cmd_msg, the target is determined by \a nch argument.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NORECIPIENT
- * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
- * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
- * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
- * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- *
- * On success there is NOTHING generated.
- * However, a ::LIBIRC_RFC_RPL_AWAY reply can be also generated.
- *
- * \sa irc_cmd_msg
- * \ingroup ircmd_msg
- */
- @discardableResult func irc_cmd_me(_ session: Swift.OpaquePointer!, _ nch: Swift.UnsafePointer<Swift.Int8>!, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn irc_cmd_msg (irc_session_t * session, const char * nch, const char * text)
- * \brief Sends the message to the nick or to the channel.
- *
- * \param session An initiated and connected session.
- * \param nch A target nick or channel. Must not be NULL.
- * \param text Message text. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to send the channel or private messages. The target
- * is determined by \a nch argument: if it describes nick, this will be a
- * private message, if a channel name - public (channel) message. Note that
- * depending on channel modes, you may be required to join the channel to
- * send the channel messages.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NORECIPIENT
- * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
- * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
- * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
- * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- *
- * On success there is NOTHING generated.
- *
- * \ingroup ircmd_msg
- */
- @discardableResult func irc_cmd_msg(_ session: Swift.OpaquePointer!, _ nch: Swift.UnsafePointer<Swift.Int8>!, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_names (irc_session_t * session, const char * channel)
- * \brief Obtains a list of users who're in channel.
- *
- * \param session An initiated and connected session.
- * \param channel A channel name(s) to obtain user list. Must not be NULL.
- * It is possible to specify more than a single channel, but
- * several channel names should be separated by a comma.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to ask the IRC server for the list of the users
- * who're in specified channel. You can list all nicknames that are visible
- * to you on any channel that you can see. The list of users will be returned
- * using ::RPL_NAMREPLY and ::RPL_ENDOFNAMES numeric codes.
- *
- * The channel names are returned by irc_callbacks_t::event_numeric
- * using the following reply codes:
- * - ::LIBIRC_RFC_RPL_NAMREPLY
- * - ::LIBIRC_RFC_RPL_ENDOFNAMES
- *
- * \ingroup ircmd_ch
- */
- @discardableResult func irc_cmd_names(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_nick (irc_session_t * session, const char * newnick)
- * \brief Changes your nick.
- *
- * \param session An initiated and connected session.
- * \param newnick A new nick. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to change your current nick to another nick. Note
- * that such a change is not always possible; for example you cannot change
- * nick to the existing nick, or (on some servers) to the registered nick.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NONICKNAMEGIVEN
- * - ::LIBIRC_RFC_ERR_ERRONEUSNICKNAME
- * - ::LIBIRC_RFC_ERR_NICKNAMEINUSE
- * - ::LIBIRC_RFC_ERR_NICKCOLLISION
- *
- * \ingroup ircmd_oth
- */
- @discardableResult func irc_cmd_nick(_ session: Swift.OpaquePointer!, _ newnick: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_notice (irc_session_t * session, const char * nch, const char * text)
- * \brief Sends the notice to the nick or to the channel.
- *
- * \param session An initiated and connected session.
- * \param nch A target nick or channel. Must not be NULL.
- * \param text Notice text. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to send the channel or private notices. The target
- * is determined by \a nch argument: if it describes nick, this will be a
- * private message, if a channel name - public (channel) message. Note that
- * depending on channel modes, you may be required to join the channel to
- * send the channel notices.
- *
- * The only difference between message and notice is that, according to RFC
- * 1459, you must not automatically reply to NOTICE messages.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NORECIPIENT
- * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
- * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
- * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
- * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- *
- * On success there is NOTHING generated. On notices sent to target nick,
- * a ::LIBIRC_RFC_RPL_AWAY reply may be generated.
- *
- * \sa irc_cmd_msg
- * \ingroup ircmd_msg
- */
- @discardableResult func irc_cmd_notice(_ session: Swift.OpaquePointer!, _ nch: Swift.UnsafePointer<Swift.Int8>!, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_part (irc_session_t * session, const char * channel)
- * \brief Leaves the IRC channel.
- *
- * \param session An initiated and connected session.
- * \param channel A channel name to leave. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function is used to leave the IRC channel you've already joined to.
- * An attempt to leave the channel you aren't in results a ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * server error.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
- * - ::LIBIRC_RFC_ERR_NOSUCHCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- *
- * \ingroup ircmd_ch
- */
- @discardableResult func irc_cmd_part(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_quit (irc_session_t * session, const char * reason)
- * \brief Sends QUIT command to the IRC server.
- *
- * \param session An initiated and connected session.
- * \param reason A reason to quit. May be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function sends the QUIT command to the IRC server. This command
- * forces the IRC server to close the IRC connection, and terminate the
- * session.
- *
- * \ingroup ircmd_oth
- */
- @discardableResult func irc_cmd_quit(_ session: Swift.OpaquePointer!, _ reason: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_topic (irc_session_t * session, const char * channel, const char * topic)
- * \brief Views or changes the channel topic.
- *
- * \param session An initiated and connected session.
- * \param channel A channel name to invite to. Must not be NULL.
- * \param topic A new topic to change. If NULL, the old topic will be
- * returned, and topic won't changed.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * The irc_cmd_topic() is used to change or view the topic of a channel.
- * The topic for \a channel is returned if \a topic is NULL. If the \a topic
- * is not NULL, the topic for the \a channel will be changed. Note that,
- * depending on \a +t channel mode, you may be required to be a channel
- * operator to change the channel topic.
- *
- * If the command succeed, the IRC server will generate a ::RPL_NOTOPIC or
- * ::RPL_TOPIC message, containing either old or changed topic. Also the IRC
- * server can (but not have to) generate the non-RFC ::RPL_TOPIC_EXTRA message,
- * containing the nick of person, who's changed the topic, and the time of
- * latest topic change.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
- * - ::LIBIRC_RFC_ERR_CHANOPRIVSNEEDED
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- *
- * And the topic information is returned using one of following reply codes:
- * - ::LIBIRC_RFC_RPL_NOTOPIC
- * - ::LIBIRC_RFC_RPL_TOPIC
- *
- * \sa irc_callbacks_t::event_topic irc_cmd_channel_mode
- * \ingroup ircmd_ch
- */
- @discardableResult func irc_cmd_topic(_ session: Swift.OpaquePointer!, _ channel: Swift.UnsafePointer<Swift.Int8>!, _ topic: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_user_mode (irc_session_t * session, const char * mode)
- * \brief Views or changes your own user mode.
- *
- * \param session An initiated and connected session.
- * \param mode A user mode, described below. If NULL, the user mode is
- * not changed, just the old mode is returned.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * The irc_cmd_user_mode() is used to change or view the user modes.
- * Note that, unlike channel modes, not all user modes can be changed.
- * The user mode is returned if the \a mode is NULL. If the \a mode
- * is not NULL, the mode for you will be changed, and new mode will be
- * returned.
- *
- * Like channel mode, user mode is also represended by the letters combination.
- * All the user mode letters are boolean (i.e. could only be set or reset),
- * they are set by adding a plus sign before the letter, and reset by adding
- * a minus sign before the letter.
- *
- * Here is the list of 'standard' user modes:
- *
- * - \a o - represents an IRC operator status. Could not be set directly (but
- * can be reset though), to set it use the IRC \a OPER command.
- *
- * - \a i - if set, marks a user as 'invisible' - that is, not seen by lookups
- * if the user is not in a channel.
- *
- * - \a w - if set, marks a user as 'receiving wallops' - special messages
- * generated by IRC operators using WALLOPS command.
- *
- * - \a s - if set, marks a user for receipt of server notices.
- *
- * - \a r - NON-STANDARD MODE. If set, user has been authenticated with
- * NICKSERV IRC service.
- *
- * - \a x - NON-STANDARD MODE. If set, user's real IP is hidden by IRC
- * servers, to prevent scriptkiddies to do nasty things to the user's
- * computer.
- *
- * Note that the actual list of user modes depends on the IRC server, and
- * can be bigger. If you know the popular user modes, which aren't
- * mentioned here - please contact me at tim@krasnogorsk.ru
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NEEDMOREPARAMS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- * - ::LIBIRC_RFC_ERR_UNKNOWNMODE
- * - ::LIBIRC_RFC_ERR_USERSDONTMATCH
- * - ::LIBIRC_RFC_ERR_UMODEUNKNOWNFLAG
- *
- * And the mode information is given using reply code ::LIBIRC_RFC_RPL_UMODEIS
- *
- * \ingroup ircmd_oth
- */
- @discardableResult func irc_cmd_user_mode(_ session: Swift.OpaquePointer!, _ mode: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn int irc_cmd_whois (irc_session_t * session, const char * nick)
- * \brief Queries the information about the nick.
- *
- * \param session An initiated and connected session.
- * \param nick A nick to query the information abour. Must not be NULL.
- * A comma-separated list of several nicknames may be given.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function queries various information about the nick: username, real
- * name, the IRC server used, the channels user is in, idle time, away mode and so on.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NOSUCHSERVER
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- * - ::LIBIRC_RFC_ERR_NONICKNAMEGIVEN
- *
- * And the information is returned using the following reply codes. The whois
- * query is completed when ::LIBIRC_RFC_RPL_ENDOFWHOIS message is received.
- * - ::LIBIRC_RFC_RPL_WHOISUSER
- * - ::LIBIRC_RFC_RPL_WHOISCHANNELS
- * - ::LIBIRC_RFC_RPL_WHOISSERVER
- * - ::LIBIRC_RFC_RPL_AWAY
- * - ::LIBIRC_RFC_RPL_WHOISOPERATOR
- * - ::LIBIRC_RFC_RPL_WHOISIDLE
- * - ::LIBIRC_RFC_RPL_ENDOFWHOIS
- *
- * \ingroup ircmd_oth
- */
- @discardableResult func irc_cmd_whois(_ session: Swift.OpaquePointer!, _ nick: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \fn char * irc_color_convert_from_mirc (const char * message)
- * \brief Converts all the color codes and format options to libircclient colors.
- *
- * \param message A message from IRC
- *
- * \return Returns a new message with converted mIRC color codes and format
- * options. See the irc_color_convert_to_mirc() help to see how the colors
- * are converted.\n
- * Note that the memory for the new message is allocated using malloc(), so
- * you should free it using free() when it is not used anymore. If memory
- * allocation failed, returns 0.
- *
- * \sa irc_color_strip_from_mirc irc_color_convert_to_mirc
- * \ingroup colors
- */
- @discardableResult func irc_color_convert_from_mirc(_ message: Swift.UnsafePointer<Swift.Int8>!) -> Swift.UnsafeMutablePointer<Swift.Int8>!
- /*!
- * \fn char * irc_color_convert_to_mirc (const char * message)
- * \brief Converts all the color codes from libircclient format to mIRC.
- *
- * \param message A message with color codes
- *
- * \return Returns a new message with converted color codes and format
- * options, or 0 if memory could not be allocated. Note that the memory for
- * the new message is allocated using malloc(), so you should free it using
- * free() when it is not used anymore.
- *
- * The color system of libircclient is designed to be easy to use, and
- * portable between different IRC clients. Every color or format option is
- * described using plain text commands written between square brackets. The
- * possible codes are:
- * - [B] ... [/B] - bold format mode. Everything between [B] and [/B] is written in \b bold.
- * - [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).
- * - [U] ... [/U] - underline format mode. Everything between [U] and [/U] is written underlined.
- * - [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).
- * - [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.
- *
- * The supported text colors are:
- * - WHITE
- * - BLACK
- * - DARKBLUE
- * - DARKGREEN
- * - RED
- * - BROWN
- * - PURPLE
- * - OLIVE
- * - YELLOW
- * - GREEN
- * - TEAL
- * - CYAN
- * - BLUE
- * - MAGENTA
- * - DARKGRAY
- * - LIGHTGRAY
- *
- * Examples of color sequences:
- * \code
- * Hello, [B]Tim[/B].
- * [U]Arsenal[/U] got a [COLOR=RED]red card[/COLOR]
- * The tree[U]s[/U] are [COLOR=GREEN/BLACK]green[/COLOR]
- * \endcode
- *
- * \sa irc_color_strip_from_mirc irc_color_convert_from_mirc
- * \ingroup colors
- */
- @discardableResult func irc_color_convert_to_mirc(_ message: Swift.UnsafePointer<Swift.Int8>!) -> Swift.UnsafeMutablePointer<Swift.Int8>!
- /*!
- * \fn char * irc_color_strip_from_mirc (const char * message)
- * \brief Removes all the color codes and format options.
- *
- * \param message A message from IRC
- *
- * \return Returns a new plain text message with stripped mIRC color codes.
- * Note that the memory for the new message is allocated using malloc(), so
- * you should free it using free() when it is not used anymore. If memory
- * allocation failed, returns 0.
- *
- * \sa irc_color_convert_from_mirc irc_color_convert_to_mirc
- * \ingroup colors
- */
- @discardableResult func irc_color_strip_from_mirc(_ message: Swift.UnsafePointer<Swift.Int8>!) -> Swift.UnsafeMutablePointer<Swift.Int8>!
- /*!
- * \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);
- * \brief Initiates a connection to IRC server.
- *
- * \param session A session to initiate connections on. Must not be NULL.
- * \param server A domain name or an IP address of the IRC server to connect to. Cannot be NULL.
- * If the library is built with SSL support and the first character is hash, tries to establish the SSL connection.
- * For example, the connection to "irc.example.com" is assumed to be plaintext, and connection to "#irc.example.com"
- * is assumed to be secured by SSL. Note that SSL will only work if the library is built with the SSL support.
- * \param port An IRC server port, usually 6667.
- * \param server_password An IRC server password, if the server requires it.
- * May be NULL, in this case password will not be send to the
- * IRC server. Vast majority of IRC servers do not require passwords.
- * \param nick A nick, which libircclient will use to login to the IRC server.
- * Must not be NULL.
- * \param username A username of the account, which is used to connect to the
- * IRC server. This is for information only, will be shown in
- * "user properties" dialogs and returned by /whois request.
- * May be NULL, in this case 'nobody' will be sent as username.
- * \param realname A real name of the person, who connects to the IRC. Usually
- * people put some wide-available information here (URL, small
- * description or something else). This information also will
- * be shown in "user properties" dialogs and returned by /whois
- * request. May be NULL, in this case 'noname' will be sent as
- * username.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function prepares and initiates a connection to the IRC server. The
- * connection is done asynchronously (see irc_callbacks_t::event_connect), so the success
- * return value means that connection was initiated (but not completed!)
- * successfully.
- *
- * \sa irc_run
- * \ingroup conndisc
- */
- @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
- /*!
- * \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);
- * \brief Initiates a connection to IRC server using IPv6.
- *
- * \param session A session to initiate connections on. Must not be NULL.
- * \param server A domain name or an IP address of the IRC server to connect to. Cannot be NULL.
- * If the library is built with SSL support and the first character is hash, tries to establish the SSL connection.
- * For example, the connection to "irc.example.com" is assumed to be plaintext, and connection to "#irc.example.com"
- * is assumed to be secured by SSL. Note that SSL will only work if the library is built with the SSL support.
- * \param port An IRC server port, usually 6667.
- * \param server_password An IRC server password, if the server requires it.
- * May be NULL, in this case password will not be send to the
- * IRC server. Vast majority of IRC servers do not require passwords.
- * \param nick A nick, which libircclient will use to login to the IRC server.
- * Must not be NULL.
- * \param username A username of the account, which is used to connect to the
- * IRC server. This is for information only, will be shown in
- * "user properties" dialogs and returned by /whois request.
- * May be NULL, in this case 'nobody' will be sent as username.
- * \param realname A real name of the person, who connects to the IRC. Usually
- * people put some wide-available information here (URL, small
- * description or something else). This information also will
- * be shown in "user properties" dialogs and returned by /whois
- * request. May be NULL, in this case 'noname' will be sent as
- * username.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function prepares and initiates a connection to the IRC server. The
- * connection is done asynchronously (see irc_callbacks_t::event_connect), so the success
- * return value means that connection was initiated (but not completed!)
- * successfully.
- *
- * \sa irc_run
- * \ingroup conndisc
- */
- @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
- /*!
- * \fn irc_session_t * irc_create_session (irc_callbacks_t * callbacks)
- * \brief Creates and initiates a new IRC session.
- *
- * \param callbacks A structure, which defines several callbacks, which will
- * be called on appropriate events. Must not be NULL.
- *
- * \return An ::irc_session_t object, or 0 if creation failed. Usually,
- * failure is caused by out of memory error.
- *
- * Every ::irc_session_t object describes a single IRC session - a connection
- * to an IRC server, and possibly to some DCC clients. Almost every irc_*
- * function requires this object to be passed to, and therefore this function
- * should be called first.
- *
- * Every session created must be destroyed when it is not needed anymore
- * by calling irc_destroy_session().
- *
- * The most common function sequence is:
- * \code
- * ... prepare irc_callbacks_t structure ...
- * irc_create_session();
- * irc_connect();
- * irc_run();
- * irc_destroy_session();
- * \endcode
- *
- * \sa irc_destroy_session
- * \ingroup initclose
- */
- @discardableResult func irc_create_session(_ callbacks: Swift.UnsafeMutablePointer<IRC.irc_callbacks_t>!) -> Swift.OpaquePointer!
- /*!
- * \fn int irc_dcc_accept (irc_session_t * session, irc_dcc_t dccid, void * ctx, irc_dcc_callback_t callback)
- * \brief Accepts a remote DCC CHAT or DCC RECVFILE request.
- *
- * \param session An initiated and connected session.
- * \param dccid A DCC session ID, returned by appropriate callback.
- * \param ctx A user-supplied DCC session context, which will be passed
- * to the DCC callback function. May be NULL.
- * \param callback A DCC callback function, which will be called when
- * anything is said by other party. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function accepts a remote DCC request - either DCC CHAT or DCC FILE.
- * After the request is accepted, the supplied callback will be called,
- * and you can start sending messages or receiving the file.
- *
- * This function should be called only after either event_dcc_chat_req or
- * event_dcc_send_req events are generated, and should react to them. It is
- * possible not to call irc_dcc_accept or irc_dcc_decline immediately in
- * callback function - you may just return, and call it later. However, to
- * prevent memory leaks, you must call either irc_dcc_decline or
- * irc_dcc_accept for any incoming DCC request.
- *
- * \sa irc_dcc_decline event_dcc_chat_req event_dcc_send_req
- * \ingroup dccstuff
- */
- @discardableResult func irc_dcc_accept(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t, _ ctx: Swift.UnsafeMutableRawPointer!, _ callback: IRC.irc_dcc_callback_t!) -> Swift.Int32
- @convention(c) (Swift.OpaquePointer?, Swift.UInt32, Swift.Int32, Swift.UnsafeMutableRawPointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UInt32) -> ()
- /*!
- * \fn int irc_dcc_chat(irc_session_t * session, void * ctx, const char * nick, irc_dcc_callback_t callback, irc_dcc_t * dccid)
- * \brief Initiates a DCC CHAT.
- *
- * \param session An initiated and connected session.
- * \param ctx A user-supplied DCC session context, which will be passed to
- * the DCC callback function. May be NULL.
- * \param nick A nick to DCC CHAT with.
- * \param callback A DCC callback function, which will be called when
- * anything is said by other party. Must not be NULL.
- * \param dccid On success, DCC session ID will be stored in this var.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function requests a DCC CHAT between you and other user. For
- * newbies, DCC chat is like private chat, but it goes directly between
- * two users, and bypasses IRC server. DCC CHAT request must be accepted
- * by other side before you can send anything.
- *
- * When the chat is accepted, terminated, or some data is received, the
- * callback function is called. See the details in irc_dcc_callback_t
- * declaration.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NORECIPIENT
- * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
- * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
- * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
- * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- *
- * \sa irc_dcc_callback_t irc_dcc_msg
- * \ingroup dccstuff
- */
- @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
- /*!
- * \fn int irc_dcc_decline (irc_session_t * session, irc_dcc_t dccid)
- * \brief Declines a remote DCC CHAT or DCC RECVFILE request.
- *
- * \param session An initiated and connected session.
- * \param dccid A DCC session ID, returned by appropriate callback.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function declines a remote DCC request - either DCC CHAT or DCC FILE.
- *
- * This function should be called only after either event_dcc_chat_req or
- * event_dcc_send_req events are generated, and should react to them. It is
- * possible not to call irc_dcc_accept or irc_dcc_decline immediately in
- * callback function - you may just return, and call it later. However, to
- * prevent memory leaks, you must call either irc_dcc_decline or
- * irc_dcc_accept for any incoming DCC request.
- *
- * Do not use this function to close the accepted or initiated DCC session.
- * Use irc_dcc_destroy instead.
- *
- * \sa irc_dcc_accept irc_callbacks_t::event_dcc_chat_req irc_callbacks_t::event_dcc_send_req irc_dcc_destroy
- * \ingroup dccstuff
- */
- @discardableResult func irc_dcc_decline(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t) -> Swift.Int32
- /*!
- * \fn int irc_dcc_destroy (irc_session_t * session, irc_dcc_t dccid)
- * \brief Destroys a DCC session.
- *
- * \param session An initiated and connected session.
- * \param dccid A DCC session ID.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function closes the DCC connection (if available), and destroys
- * the DCC session, freeing the used resources. It can be called in any
- * moment, even from callbacks or from different threads.
- *
- * Note that when DCC session is finished (either with success or failure),
- * you should not destroy it - it will be destroyed automatically.
- *
- * \ingroup dccstuff
- */
- @discardableResult func irc_dcc_destroy(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t) -> Swift.Int32
- /*!
- * \fn int irc_dcc_msg (irc_session_t * session, irc_dcc_t dccid, const char * text)
- * \brief Sends the message to the specific DCC CHAT
- *
- * \param session An IRC session.
- * \param dccid A DCC session ID, which chat request must have been accepted.
- * \param text Message text. Must not be NULL.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function is used to send the DCC CHAT messages. DCC CHAT request
- * must be initiated and accepted first (or just accepted, if initiated by
- * other side).
- *
- * \sa irc_dcc_chat
- * \ingroup dccstuff
- */
- @discardableResult func irc_dcc_msg(_ session: Swift.OpaquePointer!, _ dccid: IRC.irc_dcc_t, _ text: Swift.UnsafePointer<Swift.Int8>!) -> Swift.Int32
- /*!
- * \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)
- * \brief Sends a file via DCC.
- *
- * \param session An initiated and connected session.
- * \param ctx A user-supplied DCC session context, which will be passed to
- * the DCC callback function. May be NULL.
- * \param nick A nick to send file via DCC to.
- * \param filename A file name to sent. Must be an existing file.
- * \param callback A DCC callback function, which will be called when
- * file sent operation is failed, progressed or completed.
- * \param dccid On success, DCC session ID will be stored in this var.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function generates a DCC SEND request to send the file. When it is
- * accepted, the file is sent to the remote party, and the DCC session is
- * closed. The send operation progress and result can be checked in
- * callback. See the details in irc_dcc_callback_t declaration.
- *
- * Possible error responces for this command from the RFC1459:
- * - ::LIBIRC_RFC_ERR_NORECIPIENT
- * - ::LIBIRC_RFC_ERR_NOTEXTTOSEND
- * - ::LIBIRC_RFC_ERR_CANNOTSENDTOCHAN
- * - ::LIBIRC_RFC_ERR_NOTONCHANNEL
- * - ::LIBIRC_RFC_ERR_NOTOPLEVEL
- * - ::LIBIRC_RFC_ERR_WILDTOPLEVEL
- * - ::LIBIRC_RFC_ERR_TOOMANYTARGETS
- * - ::LIBIRC_RFC_ERR_NOSUCHNICK
- *
- * \sa irc_dcc_callback_t
- * \ingroup dccstuff
- */
- @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
- /// A 32-bit unsigned integer value
- /// type.
- struct UInt32 : UnsignedInteger, Comparable, Equatable {
- var _value: Builtin.Int32
- /// Create an instance initialized to zero.
- init()
- init(_ _v: Builtin.Int32)
- init(_bits: Builtin.Int32)
- /// Creates an integer from its big-endian representation, changing the
- /// byte order if necessary.
- init(bigEndian value: Swift.UInt32)
- /// Creates an integer from its little-endian representation, changing the
- /// byte order if necessary.
- init(littleEndian value: Swift.UInt32)
- init(_builtinIntegerLiteral value: Builtin.Int2048)
- /// Create an instance initialized to `value`.
- init(integerLiteral value: Swift.UInt32)
- /// Returns the big-endian representation of the integer, changing the
- /// byte order if necessary.
- var bigEndian: Swift.UInt32 {
- get {}
- }
- /// Returns the little-endian representation of the integer, changing the
- /// byte order if necessary.
- var littleEndian: Swift.UInt32 {
- get {}
- }
- /// Returns the current integer with the byte order swapped.
- var byteSwapped: Swift.UInt32 {
- get {}
- }
- static var max: Swift.UInt32 {
- get {}
- }
- static var min: Swift.UInt32 {
- get {}
- }
- static var _sizeInBits: Swift.UInt32 {
- get {}
- }
- static var _sizeInBytes: Swift.UInt32 {
- get {}
- }
- typealias IntegerLiteralType = Swift.UInt32
- typealias Stride = Swift.Int
- typealias _DisallowMixedSignArithmetic = Swift.Int
- }
- extension UInt32 : Hashable {
- /// The hash value.
- ///
- /// **Axiom:** `x == y` implies `x.hashValue == y.hashValue`.
- ///
- /// - Note: The hash value is not guaranteed to be stable across
- /// different invocations of the same program. Do not persist the
- /// hash value across program runs.
- var hashValue: Swift.Int {
- @inline(__always) get {}
- }
- }
- extension UInt32 : CustomStringConvertible {
- /// A textual representation of `self`.
- var description: Swift.String {
- get {}
- }
- }
- extension UInt32 {
- /// Add `lhs` and `rhs`, returning a result and a
- /// `Bool` that is `true` iff the operation caused an arithmetic
- /// overflow.
- static func addWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
- /// Subtract `lhs` and `rhs`, returning a result and a
- /// `Bool` that is `true` iff the operation caused an arithmetic
- /// overflow.
- static func subtractWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
- /// Multiply `lhs` and `rhs`, returning a result and a
- /// `Bool` that is `true` iff the operation caused an arithmetic
- /// overflow.
- static func multiplyWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
- /// Divide `lhs` and `rhs`, returning
- /// a result and a `Bool`
- /// that is `true` iff the operation caused an arithmetic overflow.
- static func divideWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
- /// Divide `lhs` and `rhs`, returning
- /// the remainder and a `Bool`
- /// that is `true` iff the operation caused an arithmetic overflow.
- static func remainderWithOverflow(_ lhs: Swift.UInt32, _ rhs: Swift.UInt32) -> (Swift.UInt32, overflow: Swift.Bool)
- /// Represent this number using Swift's widest native unsigned
- /// integer type.
- func toUIntMax() -> Swift.UIntMax
- /// Explicitly convert to `IntMax`.
- func toIntMax() -> Swift.IntMax
- }
- extension UInt32 {
- init(_ value: Swift.UInt8)
- @available(*, message: "Converting UInt8 to UInt32 will always succeed.") init?(exactly value: Swift.UInt8)
- }
- extension UInt32 {
- init(_ value: Swift.Int8)
- init?(exactly value: Swift.Int8)
- }
- extension UInt32 {
- init(_ value: Swift.UInt16)
- @available(*, message: "Converting UInt16 to UInt32 will always succeed.") init?(exactly value: Swift.UInt16)
- }
- extension UInt32 {
- init(_ value: Swift.Int16)
- init?(exactly value: Swift.Int16)
- }
- extension UInt32 {
- init(_ value: Swift.UInt32)
- @available(*, message: "Converting UInt32 to UInt32 will always succeed.") init?(exactly value: Swift.UInt32)
- }
- extension UInt32 {
- init(_ value: Swift.Int32)
- init?(exactly value: Swift.Int32)
- }
- extension UInt32 {
- init(_ value: Swift.UInt64)
- init?(exactly value: Swift.UInt64)
- /// Construct a `UInt32` having the same bitwise representation as
- /// the least significant bits of the provided bit pattern.
- ///
- /// No range or overflow checking occurs.
- init(truncatingBitPattern: Swift.UInt64)
- }
- extension UInt32 {
- init(_ value: Swift.Int64)
- init?(exactly value: Swift.Int64)
- /// Construct a `UInt32` having the same bitwise representation as
- /// the least significant bits of the provided bit pattern.
- ///
- /// No range or overflow checking occurs.
- init(truncatingBitPattern: Swift.Int64)
- }
- extension UInt32 {
- init(_ value: Swift.UInt)
- init?(exactly value: Swift.UInt)
- /// Construct a `UInt32` having the same bitwise representation as
- /// the least significant bits of the provided bit pattern.
- ///
- /// No range or overflow checking occurs.
- init(truncatingBitPattern: Swift.UInt)
- }
- extension UInt32 {
- init(_ value: Swift.Int)
- init?(exactly value: Swift.Int)
- /// Construct a `UInt32` having the same bitwise representation as
- /// the least significant bits of the provided bit pattern.
- ///
- /// No range or overflow checking occurs.
- init(truncatingBitPattern: Swift.Int)
- }
- extension UInt32 {
- /// Construct a `UInt32` having the same memory representation as
- /// the `Int32` `bitPattern`. No range or overflow checking
- /// occurs, and the resulting `UInt32` may not have the same numeric
- /// value as `bitPattern`--it is only guaranteed to use the same
- /// pattern of bits.
- init(bitPattern: Swift.Int32)
- }
- extension UInt32 : BitwiseOperations {
- /// The empty bitset of type `UInt32`.
- static var allZeros: Swift.UInt32 {
- get {}
- }
- }
- extension UInt32 {
- typealias _DisabledRangeIndex = Swift.UInt32
- }
- extension UInt32 {
- var signBitIndex: Swift.Int {
- get {}
- }
- var countTrailingZeros: Swift.Int {
- get {}
- }
- }
- extension UInt32 {
- /// Creates a new instance by rounding the given floating-point value toward
- /// zero.
- ///
- /// - Parameter other: A floating-point value. When `other` is rounded toward
- /// zero, the result must be within the range `UInt32.min...UInt32.max`.
- init(_ other: Swift.Float)
- /// Creates a new instance by rounding the given floating-point value toward
- /// zero.
- ///
- /// - Parameter other: A floating-point value. When `other` is rounded toward
- /// zero, the result must be within the range `UInt32.min...UInt32.max`.
- init(_ other: Swift.Double)
- /// Creates a new instance by rounding the given floating-point value toward
- /// zero.
- ///
- /// - Parameter other: A floating-point value. When `other` is rounded toward
- /// zero, the result must be within the range `UInt32.min...UInt32.max`.
- init(_ other: Swift.Float80)
- }
- extension UInt32 {
- /// Construct from an ASCII representation in the given `radix`.
- ///
- /// If `text` does not match the regular expression
- /// "[+-]?[0-9a-zA-Z]+", or the value it denotes in the given `radix`
- /// is not representable, the result is `nil`.
- init?(_ text: Swift.String, radix: Swift.Int = default)
- }
- extension UInt32 : CustomReflectable {
- /// A mirror that reflects the `UInt32` instance.
- var customMirror: Swift.Mirror {
- get {}
- }
- }
- extension UInt32 : CustomPlaygroundQuickLookable {
- var customPlaygroundQuickLook: Swift.PlaygroundQuickLook {
- get {}
- }
- }
- extension UInt32 {
- /// Construct with value `v.value`.
- ///
- /// - Precondition: `v.value` can be represented as UInt32.
- init(_ v: Swift.UnicodeScalar)
- }
- extension UInt32 : CVarArg {
- /// Transform `self` into a series of machine words that can be
- /// appropriately interpreted by C varargs.
- var _cVarArgEncoding: [Swift.Int] {
- get {}
- }
- }
- /*!
- * \fn void irc_destroy_session (irc_session_t * session)
- * \brief Destroys previously created IRC session.
- *
- * \param session A session to destroy. Must not be NULL.
- *
- * This function should be used to destroy an IRC session, close the
- * connection to the IRC server, and free all the used resources. After
- * calling this function, you should not use this session object anymore.
- *
- * \ingroup initclose
- */
- func irc_destroy_session(_ session: Swift.OpaquePointer!)
- /*!
- * \fn void irc_disconnect (irc_session_t * session)
- * \brief Disconnects a connection to IRC server.
- *
- * \param session An IRC session.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function closes the IRC connection. After that connection is closed,
- * libircclient automatically leaves irc_run loop.
- *
- * \sa irc_connect irc_run
- * \ingroup conndisc
- */
- func irc_disconnect(_ session: Swift.OpaquePointer!)
- /*!
- * \fn int irc_errno (irc_session_t * session)
- * \brief Returns the last error code.
- *
- * \param session An initiated session.
- *
- * This function returns the last error code associated with last operation
- * of this IRC session. Possible error codes are defined in libirc_errors.h
- *
- * As usual, next errno rules apply:
- * - irc_errno() should be called ONLY if the called function fails;
- * - irc_errno() doesn't return 0 if function succeed; actually, the return
- * value will be undefined.
- * - you should call irc_errno() IMMEDIATELY after function fails, before
- * calling any other libircclient function.
- *
- * \sa irc_strerror
- * \ingroup errors
- */
- @discardableResult func irc_errno(_ session: Swift.OpaquePointer!) -> Swift.Int32
- @convention(c) (Swift.OpaquePointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafeMutablePointer<Swift.UnsafePointer<Swift.Int8>?>?, Swift.UInt32) -> ()
- @convention(c) (Swift.OpaquePointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UInt32) -> ()
- @convention(c) (Swift.OpaquePointer?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafePointer<Swift.Int8>?, Swift.UInt, Swift.UInt32) -> ()
- @convention(c) (Swift.OpaquePointer?, Swift.UInt32, Swift.UnsafePointer<Swift.Int8>?, Swift.UnsafeMutablePointer<Swift.UnsafePointer<Swift.Int8>?>?, Swift.UInt32) -> ()
- /*!
- * \fn void * irc_get_ctx (irc_session_t * session)
- * \brief Returns the IRC session context.
- *
- * \param session An initiated session.
- *
- * This function returns the IRC session context, which was set by
- * irc_set_ctx(). If no context was set, this function returns NULL.
- *
- * \sa irc_set_ctx
- * \ingroup contexts
- */
- @discardableResult func irc_get_ctx(_ session: Swift.OpaquePointer!) -> Swift.UnsafeMutableRawPointer!
- /*!
- * \fn void irc_get_version (unsigned int * high, unsigned int * low)
- * \brief Obtains a libircclient version.
- *
- * \param high A pointer to receive the high version part.
- * \param low A pointer to receive the low version part.
- *
- * This function returns the libircclient version. You can use the version either
- * to check whether required options are available, or to output the version.
- * The preferred printf-like format string to output the version is:
- *
- * printf ("Version: %d.%02d", high, low);
- *
- * \ingroup common
- */
- func irc_get_version(_ high: Swift.UnsafeMutablePointer<Swift.UInt32>!, _ low: Swift.UnsafeMutablePointer<Swift.UInt32>!)
- /*!
- * \fn int irc_is_connected (irc_session_t * session)
- * \brief Checks whether the session is connecting/connected to the IRC server.
- *
- * \param session An initialized IRC session.
- *
- * \return Return code 1 means that session is connecting or connected to the
- * IRC server, zero value means that the session has been disconnected.
- *
- * \sa irc_connect irc_run
- * \ingroup conndisc
- */
- @discardableResult func irc_is_connected(_ session: Swift.OpaquePointer!) -> Swift.Int32
- /*!
- * \fn void irc_option_reset (irc_session_t * session, unsigned int option)
- * \brief Resets the libircclient option.
- *
- * \param session An initiated session.
- * \param option An option from libirc_options.h
- *
- * This function removes the previously set libircclient option, changing libircclient
- * behavior. See the option list for the meaning for every option.
- *
- * \sa irc_option_set
- * \ingroup options
- */
- func irc_option_reset(_ session: Swift.OpaquePointer!, _ option: Swift.UInt32)
- /*!
- * \fn void irc_option_set (irc_session_t * session, unsigned int option)
- * \brief Sets the libircclient option.
- *
- * \param session An initiated session.
- * \param option An option from libirc_options.h
- *
- * This function sets the libircclient option, changing libircclient behavior. See the
- * option list for the meaning for every option.
- *
- * \sa irc_option_reset
- * \ingroup options
- */
- func irc_option_set(_ session: Swift.OpaquePointer!, _ option: Swift.UInt32)
- /*!
- * \fn int irc_process_select_descriptors (irc_session_t * session, fd_set *in_set, fd_set *out_set)
- * \brief Processes the IRC socket(s), which descriptor(s) are set.
- *
- * \param session An initiated and connected session.
- * \param in_set A FD_IN descriptor set for select()
- * \param out_set A FD_OUT descriptor set for select()
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function should be used in pair with irc_add_select_descriptors
- * function. See irc_add_select_descriptors description.
- *
- * \sa irc_add_select_descriptors
- * \ingroup running
- */
- @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
- /*!
- * \fn int irc_run (irc_session_t * session)
- * \brief Goes into forever-loop, processing IRC events and generating
- * callbacks.
- *
- * \param session An initiated and connected session.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno().
- *
- * This function goes into forever loop, processing the IRC events, and
- * calling appropriate callbacks. This function will not return until the
- * server connection is terminated - either by server, or by calling
- * irc_cmd_quit. This function should be used, if you don't need asynchronous
- * request processing (i.e. your bot just reacts on the events, and doesn't
- * generate it asynchronously). Even in last case, you still can call irc_run,
- * and start the asynchronous thread in event_connect handler. See examples.
- *
- * \ingroup running
- */
- @discardableResult func irc_run(_ session: Swift.OpaquePointer!) -> Swift.Int32
- /*!
- * \fn int irc_send_raw (irc_session_t * session, const char * format, ...)
- * \brief Sends raw data to the IRC server.
- *
- * \param session An initiated and connected session.
- * \param format A printf-formatted string, followed by function args.
- *
- * \return Return code 0 means success. Other value means error, the error
- * code may be obtained through irc_errno(). Any error, generated by the
- * IRC server, is available through irc_callbacks_t::event_numeric.
- *
- * This function sends the raw data as-is to the IRC server. Use it to
- * generate a server command, which is not (yet) provided by libircclient
- * directly.
- *
- * \ingroup ircmd_oth
- */
- @available(*, unavailable, message: "Variadic function is unavailable") func irc_send_raw(_ session: Swift.OpaquePointer!, _ format: Swift.UnsafePointer<Swift.Int8>!, _ varargs: Any...) -> Swift.Int32
- /*!
- * \fn void irc_set_ctcp_version (irc_session_t * session, const char *version)
- * \brief Sets the internal CTCP VERSION
- *
- * \param session an Initiated session.
- * \param version the version to reply
- *
- * This function sets an internal user-defined version to reply on CTCP
- * VERSION request. If none is given, a default one is provided. The parameter
- * version is copied and can be freed by the user.
- *
- * \ingroup contexts
- */
- func irc_set_ctcp_version(_ session: Swift.OpaquePointer!, _ version: Swift.UnsafePointer<Swift.Int8>!)
- /*!
- * \fn void irc_set_ctx (irc_session_t * session, void * ctx)
- * \brief Sets the IRC session context.
- *
- * \param session An initiated session.
- * \param ctx A context.
- *
- * This function sets the user-defined context for this IRC session. This
- * context is not used by libircclient. Its purpose is to store session-specific
- * user data, which may be obtained later by calling irc_get_ctx().
- * Note that libircclient just 'carries out' this pointer. If you allocate some
- * memory, and store its address in ctx (most common usage), it is your
- * responsibility to free it before calling irc_destroy_session().
- *
- * \sa irc_get_ctx
- * \ingroup contexts
- */
- func irc_set_ctx(_ session: Swift.OpaquePointer!, _ ctx: Swift.UnsafeMutableRawPointer!)
- /*!
- * \fn const char * irc_strerror (int ircerrno)
- * \brief Returns the text error message associated with this error code.
- *
- * \param ircerrno A numeric error code returned by irc_errno()
- *
- * This function returns the text representation of the given error code.
- *
- * \sa irc_errno()
- * \ingroup errors
- */
- @discardableResult func irc_strerror(_ ircerrno: Swift.Int32) -> Swift.UnsafePointer<Swift.Int8>!
- /*!
- * \fn void irc_target_get_host (const char * target, char *nick, size_t size)
- * \brief Gets the host part from the target
- *
- * \param target A nick in common IRC server form like tim!root\@mydomain.com
- * \param nick A buffer to hold the nickname.
- * \param size A buffer size. If nick is longer than buffer size, it will
- * be truncated.
- *
- * For most events IRC server returns 'origin' (i.e. the person, who
- * generated this event) in i.e. "common" form, like nick!host\@domain.
- * I don't know any command, which requires host, but it may be useful :)
- * This function parses this origin, and gets the host, storing it into
- * user-provided buffer.
- *
- * \ingroup nnparse
- */
- func irc_target_get_host(_ target: Swift.UnsafePointer<Swift.Int8>!, _ nick: Swift.UnsafeMutablePointer<Swift.Int8>!, _ size: Swift.Int)
- /*!
- * \fn void irc_target_get_nick (const char * target, char *nick, size_t size)
- * \brief Gets the nick part from the target
- *
- * \param target A nick in common IRC server form like tim!root\@mycomain.com
- * \param nick A buffer to hold the nickname.
- * \param size A buffer size. If nick is longer than buffer size, it will
- * be truncated.
- *
- * For most events IRC server returns 'origin' (i.e. the person, who
- * generated this event) in i.e. "common" form, like nick!host\@domain.
- * However, all the irc_cmd_* functions require just a nick/
- * This function parses this origin, and gets the nick, storing it into
- * user-provided buffer.
- * A buffer of size 90 should be enough for most nicks :)
- *
- * \ingroup nnparse
- */
- 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