X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fnotmuch-private.h;h=012ad25c42cd3845588f9e2cee0b9d4a631900f7;hb=0f35ddcdfc9d4011db32def6082f8aec5c372a7b;hp=17f30613bd00509e912d594101d21b7f587aae4d;hpb=df8885f62c13f77b2b16cbb211e3a727945870b0;p=notmuch diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 17f30613..012ad25c 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -63,6 +63,17 @@ NOTMUCH_BEGIN_DECLS #define STRNCMP_LITERAL(var, literal) \ strncmp ((var), (literal), sizeof (literal) - 1) +/* Robust bit test/set/reset macros */ +#define NOTMUCH_TEST_BIT(val, bit) \ + (((bit) < 0 || (bit) >= CHAR_BIT * sizeof (unsigned long long)) ? 0 \ + : !!((val) & (1ull << (bit)))) +#define NOTMUCH_SET_BIT(valp, bit) \ + (((bit) < 0 || (bit) >= CHAR_BIT * sizeof (unsigned long long)) ? *(valp) \ + : (*(valp) |= (1ull << (bit)))) +#define NOTMUCH_CLEAR_BIT(valp, bit) \ + (((bit) < 0 || (bit) >= CHAR_BIT * sizeof (unsigned long long)) ? *(valp) \ + : (*(valp) &= ~(1ull << (bit)))) + #define unused(x) x __attribute__ ((unused)) #ifdef __cplusplus @@ -174,6 +185,9 @@ typedef struct _notmuch_doc_id_set notmuch_doc_id_set_t; const char * _find_prefix (const char *name); +char * +_notmuch_message_id_compressed (void *ctx, const char *message_id); + notmuch_status_t _notmuch_database_ensure_writable (notmuch_database_t *notmuch); @@ -294,6 +308,10 @@ _notmuch_message_sync (notmuch_message_t *message); notmuch_status_t _notmuch_message_delete (notmuch_message_t *message); +notmuch_private_status_t +_notmuch_message_initialize_ghost (notmuch_message_t *message, + const char *thread_id); + void _notmuch_message_close (notmuch_message_t *message);