sqlite3 c例程(大家直接拿来改就行)

sqlite3 c例程(大家直接拿来改就行),第1张

概述#include <stdio.h> #include <stdlib.h> //exit等函数的声明 #include <sqlite3.h> int displaycb(void *para,int n_column,char **column_value,char **column_name); int inquire_Usecb(sqlite3 *db); int inquire_nocb

#include <stdio.h>
#include <stdlib.h> //exit等函数的声明
#include <sqlite3.h>

int displaycb(voID *para,int n_column,char **column_value,char **column_name);

int inquire_Usecb(sqlite3 *db);

int inquire_nocb(sqlite3 *db);

int createtable(sqlite3 *db);

int insertRecord(sqlite3 *db);

int deleteRecord(sqlite3 *db);


//回调函数 每一条记录执行一次
int displaycb(voID *para,char **column_name)
{
int i = 0;
printf("Total column is %d\n",n_column);
for(i = 0;i<n_column;i++){
printf("字段名: %s---->字段值:%s\n",column_name[i],column_value[i]);
}
printf("==========================\n");
return 0;
}
//使用回调函数的查询
int inquire_Usecb(sqlite3 *db)
{
char *sql;
char *zErrMsg;
sql = "select * from 'SensorData';";
if(sqlITE_OK != sqlite3_exec(db,sql,displaycb,NulL,&zErrMsg)){
printf("operate Failed: %s\n",zErrMsg);
}
return 0;
}
//不使用回调函数的查询
int inquire_nocb(sqlite3 *db)
{
int nrow = 0,ncolumn = 0;
char **azResult=0;
int i = 0;
char *sql;
char *zErrMsg;
sql = "SELECT * FROM SensorData";
if(sqlITE_OK != sqlite3_get_table(db,&azResult,&nrow,&ncolumn,zErrMsg);
}

printf("row:%d column = %d\n",nrow,ncolumn);
printf("The result of querying is :\n");
for ( i = 0;i < ( nrow + 1) * ncolumn; i++)
printf("azResult[%d] = %s\n",i,azResult[i]);
sqlite3_free_table(azResult);
return 0;
}
//创建表函数
int createtable(sqlite3 *db)
{
char *zErrMsg = 0;
char *sql = "CREATE table SensorData(ID INTEGER PRIMARY KEY,SensorID INTEGER,SiteNum INTERER,Time VARCHAR(12),SensorParameter REAL);";
if(sqlITE_OK != sqlite3_exec(db,zErrMsg);
}
}
//插入数据函数
int insertRecord(sqlite3 *db)
{
char *sql;
char *zErrMsg;
sql = "INSERT INTO 'SensorData' VALUES(NulL,101,261,'20100314',18.9);";
if(sqlITE_OK != sqlite3_exec(db,zErrMsg);
}

sql = "INSERT INTO 'SensorData' VALUES(NulL,369,281,'20100616',113);";
if(sqlITE_OK != sqlite3_exec(db,667,290,'20110315',27);";
if(sqlITE_OK != sqlite3_exec(db,865,300,'20120616',323);";
if(sqlITE_OK != sqlite3_exec(db,zErrMsg);
}

}
//删除数据函数
int deleteRecord(sqlite3 *db)
{
char *sql;
char *zErrMsg;
char **azResult=0;
int nrow = 0,ncolumn = 0;
int i;
sql = "DELETE FROM SensorData WHERE ID=4;";
if(sqlITE_OK != sqlite3_exec(db,zErrMsg);
}

sql = "SELECT * FROM SensorData;";
if(sqlITE_OK != sqlite3_get_table(db,zErrMsg);
}
printf("row:%d column:%d\n",ncolumn);
printf("After deleting,the result of querying is :\n");
for(i=0;i<(nrow+1)*ncolumn;i++)
printf("azResult[%d] = %s\n",azResult[i]);
sqlite3_free_table(azResult);
}
int main(voID)
{
sqlite3 *db = NulL;
int rc;

//打开指定的数据库文件
rc = sqlite3_open("mydatabase.db",&db);
if(rc){
fprintf(stderr,"can't open database: %s\n",sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}else
printf("You have opened a sqlite3 database successfully!\n");
//创建表
createtable(db);
//插入记录
insertRecord(db);
//查询
//使用sqlite3_get_table实现查询
inquire_nocb(db);
printf("ppppppppppppppppppppppppppppppppppp\n");
//使用回调函数实现查询
inquire_Usecb(db);
//删除记录
deleteRecord(db);
//关闭数据库
sqlite3_close(db);
return 0;
}

执行结果:

[root@localhost MysqLite_databasefile]# ./mysqlite3
You have opened a sqlite3 database successfully!
row:4 column = 5
The result of querying is :
azResult[0] = ID
azResult[1] = SensorID
azResult[2] = SiteNum
azResult[3] = Time
azResult[4] = SensorParameter
azResult[5] = 1
azResult[6] = 101
azResult[7] = 261
azResult[8] = 20100314
azResult[9] = 18.9
azResult[10] = 2
azResult[11] = 369
azResult[12] = 281
azResult[13] = 20100616
azResult[14] = 113.0
azResult[15] = 3
azResult[16] = 667
azResult[17] = 290
azResult[18] = 20110315
azResult[19] = 27.0
azResult[20] = 4
azResult[21] = 865
azResult[22] = 300
azResult[23] = 20120616
azResult[24] = 323.0
ppppppppppppppppppppppppppppppppppp
Total column is 5
字段名: ID---->字段值:1
字段名: SensorID---->字段值:101
字段名: SiteNum---->字段值:261
字段名: Time---->字段值:20100314
字段名: SensorParameter---->字段值:18.9
==========================
Total column is 5
字段名: ID---->字段值:2
字段名: SensorID---->字段值:369
字段名: SiteNum---->字段值:281
字段名: Time---->字段值:20100616
字段名: SensorParameter---->字段值:113.0
==========================
Total column is 5
字段名: ID---->字段值:3
字段名: SensorID---->字段值:667
字段名: SiteNum---->字段值:290
字段名: Time---->字段值:20110315
字段名: SensorParameter---->字段值:27.0
==========================
Total column is 5
字段名: ID---->字段值:4
字段名: SensorID---->字段值:865
字段名: SiteNum---->字段值:300
字段名: Time---->字段值:20120616
字段名: SensorParameter---->字段值:323.0
==========================
operate Failed: near "DELETE?": Syntax error
row:4 column:5
After deleting,the result of querying is :
azResult[0] = ID
azResult[1] = SensorID
azResult[2] = SiteNum
azResult[3] = Time
azResult[4] = SensorParameter
azResult[5] = 1
azResult[6] = 101
azResult[7] = 261
azResult[8] = 20100314
azResult[9] = 18.9
azResult[10] = 2
azResult[11] = 369
azResult[12] = 281
azResult[13] = 20100616
azResult[14] = 113.0
azResult[15] = 3
azResult[16] = 667
azResult[17] = 290
azResult[18] = 20110315
azResult[19] = 27.0
azResult[20] = 4
azResult[21] = 865
azResult[22] = 300
azResult[23] = 20120616
azResult[24] = 323.0
[root@localhost MysqLite_databasefile]#
sql
删除语句出现语法错误,经检查发现 DELETE 后面多了空格,修改后,执行结果如下

[root@localhost MysqLite_databasefile]# ./mysqlite3
You have opened a sqlite3 database successfully!
row:4 column = 5
The result of querying is :
azResult[0] = ID
azResult[1] = SensorID
azResult[2] = SiteNum
azResult[3] = Time
azResult[4] = SensorParameter
azResult[5] = 1
azResult[6] = 101
azResult[7] = 261
azResult[8] = 20100314
azResult[9] = 18.9
azResult[10] = 2
azResult[11] = 369
azResult[12] = 281
azResult[13] = 20100616
azResult[14] = 113.0
azResult[15] = 3
azResult[16] = 667
azResult[17] = 290
azResult[18] = 20110315
azResult[19] = 27.0
azResult[20] = 4
azResult[21] = 865
azResult[22] = 300
azResult[23] = 20120616
azResult[24] = 323.0
ppppppppppppppppppppppppppppppppppp
Total column is 5
字段名: ID---->字段值:1
字段名: SensorID---->字段值:101
字段名: SiteNum---->字段值:261
字段名: Time---->字段值:20100314
字段名: SensorParameter---->字段值:18.9
==========================
Total column is 5
字段名: ID---->字段值:2
字段名: SensorID---->字段值:369
字段名: SiteNum---->字段值:281
字段名: Time---->字段值:20100616
字段名: SensorParameter---->字段值:113.0
==========================
Total column is 5
字段名: ID---->字段值:3
字段名: SensorID---->字段值:667
字段名: SiteNum---->字段值:290
字段名: Time---->字段值:20110315
字段名: SensorParameter---->字段值:27.0
==========================
Total column is 5
字段名: ID---->字段值:4
字段名: SensorID---->字段值:865
字段名: SiteNum---->字段值:300
字段名: Time---->字段值:20120616
字段名: SensorParameter---->字段值:323.0
==========================
row:3 column:5
After deleting,the result of querying is :
azResult[0] = ID
azResult[1] = SensorID
azResult[2] = SiteNum
azResult[3] = Time
azResult[4] = SensorParameter
azResult[5] = 1
azResult[6] = 101
azResult[7] = 261
azResult[8] = 20100314
azResult[9] = 18.9
azResult[10] = 2
azResult[11] = 369
azResult[12] = 281
azResult[13] = 20100616
azResult[14] = 113.0
azResult[15] = 3
azResult[16] = 667
azResult[17] = 290
azResult[18] = 20110315
azResult[19] = 27.0
[root@localhost MysqLite_databasefile]#

sqlite3ext.h头文件

/*
** 2006 June 7
**
** The author disclaims copyright to this source code. In place of
** a legal notice,here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely,never taking more than you give.
**
*************************************************************************
** This header file defines the sqlite interface for use by
** shared librarIEs that want to be imported as extensions into
** an sqlite instance. Shared librarIEs that intend to be loaded
** as extensions by sqlite should #include this file instead of
** sqlite3.h.
*/
#ifndef _sqlite3EXT_H_
#define _sqlite3EXT_H_
#include "sqlite3.h"

typedef struct sqlite3_API_routines sqlite3_API_routines;

/*
** The following structure holds pointers to all of the sqlite API
** routines.
**
** WARNING: In order to maintain backwards compatibility,add new
** interfaces to the end of this structure only. If you insert new
** interfaces in the mIDdle of this structure,then older different
** versions of sqlite will not be able to load each others' shared
** librarIEs!
*/
struct sqlite3_API_routines {
voID * (*aggregate_context)(sqlite3_context*,int nBytes);
int (*aggregate_count)(sqlite3_context*);
int (*bind_blob)(sqlite3_stmt*,int,const voID*,int n,voID(*)(voID*));
int (*bind_double)(sqlite3_stmt*,double);
int (*bind_int)(sqlite3_stmt*,int);
int (*bind_int64)(sqlite3_stmt*,sqlite_int64);
int (*bind_null)(sqlite3_stmt*,int);
int (*bind_parameter_count)(sqlite3_stmt*);
int (*bind_parameter_index)(sqlite3_stmt*,const char*zname);
const char * (*bind_parameter_name)(sqlite3_stmt*,int);
int (*bind_text)(sqlite3_stmt*,const char*,voID(*)(voID*));
int (*bind_text16)(sqlite3_stmt*,voID(*)(voID*));
int (*bind_value)(sqlite3_stmt*,const sqlite3_value*);
int (*busy_handler)(sqlite3*,int(*)(voID*,int),voID*);
int (*busy_timeout)(sqlite3*,int ms);
int (*changes)(sqlite3*);
int (*close)(sqlite3*);
int (*collation_needed)(sqlite3*,voID*,voID(*)(voID*,sqlite3*,
int eTextRep,const char*));
int (*collation_needed16)(sqlite3*,const voID*));
const voID * (*column_blob)(sqlite3_stmt*,int iCol);
int (*column_bytes)(sqlite3_stmt*,int iCol);
int (*column_bytes16)(sqlite3_stmt*,int iCol);
int (*column_count)(sqlite3_stmt*pStmt);
const char * (*column_database_name)(sqlite3_stmt*,int);
const voID * (*column_database_name16)(sqlite3_stmt*,int);
const char * (*column_decltype)(sqlite3_stmt*,int i);
const voID * (*column_decltype16)(sqlite3_stmt*,int);
double (*column_double)(sqlite3_stmt*,int iCol);
int (*column_int)(sqlite3_stmt*,int iCol);
sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
const char * (*column_name)(sqlite3_stmt*,int);
const voID * (*column_name16)(sqlite3_stmt*,int);
const char * (*column_origin_name)(sqlite3_stmt*,int);
const voID * (*column_origin_name16)(sqlite3_stmt*,int);
const char * (*column_table_name)(sqlite3_stmt*,int);
const voID * (*column_table_name16)(sqlite3_stmt*,int);
const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
const voID * (*column_text16)(sqlite3_stmt*,int iCol);
int (*column_type)(sqlite3_stmt*,int iCol);
sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
voID * (*commit_hook)(sqlite3*,int(*)(voID*),voID*);
int (*complete)(const char*sql);
int (*complete16)(const voID*sql);
int (*create_collation)(sqlite3*,
int(*)(voID*,const voID*));
int (*create_collation16)(sqlite3*,const voID*));
int (*create_function)(sqlite3*,
voID (*xFunc)(sqlite3_context*,sqlite3_value**),
voID (*xStep)(sqlite3_context*,
voID (*xFinal)(sqlite3_context*));
int (*create_function16)(sqlite3*,
voID (*xFinal)(sqlite3_context*));
int (*create_module)(sqlite3*,const sqlite3_module*,voID*);
int (*data_count)(sqlite3_stmt*pStmt);
sqlite3 * (*db_handle)(sqlite3_stmt*);
int (*declare_vtab)(sqlite3*,const char*);
int (*enable_shared_cache)(int);
int (*errcode)(sqlite3*db);
const char * (*errmsg)(sqlite3*);
const voID * (*errmsg16)(sqlite3*);
int (*exec)(sqlite3*,sqlite3_callback,char**);
int (*expired)(sqlite3_stmt*);
int (*finalize)(sqlite3_stmt*pStmt);
voID (*free)(voID*);
voID (*free_table)(char**result);
int (*get_autocommit)(sqlite3*);
voID * (*get_auxdata)(sqlite3_context*,int);
int (*get_table)(sqlite3*,char***,int*,char**);
int (*global_recover)(voID);
voID (*interruptx)(sqlite3*);
sqlite_int64 (*last_insert_rowID)(sqlite3*);
const char * (*libversion)(voID);
int (*libversion_number)(voID);
voID *(*malloc)(int);
char * (*mprintf)(const char*,...);
int (*open)(const char*,sqlite3**);
int (*open16)(const voID*,sqlite3**);
int (*prepare)(sqlite3*,sqlite3_stmt**,const char**);
int (*prepare16)(sqlite3*,const voID**);
voID * (*profile)(sqlite3*,sqlite_uint64),voID*);
voID (*progress_handler)(sqlite3*,voID*);
voID *(*realloc)(voID*,int);
int (*reset)(sqlite3_stmt*pStmt);
voID (*result_blob)(sqlite3_context*,voID(*)(voID*));
voID (*result_double)(sqlite3_context*,double);
voID (*result_error)(sqlite3_context*,int);
voID (*result_error16)(sqlite3_context*,int);
voID (*result_int)(sqlite3_context*,int);
voID (*result_int64)(sqlite3_context*,sqlite_int64);
voID (*result_null)(sqlite3_context*);
voID (*result_text)(sqlite3_context*,voID(*)(voID*));
voID (*result_text16)(sqlite3_context*,voID(*)(voID*));
voID (*result_text16be)(sqlite3_context*,voID(*)(voID*));
voID (*result_text16le)(sqlite3_context*,voID(*)(voID*));
voID (*result_value)(sqlite3_context*,sqlite3_value*);
voID * (*rollback_hook)(sqlite3*,voID(*)(voID*),voID*);
int (*set_authorizer)(sqlite3*,
const char*,const char*),voID*);
voID (*set_auxdata)(sqlite3_context*,voID (*)(voID*));
char * (*snprintf)(int,char*,...);
int (*step)(sqlite3_stmt*);
int (*table_column_Metadata)(sqlite3*,
char const**,char const**,int*);
voID (*thread_cleanup)(voID);
int (*total_changes)(sqlite3*);
voID * (*trace)(sqlite3*,voID(*xTrace)(voID*,voID*);
int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
voID * (*update_hook)(sqlite3*,char const*,
sqlite_int64),voID*);
voID * (*user_data)(sqlite3_context*);
const voID * (*value_blob)(sqlite3_value*);
int (*value_bytes)(sqlite3_value*);
int (*value_bytes16)(sqlite3_value*);
double (*value_double)(sqlite3_value*);
int (*value_int)(sqlite3_value*);
sqlite_int64 (*value_int64)(sqlite3_value*);
int (*value_numeric_type)(sqlite3_value*);
const unsigned char * (*value_text)(sqlite3_value*);
const voID * (*value_text16)(sqlite3_value*);
const voID * (*value_text16be)(sqlite3_value*);
const voID * (*value_text16le)(sqlite3_value*);
int (*value_type)(sqlite3_value*);
char *(*vmprintf)(const char*,va_List);
/* Added ??? */
int (*overload_function)(sqlite3*,const char *zFuncname,int nArg);
/* Added by 3.3.13 */
int (*prepare_v2)(sqlite3*,const char**);
int (*prepare16_v2)(sqlite3*,const voID**);
int (*clear_bindings)(sqlite3_stmt*);
/* Added by 3.4.1 */
int (*create_module_v2)(sqlite3*,
voID (*xDestroy)(voID *));
/* Added by 3.5.0 */
int (*bind_zeroblob)(sqlite3_stmt*,int);
int (*blob_bytes)(sqlite3_blob*);
int (*blob_close)(sqlite3_blob*);
int (*blob_open)(sqlite3*,sqlite3_int64,
int,sqlite3_blob**);
int (*blob_read)(sqlite3_blob*,int);
int (*blob_write)(sqlite3_blob*,int);
int (*create_collation_v2)(sqlite3*,const voID*),
voID(*)(voID*));
int (*file_control)(sqlite3*,voID*);
sqlite3_int64 (*memory_highwater)(int);
sqlite3_int64 (*memory_used)(voID);
sqlite3_mutex *(*mutex_alloc)(int);
voID (*mutex_enter)(sqlite3_mutex*);
voID (*mutex_free)(sqlite3_mutex*);
voID (*mutex_leave)(sqlite3_mutex*);
int (*mutex_try)(sqlite3_mutex*);
int (*open_v2)(const char*,sqlite3**,const char*);
int (*release_memory)(int);
voID (*result_error_nomem)(sqlite3_context*);
voID (*result_error_toobig)(sqlite3_context*);
int (*sleep)(int);
voID (*soft_heap_limit)(int);
sqlite3_vfs *(*vfs_find)(const char*);
int (*vfs_register)(sqlite3_vfs*,int);
int (*vfs_unregister)(sqlite3_vfs*);
int (*xthreadsafe)(voID);
voID (*result_zeroblob)(sqlite3_context*,int);
voID (*result_error_code)(sqlite3_context*,int);
int (*test_control)(int,...);
voID (*randomness)(int,voID*);
sqlite3 *(*context_db_handle)(sqlite3_context*);
int (*extended_result_codes)(sqlite3*,int);
int (*limit)(sqlite3*,int);
sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
const char *(*sql)(sqlite3_stmt*);
int (*status)(int,int);
int (*backup_finish)(sqlite3_backuP*);
sqlite3_backup *(*backup_init)(sqlite3*,const char*);
int (*backup_pagecount)(sqlite3_backuP*);
int (*backup_remaining)(sqlite3_backuP*);
int (*backup_step)(sqlite3_backuP*,int);
const char *(*compileoption_get)(int);
int (*compileoption_used)(const char*);
int (*create_function_v2)(sqlite3*,
voID (*xFinal)(sqlite3_context*),
voID(*xDestroy)(voID*));
int (*db_config)(sqlite3*,...);
sqlite3_mutex *(*db_mutex)(sqlite3*);
int (*db_status)(sqlite3*,int);
int (*extended_errcode)(sqlite3*);
voID (*log)(int,...);
sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
const char *(*sourceID)(voID);
int (*stmt_status)(sqlite3_stmt*,int);
int (*strnicmp)(const char*,int);
int (*unlock_notify)(sqlite3*,voID(*)(voID**,voID*);
int (*wal_autocheckpoint)(sqlite3*,int);
int (*wal_checkpoint)(sqlite3*,const char*);
voID *(*wal_hook)(sqlite3*,voID*);
int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
int (*vtab_config)(sqlite3*,int op,...);
int (*vtab_on_conflict)(sqlite3*);
};

/*
** The following macros redefine the API routines so that they are
** redirected throught the global sqlite3_API structure.
**
** This header file is also used by the loadext.c source file
** (part of the main sqlite library - not an extension) so that
** it can get access to the sqlite3_API_routines structure
** deFinition. But the main library does not want to redefine
** the API. So the redeFinition macros are only valID if the
** sqlITE_CORE macros is undefined.
*/
#ifndef sqlITE_CORE
#define sqlite3_aggregate_context sqlite3_API->aggregate_context
#ifndef sqlITE_OMIT_DEPRECATED
#define sqlite3_aggregate_count sqlite3_API->aggregate_count
#endif
#define sqlite3_bind_blob sqlite3_API->bind_blob
#define sqlite3_bind_double sqlite3_API->bind_double
#define sqlite3_bind_int sqlite3_API->bind_int
#define sqlite3_bind_int64 sqlite3_API->bind_int64
#define sqlite3_bind_null sqlite3_API->bind_null
#define sqlite3_bind_parameter_count sqlite3_API->bind_parameter_count
#define sqlite3_bind_parameter_index sqlite3_API->bind_parameter_index
#define sqlite3_bind_parameter_name sqlite3_API->bind_parameter_name
#define sqlite3_bind_text sqlite3_API->bind_text
#define sqlite3_bind_text16 sqlite3_API->bind_text16
#define sqlite3_bind_value sqlite3_API->bind_value
#define sqlite3_busy_handler sqlite3_API->busy_handler
#define sqlite3_busy_timeout sqlite3_API->busy_timeout
#define sqlite3_changes sqlite3_API->changes
#define sqlite3_close sqlite3_API->close
#define sqlite3_collation_needed sqlite3_API->collation_needed
#define sqlite3_collation_needed16 sqlite3_API->collation_needed16
#define sqlite3_column_blob sqlite3_API->column_blob
#define sqlite3_column_bytes sqlite3_API->column_bytes
#define sqlite3_column_bytes16 sqlite3_API->column_bytes16
#define sqlite3_column_count sqlite3_API->column_count
#define sqlite3_column_database_name sqlite3_API->column_database_name
#define sqlite3_column_database_name16 sqlite3_API->column_database_name16
#define sqlite3_column_decltype sqlite3_API->column_decltype
#define sqlite3_column_decltype16 sqlite3_API->column_decltype16
#define sqlite3_column_double sqlite3_API->column_double
#define sqlite3_column_int sqlite3_API->column_int
#define sqlite3_column_int64 sqlite3_API->column_int64
#define sqlite3_column_name sqlite3_API->column_name
#define sqlite3_column_name16 sqlite3_API->column_name16
#define sqlite3_column_origin_name sqlite3_API->column_origin_name
#define sqlite3_column_origin_name16 sqlite3_API->column_origin_name16
#define sqlite3_column_table_name sqlite3_API->column_table_name
#define sqlite3_column_table_name16 sqlite3_API->column_table_name16
#define sqlite3_column_text sqlite3_API->column_text
#define sqlite3_column_text16 sqlite3_API->column_text16
#define sqlite3_column_type sqlite3_API->column_type
#define sqlite3_column_value sqlite3_API->column_value
#define sqlite3_commit_hook sqlite3_API->commit_hook
#define sqlite3_complete sqlite3_API->complete
#define sqlite3_complete16 sqlite3_API->complete16
#define sqlite3_create_collation sqlite3_API->create_collation
#define sqlite3_create_collation16 sqlite3_API->create_collation16
#define sqlite3_create_function sqlite3_API->create_function
#define sqlite3_create_function16 sqlite3_API->create_function16
#define sqlite3_create_module sqlite3_API->create_module
#define sqlite3_create_module_v2 sqlite3_API->create_module_v2
#define sqlite3_data_count sqlite3_API->data_count
#define sqlite3_db_handle sqlite3_API->db_handle
#define sqlite3_declare_vtab sqlite3_API->declare_vtab
#define sqlite3_enable_shared_cache sqlite3_API->enable_shared_cache
#define sqlite3_errcode sqlite3_API->errcode
#define sqlite3_errmsg sqlite3_API->errmsg
#define sqlite3_errmsg16 sqlite3_API->errmsg16
#define sqlite3_exec sqlite3_API->exec
#ifndef sqlITE_OMIT_DEPRECATED
#define sqlite3_expired sqlite3_API->expired
#endif
#define sqlite3_finalize sqlite3_API->finalize
#define sqlite3_free sqlite3_API->free
#define sqlite3_free_table sqlite3_API->free_table
#define sqlite3_get_autocommit sqlite3_API->get_autocommit
#define sqlite3_get_auxdata sqlite3_API->get_auxdata
#define sqlite3_get_table sqlite3_API->get_table
#ifndef sqlITE_OMIT_DEPRECATED
#define sqlite3_global_recover sqlite3_API->global_recover
#endif
#define sqlite3_interrupt sqlite3_API->interruptx
#define sqlite3_last_insert_rowID sqlite3_API->last_insert_rowID
#define sqlite3_libversion sqlite3_API->libversion
#define sqlite3_libversion_number sqlite3_API->libversion_number
#define sqlite3_malloc sqlite3_API->malloc
#define sqlite3_mprintf sqlite3_API->mprintf
#define sqlite3_open sqlite3_API->open
#define sqlite3_open16 sqlite3_API->open16
#define sqlite3_prepare sqlite3_API->prepare
#define sqlite3_prepare16 sqlite3_API->prepare16
#define sqlite3_prepare_v2 sqlite3_API->prepare_v2
#define sqlite3_prepare16_v2 sqlite3_API->prepare16_v2
#define sqlite3_profile sqlite3_API->profile
#define sqlite3_progress_handler sqlite3_API->progress_handler
#define sqlite3_realloc sqlite3_API->realloc
#define sqlite3_reset sqlite3_API->reset
#define sqlite3_result_blob sqlite3_API->result_blob
#define sqlite3_result_double sqlite3_API->result_double
#define sqlite3_result_error sqlite3_API->result_error
#define sqlite3_result_error16 sqlite3_API->result_error16
#define sqlite3_result_int sqlite3_API->result_int
#define sqlite3_result_int64 sqlite3_API->result_int64
#define sqlite3_result_null sqlite3_API->result_null
#define sqlite3_result_text sqlite3_API->result_text
#define sqlite3_result_text16 sqlite3_API->result_text16
#define sqlite3_result_text16be sqlite3_API->result_text16be
#define sqlite3_result_text16le sqlite3_API->result_text16le
#define sqlite3_result_value sqlite3_API->result_value
#define sqlite3_rollback_hook sqlite3_API->rollback_hook
#define sqlite3_set_authorizer sqlite3_API->set_authorizer
#define sqlite3_set_auxdata sqlite3_API->set_auxdata
#define sqlite3_snprintf sqlite3_API->snprintf
#define sqlite3_step sqlite3_API->step
#define sqlite3_table_column_Metadata sqlite3_API->table_column_Metadata
#define sqlite3_thread_cleanup sqlite3_API->thread_cleanup
#define sqlite3_total_changes sqlite3_API->total_changes
#define sqlite3_trace sqlite3_API->trace
#ifndef sqlITE_OMIT_DEPRECATED
#define sqlite3_transfer_bindings sqlite3_API->transfer_bindings
#endif
#define sqlite3_update_hook sqlite3_API->update_hook
#define sqlite3_user_data sqlite3_API->user_data
#define sqlite3_value_blob sqlite3_API->value_blob
#define sqlite3_value_bytes sqlite3_API->value_bytes
#define sqlite3_value_bytes16 sqlite3_API->value_bytes16
#define sqlite3_value_double sqlite3_API->value_double
#define sqlite3_value_int sqlite3_API->value_int
#define sqlite3_value_int64 sqlite3_API->value_int64
#define sqlite3_value_numeric_type sqlite3_API->value_numeric_type
#define sqlite3_value_text sqlite3_API->value_text
#define sqlite3_value_text16 sqlite3_API->value_text16
#define sqlite3_value_text16be sqlite3_API->value_text16be
#define sqlite3_value_text16le sqlite3_API->value_text16le
#define sqlite3_value_type sqlite3_API->value_type
#define sqlite3_vmprintf sqlite3_API->vmprintf
#define sqlite3_overload_function sqlite3_API->overload_function
#define sqlite3_prepare_v2 sqlite3_API->prepare_v2
#define sqlite3_prepare16_v2 sqlite3_API->prepare16_v2
#define sqlite3_clear_bindings sqlite3_API->clear_bindings
#define sqlite3_bind_zeroblob sqlite3_API->bind_zeroblob
#define sqlite3_blob_bytes sqlite3_API->blob_bytes
#define sqlite3_blob_close sqlite3_API->blob_close
#define sqlite3_blob_open sqlite3_API->blob_open
#define sqlite3_blob_read sqlite3_API->blob_read
#define sqlite3_blob_write sqlite3_API->blob_write
#define sqlite3_create_collation_v2 sqlite3_API->create_collation_v2
#define sqlite3_file_control sqlite3_API->file_control
#define sqlite3_memory_highwater sqlite3_API->memory_highwater
#define sqlite3_memory_used sqlite3_API->memory_used
#define sqlite3_mutex_alloc sqlite3_API->mutex_alloc
#define sqlite3_mutex_enter sqlite3_API->mutex_enter
#define sqlite3_mutex_free sqlite3_API->mutex_free
#define sqlite3_mutex_leave sqlite3_API->mutex_leave
#define sqlite3_mutex_try sqlite3_API->mutex_try
#define sqlite3_open_v2 sqlite3_API->open_v2
#define sqlite3_release_memory sqlite3_API->release_memory
#define sqlite3_result_error_nomem sqlite3_API->result_error_nomem
#define sqlite3_result_error_toobig sqlite3_API->result_error_toobig
#define sqlite3_sleep sqlite3_API->sleep
#define sqlite3_soft_heap_limit sqlite3_API->soft_heap_limit
#define sqlite3_vfs_find sqlite3_API->vfs_find
#define sqlite3_vfs_register sqlite3_API->vfs_register
#define sqlite3_vfs_unregister sqlite3_API->vfs_unregister
#define sqlite3_threadsafe sqlite3_API->xthreadsafe
#define sqlite3_result_zeroblob sqlite3_API->result_zeroblob
#define sqlite3_result_error_code sqlite3_API->result_error_code
#define sqlite3_test_control sqlite3_API->test_control
#define sqlite3_randomness sqlite3_API->randomness
#define sqlite3_context_db_handle sqlite3_API->context_db_handle
#define sqlite3_extended_result_codes sqlite3_API->extended_result_codes
#define sqlite3_limit sqlite3_API->limit
#define sqlite3_next_stmt sqlite3_API->next_stmt
#define sqlite3_sql sqlite3_API->sql
#define sqlite3_status sqlite3_API->status
#define sqlite3_backup_finish sqlite3_API->backup_finish
#define sqlite3_backup_init sqlite3_API->backup_init
#define sqlite3_backup_pagecount sqlite3_API->backup_pagecount
#define sqlite3_backup_remaining sqlite3_API->backup_remaining
#define sqlite3_backup_step sqlite3_API->backup_step
#define sqlite3_compileoption_get sqlite3_API->compileoption_get
#define sqlite3_compileoption_used sqlite3_API->compileoption_used
#define sqlite3_create_function_v2 sqlite3_API->create_function_v2
#define sqlite3_db_config sqlite3_API->db_config
#define sqlite3_db_mutex sqlite3_API->db_mutex
#define sqlite3_db_status sqlite3_API->db_status
#define sqlite3_extended_errcode sqlite3_API->extended_errcode
#define sqlite3_log sqlite3_API->log
#define sqlite3_soft_heap_limit64 sqlite3_API->soft_heap_limit64
#define sqlite3_sourceID sqlite3_API->sourceID
#define sqlite3_stmt_status sqlite3_API->stmt_status
#define sqlite3_strnicmp sqlite3_API->strnicmp
#define sqlite3_unlock_notify sqlite3_API->unlock_notify
#define sqlite3_wal_autocheckpoint sqlite3_API->wal_autocheckpoint
#define sqlite3_wal_checkpoint sqlite3_API->wal_checkpoint
#define sqlite3_wal_hook sqlite3_API->wal_hook
#define sqlite3_blob_reopen sqlite3_API->blob_reopen
#define sqlite3_vtab_config sqlite3_API->vtab_config
#define sqlite3_vtab_on_conflict sqlite3_API->vtab_on_conflict
#endif /* sqlITE_CORE */

#define sqlITE_EXTENSION_INIT1 const sqlite3_API_routines *sqlite3_API = 0;
#define sqlITE_EXTENSION_INIT2(v) sqlite3_API = v;

#endif /* _sqlite3EXT_H_ */

总结

以上是内存溢出为你收集整理的sqlite3 c例程(大家直接拿来改就行)全部内容,希望文章能够帮你解决sqlite3 c例程(大家直接拿来改就行)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1173069.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存