Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
Create a new
irc-object
.
Default values.
Access the corresponding field of
irc-object
obj.
Set the field of
irc-object
obj. set-port! expects a valid port number, all others expect a string. Using the empty string will reset the values to their defaults (see make-irc). The return value is not specified.Note that it is not possible to set a value when connected. Trying to do so will result in an error.
Connect
irc-object
obj to server, and try to register (PASS USER NICK sequence). Failure to connect results in an error.Note that there is no nick collision detection yet, so make sure you use a `free' nick.
Send the
JOIN
command.Currently there is no error checking implemented, so a rejected join still shows in the channel list.
(let ([sock (_socket obj)]) (while (not (port-closed? sock)) (handle-message obj (do-wait obj))))
Remove the procedure with tag tag from the message-hook of
irc-object
obj.
Apply all procedures from the message-hook of
irc-object
obj to the arguments arg .The order of the procedure application is first to last. The return value of this procedure is not specified.
Messages are parsed according to the 'pseudo' BNF in RFC 1459 (http://www.ietf.org/rfc/rfc1459.txt).
<message> ::= [':' <prefix> <SPACE> ] <command> <params> <crlf> <prefix> ::= <servername> | <nick> [ '!' <user> ] [ '@' <host> ] <command> ::= <letter> { <letter> } | <number> <number> <number> <SPACE> ::= ' ' { ' ' } <params> ::= <SPACE> [ ':' <trailing> | <middle> <params> ] <middle> ::= <Any *non-empty* sequence of octets not including SPACE or NUL or CR or LF, the first of which may not be ':'> <trailing> ::= <Any, possibly *empty*, sequence of octets not including NUL or CR or LF> <crlf> ::= CR LF
Return the prefix part of
message-object
msg.Either '(user nick host), server or #f.
Returns 'USER if the message was send by a user, 'SERVER if the message was send by a server and #f otherwise.
Find the source or
message-object
msg. If the source is found the return value is a string, otherwise it is#f
.