1 /*
2  * Copyright (C) 2001 - 2002 Carlos Perelló Marín <carlos@gnome-db.org>
3  * Copyright (C) 2001 - 2002 Rodrigo Moya <rodrigo@gnome-db.org>
4  * Copyright (C) 2001 - 2011 Vivien Malerba <malerba@gnome-db.org>
5  * Copyright (C) 2002 Gonzalo Paniagua Javier <gonzalo@src.gnome.org>
6  * Copyright (C) 2005 Denis Fortin <denis.fortin@free.fr>
7  * Copyright (C) 2008 Przemysław Grzegorczyk <pgrzegorczyk@gmail.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
22  * Boston, MA  02110-1301, USA.
23  */
24 
25 #ifndef __GDA_SQLITE_H__
26 #define __GDA_SQLITE_H__
27 
28 #include <glib.h>
29 #include <libgda/libgda.h>
30 
31 #ifdef WITH_BDBSQLITE
32   #include <dbsql.h>
33   #include "gda-symbols-util.h"
34   #define SQLITE3_CALL(x) (s3r->x)
35 #else
36   #ifdef STATIC_SQLITE
37     #include "sqlite-src/sqlite3.h"
38     #define SQLITE3_CALL(x) (x)
39   #else
40     #ifdef HAVE_SQLITE
41       #include <sqlite3.h>
42       #include "gda-symbols-util.h"
43       #define SQLITE3_CALL(x) (s3r->x)
44       #if (SQLITE_VERSION_NUMBER < 3005000)
45         typedef sqlite_int64 sqlite3_int64;
46       #endif
47     #else
48       #include "sqlite-src/sqlite3.h"
49       #define SQLITE3_CALL(x) (x)
50     #endif
51   #endif
52 #endif
53 
54 /*
55  * Provider's specific connection data
56  */
57 typedef struct {
58 	GdaConnection *gdacnc;
59 	sqlite3      *connection;
60 	gchar        *file;
61 	GHashTable   *types_hash; /* key = type name, value = pointer to a GType */
62 	GType        *types_array;/* holds GType values, pointed by @types_hash */
63 } SqliteConnectionData;
64 
65 extern GHashTable *error_blobs_hash;
66 
67 #endif
68