aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-08-14 16:01:24 +0000
committerdrh <drh@noemail.net>2009-08-14 16:01:24 +0000
commit47baebc2a68f03c7625b48d94df2df0c54cc0f99 (patch)
tree7474018643d0fbc508a6b2a77b3cf211fcc91c1c /src/func.c
parent9e42f8ac1a132d19fbba1b5a8f1d66f4d36c71ca (diff)
downloadsqlite-47baebc2a68f03c7625b48d94df2df0c54cc0f99.tar.gz
sqlite-47baebc2a68f03c7625b48d94df2df0c54cc0f99.zip
Incorporate fossil-scm version information into the build. Add the
SQLITE_SOURCE_ID macro to the header. Add the sqlite3_sourceid() interface. Add the sqlite_source_id() SQL function. FossilOrigin-Name: 302dabe98f50b472bccd65c58504bc8a330049c4
Diffstat (limited to 'src/func.c')
-rw-r--r--src/func.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/func.c b/src/func.c
index 6243536cb..2766fa3b1 100644
--- a/src/func.c
+++ b/src/func.c
@@ -15,8 +15,6 @@
** There is only one exported symbol in this file - the function
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
-**
-** $Id: func.c,v 1.239 2009/06/19 16:44:41 drh Exp $
*/
#include "sqliteInt.h"
#include <stdlib.h>
@@ -702,7 +700,7 @@ static void nullifFunc(
}
/*
-** Implementation of the VERSION(*) function. The result is the version
+** Implementation of the sqlite_version() function. The result is the version
** of the SQLite library that is running.
*/
static void versionFunc(
@@ -714,6 +712,20 @@ static void versionFunc(
sqlite3_result_text(context, sqlite3_version, -1, SQLITE_STATIC);
}
+/*
+** Implementation of the sqlite_source_id() function. The result is a string
+** that identifies the particular version of the source code used to build
+** SQLite.
+*/
+static void sourceidFunc(
+ sqlite3_context *context,
+ int NotUsed,
+ sqlite3_value **NotUsed2
+){
+ UNUSED_PARAMETER2(NotUsed, NotUsed2);
+ sqlite3_result_text(context, SQLITE_SOURCE_ID, -1, SQLITE_STATIC);
+}
+
/* Array for converting from half-bytes (nybbles) into ASCII hex
** digits. */
static const char hexdigits[] = {
@@ -1433,6 +1445,7 @@ void sqlite3RegisterGlobalFunctions(void){
FUNCTION(randomblob, 1, 0, 0, randomBlob ),
FUNCTION(nullif, 2, 0, 1, nullifFunc ),
FUNCTION(sqlite_version, 0, 0, 0, versionFunc ),
+ FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ),
FUNCTION(quote, 1, 0, 0, quoteFunc ),
FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid),
FUNCTION(changes, 0, 0, 0, changes ),