Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: third_party/sqlite/src/src/wal.h

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/src/vxworks.h ('k') | third_party/sqlite/src/src/wal.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** 2010 February 1 2 ** 2010 February 1
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
11 ************************************************************************* 11 *************************************************************************
12 ** This header file defines the interface to the write-ahead logging 12 ** This header file defines the interface to the write-ahead logging
13 ** system. Refer to the comments below and the header comment attached to 13 ** system. Refer to the comments below and the header comment attached to
14 ** the implementation of each function in log.c for further details. 14 ** the implementation of each function in log.c for further details.
15 */ 15 */
16 16
17 #ifndef _WAL_H_ 17 #ifndef SQLITE_WAL_H
18 #define _WAL_H_ 18 #define SQLITE_WAL_H
19 19
20 #include "sqliteInt.h" 20 #include "sqliteInt.h"
21 21
22 /* Additional values that can be added to the sync_flags argument of 22 /* Additional values that can be added to the sync_flags argument of
23 ** sqlite3WalFrames(): 23 ** sqlite3WalFrames():
24 */ 24 */
25 #define WAL_SYNC_TRANSACTIONS 0x20 /* Sync at the end of each transaction */ 25 #define WAL_SYNC_TRANSACTIONS 0x20 /* Sync at the end of each transaction */
26 #define SQLITE_SYNC_MASK 0x13 /* Mask off the SQLITE_SYNC_* values */ 26 #define SQLITE_SYNC_MASK 0x13 /* Mask off the SQLITE_SYNC_* values */
27 27
28 #ifdef SQLITE_OMIT_WAL 28 #ifdef SQLITE_OMIT_WAL
29 # define sqlite3WalOpen(x,y,z) 0 29 # define sqlite3WalOpen(x,y,z) 0
30 # define sqlite3WalLimit(x,y) 30 # define sqlite3WalLimit(x,y)
31 # define sqlite3WalClose(w,x,y,z) 0 31 # define sqlite3WalClose(v,w,x,y,z) 0
32 # define sqlite3WalBeginReadTransaction(y,z) 0 32 # define sqlite3WalBeginReadTransaction(y,z) 0
33 # define sqlite3WalEndReadTransaction(z) 33 # define sqlite3WalEndReadTransaction(z)
34 # define sqlite3WalDbsize(y) 0 34 # define sqlite3WalDbsize(y) 0
35 # define sqlite3WalBeginWriteTransaction(y) 0 35 # define sqlite3WalBeginWriteTransaction(y) 0
36 # define sqlite3WalEndWriteTransaction(x) 0 36 # define sqlite3WalEndWriteTransaction(x) 0
37 # define sqlite3WalUndo(x,y,z) 0 37 # define sqlite3WalUndo(x,y,z) 0
38 # define sqlite3WalSavepoint(y,z) 38 # define sqlite3WalSavepoint(y,z)
39 # define sqlite3WalSavepointUndo(y,z) 0 39 # define sqlite3WalSavepointUndo(y,z) 0
40 # define sqlite3WalFrames(u,v,w,x,y,z) 0 40 # define sqlite3WalFrames(u,v,w,x,y,z) 0
41 # define sqlite3WalCheckpoint(r,s,t,u,v,w,x,y,z) 0 41 # define sqlite3WalCheckpoint(q,r,s,t,u,v,w,x,y,z) 0
42 # define sqlite3WalCallback(z) 0 42 # define sqlite3WalCallback(z) 0
43 # define sqlite3WalExclusiveMode(y,z) 0 43 # define sqlite3WalExclusiveMode(y,z) 0
44 # define sqlite3WalHeapMemory(z) 0 44 # define sqlite3WalHeapMemory(z) 0
45 # define sqlite3WalFramesize(z) 0 45 # define sqlite3WalFramesize(z) 0
46 # define sqlite3WalFindFrame(x,y,z) 0 46 # define sqlite3WalFindFrame(x,y,z) 0
47 # define sqlite3WalFile(x) 0 47 # define sqlite3WalFile(x) 0
48 #else 48 #else
49 49
50 #define WAL_SAVEPOINT_NDATA 4 50 #define WAL_SAVEPOINT_NDATA 4
51 51
52 /* Connection to a write-ahead log (WAL) file. 52 /* Connection to a write-ahead log (WAL) file.
53 ** There is one object of this type for each pager. 53 ** There is one object of this type for each pager.
54 */ 54 */
55 typedef struct Wal Wal; 55 typedef struct Wal Wal;
56 56
57 /* Open and close a connection to a write-ahead log. */ 57 /* Open and close a connection to a write-ahead log. */
58 int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**); 58 int sqlite3WalOpen(sqlite3_vfs*, sqlite3_file*, const char *, int, i64, Wal**);
59 int sqlite3WalClose(Wal *pWal, int sync_flags, int, u8 *); 59 int sqlite3WalClose(Wal *pWal, sqlite3*, int sync_flags, int, u8 *);
60 60
61 /* Set the limiting size of a WAL file. */ 61 /* Set the limiting size of a WAL file. */
62 void sqlite3WalLimit(Wal*, i64); 62 void sqlite3WalLimit(Wal*, i64);
63 63
64 /* Used by readers to open (lock) and close (unlock) a snapshot. A 64 /* Used by readers to open (lock) and close (unlock) a snapshot. A
65 ** snapshot is like a read-transaction. It is the state of the database 65 ** snapshot is like a read-transaction. It is the state of the database
66 ** at an instant in time. sqlite3WalOpenSnapshot gets a read lock and 66 ** at an instant in time. sqlite3WalOpenSnapshot gets a read lock and
67 ** preserves the current state even if the other threads or processes 67 ** preserves the current state even if the other threads or processes
68 ** write to or checkpoint the WAL. sqlite3WalCloseSnapshot() closes the 68 ** write to or checkpoint the WAL. sqlite3WalCloseSnapshot() closes the
69 ** transaction and releases the lock. 69 ** transaction and releases the lock.
(...skipping 22 matching lines...) Expand all
92 /* Move the write position of the WAL back to iFrame. Called in 92 /* Move the write position of the WAL back to iFrame. Called in
93 ** response to a ROLLBACK TO command. */ 93 ** response to a ROLLBACK TO command. */
94 int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData); 94 int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData);
95 95
96 /* Write a frame or frames to the log. */ 96 /* Write a frame or frames to the log. */
97 int sqlite3WalFrames(Wal *pWal, int, PgHdr *, Pgno, int, int); 97 int sqlite3WalFrames(Wal *pWal, int, PgHdr *, Pgno, int, int);
98 98
99 /* Copy pages from the log to the database file */ 99 /* Copy pages from the log to the database file */
100 int sqlite3WalCheckpoint( 100 int sqlite3WalCheckpoint(
101 Wal *pWal, /* Write-ahead log connection */ 101 Wal *pWal, /* Write-ahead log connection */
102 sqlite3 *db, /* Check this handle's interrupt flag */
102 int eMode, /* One of PASSIVE, FULL and RESTART */ 103 int eMode, /* One of PASSIVE, FULL and RESTART */
103 int (*xBusy)(void*), /* Function to call when busy */ 104 int (*xBusy)(void*), /* Function to call when busy */
104 void *pBusyArg, /* Context argument for xBusyHandler */ 105 void *pBusyArg, /* Context argument for xBusyHandler */
105 int sync_flags, /* Flags to sync db file with (or 0) */ 106 int sync_flags, /* Flags to sync db file with (or 0) */
106 int nBuf, /* Size of buffer nBuf */ 107 int nBuf, /* Size of buffer nBuf */
107 u8 *zBuf, /* Temporary buffer to use */ 108 u8 *zBuf, /* Temporary buffer to use */
108 int *pnLog, /* OUT: Number of frames in WAL */ 109 int *pnLog, /* OUT: Number of frames in WAL */
109 int *pnCkpt /* OUT: Number of backfilled frames in WAL */ 110 int *pnCkpt /* OUT: Number of backfilled frames in WAL */
110 ); 111 );
111 112
(...skipping 11 matching lines...) Expand all
123 124
124 /* Return true if the argument is non-NULL and the WAL module is using 125 /* Return true if the argument is non-NULL and the WAL module is using
125 ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the 126 ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
126 ** WAL module is using shared-memory, return false. 127 ** WAL module is using shared-memory, return false.
127 */ 128 */
128 int sqlite3WalHeapMemory(Wal *pWal); 129 int sqlite3WalHeapMemory(Wal *pWal);
129 130
130 #ifdef SQLITE_ENABLE_SNAPSHOT 131 #ifdef SQLITE_ENABLE_SNAPSHOT
131 int sqlite3WalSnapshotGet(Wal *pWal, sqlite3_snapshot **ppSnapshot); 132 int sqlite3WalSnapshotGet(Wal *pWal, sqlite3_snapshot **ppSnapshot);
132 void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot); 133 void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot);
134 int sqlite3WalSnapshotRecover(Wal *pWal);
133 #endif 135 #endif
134 136
135 #ifdef SQLITE_ENABLE_ZIPVFS 137 #ifdef SQLITE_ENABLE_ZIPVFS
136 /* If the WAL file is not empty, return the number of bytes of content 138 /* If the WAL file is not empty, return the number of bytes of content
137 ** stored in each frame (i.e. the db page-size when the WAL was created). 139 ** stored in each frame (i.e. the db page-size when the WAL was created).
138 */ 140 */
139 int sqlite3WalFramesize(Wal *pWal); 141 int sqlite3WalFramesize(Wal *pWal);
140 #endif 142 #endif
141 143
142 /* Return the sqlite3_file object for the WAL file */ 144 /* Return the sqlite3_file object for the WAL file */
143 sqlite3_file *sqlite3WalFile(Wal *pWal); 145 sqlite3_file *sqlite3WalFile(Wal *pWal);
144 146
145 #endif /* ifndef SQLITE_OMIT_WAL */ 147 #endif /* ifndef SQLITE_OMIT_WAL */
146 #endif /* _WAL_H_ */ 148 #endif /* SQLITE_WAL_H */
OLDNEW
« no previous file with comments | « third_party/sqlite/src/src/vxworks.h ('k') | third_party/sqlite/src/src/wal.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698