r1649: *** empty log message ***
[clsql.git] / interfaces / postgresql / postgresql-loader.cl
index 4db5fd426a63054a5e2b6f77075a191380d2fb3c..f9d6f1cf85036dc3956520d916c330c89861a649 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: postgresql-loader.cl,v 1.1 2002/03/23 14:04:53 kevin Exp $
+;;;; $Id: postgresql-loader.cl,v 1.3 2002/03/24 04:37:09 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 load the PostgresSQL client library succesfully.  If this differs at your site,
 set to the right path before compiling or loading the system.")
 
 load the PostgresSQL client library succesfully.  If this differs at your site,
 set to the right path before compiling or loading the system.")
 
-(defmethod database-type-load-foreign ((database-type (eql :postgresql)))
-  (uffi:load-foreign-library *postgresql-library-filename* 
-                            :module "postgresql"
-                            :supporting-libraries 
-                            *postgresql-supporting-libraries*))
+(defvar *postgresql-library-loaded* nil
+  "T if foreign library was able to be loaded successfully")
 
 
-(database-type-load-foreign :postgresql)
+(defmethod clsql-sys:database-type-library-loaded ((database-type
+                                                   (eql :postgresql)))
+  *postgresql-library-loaded*)
+                                     
+(defmethod clsql-sys:database-type-load-foreign ((database-type
+                                                 (eql :postgresql)))
+  (when
+      (uffi:load-foreign-library *postgresql-library-filename* 
+                                :module "postgresql"
+                                :supporting-libraries 
+                                *postgresql-supporting-libraries*)
+    (setq *postgresql-library-loaded* t)))
+
+(clsql-sys:database-type-load-foreign :postgresql)