NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
private.h
Go to the documentation of this file.
1
23
24
#ifndef MUTT_NOTMUCH_PRIVATE_H
25
#define MUTT_NOTMUCH_PRIVATE_H
26
27
#include <notmuch.h>
28
#include <stdbool.h>
29
#include <time.h>
30
31
struct
Mailbox
;
32
33
#ifdef LIBNOTMUCH_CHECK_VERSION
34
#undef LIBNOTMUCH_CHECK_VERSION
35
#endif
36
37
#ifndef HAVE_NOTMUCH_DATABASE_INDEX_FILE
38
#define HAVE_NOTMUCH_DATABASE_INDEX_FILE 0
39
#endif
40
41
#ifndef HAVE_NOTMUCH_DATABASE_OPEN_WITH_CONFIG
42
#define HAVE_NOTMUCH_DATABASE_OPEN_WITH_CONFIG 0
43
#endif
44
45
/*
46
* The definition in <notmuch.h> is broken.
47
*
48
* Corrects for libnotmuch releases with missing version bumps:
49
* - libnotmuch 5.4 released with notmuch 0.32. notmuch 0.32.3 fixed version.
50
* - libnotmuch 5.1 released with notmuch 0.26. notmuch 0.26.1 fixed version.
51
*/
52
#define LIBNOTMUCH_CHECK_VERSION(major, minor, micro) \
53
((major) == 5 && (minor) == 4 && HAVE_NOTMUCH_DATABASE_OPEN_WITH_CONFIG) || \
54
((major) == 5 && (minor) == 1 && HAVE_NOTMUCH_DATABASE_INDEX_FILE) || \
55
((LIBNOTMUCH_MAJOR_VERSION > (major) || \
56
(LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION > (minor)) || \
57
(LIBNOTMUCH_MAJOR_VERSION == (major) && \
58
LIBNOTMUCH_MINOR_VERSION == (minor) && LIBNOTMUCH_MICRO_VERSION >= (micro))))
59
60
extern
const
char
NmUrlProtocol
[];
61
extern
const
int
NmUrlProtocolLen
;
62
63
notmuch_database_t *
nm_db_do_open
(
const
char
*filename,
bool
writable,
bool
verbose
);
64
void
nm_db_free
(notmuch_database_t *db);
65
const
char
*
nm_db_get_filename
(
struct
Mailbox
*m);
66
int
nm_db_get_mtime
(
struct
Mailbox
*m, time_t *mtime);
67
notmuch_database_t *
nm_db_get
(
struct
Mailbox
*m,
bool
writable);
68
bool
nm_db_is_longrun
(
struct
Mailbox
*m);
69
int
nm_db_release
(
struct
Mailbox
*m);
70
int
nm_db_trans_begin
(
struct
Mailbox
*m);
71
int
nm_db_trans_end
(
struct
Mailbox
*m);
72
73
#endif
/* MUTT_NOTMUCH_PRIVATE_H */
nm_db_get
notmuch_database_t * nm_db_get(struct Mailbox *m, bool writable)
Get the Notmuch database.
Definition
db.c:210
nm_db_trans_begin
int nm_db_trans_begin(struct Mailbox *m)
Start a Notmuch database transaction.
Definition
db.c:278
nm_db_do_open
notmuch_database_t * nm_db_do_open(const char *filename, bool writable, bool verbose)
Open a Notmuch database.
Definition
db.c:116
nm_db_get_filename
const char * nm_db_get_filename(struct Mailbox *m)
Get the filename of the Notmuch database.
Definition
db.c:63
nm_db_get_mtime
int nm_db_get_mtime(struct Mailbox *m, time_t *mtime)
Get the database modification time.
Definition
db.c:327
nm_db_release
int nm_db_release(struct Mailbox *m)
Close the Notmuch database.
Definition
db.c:245
nm_db_is_longrun
bool nm_db_is_longrun(struct Mailbox *m)
Is Notmuch in the middle of a long-running transaction.
Definition
db.c:364
nm_db_free
void nm_db_free(notmuch_database_t *db)
Decoupled way to close a Notmuch database.
Definition
db.c:262
nm_db_trans_end
int nm_db_trans_end(struct Mailbox *m)
End a database transaction.
Definition
db.c:300
NmUrlProtocolLen
const int NmUrlProtocolLen
Length of NmUrlProtocol string.
Definition
notmuch.c:104
NmUrlProtocol
const char NmUrlProtocol[]
Protocol string for Notmuch URLs.
Definition
notmuch.c:102
Mailbox
A mailbox.
Definition
mailbox.h:81
Mailbox::verbose
bool verbose
Display status messages?
Definition
mailbox.h:119