blob: cec8f4ea705ae569a82592b7edb30df8f19332a5 [file] [log] [blame]
drh960e8c62001-04-03 16:53:21 +00001/*
2** Copyright (c) 2001 D. Richard Hipp
3**
4** This program is free software; you can redistribute it and/or
5** modify it under the terms of the GNU General Public
6** License as published by the Free Software Foundation; either
7** version 2 of the License, or (at your option) any later version.
8**
9** This program is distributed in the hope that it will be useful,
10** but WITHOUT ANY WARRANTY; without even the implied warranty of
11** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12** General Public License for more details.
13**
14** You should have received a copy of the GNU General Public
15** License along with this library; if not, write to the
16** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17** Boston, MA 02111-1307, USA.
18**
19** Author contact information:
20** drh@hwaci.com
21** http://www.hwaci.com/drh/
22**
23*************************************************************************
24** This header file defines the interface that the sqlite page cache
25** subsystem. The page cache subsystem reads and writes a file a page
26** at a time and provides a journal for rollback.
27**
28** @(#) $Id: pager.h,v 1.1 2001/04/03 16:53:22 drh Exp $
29*/
30#include "sqliteInt.h"
31
32/*
33** The size of one page
34*/
35#define SQLITE_PAGE_SIZE 1024
36
37/*
38** The type used to represent a page number. The first page in a file
39** is called page 1. 0 is used to represent "not a page".
40*/
41typedef unsigned int Pgno;
42
43/*
44** Each open file is managed by a separate instance of the "Pager" structure.
45*/
46typedef struct Pager Pager;
47
48int sqlite_pager_open(Pager **ppPager, const char *zFilename);
49int sqlite_pager_close(Pager *pPager);
50int sqlite_pager_get(Pager *pPager, Pgno pgno, void **ppPage);
51int sqlite_pager_unref(void*);
52Pgno sqlite_pager_pagenumber(void*);
53int sqlite_pager_write(void*);
54int sqlite_pager_pagecount(Pager*);
55int sqlite_pager_commit(Pager*);
56int sqlite_pager_rollback(Pager*);