[usocket-cvs] r241 - usocket/trunk/backend

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Thu May 17 07:27:17 UTC 2007


Author: ehuelsmann
Date: Thu May 17 03:27:16 2007
New Revision: 241

Modified:
   usocket/trunk/backend/clisp.lisp
Log:
Add cl-smtp 'requirement': get-host-name (clisp backend).

Modified: usocket/trunk/backend/clisp.lisp
==============================================================================
--- usocket/trunk/backend/clisp.lisp	(original)
+++ usocket/trunk/backend/clisp.lisp	Thu May 17 03:27:16 2007
@@ -6,6 +6,23 @@
 (in-package :usocket)
 
 
+;; utility routine for looking up the current host name
+(FFI:DEF-CALL-OUT get-host-name-internal
+         (:name "gethostname")
+         (:arguments (name (FFI:C-PTR (FFI:C-ARRAY-MAX ffi:character 256))
+                           :OUT :ALLOCA)
+                     (len ffi:int))
+         #+win32 (:library "WS2_32")
+         (:return-type ffi:int))
+
+
+(defun get-host-name ()
+  (multiple-value-bind (retcode name)
+      (get-host-name-internal)
+    (when (= retcode 0)
+      name)))
+
+
 #+win32
 (defun remap-maybe-for-win32 (z)
   (mapcar #'(lambda (x)



More information about the usocket-cvs mailing list