(index ("irc:connection" 0) ("irc:connection?" 1060) ("irc:connection-in" 1223) ("irc:connection-out" 1223) ("irc:connection-server" 1223) ("irc:connection-nick" 1223) ("irc:connection-user" 1223) ("irc:connection-real-name" 1223) ("irc:connection-port" 1223) ("irc:connection-channels" 1223) ("irc:connection-log-file" 1223) ("irc:connection-reconnect-timeout" 1223) ("irc:connection-password" 1223) ("irc:connection-reconnect?" 1223) ("irc:connection-raw-filter-set!" 2378) ("irc:connect" 2772) ("irc:connect" 2772) ("irc:disconnect" 3213) ("irc:reconnect" 3338) ("irc:connected?" 3536) ("irc:quit" 3728) ("irc:join" 3987) ("irc:part" 4139) ("irc:leave" 4139) ("irc:nick" 4372) ("irc:say" 4514) ("irc:notice" 4959) ("irc:action" 5131) ("irc:command" 5310) ("irc:listen" 5437) ("irc:message?" 5751) ("irc:message-prefix" 5905) ("irc:message-command" 5905) ("irc:message-timestamp" 5905) ("irc:message-code" 5905) ("irc:message-body" 5905) ("irc:message-parameters" 5905) ("irc:message-index" 5905) ("irc:message-sender" 7138) ("irc:message-receiver" 7138) ("irc:extended-data?" 7424) ("irc:extended-data-tag" 7597) ("irc:extended-data-content" 7597) ("irc:wait" 7850) ("irc:process-message" 8014) ("irc:run-message-loop" 8354) ("irc:add-message-handler!" 9335) ("irc:remove-message-handler!" 10587))
(def (sig (procedure "(irc:connection #!key user password server nick real-name port log-traffic ping-timeout reconnect reconnect-timeout)" (id irc:connection))) (p "Returns a " (i "connection") " object, where the following keyword arguments specify the connection parameters:") (table (tr (th "keyword") (th "argument type") (th "default")) "\n" (tr (td (tt "user")) (td "string") (td (tt "nobody"))) "\n" (tr (td (tt "password")) (td "string") (td (i "none"))) "\n" (tr (td (tt "server")) (td "string") (td (i "none"))) "\n" (tr (td (tt "nick")) (td "string") (td "some random symbol")) "\n" (tr (td (tt "real-name")) (td "string") (td "same as the " (tt "user") " parameter")) "\n" (tr (td (tt "port")) (td "integer") (td "6667")) "\n" (tr (td (tt "log-traffic")) (td "port or #f") (td "#f")) "\n" (tr (td (tt "reconnect-timeout")) (td "milliseconds (integer)") (td "3600000")) "\n" (tr (td (tt "reconnect")) (td "boolean") (td "#f"))) (p "A server must be provided in any case.") (p "The connection object can be queried using the following accessors:"))
(def (sig (procedure "(irc:connection? X)" (id irc:connection?))) (p "Returns " (tt "#t") " if " (tt "X") " is a connection object, or " (tt "#f") " otherwise."))
(def (sig (procedure "(irc:connection-in CONNECTION)" (id irc:connection-in)) (procedure "(irc:connection-out CONNECTION)" (id irc:connection-out)) (procedure "(irc:connection-server CONNECTION)" (id irc:connection-server)) (procedure "(irc:connection-nick CONNECTION)" (id irc:connection-nick)) (procedure "(irc:connection-user CONNECTION)" (id irc:connection-user)) (procedure "(irc:connection-real-name CONNECTION)" (id irc:connection-real-name)) (procedure "(irc:connection-port CONNECTION)" (id irc:connection-port)) (procedure "(irc:connection-channels CONNECTION)" (id irc:connection-channels)) (procedure "(irc:connection-log-file CONNECTION)" (id irc:connection-log-file)) (procedure "(irc:connection-reconnect-timeout CONNECTION)" (id irc:connection-reconnect-timeout)) (procedure "(irc:connection-password CONNECTION)" (id irc:connection-password)) (procedure "(irc:connection-reconnect? CONNECTION)" (id irc:connection-reconnect?))) (p "Accessors for values stored in a connection object. The " (tt "in") " and " (tt "out") " values are ports, " (tt "port") " is an integer, " (tt "channel") " is a string and all other values are strings."))
(def (sig (procedure "(irc:connection-raw-filter-set! CONNECTION PROC)" (id irc:connection-raw-filter-set!))) (p "When set, then each line of received input will first be processed by the one argument procedure " (tt "PROC") ", and the result be passed to the message deconstruction machinery instead. Use this facility to perform very low level pre-processing of input from the IRC server."))
(def (sig (procedure "(irc:connect CONNECTION)" (id irc:connect)) (procedure "(irc:connect #!key KEYWORD ...)" (id irc:connect))) (p "Connects to an IRC server, with the parameters given in the connection object " (tt "CONNECTION") " or via the parameters passed as keywords arguments (just like in the call to " (tt "irc:connection") ").  Returns the connection object. A connection can only be made to a single server at the same time."))
(def (sig (procedure "(irc:disconnect CONNECTION)" (id irc:disconnect))) (p "Disconnects any currently active connection."))
(def (sig (procedure "(irc:reconnect CONNECTION)" (id irc:reconnect))) (p "Disconnect and reconnect to " (tt "CONNECTION") ", automatically re-joining all channels that we have currently joined."))
(def (sig (procedure "(irc:connected? CONNECTION)" (id irc:connected?))) (p "Returns " (tt "#t") " if there exists an open connection for " (tt "CONNECTION") ", or " (tt "#f") " otherwise."))
(def (sig (procedure "(irc:quit CONNECTION [MESSAGE])" (id irc:quit))) (p "Sends a " (tt "QUIT") " message to the IRC server (optionally with the text " (tt "MESSAGE") ") and closes the connection designated by the connection object " (tt "CONNECTION") "."))
(def (sig (procedure "(irc:join CONNECTION CHANNEL)" (id irc:join))) (p "Sends " (tt "JOIN") " messages for the given " (tt "CHANNEL") " (a string)."))
(def (sig (procedure "(irc:part CONNECTION CHANNEL)" (id irc:part)) (procedure "(irc:leave CONNECTION CHANNEL)" (id irc:leave))) (p "Leaves the channels given in the string " (tt "CHANNEL") " by sending a " (tt "PART") " message."))
(def (sig (procedure "(irc:nick CONNECTION NICK)" (id irc:nick))) (p "Changes the nickname to the one given in the string " (tt "NICK") "."))
(def (sig (procedure "(irc:say CONNECTION MESSAGE DESTINATION ...)" (id irc:say))) (p "Sends the string " (tt "MESSAGE") " via a " (tt "PRIVMSG") " command to the given destinations, which should be strings designating either channels or nicknames. If no destinations are given, the message is sent to the last channel that has been joined. The message is split into multiple " (tt "PRIVMSG") " operations, if it contains newline characters."))
(def (sig (procedure "(irc:notice CONNECTION MESSAGE DESTINATION ...)" (id irc:notice))) (p "Similar to " (tt "irc:say") " but uses a " (tt "NOTICE") " command instead."))
(def (sig (procedure "(irc:action CONNECTION MESSAGE DESTINATION ...)" (id irc:action))) (p "Similar to " (tt "irc:say") " but Sends an \"action\" instead of a normal message."))
(def (sig (procedure "(irc:command CONNECTION STRING)" (id irc:command))) (p "Sends an arbitrary IRC command to the server."))
(def (sig (procedure "(irc:listen CONNECTION)" (id irc:listen))) (p "If data is available for reading, then the incoming message is parsed and a \"message\" object is returned.  If no data is currently available, " (tt "#f") " is returned.") (p "The message object can be queried with the following procedures:"))
(def (sig (procedure "(irc:message? X)" (id irc:message?))) (p "Returns " (tt "#t") " if " (tt "X") " is a message object, or " (tt "#f") " otherwise."))
(def (sig (procedure "(irc:message-prefix MESSAGE)" (id irc:message-prefix)) (procedure "(irc:message-command MESSAGE)" (id irc:message-command)) (procedure "(irc:message-timestamp MESSAGE)" (id irc:message-timestamp)) (procedure "(irc:message-code MESSAGE)" (id irc:message-code)) (procedure "(irc:message-body MESSAGE)" (id irc:message-body)) (procedure "(irc:message-parameters MESSAGE)" (id irc:message-parameters)) (procedure "(irc:message-index MESSAGE)" (id irc:message-index))) (p "Return the components of a message object. The prefix is either a list of the form " (tt "(SERVERNAME)") " or a list containing the message prefix of the form " (tt "(NICK USER HOST)") " (all values are strings).  The timestamp holds the current number of seconds (as returned by " (tt "(current-seconds)") ") at the point when the message was parsed. The body contains the complete message string. The code is a numerical command-code for the message or " (tt "#f") ". The parameters is a list of strings, containing message destination and message body.  If the message contains extended information (mostly " (tt "ACTION") "s), then the last value in the list is an " (i "extended data") " object.  The index is a numeric message index."))
(def (sig (procedure "(irc:message-sender MESSAGE)" (id irc:message-sender)) (procedure "(irc:message-receiver MESSAGE)" (id irc:message-receiver))) (p "Returns the sender and receiver of a message, respectively. The receiver may be a channel name or the nickname of another client."))
(def (sig (procedure "(irc:extended-data? X)" (id irc:extended-data?))) (p "Returns " (tt "#t") " if " (tt "X") " is an extended data object, or " (tt "#f") " otherwise."))
(def (sig (procedure "(irc:extended-data-tag EXTENDED)" (id irc:extended-data-tag)) (procedure "(irc:extended-data-content EXTENDED)" (id irc:extended-data-content))) (p "Return the tag (symbol) and content (string) parts of an extended data object."))
(def (sig (procedure "(irc:wait CONNECTION)" (id irc:wait))) (p "Waits until data is available from " (tt "CONNECTION") " and returns the parsed message object."))
(def (sig (procedure "(irc:process-message CONNECTION MESSAGE [VERBOSE])" (id irc:process-message))) (p "Calls any registered message handlers that apply to " (tt "MESSAGE") ". If the optional argument " (tt "VERBOSE") " is given and true, then diagnostic output will be written to the port returned by " (tt "(current-output-port)") "."))
(def (sig (procedure "(irc:run-message-loop CONNECTION #!key debug pong filter)" (id irc:run-message-loop))) (p "Repeatedly calls " (tt "irc:wait") " and " (tt "irc:process-message") ". If the keyword argument " (tt "debug") " is given and true, then each incoming message will be dumped to the port given by the value of " (tt "(current-output-port)") ". The keyword argument " (tt "pong") " specifies whether automatic processing of " (tt "PING") " messages should be done. If yes, then a message handler with the tag " (tt "ping") " (a symbol) will be registered as with the following commands:") (pre " (irc:add-message-handler! \n   con\n   (lambda (msg)\n     (irc:command con (string-append \"PONG :\" (car (irc:message-parameters msg)))) )\n   tag: 'ping\n   command: \"PING\") )") (p "The keyword argument " (tt "filter") " can be used to specify a procedure that will be called for each icoming message object (the result will be used for further processing instead)."))
(def (sig (procedure "(irc:add-message-handler! CONNECTION PROC #!key command sender receiver body tag code)" (id irc:add-message-handler!))) (p "Defines a message handler for the given " (tt "CONNECTION") " that will invoke the one argument procedure " (tt "PROC") " with the received message object when all of the regular expressions given for the keyword arguments match (uses " (tt "string-search") "), and the " (tt "code") ", which should be an exact integer (and is compared using " (tt "eq?") ").") (p "The keyword " (tt "tag") " defines a message-handler " (i "tag") ", which can be used to remove the handler at a later time.") (p "Note that if this procedure is called with two arguments (and no keyword args), then the message handler will be invoked for all incoming messages.") (p "Message handlers are run in the order in which they are defined. A message handler should return " (tt "#f") " if further handlers should be invoked for the same message, or true if other handlers should not be called.") (p "The " (tt "command, sender, receiver") " and " (tt "body") " arguments may optionally be predicates instead of strings (which will be called with the respective part of the checked message) to allow more fine-grained matching."))
(def (sig (procedure "(irc:remove-message-handler! CONNECTION TAG)" (id irc:remove-message-handler!))) (p "Removes the message handler with the given tag."))
