From a1428e57b84e21a39b99b019329849394e9f7cb7 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 6 Sep 2011 12:42:42 +0100 Subject: [PATCH] serv.lisp: Spread exports throughout the file. --- serv.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/serv.lisp b/serv.lisp index f8827b1..245ffe9 100644 --- a/serv.lisp +++ b/serv.lisp @@ -22,12 +22,11 @@ ;;; 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)." -- 2.11.0