SQLITE源码剖析(17)

<!--StartFragment-->

/*声明:本SQLite源码剖析系列为刘兴(http://deepfuture.iteye.com/)原创,未经笔者授权,任何人和机构不能转载

** CAPI3REF: Flags For File Open Operations

**文件打开操作标志,sqlite3_open_v2()的第三个参数所用,sqlite3_vfs的xopen模式的第4个参数所用

** These bit values are intended for use in the

** 3rd parameter to the [sqlite3_open_v2()] interface and

** in the 4th parameter to the xOpen method of the

** [sqlite3_vfs] object.

*/

#define SQLITE_OPEN_READONLY         0x00000001  /* Ok for sqlite3_open_v2() */

#define SQLITE_OPEN_READWRITE        0x00000002  /* Ok for sqlite3_open_v2() */

#define SQLITE_OPEN_CREATE           0x00000004  /* Ok for sqlite3_open_v2() */

#define SQLITE_OPEN_DELETEONCLOSE    0x00000008  /* VFS only */

#define SQLITE_OPEN_EXCLUSIVE        0x00000010  /* VFS only */

#define SQLITE_OPEN_AUTOPROXY        0x00000020  /* VFS only */

#define SQLITE_OPEN_MAIN_DB          0x00000100  /* VFS only */

#define SQLITE_OPEN_TEMP_DB          0x00000200  /* VFS only */

#define SQLITE_OPEN_TRANSIENT_DB     0x00000400  /* VFS only */

#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800  /* VFS only */

#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000  /* VFS only */

#define SQLITE_OPEN_SUBJOURNAL       0x00002000  /* VFS only */

#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000  /* VFS only */

#define SQLITE_OPEN_NOMUTEX          0x00008000  /* Ok for sqlite3_open_v2() */

#define SQLITE_OPEN_FULLMUTEX        0x00010000  /* Ok for sqlite3_open_v2() */

#define SQLITE_OPEN_SHAREDCACHE      0x00020000  /* Ok for sqlite3_open_v2() */

#define SQLITE_OPEN_PRIVATECACHE     0x00040000  /* Ok for sqlite3_open_v2() */

 

/*

** CAPI3REF: Device Characteristics

**设备参数

**sqlite3_io_methods对象的xDeviceCapabilities方法返回一个整数,这个整数是主存储设备I/O参数位容器,该主存储设备为sqlite3_io_methods所引用

** The xDeviceCapabilities method of the [sqlite3_io_methods]

** object returns an integer which is a vector of the these

** bit values expressing I/O characteristics of the mass storage

** device that holds the file that the [sqlite3_io_methods]

** refers to.

**SQLITE_IOCAP_ATOMIC属性意味着任何大小的写都是原子性,即要么完成,要么不完成,SQLITE_IOCAP_ATOMICnnn意味着nnn字节大小的块写入某个地址是原子操作,地址是多个nnn组成的整数。SQLITE_IOCAP_SAFE_APPEND意味着当数据增加到一个文件中,这个数据第一次增加时,文件大小扩展;SQLITE_IOCAP_SEQUENTIAL意味着信息按照xWrite()的相同顺序被写到磁盘

** The SQLITE_IOCAP_ATOMIC property means that all writes of

** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values

** mean that writes of blocks that are nnn bytes in size and

** are aligned to an address which is an integer multiple of

** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means

** that when data is appended to a file, the data is appended

** first then the size of the file is extended, never the other

** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that

** information is written to disk in the same order as calls

** to xWrite().

*/

#define SQLITE_IOCAP_ATOMIC          0x00000001

#define SQLITE_IOCAP_ATOMIC512       0x00000002

#define SQLITE_IOCAP_ATOMIC1K        0x00000004

#define SQLITE_IOCAP_ATOMIC2K        0x00000008

#define SQLITE_IOCAP_ATOMIC4K        0x00000010

#define SQLITE_IOCAP_ATOMIC8K        0x00000020

#define SQLITE_IOCAP_ATOMIC16K       0x00000040

#define SQLITE_IOCAP_ATOMIC32K       0x00000080

#define SQLITE_IOCAP_ATOMIC64K       0x00000100

#define SQLITE_IOCAP_SAFE_APPEND     0x00000200

#define SQLITE_IOCAP_SEQUENTIAL      0x00000400

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值