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