[pg-cvs] CVS pg

emarsden emarsden at common-lisp.net
Sat Sep 30 16:51:13 UTC 2006


Update of /project/pg/cvsroot/pg
In directory clnet:/tmp/cvs-serv6047

Modified Files:
	sysdep.lisp pg.asd 
Log Message:
Add unix-domain socket support for Allegro CL (tested with Express
edition for Linux/x86).


--- /project/pg/cvsroot/pg/sysdep.lisp	2006/09/24 15:50:18	1.16
+++ /project/pg/cvsroot/pg/sysdep.lisp	2006/09/30 16:51:12	1.17
@@ -1,14 +1,13 @@
 ;;; sysdep.lisp -- system-dependent parts of pg-dot-lisp
 ;;;
 ;;; Author: Eric Marsden <eric.marsden at free.fr>
-;;; Time-stamp: <2006-09-24 emarsden>
+;;; Time-stamp: <2006-09-30 emarsden>
 ;;
 ;;
 
 (in-package :postgresql)
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
-  #+allegro (require :socket)
   #+lispworks (require "comm")
   #+cormanlisp (require :sockets)
   #+armedbear (require :socket))
@@ -165,14 +164,22 @@
 (defun socket-connect (port host)
   (declare (type integer port))
   (handler-case
-   (socket:make-socket :remote-host host
-                       :remote-port port
-                       :format :binary)
-   (error (e)
+      (if (eql #\/ (char host 0))
+          (socket:make-socket :type :stream
+                              :address-family :file
+                              :connect :active
+                              ;; :local-filename (format nil "~A.s.PGSQL.~D" (string host) port)
+                              :remote-filename (format nil "~A.s.PGSQL.~D" (string host) port)
+                              :format :binary)
+          (socket:make-socket :remote-host host
+                              :remote-port port
+                              :connect :active
+                              :format :binary))
+    (error (e)
       (error 'connection-failure
-              :host host
-              :port port
-              :transport-error e))))
+             :host host
+             :port port
+             :transport-error e))))
 
 ;; Lispworks 4.2 doesn't seem to implement WRITE-SEQUENCE on binary
 ;; streams. Fixed in version 4.3. 
@@ -283,6 +290,9 @@
 (eval-when (:load-toplevel :execute :compile-toplevel)
   (require :socket))
 
+;; could provide support for connections via a unix-domain socket by
+;; using http://freshmeat.net/projects/j-buds/ (requires linking to a
+;; shared libary)
 #+armedbear
 (defun socket-connect (port host)
   (declare (type integer port))
--- /project/pg/cvsroot/pg/pg.asd	2006/09/18 19:10:01	1.10
+++ /project/pg/cvsroot/pg/pg.asd	2006/09/30 16:51:12	1.11
@@ -17,9 +17,8 @@
 (defsystem :pg
     :name "Socket-level PostgreSQL interface"
     :author "Eric Marsden"
-    :version "0.22"
+    :version "0.24"
     :depends-on (
-              #+allegro :socket
               #+lispworks "comm"
               #+cormanlisp :sockets
               #+sbcl :sb-bsd-sockets




More information about the Pg-cvs mailing list