声明:本SQLite源码剖析系列为刘兴(http://deepfuture.iteye.com/)原创,未经笔者授权,任何人和机构不能转载
** CAPI3REF: OS Interface Open File Handle
**sqlite3_file对象代表一个在sqlite3_vfs | OS interface layer打开的文件,独立的OS接口实现将通过这个对象的子类增加自己的字段
** An [sqlite3_file] object represents an open file in the
** [sqlite3_vfs | OS interface layer]. Individual OS interface
** implementations will
** want to subclass this object by appending additional fields
** for their own use. The pMethods entry is a pointer to an
** [sqlite3_io_methods] object that defines methods for performing
** I/O operations on the open file.
*pMethods入口是指向sqlite3_io_methods对象的指针,该对象定义了在打开文件执行I/O操作的方法
*/
typedef struct sqlite3_file sqlite3_file;
struct sqlite3_file {
const struct sqlite3_io_methods *pMethods; /* Methods for an open file */
};
/*
** CAPI3REF: OS Interface File Virtual Methods Object
**OS接口文件的虚拟方法对象
*被sqlite3_vfs对象的xOpen方法打开的每个文件组成了sqlite3_file对象或该对象的子类,这些文件以指向这些对象的实例的指针形式存在
** Every file opened by the [sqlite3_vfs] xOpen method populates an
** [sqlite3_file] object (or, more commonly, a subclass of the
** [sqlite3_file] object) with a pointer to an instance of this object.
**该对象定义了多种对代表sqlite3_file对象的打开文件的操作
** This object defines the methods used to perform various operations
** against the open file represented by the [sqlite3_file] object.
**如果xopen方法设置sqlite3_file.pMethods元素为非NULL指针,则sqlite3_io_methods.xClose会被调用,即使在xOpen失败时也是如此。如果要防止xClose在xopen失败后调用,只能将sqlite3_file.pMethods设置为空
** If the xOpen method sets the sqlite3_file.pMethods element
** to a non-NULL pointer, then the sqlite3_io_methods.xClose method
** may be invoked even if the xOpen reported that it failed. The
** only way to prevent a call to xClose following a failed xOpen
** is for the xOpen to set the sqlite3_file.pMethods element to NULL.
**SQLITE_SYNC_NORMAL和SQLITE_SYNC_FULL是xSync的标志参数,首选是使用标准的fsync(),其次是使用Mac OS X 形式的fullsync。与SQLITE_SYNC_DATAONLY标志进行或运算(即|SQLITE_SYNC_DATAONLY)表明文件数据和它的非索引节点需要被同步
** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or
** [SQLITE_SYNC_FULL]. The first choice is the normal fsync().
** The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY]
** flag may be ORed in to indicate that only the data of the file
** and not its inode needs to be synced.
** The integer values to xLock() and xUnlock() are one of
** <ul>xLock()和 xUnlock()的整数值是下列之一:
** <li> [SQLITE_LOCK_NONE],
** <li> [SQLITE_LOCK_SHARED],
** <li> [SQLITE_LOCK_RESERVED],
** <li> [SQLITE_LOCK_PENDING], or
** <li> [SQLITE_LOCK_EXCLUSIVE].
** </ul>
** xLock() increases the lock. xUnlock() decreases the lock.
xLock增加锁,xUnlock()解锁,xCheckReservedLock()检测是否存在数据库连接,本进程或其它进程是否在文件中施加RESERVED、PENDING或EXCLUSIVE锁,如果锁存在返回true,否则返回false
** The xCheckReservedLock() method checks whether any database connection,
** either in this process or in some other process, is holding a RESERVED,
** PENDING, or EXCLUSIVE lock on the file. It returns true
** if such a lock exists and false otherwise.
分享到:
相关推荐
文档包含sqlite源码,源码分析,以及使用教程
SQLite源码精髓,值得学习!!SQLite源码精髓,值得学习!!SQLite源码精髓,值得学习!!
开源数据库源码sqlite 开源数据库sqlite源码 开源数据库sqlite源码
SQLite是一个小型的,支持嵌入式的数据库,C语言开发,架构清晰。适合研究SQLite源码使用。
sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,
sqlite源码分析数据库高级教程,包括里面所有的代码
Android 数据库 SQLite 详细文档 以及 源代码
学习sqlite时需要用到的源码,是最新的版本,希望对你有用。
sqlite源码在自己工程中的应用,可以不依赖于其他安装程序和插件,并且纯C语言具有跨平台的特性。 工程是在Qt下的,不过代码是很简单的Demo。
这是sqlite数据库的源代码,有兴趣的可以看看是怎么实现的 方便大家学习和查阅。。。。。。。。。。。。。。
QT操作sqlite数据库源码,包括添加,删除,更新操作
这是一个安装中使用sqlite的源码,用面向对象写的,可供参考
sqlite源码库,包含多个版本的vs,可编译使用
非常好的开源C学习项目,轻量级的嵌入式...SQLite是一个开源的嵌入式关系数据库,实现自包容、零配置、支持事务的SQL数据库引擎。 其特点是高度便携、使用方便、结构紧凑、高效、可靠。足够小,大致3万行C代码,250K。
Delphi SQLite实例源码,现在SQLite的用途越来越广了,的确如此,SQLite强大易用,而且存储文件体积小,特别是一些单机程序,特别适合使用SQLite作为数据库,本源码就是一个在Delphi中使用SQLite的例子,一个上报...
sqlite3.08源码及使用指南 sqlite是嵌入式SQL数据库引擎SQLite(SQLite Embeddable SQL Database Engine)的一个扩展。 SQLite是一个实现嵌入式SQL数据库引擎小型C语言库(C library),实现了独立的,可嵌入的,零...
该示例演示C#如何连接SQLite并实现增删改查操作;演示批量操作,须要使用事务处理,才能提高效率;同时加入了SQLDapper框架,代码简练,实用,可以直接放在项目中使用;操作完成后,是完全释放了数据库资源的。该压缩...
sqlite3源码,用vs2013打开项目,可以直接编译成库使用,用于访问sqlite数据库