Remove CVS $Id$ keyword
[clsql.git] / db-postgresql / postgresql-loader.lisp
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          postgresql-loader.sql
6 ;;;; Purpose:       PostgreSQL library loader using UFFI
7 ;;;; Programmer:    Kevin M. Rosenberg
8 ;;;; Date Started:  Feb 2002
9 ;;;;
10 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
11 ;;;;
12 ;;;; CLSQL users are granted the rights to distribute and use this software
13 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
14 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
15 ;;;; *************************************************************************
16
17 (in-package #:pgsql)
18
19
20 (defvar *postgresql-supporting-libraries* '("crypt" "c")
21   "Used only by CMU. List of library flags needed to be passed to ld to
22 load the PostgresSQL client library succesfully.  If this differs at your site,
23 set to the right path before compiling or loading the system.")
24
25 (defvar *postgresql-library-loaded* nil
26   "T if foreign library was able to be loaded successfully")
27
28 (defmethod clsql-sys:database-type-library-loaded ((database-type
29                                                     (eql :postgresql)))
30   *postgresql-library-loaded*)
31
32 (defmethod clsql-sys:database-type-load-foreign ((database-type
33                                                   (eql :postgresql)))
34   (clsql-uffi:find-and-load-foreign-library "libpq"
35                                             :module "postgresql"
36                                             :supporting-libraries *postgresql-supporting-libraries*)
37   (setq *postgresql-library-loaded* t))
38
39 (clsql-sys:database-type-load-foreign :postgresql)
40