aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/win32/pager.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/sqlite/win32/pager.h')
-rwxr-xr-xlibraries/sqlite/win32/pager.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/libraries/sqlite/win32/pager.h b/libraries/sqlite/win32/pager.h
new file mode 100755
index 0000000..cf05b11
--- /dev/null
+++ b/libraries/sqlite/win32/pager.h
@@ -0,0 +1,125 @@
1/*
2** 2001 September 15
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** This header file defines the interface that the sqlite page cache
13** subsystem. The page cache subsystem reads and writes a file a page
14** at a time and provides a journal for rollback.
15**
16** @(#) $Id: pager.h,v 1.67 2007/09/03 15:19:35 drh Exp $
17*/
18
19#ifndef _PAGER_H_
20#define _PAGER_H_
21
22/*
23** The type used to represent a page number. The first page in a file
24** is called page 1. 0 is used to represent "not a page".
25*/
26typedef unsigned int Pgno;
27
28/*
29** Each open file is managed by a separate instance of the "Pager" structure.
30*/
31typedef struct Pager Pager;
32
33/*
34** Handle type for pages.
35*/
36typedef struct PgHdr DbPage;
37
38/*
39** Allowed values for the flags parameter to sqlite3PagerOpen().
40**
41** NOTE: This values must match the corresponding BTREE_ values in btree.h.
42*/
43#define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */
44#define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */
45
46/*
47** Valid values for the second argument to sqlite3PagerLockingMode().
48*/
49#define PAGER_LOCKINGMODE_QUERY -1
50#define PAGER_LOCKINGMODE_NORMAL 0
51#define PAGER_LOCKINGMODE_EXCLUSIVE 1
52
53/*
54** See source code comments for a detailed description of the following
55** routines:
56*/
57int sqlite3PagerOpen(sqlite3_vfs *, Pager **ppPager, const char*, int,int,int);
58void sqlite3PagerSetBusyhandler(Pager*, BusyHandler *pBusyHandler);
59void sqlite3PagerSetDestructor(Pager*, void(*)(DbPage*,int));
60void sqlite3PagerSetReiniter(Pager*, void(*)(DbPage*,int));
61int sqlite3PagerSetPagesize(Pager*, u16*);
62int sqlite3PagerMaxPageCount(Pager*, int);
63int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
64void sqlite3PagerSetCachesize(Pager*, int);
65int sqlite3PagerClose(Pager *pPager);
66int sqlite3PagerAcquire(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag);
67#define sqlite3PagerGet(A,B,C) sqlite3PagerAcquire(A,B,C,0)
68DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno);
69int sqlite3PagerRef(DbPage*);
70int sqlite3PagerUnref(DbPage*);
71int sqlite3PagerWrite(DbPage*);
72int sqlite3PagerOverwrite(Pager *pPager, Pgno pgno, void*);
73int sqlite3PagerPagecount(Pager*);
74int sqlite3PagerTruncate(Pager*,Pgno);
75int sqlite3PagerBegin(DbPage*, int exFlag);
76int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, Pgno);
77int sqlite3PagerCommitPhaseTwo(Pager*);
78int sqlite3PagerRollback(Pager*);
79int sqlite3PagerIsreadonly(Pager*);
80int sqlite3PagerStmtBegin(Pager*);
81int sqlite3PagerStmtCommit(Pager*);
82int sqlite3PagerStmtRollback(Pager*);
83void sqlite3PagerDontRollback(DbPage*);
84void sqlite3PagerDontWrite(DbPage*);
85int sqlite3PagerRefcount(Pager*);
86void sqlite3PagerSetSafetyLevel(Pager*,int,int);
87const char *sqlite3PagerFilename(Pager*);
88const sqlite3_vfs *sqlite3PagerVfs(Pager*);
89sqlite3_file *sqlite3PagerFile(Pager*);
90const char *sqlite3PagerDirname(Pager*);
91const char *sqlite3PagerJournalname(Pager*);
92int sqlite3PagerNosync(Pager*);
93int sqlite3PagerMovepage(Pager*,DbPage*,Pgno);
94void *sqlite3PagerGetData(DbPage *);
95void *sqlite3PagerGetExtra(DbPage *);
96int sqlite3PagerLockingMode(Pager *, int);
97
98#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) && !defined(SQLITE_OMIT_DISKIO)
99 int sqlite3PagerReleaseMemory(int);
100#endif
101
102#ifdef SQLITE_HAS_CODEC
103 void sqlite3PagerSetCodec(Pager*,void*(*)(void*,void*,Pgno,int),void*);
104#endif
105
106#if !defined(NDEBUG) || defined(SQLITE_TEST)
107 Pgno sqlite3PagerPagenumber(DbPage*);
108 int sqlite3PagerIswriteable(DbPage*);
109#endif
110
111#ifdef SQLITE_TEST
112 int *sqlite3PagerStats(Pager*);
113 void sqlite3PagerRefdump(Pager*);
114 int pager3_refinfo_enable;
115#endif
116
117#ifdef SQLITE_TEST
118void disable_simulated_io_errors(void);
119void enable_simulated_io_errors(void);
120#else
121# define disable_simulated_io_errors()
122# define enable_simulated_io_errors()
123#endif
124
125#endif /* _PAGER_H_ */