engine/sqlite/src/helper.cpp
changeset 2 29cda98b007e
equal deleted inserted replaced
1:5f8e5adbbed9 2:29cda98b007e
       
     1 /*
       
     2 ** 2004 May 22
       
     3 **
       
     4 ** The author disclaims copyright to this source code.  In place of
       
     5 ** a legal notice, here is a blessing:
       
     6 **
       
     7 **    May you do good and not evil.
       
     8 **    May you find forgiveness for yourself and forgive others.
       
     9 **    May you share freely, never taking more than you give.
       
    10 **
       
    11 ******************************************************************************
       
    12 **
       
    13 ** Functions wrapping 'int64' and 'double' functions to pass values by reference.
       
    14 */
       
    15 
       
    16 #include <stdlib.h>
       
    17 #include "sqlite3.h"
       
    18 #include <string.h>
       
    19 
       
    20 EXPORT_C int sqlite3_bind_double_ref(sqlite3_stmt *stmt, int iCol, double *val)
       
    21 {
       
    22 	return sqlite3_bind_double(stmt,iCol,*val);
       
    23 }
       
    24 
       
    25 EXPORT_C int sqlite3_bind_int64_ref(sqlite3_stmt *stmt, int iCol, sqlite_int64 *val)
       
    26 {
       
    27 	return sqlite3_bind_int64(stmt,iCol,*val);
       
    28 }
       
    29 
       
    30 EXPORT_C void sqlite3_column_double_ref(sqlite3_stmt *stmt, int iCol, double *val)
       
    31 {
       
    32 	*val = sqlite3_column_double(stmt,iCol);
       
    33 }
       
    34 
       
    35 EXPORT_C void sqlite3_column_int64_ref(sqlite3_stmt *stmt, int iCol, sqlite_int64 *val)
       
    36 {
       
    37 	*val = sqlite3_column_int64(stmt,iCol);
       
    38 }
       
    39 
       
    40 EXPORT_C unsigned int sqlite3_strlen(char *ptr)
       
    41 {
       
    42 	return strlen(ptr);
       
    43 }