/ Check-in [8de9f010]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add "log.h", which should have been part of the previous commit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: 8de9f010044fc992b5b45a7bb0da1284b404ecdb
User & Date: dan 2010-04-12 19:05:58
Context
2010-04-12
19:32
Remove duplicate secure_delete pragma implemention. check-in: c15fda14 user: drh tags: wal
19:05
Add "log.h", which should have been part of the previous commit. check-in: 8de9f010 user: dan tags: wal
19:00
Import experimental write-ahead-logging code. check-in: 409d61ba user: dan tags: wal
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added src/log.h.



























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
** 2010 February 1
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This header file defines the interface to the write-ahead logging 
** system. Refer to the comments below and the header comment attached to 
** the implementation of each function in log.c for further details.
*/

#ifndef _LOG_H_
#define _LOG_H_

#include "sqliteInt.h"

/* Flags that may be set in the 'flags' argument to sqlite3LogWrite(): */
#define LOG_MASK_COMMIT        0x08
#define LOG_MASK_MASTERJOURNAL 0x10
#define LOG_MASK_TRUNCATE      0x20


#define LOG_TRUNCATE_BIT       0x80000000 

/* Connection to a log file. There is one object of this type for each pager. */
typedef struct Log Log;

/* Open and close a connection to a log file. */
int sqlite3LogOpen(sqlite3_vfs*, const char *zDb, Log **ppLog);
int sqlite3LogClose(Log *pLog, sqlite3_file *pFd, u8 *zBuf);

/* Configure the log connection. */
void sqlite3LogSetSyncflags(Log *, int sync_flags);

/* Used by readers to open (lock) and close (unlock) a database snapshot. */
int sqlite3LogOpenSnapshot(Log *pLog, int *);
void sqlite3LogCloseSnapshot(Log *pLog);

/* Read a page from the log, if it is present. */
int sqlite3LogRead(Log *pLog, Pgno pgno, int *pInLog, u8 *pOut);
void sqlite3LogMaxpgno(Log *pLog, Pgno *pPgno);

/* Obtain or release the WRITER lock. */
int sqlite3LogWriteLock(Log *pLog, int op);

/* Write a segment to the log. */
int sqlite3LogFrames(Log *pLog, int, PgHdr *, Pgno, int, int);

/* Copy pages from the log to the database file */ 
int sqlite3LogCheckpoint(
  Log *pLog,                      /* Log connection */
  sqlite3_file *pFd,              /* File descriptor open on db file */
  u8 *zBuf                        /* Temporary buffer to use */
);

#endif /* _LOG_H_ */