This is the birch Reference Manual, version 1.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 03:27:09 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
birch
A simple Common Lisp IRC client library
Joram Schrijver <i@joram.io>
MIT
1.0.1
split-sequence
(system).
usocket
(system).
flexi-streams
(system).
alexandria
(system).
cl+ssl
(system).
replies.lisp
(file).
parse.lisp
(file).
ctcp.lisp
(file).
connection.lisp
(file).
commands.lisp
(file).
events.lisp
(file).
init.lisp
(file).
package.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
birch/birch.asd
birch/replies.lisp
birch/parse.lisp
birch/ctcp.lisp
birch/connection.lisp
birch/commands.lisp
birch/events.lisp
birch/init.lisp
birch/package.lisp
birch/replies.lisp
birch
(system).
reply->keyword
(function).
*reply-codes*
(special variable).
birch/parse.lisp
birch
(system).
parse-message
(function).
parse-prefix
(function).
birch/ctcp.lisp
birch
(system).
ctcp-message-p
(function).
make-ctcp-message
(function).
birch/connection.lisp
birch
(system).
activep
(reader method).
(setf activep)
(writer method).
add-user
(function).
channel
(class).
channel-class
(reader method).
(setf channel-class)
(writer method).
channel-type
(reader method).
(setf channel-type)
(writer method).
channel-type
(type).
channels
(reader method).
(setf channels)
(writer method).
connect-socket
(function).
connection
(reader method).
connection
(reader method).
(setf connection)
(writer method).
connection
(class).
host
(reader method).
(setf host)
(writer method).
initialize-instance
(method).
make-channel
(function).
make-user
(function).
name
(reader method).
nick
(reader method).
(setf nick)
(writer method).
pass
(reader method).
(setf pass)
(writer method).
real-name
(reader method).
(setf real-name)
(writer method).
remove-user
(function).
rename-user
(function).
server-host
(reader method).
server-port
(reader method).
(setf server-port)
(writer method).
socket-stream
(reader method).
(setf socket-stream)
(writer method).
topic
(reader method).
(setf topic)
(writer method).
user
(reader method).
(setf user)
(writer method).
user
(class).
user-class
(reader method).
(setf user-class)
(writer method).
users
(reader method).
users
(reader method).
(setf users)
(writer method).
(setf users)
(writer method).
%socket
(reader method).
(setf %socket)
(writer method).
get-channel
(function).
get-user
(function).
ssl
(reader method).
(setf ssl)
(writer method).
ssl-verify
(reader method).
(setf ssl-verify)
(writer method).
valid-channel-name-p
(function).
birch/commands.lisp
connection.lisp
(file).
birch
(system).
/invite
(generic function).
/join
(generic function).
/kick
(generic function).
/nick
(generic function).
/notice
(generic function).
/part
(generic function).
/pass
(generic function).
/pong
(generic function).
/privmsg
(generic function).
/quit
(generic function).
/raw
(generic function).
/user
(generic function).
/who
(generic function).
birch/events.lisp
connection.lisp
(file).
commands.lisp
(file).
birch
(system).
channel
(reader method).
(setf channel)
(writer method).
channel-event
(class).
define-event-dispatcher
(macro).
event
(method combination).
event
(class).
handle-event
(generic function).
handle-message
(generic function).
join-event
(class).
kick-event
(class).
message
(reader method).
(setf message)
(writer method).
new-nick
(reader method).
(setf new-nick)
(writer method).
new-topic
(reader method).
(setf new-topic)
(writer method).
nick-event
(class).
notice-event
(class).
part-event
(class).
privmsg-event
(class).
quit-event
(class).
target
(reader method).
(setf target)
(writer method).
topic-event
(class).
user
(reader method).
(setf user)
(writer method).
birch/init.lisp
connection.lisp
(file).
parse.lisp
(file).
commands.lisp
(file).
birch
(system).
connect
(function).
process-message
(function).
process-message-loop
(function).
read-message
(function).
birch/package.lisp
replies.lisp
(file).
parse.lisp
(file).
ctcp.lisp
(file).
connection.lisp
(file).
commands.lisp
(file).
events.lisp
(file).
init.lisp
(file).
birch
(system).
Packages are listed by definition order.
birch/connection
common-lisp
.
activep
(generic reader).
(setf activep)
(generic writer).
add-user
(function).
channel
(generic reader).
(setf channel)
(generic writer).
channel
(class).
channel
(slot).
channel-class
(generic reader).
(setf channel-class)
(generic writer).
channel-type
(generic reader).
(setf channel-type)
(generic writer).
channel-type
(type).
channels
(generic reader).
(setf channels)
(generic writer).
connect-socket
(function).
connection
(generic reader).
(setf connection)
(generic writer).
connection
(class).
host
(generic reader).
(setf host)
(generic writer).
make-channel
(function).
make-user
(function).
name
(generic reader).
nick
(generic reader).
(setf nick)
(generic writer).
pass
(generic reader).
(setf pass)
(generic writer).
real-name
(generic reader).
(setf real-name)
(generic writer).
remove-user
(function).
rename-user
(function).
server-host
(generic reader).
server-port
(generic reader).
(setf server-port)
(generic writer).
socket-stream
(generic reader).
(setf socket-stream)
(generic writer).
topic
(generic reader).
(setf topic)
(generic writer).
user
(generic reader).
(setf user)
(generic writer).
user
(class).
user
(slot).
user-class
(generic reader).
(setf user-class)
(generic writer).
users
(generic reader).
(setf users)
(generic writer).
%socket
(generic reader).
(setf %socket)
(generic writer).
get-channel
(function).
get-user
(function).
ssl
(generic reader).
(setf ssl)
(generic writer).
ssl-verify
(generic reader).
(setf ssl-verify)
(generic writer).
valid-channel-name-p
(function).
birch/ctcp
common-lisp
.
ctcp-message-p
(function).
make-ctcp-message
(function).
birch/commands
common-lisp
.
/invite
(generic function).
/join
(generic function).
/kick
(generic function).
/nick
(generic function).
/notice
(generic function).
/part
(generic function).
/pass
(generic function).
/pong
(generic function).
/privmsg
(generic function).
/quit
(generic function).
/raw
(generic function).
/user
(generic function).
/who
(generic function).
birch/events
common-lisp
.
channel-event
(class).
define-event-dispatcher
(macro).
event
(method combination).
event
(class).
handle-event
(generic function).
handle-message
(generic function).
join-event
(class).
kick-event
(class).
message
(generic reader).
(setf message)
(generic writer).
new-nick
(generic reader).
(setf new-nick)
(generic writer).
new-topic
(generic reader).
(setf new-topic)
(generic writer).
nick-event
(class).
notice-event
(class).
part-event
(class).
privmsg-event
(class).
quit-event
(class).
target
(generic reader).
(setf target)
(generic writer).
topic-event
(class).
birch/parse
birch/replies
.
common-lisp
.
split-sequence
.
parse-message
(function).
parse-prefix
(function).
birch/init
birch/connection
.
birch/parse
.
common-lisp
.
connect
(function).
process-message
(function).
process-message-loop
(function).
read-message
(function).
birch/replies
common-lisp
.
reply->keyword
(function).
*reply-codes*
(special variable).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Defines a method on HANDLE-MESSAGE to handle messages of which the command
is COMMAND. This new method will call HANDLE-EVENT with a new instance of type
CLASS.
POSITIONAL-INITARGS should be a list of initargs to pass to MAKE-INSTANCE,
where the position of the keyword determines the IRC command parameter that
will be used as a value. A NIL will cause an IRC parameter to be ignored.
For example, when POSITIONAL-INITARGS is (:CHANNEL), the first parameter of the
IRC message will be passed as the initial value of :CHANNEL. If
POSITIONAL-INITARGS is (:CHANNEL :TARGET), the first parameter will be passed
as the initial value of :CHANNEL, and the second parameter will be passed as
the initial value of :TARGET.
Instead of a keyword, an element of POSITIONAL-INITARGS can also be a list of
the form (:KEYWORD FUNCTION), which means the value passed as the initarg will
be the result of calling FUNCTION with two arguments: the connection object and
the IRC parameter.
Any remaining arguments will be joined together (separated by spaces) and passed as the initial value of :MESSAGE.
Connects to the IRC network denoted by CONNECTION. Opens a connection to the server and performs initial registration.
Returns whether or not STRING is a valid CTCP message, by checking if it starts and ends with a 0x01 character.
Turn a channel name into a CHANNEL object. For unknown channels this will result in a new CHANNEL object, for ones that are already known the existing one will be returned. NIL is returned if NAME is not a valid channel name.
Returns a string with a 0x01 character added to the start and end of STRING, turning it into a CTCP message. The resulting string can then be sent to a connection using PRIVMSG or NOTICE
Turn a user’s nick or prefix into a USER object. For unknown users this will result in a new USER object, for ones that are already known the existing one will be returned. If the user is already known and NICK/PREFIX is a prefix with both a USER and HOST component, those slots of the user object will be updated.
Parses MESSAGE into a couple of parts:
- PREFIX as a list consisting of SOURCE, USER and HOST
- COMMAND as a keyword, numerics are converted to their keyword equivalent
- PARAMS as a list of strings
The trailing argument, if available, will be the last item in PARAMS
Parses a prefix, assumed to still have the ’:’ at the front.
Returns 3 values:
- NICK (or server name)
- USER
- HOST
Note that this function also succeeds when a user is supplied but not a
host, even though that isn’t valid according to RFC2812.
Reads a message from CONNECTION and calls HANDLE-MESSAGE on it. Should probably be called in a loop. See PROCESS-MESSAGE-LOOP.
Continuously calls READ-MESSAGE until the connection is closed.
Turns a string representing a reply into an appropriate keyword. Numeric replies are converted to keywords based on their names as listed on https://www.alien.net.au/irc/irc2numerics.html Other replies are simply turned into keywords an returned.
Sends an INVITE message to CONNECTION, trying to invite NICK to CHANNEL
connection
) (user string
) (channel string
)) ¶connection
) (user user
) (channel channel
)) ¶connection
) (user user
) (channel string
)) ¶connection
) (user string
) (channel channel
)) ¶Sends a JOIN message to CONNECTION, to join a channel.
connection
) (channel string
) &optional key) ¶connection
) (channel channel
) &optional key) ¶Sends a KICK message to CONNECTION, trying to kick NICK from CHANNEL
connection
) (channel string
) (user string
) &optional message) ¶connection
) (channel channel
) (user user
) &optional message) ¶connection
) (channel string
) (user user
) &optional message) ¶connection
) (channel channel
) (user string
) &optional message) ¶Sends a NICK message to CONNECTION, to change nicknames.
connection
) (nick string
)) ¶Sends a NOTICE message to CONNECTION. TARGET should either be a channel name or the name of a user connected to the network.
connection
) (target string
) (message string
)) ¶connection
) (target channel
) (message string
)) ¶connection
) (target user
) (message string
)) ¶Sends a PART message to CONNECTION, to leave a channel.
connection
) (channel string
) &optional message) ¶connection
) (channel channel
) &optional message) ¶Sends a PASS message to CONNECTION, for the purpose of registration.
connection
) pass) ¶Sends a PONG message to CONNECTION, usually in reply to a PING by the server
connection
) (server-1 string
) &optional server-2) ¶Sends a PRIVMSG message to CONNECTION. CHANNEL should either be a channel name or the name of a user connected to the network.
connection
) (channel string
) (message string
)) ¶connection
) (channel channel
) (message string
)) ¶connection
) (user user
) (message string
)) ¶Sends a QUIT message to CONNECTION and sets (ACTIVEP CONNECTION) to T, which will stop READ-MESSAGE-LOOP from trying to reconnect
connection
) &optional message) ¶Sends MESSAGE to the stream associated with CONNECTION, after applying FORMAT to message with FORMAT-ARGUMENTS.
connection
) (message string
) &rest format-arguments) ¶Sends a USER message to CONNECTION, for the purpose of registration. Note that the IRC USER command also takes another parameter between MODE and REAL-NAME, but this parameter is unused.
connection
) (user string
) (mode integer
) (real-name string
)) ¶Sends a WHO message to CONNECTION about TARGET, optionally requesting operators only. TARGET can be either a user, channel, or string representing the desired mask.
connection
) (target string
) &optional operators-only-p) ¶connection
) (target user
) &optional operators-only-p) ¶connection
) (target channel
) &optional operators-only-p) ¶connection
)) ¶connection
)) ¶Whether or not the connection to the server is supposed to be open. In case of connection issues READ-MESSAGE-LOOP uses this to determine whether or not to reconnect
channel-event
)) ¶automatically generated reader method
channel-event
)) ¶automatically generated writer method
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated writer method
Will be called after an IRC message has successfully been parsed and turned into an event. Most IRC messages don’t result in events, should you want to handle them you can define a method on HANDLE-MESSAGE instead.
connection
) (event kick-event
)) ¶Remove a user from a channel they’re kicked from.
connection
) (event quit-event
)) ¶Remove a user from all channels they’re in.
connection
) (event part-event
)) ¶Remove a user from a channel they’re leaving.
connection
) (event join-event
)) ¶Add a user to a channel.
connection
) (event topic-event
)) ¶Change the topic associated with a channel.
connection
) (event nick-event
)) ¶Change the nickname associated with a user, or of the connection if the old nickname is the nickname of the connection.
Called when a raw message is returned. CONNECTION is the connection object of the connection the message was received on. PREFIX is a list of (NICK USER HOST) COMMAND is a keyword, such as :PRIVMSG or :RPL_WELCOME PARAMS is a list of parameters
connection
) prefix (command (eql :rpl_topic)
) params) ¶connection
) prefix (command (eql :topic)
) params) ¶connection
) prefix (command (eql :nick)
) params) ¶connection
) prefix (command (eql :kick)
) params) ¶connection
) prefix (command (eql :quit)
) params) ¶connection
) prefix (command (eql :part)
) params) ¶connection
) prefix (command (eql :join)
) params) ¶connection
) prefix (command (eql :notice)
) params) ¶connection
) prefix (command (eql :privmsg)
) params) ¶connection
) prefix (command (eql :rpl_whoreply)
) params) ¶Handles an RPL_WHOREPLY message and updates the users and channels associated.
connection
) prefix (command (eql :rpl_namreply)
) params) ¶Handles an RPL_NAMREPLY message and updates the channel.
connection
) prefix (command (eql :ping)
) params) ¶Responds to a PING message by the server by sending a PONG message in return
nick-event
)) ¶automatically generated reader method
nick-event
)) ¶automatically generated writer method
topic-event
)) ¶automatically generated reader method
topic-event
)) ¶automatically generated writer method
connection
)) ¶automatically generated reader method
pass
.
connection
)) ¶automatically generated writer method
pass
.
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated writer method
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated writer method
connection
)) ¶connection
)) ¶The stream associated with the current socket connection to the server.
kick-event
)) ¶automatically generated reader method
kick-event
)) ¶automatically generated writer method
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated writer method
connection
)) ¶automatically generated reader method
connection
)) ¶automatically generated writer method
connection
) &key &allow-other-keys) ¶The EVENT method combination is used by HANDLE-MESSAGE and HANDLE-EVENT to gracefully handle the absence of message or event handlers. In standard method combination, when only a non-primary method exists, an error is signalled. This makes it very hard to handle errors through an :AROUND method, which would be the most elegant solution to the problem. This method combination is just like the standard one, except primary methods are not required.
/invite
.
/invite
.
/join
.
/kick
.
/kick
.
/notice
.
/part
.
/privmsg
.
/who
.
(setf channel-type)
.
channel-type
.
connection
.
name
.
(setf topic)
.
topic
.
(setf users)
.
users
.
:connection
This slot is read-only.
:users
""
:topic
birch/connection:channel-type
:channel-type
A CHANNEL-EVENT is an event that happens on a certain channel.
:channel
user
.
(setf %socket)
.
%socket
.
/invite
.
/invite
.
/invite
.
/invite
.
/join
.
/join
.
/kick
.
/kick
.
/kick
.
/kick
.
/nick
.
/notice
.
/notice
.
/notice
.
/part
.
/part
.
/pass
.
/pong
.
/privmsg
.
/privmsg
.
/privmsg
.
/quit
.
/raw
.
/user
.
/who
.
/who
.
/who
.
(setf activep)
.
activep
.
(setf channel-class)
.
channel-class
.
handle-event
.
handle-event
.
handle-event
.
handle-event
.
handle-event
.
handle-event
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
handle-message
.
initialize-instance
.
(setf pass)
.
pass
.
(setf real-name)
.
real-name
.
server-host
.
(setf server-port)
.
server-port
.
(setf socket-stream)
.
socket-stream
.
(setf ssl)
.
ssl
.
(setf ssl-verify)
.
ssl-verify
.
(setf user-class)
.
user-class
.
(setf users)
.
users
.
Initarg | Value |
---|---|
:nick | (error nick required, not specified) |
An instance of USOCKET:STREAM-USOCKET, the current socket connection to the server.
:socket
The stream associated with the current socket connection to the server.
:stream
Whether or not the connection to the server is supposed to be open. In case of connection issues READ-MESSAGE-LOOP uses this to determine whether or not to reconnect
:activep
(error "host required, not specified")
:server-host
This slot is read-only.
6667
:server-port
Whether to verify the SSL hostname.
t
:ssl
"birch irc library"
:real-name
:users
(quote birch/connection:user)
:user-class
(quote birch/connection:channel)
:channel-class
:target
:new-nick
Event dispatched when a NOTICE message is received from the server. Note that when the CHANNEL slot is STRING= to the current nickname this notice won’t have been sent to a channel but directly to you.
Event dispatched when a PRIVMSG message is received from the server. Note that when the CHANNEL slot is STRING= to the current nickname this privmsg won’t have been sent to a channel but directly to you.
:new-topic
:connection
:channels
Hash-table filled with all numeric IRC reply codes, taken from https://www.alien.net.au/irc/irc2numerics.html
connection
)) ¶connection
)) ¶An instance of USOCKET:STREAM-USOCKET, the current socket connection to the server.
connection
)) ¶connection
)) ¶Whether to use SSL for the IRC connection.
ssl
.
connection
)) ¶connection
)) ¶Whether to verify the SSL hostname.
Jump to: | %
(
/
A C D E F G H I M N P R S T U V |
---|
Jump to: | %
(
/
A C D E F G H I M N P R S T U V |
---|
Jump to: | %
*
A C H M N P R S T U |
---|
Jump to: | %
*
A C H M N P R S T U |
---|
Jump to: | B C E F I J K N P Q R S T U |
---|
Jump to: | B C E F I J K N P Q R S T U |
---|