source: trunk/src/3rdparty/sqlite/pager.h@ 207

Last change on this file since 207 was 205, checked in by rudi, 14 years ago

Added SQLite 2.8.17 sources. This allows to build at least one of the sql drivers / plugins.

File size: 3.5 KB
Line 
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.26 2004/02/11 02:18:07 drh Exp $
17*/
18
19/*
20** The size of one page
21**
22** You can change this value to another (reasonable) value you want.
23** It need not be a power of two, though the interface to the disk
24** will likely be faster if it is.
25**
26** Experiments show that a page size of 1024 gives the best speed
27** for common usages. The speed differences for different sizes
28** such as 512, 2048, 4096, an so forth, is minimal. Note, however,
29** that changing the page size results in a completely imcompatible
30** file format.
31*/
32#ifndef SQLITE_PAGE_SIZE
33#define SQLITE_PAGE_SIZE 1024
34#endif
35
36/*
37** Number of extra bytes of data allocated at the end of each page and
38** stored on disk but not used by the higher level btree layer. Changing
39** this value results in a completely incompatible file format.
40*/
41#ifndef SQLITE_PAGE_RESERVE
42#define SQLITE_PAGE_RESERVE 0
43#endif
44
45/*
46** The total number of usable bytes stored on disk for each page.
47** The usable bytes come at the beginning of the page and the reserve
48** bytes come at the end.
49*/
50#define SQLITE_USABLE_SIZE (SQLITE_PAGE_SIZE-SQLITE_PAGE_RESERVE)
51
52/*
53** Maximum number of pages in one database. (This is a limitation of
54** imposed by 4GB files size limits.)
55*/
56#define SQLITE_MAX_PAGE 1073741823
57
58/*
59** The type used to represent a page number. The first page in a file
60** is called page 1. 0 is used to represent "not a page".
61*/
62typedef unsigned int Pgno;
63
64/*
65** Each open file is managed by a separate instance of the "Pager" structure.
66*/
67typedef struct Pager Pager;
68
69/*
70** See source code comments for a detailed description of the following
71** routines:
72*/
73int sqlitepager_open(Pager **ppPager, const char *zFilename,
74 int nPage, int nExtra, int useJournal);
75void sqlitepager_set_destructor(Pager*, void(*)(void*));
76void sqlitepager_set_cachesize(Pager*, int);
77int sqlitepager_close(Pager *pPager);
78int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage);
79void *sqlitepager_lookup(Pager *pPager, Pgno pgno);
80int sqlitepager_ref(void*);
81int sqlitepager_unref(void*);
82Pgno sqlitepager_pagenumber(void*);
83int sqlitepager_write(void*);
84int sqlitepager_iswriteable(void*);
85int sqlitepager_overwrite(Pager *pPager, Pgno pgno, void*);
86int sqlitepager_pagecount(Pager*);
87int sqlitepager_truncate(Pager*,Pgno);
88int sqlitepager_begin(void*);
89int sqlitepager_commit(Pager*);
90int sqlitepager_rollback(Pager*);
91int sqlitepager_isreadonly(Pager*);
92int sqlitepager_ckpt_begin(Pager*);
93int sqlitepager_ckpt_commit(Pager*);
94int sqlitepager_ckpt_rollback(Pager*);
95void sqlitepager_dont_rollback(void*);
96void sqlitepager_dont_write(Pager*, Pgno);
97int *sqlitepager_stats(Pager*);
98void sqlitepager_set_safety_level(Pager*,int);
99const char *sqlitepager_filename(Pager*);
100int sqlitepager_rename(Pager*, const char *zNewName);
101void sqlitepager_set_codec(Pager*,void(*)(void*,void*,Pgno,int),void*);
102
103#ifdef SQLITE_TEST
104void sqlitepager_refdump(Pager*);
105int pager_refinfo_enable;
106int journal_format;
107#endif
Note: See TracBrowser for help on using the repository browser.