X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fsb-bsd-sockets%2Fdefpackage.lisp;h=5dfafa0d735d2235110c90cc3e060da0d17d5551;hb=a9cac95ee124f8e71a31554964d308f74da9c866;hp=71d04f8b735fab1982ffedd5ade91a1a191f78fb;hpb=d1287b8413141509ca384971f615dde98979583e;p=sbcl.git diff --git a/contrib/sb-bsd-sockets/defpackage.lisp b/contrib/sb-bsd-sockets/defpackage.lisp index 71d04f8..5dfafa0 100644 --- a/contrib/sb-bsd-sockets/defpackage.lisp +++ b/contrib/sb-bsd-sockets/defpackage.lisp @@ -1,33 +1,14 @@ +#+(and sbcl win32) +(defpackage "SB-WIN32-SOCKETS-INTERNAL" + (:nicknames "WIN32SOCKINT") + (:shadow close listen) + (:use "COMMON-LISP" "SB-ALIEN" "SB-EXT" "SB-C-CALL")) + (defpackage "SB-BSD-SOCKETS-INTERNAL" (:nicknames "SOCKINT") (:shadow close listen) - #+cmu (:shadowing-import-from "CL" with-array-data) - #+sbcl (:shadowing-import-from "SB-KERNEL" with-array-data) - - #+cmu (:use "COMMON-LISP" "ALIEN" "SYSTEM" "EXT" "C-CALL") - #+sbcl (:use "COMMON-LISP" "SB-ALIEN" #+nil "SB-SYSTEM" "SB-EXT" "SB-C-CALL")) - -;;; SBCL changes a lot of package prefixes. To avoid littering the -;;; code with conditionals, we use the SBCL package prefixes -;;; throughout. This means that we need to create said packages -;;; first, if we're using CMUCL - -;;; One thing that this exercise really has made clear is just how much -;;; of the alien stuff is scattered around the cmucl package space -;;; seemingly at random. Hmm. - -#+cmu -(eval-when (:compile-toplevel :load-toplevel) - (defun add-package-nickname (name nickname) - (let ((p (find-package name))) - (rename-package p (package-name p) - (cons nickname (package-nicknames name))))) - (add-package-nickname "EXT" "SB-EXT") - (add-package-nickname "ALIEN" "SB-ALIEN") - (add-package-nickname "UNIX" "SB-UNIX") - (add-package-nickname "C-CALL" "SB-C-CALL") - (add-package-nickname "KERNEL" "SB-KERNEL") - (add-package-nickname "SYSTEM" "SB-SYS")) + (:shadowing-import-from "SB-KERNEL" with-array-data) + (:use "COMMON-LISP" "SB-ALIEN" "SB-EXT" "SB-C-CALL")) (defpackage "SB-BSD-SOCKETS" (:export socket local-socket inet-socket @@ -36,34 +17,38 @@ socket-send socket-receive socket-recv socket-name socket-peername socket-listen socket-close socket-file-descriptor - socket-family socket-protocol socket-type - socket-make-stream get-protocol-by-name + socket-family socket-protocol socket-open-p + socket-type socket-make-stream get-protocol-by-name get-host-by-name get-host-by-address host-ent host-ent-addresses host-ent-address host-ent-aliases host-ent-name name-service-error + getaddrinfo ;; not sure if these are really good names or not netdb-internal-error netdb-success-error host-not-found-error try-again-error no-recovery-error - - ;; all socket options are also exported, by code in - ;; sockopt.lisp - socket-error + unknown-protocol + + ;; all socket options are also exported, by code in + ;; sockopt.lisp + + socket-error + + ;; other errno-based socket errors are exported by code in + ;; sockets.lisp - ;; other errno-based socket errors are exported by code in - ;; sockets.lisp - make-inet-address non-blocking-mode ) (:use "COMMON-LISP" "SB-BSD-SOCKETS-INTERNAL") + (:import-from "SB-INT" "UNSUPPORTED-OPERATOR" "FEATUREP") (:documentation " @@ -76,55 +61,16 @@ arguments to fit Lisp style more closely. " )) -#|| - -
Most of the functions are modelled on the BSD socket API. BSD sockets -are widely supported, portably ("portable" by Unix standards, at least) -available on a variety of systems, and documented. There are some -differences in approach where we have taken advantage of some of the more useful features of Common Lisp - briefly - -