monotone

monotone Mtn Source Tree

Root/sqlite/pager.h

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.1 2003/08/05 23:03:07 graydon Exp $
17*/
18
19/*
20** The size of one page
21**
22** You can change this value to another (reasonable) power of two
23** such as 512, 2048, 4096, or 8192 and things will still work. But
24** experiments show that a page size of 1024 gives the best speed.
25** (The speed differences are minimal.)
26*/
27#define SQLITE_PAGE_SIZE 1024
28
29/*
30** Maximum number of pages in one database. (This is a limitation of
31** imposed by 4GB files size limits.)
32*/
33#define SQLITE_MAX_PAGE 1073741823
34
35/*
36** The type used to represent a page number. The first page in a file
37** is called page 1. 0 is used to represent "not a page".
38*/
39typedef unsigned int Pgno;
40
41/*
42** Each open file is managed by a separate instance of the "Pager" structure.
43*/
44typedef struct Pager Pager;
45
46/*
47** See source code comments for a detailed description of the following
48** routines:
49*/
50int sqlitepager_open(Pager **ppPager, const char *zFilename,
51 int nPage, int nExtra, int useJournal);
52void sqlitepager_set_destructor(Pager*, void(*)(void*));
53void sqlitepager_set_cachesize(Pager*, int);
54int sqlitepager_close(Pager *pPager);
55int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage);
56void *sqlitepager_lookup(Pager *pPager, Pgno pgno);
57int sqlitepager_ref(void*);
58int sqlitepager_unref(void*);
59Pgno sqlitepager_pagenumber(void*);
60int sqlitepager_write(void*);
61int sqlitepager_iswriteable(void*);
62int sqlitepager_overwrite(Pager *pPager, Pgno pgno, void*);
63int sqlitepager_pagecount(Pager*);
64int sqlitepager_truncate(Pager*,Pgno);
65int sqlitepager_begin(void*);
66int sqlitepager_commit(Pager*);
67int sqlitepager_rollback(Pager*);
68int sqlitepager_isreadonly(Pager*);
69int sqlitepager_ckpt_begin(Pager*);
70int sqlitepager_ckpt_commit(Pager*);
71int sqlitepager_ckpt_rollback(Pager*);
72void sqlitepager_dont_rollback(void*);
73void sqlitepager_dont_write(Pager*, Pgno);
74int *sqlitepager_stats(Pager*);
75void sqlitepager_set_safety_level(Pager*,int);
76const char *sqlitepager_filename(Pager*);
77int sqlitepager_rename(Pager*, const char *zNewName);
78
79#ifdef SQLITE_TEST
80void sqlitepager_refdump(Pager*);
81int pager_refinfo_enable;
82int journal_format;
83#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status