serv.lisp: Spread exports throughout the file.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 6 Sep 2011 11:42:42 +0000 (12:42 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 6 Sep 2011 11:42:42 +0000 (12:42 +0100)
serv.lisp

index f8827b1..245ffe9 100644 (file)
--- a/serv.lisp
+++ b/serv.lisp
 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 (defpackage #:services
-  (:use #:common-lisp #:mdw.base #:mdw.str #:collect #:net #:anaphora)
-  (:export #:serv #:servp #:serv-name #:serv-aliases #:serv-port #:serv-proto
-          #:serv-by-name #:serv-by-port #:serv-add #:serv-list))
+  (:use #:common-lisp #:mdw.base #:mdw.str #:collect #:net #:anaphora))
 
 (in-package #:services)
 
+(export '(serv servp serv-name serv-aliases serv-port serv-proto))
 (defstruct (serv (:predicate servp))
   "Represents a service entry in /etc/services."
   (name :nil :type keyword)
@@ -39,6 +38,7 @@
       (byport (make-hash-table)))
 
   ;; Translation functions.
+  (export 'serv-by-name)
   (defun serv-by-name (name &optional proto)
     "Look up the service with the given NAME (or alias) and PROTO.  If PROTO
      is nil, use a default protocol from a built-in list."
@@ -52,6 +52,7 @@
                   (awhen (find-proto proto)
                     (return it))))))))
 
+  (export 'serv-by-port)
   (defun serv-by-port (port &optional (proto :tcp))
     "Look up the service with the given PORT number and PROTO."
     (find proto (gethash port byport) :key #'serv-proto))
@@ -64,6 +65,7 @@
       (push serv (gethash alias byname))))
 
   ;; Read the whole damned lot.
+  (export 'serv-list)
   (defun serv-list (&key (predicate (constantly t)))
     "Return as a list the services which match PREDICATE (default all of
      them)."