Remove CVS $Id$ keyword
[clsql.git] / db-sqlite3 / sqlite3-loader.lisp
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          sqlite3-loader.lisp
6 ;;;; Purpose:       Sqlite3 library loader using UFFI
7 ;;;; Programmer:    Aurelio Bignoli
8 ;;;; Date Started:  Oct 2004
9 ;;;;
10 ;;;; This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli
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 #:clsql-sqlite3)
18
19 (defvar *sqlite3-supporting-libraries* '("c")
20   "Used only by CMU. List of library flags needed to be passed to ld
21 to load the Sqlite3 library succesfully.  If this differs at your site,
22 set to the right path before compiling or loading the system.")
23
24 (defvar *sqlite3-library-loaded* nil
25   "T if foreign library was able to be loaded successfully")
26
27 (defmethod database-type-library-loaded ((database-type (eql :sqlite3)))
28   "T if foreign library was able to be loaded successfully. "
29   *sqlite3-library-loaded*)
30
31 (defmethod database-type-load-foreign ((database-type (eql :sqlite3)))
32   (clsql-uffi:find-and-load-foreign-library '("libsqlite3" "sqlite3")
33                                             :module "sqlite3"
34                                             :supporting-libraries *sqlite3-supporting-libraries*)
35   (setq *sqlite3-library-loaded* t))
36
37 (clsql-sys:database-type-load-foreign :sqlite3)