Patch for port/net.lisp for SBCL

Robin Lee Powell <[email protected]> Wed, 30 Jul 2008 10:40:48 -0700
Newsgroups gmane.lisp.clocc.devel
Message-ID <[email protected]>
Makes port:resolve-host-ipaddr work on a recent SBCL.

-Robin

*** clocc/src/port/net.lisp.orig        2008-07-29 14:13:48.000000000 -0700
--- clocc/src/port/net.lisp     2008-07-29 16:46:11.000000000 -0700
***************
*** 134,139 ****
--- 134,148 ----
              (integer host)))
           (name (ccl:ipaddr-to-hostname ipaddr)))
      (make-hostent :name name :addr-list (list (ccl:lookup-hostname ipaddr))))
+   #+(and sbcl sb-bsd-sockets)
+   (let ((he (sb-bsd-sockets:get-host-by-name host)))
+     (make-hostent :name (sb-bsd-sockets:host-ent-name he)
+                 :addr-list
+                 (loop for ipaddr in (sb-bsd-sockets:host-ent-addresses he)
+                       collect (format nil "~{~a~^.~}"
+                                       (loop for octect
+                                             being the elements of ipaddr
+                                             collect octect)))))
    #+(and sbcl db-sockets)
    (let* ((ipaddr
            (etypecase host
***************
*** 164,170 ****
                                       (net.sbcl.sockets:host-entry-addr-list he))
                    :addr-type (net.sbcl.sockets::host-entry-addr-type he)))
    #-(or allegro (and clisp syscalls) cmu gcl lispworks openmcl
!         (and sbcl (or db-sockets net.sbcl.sockets)) scl)
    (error 'not-implemented :proc (list 'resolve-host-ipaddr host)))

  ;;;
--- 173,179 ----
                                       (net.sbcl.sockets:host-entry-addr-list he))
                    :addr-type (net.sbcl.sockets::host-entry-addr-type he)))
    #-(or allegro (and clisp syscalls) cmu gcl lispworks openmcl
!         (and sbcl (or sb-bsd-sockets db-sockets net.sbcl.sockets)) scl)
    (error 'not-implemented :proc (list 'resolve-host-ipaddr host)))

  ;;;


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/