aboutsummaryrefslogtreecommitdiff
path: root/src/pager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pager.h')
-rw-r--r--src/pager.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pager.h b/src/pager.h
index 7ef9a237a..9b2cfc0bc 100644
--- a/src/pager.h
+++ b/src/pager.h
@@ -83,6 +83,22 @@ typedef struct PgHdr DbPage;
#define PAGER_JOURNALMODE_MEMORY 4 /* In-memory journal file */
#define PAGER_JOURNALMODE_WAL 5 /* Use write-ahead logging */
+#define isWalMode(x) ((x)==PAGER_JOURNALMODE_WAL)
+
+/*
+** The argument to this macro is a file descriptor (type sqlite3_file*).
+** Return 0 if it is not open, or non-zero (but not 1) if it is.
+**
+** This is so that expressions can be written as:
+**
+** if( isOpen(pPager->jfd) ){ ...
+**
+** instead of
+**
+** if( pPager->jfd->pMethods ){ ...
+*/
+#define isOpen(pFd) ((pFd)->pMethods!=0)
+
/*
** Flags that make up the mask passed to sqlite3PagerGet().
*/