[net-nittin-irc-cvs] CVS update: net-nittin-irc/protocol.lisp
Erik Enge
eenge at common-lisp.net
Mon Nov 24 00:42:53 UTC 2003
Update of /project/net-nittin-irc/cvsroot/net-nittin-irc
In directory common-lisp.net:/tmp/cvs-serv32354
Modified Files:
protocol.lisp
Log Message:
adding some more docstrings
Date: Sun Nov 23 19:42:53 2003
Author: eenge
Index: net-nittin-irc/protocol.lisp
diff -u net-nittin-irc/protocol.lisp:1.15 net-nittin-irc/protocol.lisp:1.16
--- net-nittin-irc/protocol.lisp:1.15 Sun Nov 23 18:22:19 2003
+++ net-nittin-irc/protocol.lisp Sun Nov 23 19:42:53 2003
@@ -1,4 +1,4 @@
-;;;; $Id: protocol.lisp,v 1.15 2003/11/23 23:22:19 eenge Exp $
+;;;; $Id: protocol.lisp,v 1.16 2003/11/24 00:42:53 eenge Exp $
;;;; $Source: /project/net-nittin-irc/cvsroot/net-nittin-irc/protocol.lisp,v $
;;;; See LICENSE for licensing information.
@@ -157,7 +157,9 @@
message))
(defmethod send-irc-message ((connection connection) command
- trailing-argument &rest arguments)
+ trailing-argument &rest arguments)
+ "Turn the arguments into a valid IRC message and send it to the
+server, via the `connection'."
(let ((raw-message (make-irc-message command
:arguments arguments
:trailing-argument trailing-argument)))
@@ -166,6 +168,7 @@
raw-message))
(defmethod all-users ((connection connection))
+ "Return all users known the `connection'."
(let ((user-list (dangling-users connection)))
(push (user connection) user-list)
(dolist (channel (channels connection))
@@ -175,23 +178,29 @@
(remove-duplicates user-list)))
(defmethod all-channels ((connection connection))
+ "Return a list of all channels known to the `connection'. Note that
+this includes any channels found by listing channels."
(let ((channel-list (channel-list connection)))
(dolist (channel (channels connection))
(push channel channel-list))
channel-list))
(defmethod get-hooks ((connection connection) (class symbol))
+ "Return a list of all hooks for `class'."
(gethash class (hooks connection)))
(defmethod add-hook ((connection connection) class hook)
+ "Add `hook' to `class'."
(setf (gethash class (hooks connection))
(pushnew hook (gethash class (hooks connection)))))
(defmethod remove-hook ((connection connection) class hook)
+ "Remove `hook' from `class'."
(setf (gethash class (hooks connection))
(delete hook (gethash class (hooks connection)))))
(defmethod remove-hooks ((connection connection) class)
+ "Remove all hooks for `class'."
(setf (gethash class (hooks connection)) nil))
;;
@@ -314,18 +323,24 @@
channel))
(defmethod find-channel ((connection connection) (channel string))
+ "Return channel as designated by `channel'. If no such channel can
+be found, return nil."
(find channel (all-channels connection) :key #'name :test #'string-equal))
(defmethod remove-all-channels ((connection connection))
+ "Remove all channels known to `connection'."
(setf (channels connection) nil))
(defmethod add-channel ((connection connection) (channel channel))
+ "Add `channel' to `connection'."
(pushnew channel (channels connection)))
(defmethod remove-channel ((connection connection) (channel channel))
+ "Remove `channel' from `connection'."
(setf (channels connection) (remove channel (channels connection))))
(defmethod remove-users ((channel channel))
+ "Remove all users on `channel'."
(clrhash (users channel)))
;;
@@ -375,22 +390,29 @@
nickname))
(defmethod find-user ((connection connection) (nickname string))
+ "Return user as designated by `nickname' or nil if no such user is
+known."
(find nickname (all-users connection) :key #'nickname :test #'string-equal))
(defmethod add-user ((connection connection) (user user))
+ "Add `user' to `connection'."
(pushnew user (dangling-users connection)))
(defmethod add-user ((channel channel) (user user))
+ "Add `user' to `channel'."
(setf (gethash (nickname user) (users channel)) user))
(defmethod remove-all-users ((connection connection))
+ "Remove all users known to `connection'."
(setf (dangling-users connection) nil)
(mapc #'remove-users (channels connection)))
(defmethod remove-user ((channel channel) (user user))
+ "Remove `user' from `channel'."
(remhash (nickname user) (users channel)))
(defmethod remove-user-everywhere ((connection connection) (user user))
+ "Remove `user' anywhere present in the `connection'."
(dolist (channel (channels connection))
(remove-user channel user)))
More information about the Net-nittin-irc-cvs
mailing list