sqlite_cl2.h

Go to the documentation of this file.
00001 // Do not include the SQLite header directly. Always do it via this
00002 // file to ensure that you get the correct header.
00003 
00004 #ifndef __sqlite_cl2_h__
00005 #define __sqlite_cl2_h__
00006 
00007 #include "application_config.h"
00008 
00009 #if __USE_SQLITE3H__
00010 #  include "sqlite3.h"
00011 #  ifndef __SQLITE3H__
00012 #    error include paths are wrong
00013 #  endif
00014 #elif __HAVE_SQLITE3__
00015 #  include <sqlite3.h>
00016 #else
00017 #  error configuration without sqlite
00018 #endif
00019 
00020 #define sqlite_get_error_string(db) \
00021   ((db) ? sqlite3_errmsg(db) : "<no message>")
00022 
00023 // We are not really planning on the fly schema changes, but still
00024 // prefer to use sqlite3_prepare_v2 when available, just in case.
00025 #if SQLITE_VERSION_NUMBER < 3006005
00026 #define sqlite_prepare sqlite3_prepare
00027 #else
00028 #define sqlite_prepare sqlite3_prepare_v2
00029 #endif
00030 
00031 #define sqlite3_bind_text_or_null(db, ix, t, n, f) \
00032   ((t) ? sqlite3_bind_text(db, ix, t, n, f) : sqlite3_bind_null(db, ix))
00033 
00034 #define sqlite3_bind_int_neqz(db, ix, val) \
00035   (((val) != 0) ? sqlite3_bind_int(db, ix, val) : sqlite3_bind_null(db, ix))
00036 
00037 #define sqlite3_bind_int_ltez(db, ix, val) \
00038   (((val) <= 0) ? sqlite3_bind_int(db, ix, val) : sqlite3_bind_null(db, ix))
00039 
00040 #define sqlite3_bind_int_gtez(db, ix, val) \
00041   (((val) >= 0) ? sqlite3_bind_int(db, ix, val) : sqlite3_bind_null(db, ix))
00042 
00043 #endif /* __sqlite_cl2_h__ */
00044 
00045 /**
00046 
00047 sqlite_cl2.h
00048 
00049 Copyright 2009 Helsinki Institute for Information Technology (HIIT)
00050 and the authors. All rights reserved.
00051 
00052 Authors: Tero Hasu <tero.hasu@hut.fi>
00053 
00054 Permission is hereby granted, free of charge, to any person
00055 obtaining a copy of this software and associated documentation files
00056 (the "Software"), to deal in the Software without restriction,
00057 including without limitation the rights to use, copy, modify, merge,
00058 publish, distribute, sublicense, and/or sell copies of the Software,
00059 and to permit persons to whom the Software is furnished to do so,
00060 subject to the following conditions:
00061 
00062 The above copyright notice and this permission notice shall be
00063 included in all copies or substantial portions of the Software.
00064 
00065 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00066 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00067 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00068 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00069 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00070 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00071 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00072 SOFTWARE.
00073 
00074  **/

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:56 2011 by Doxygen 1.6.1