]> git.notmuchmail.org Git - notmuch/commitdiff
Rename NOTMUCH_DATABASE_MODE_WRITABLE to NOTMUCH_DATABASE_MODE_READ_WRITE
authorCarl Worth <cworth@cworth.org>
Sat, 21 Nov 2009 21:10:18 +0000 (22:10 +0100)
committerCarl Worth <cworth@cworth.org>
Sat, 21 Nov 2009 21:10:18 +0000 (22:10 +0100)
And correspondingly, READONLY to READ_ONLY.

TODO
lib/database.cc
lib/message.cc
lib/notmuch.h
notmuch-dump.c
notmuch-new.c
notmuch-reply.c
notmuch-restore.c
notmuch-search.c
notmuch-show.c
notmuch-tag.c

diff --git a/TODO b/TODO
index b0ee13eca12436c1fec46d06a888c0860762c4c7..ea6c3c28f57e48d1f132764fa839d9aed5d94ab3 100644 (file)
--- a/TODO
+++ b/TODO
@@ -47,6 +47,9 @@ maildirs.)
 
 notmuch library
 ---------------
+Add support for files that are moved or deleted (which obviously need
+to be handled differently).
+
 Actually compile and install a libnotmuch shared library.
 
 Fix to use the *last* Message-ID header if multiple such headers are
index fb38664789e50c360df7c5a2c400e6015be81904..95057a8fa0a0fec98d557ab861ee850652aec4a7 100644 (file)
@@ -441,7 +441,7 @@ notmuch_database_create (const char *path)
     }
 
     notmuch = notmuch_database_open (path,
-                                    NOTMUCH_DATABASE_MODE_WRITABLE);
+                                    NOTMUCH_DATABASE_MODE_READ_WRITE);
 
   DONE:
     if (notmuch_path)
@@ -487,7 +487,7 @@ notmuch_database_open (const char *path,
 
     notmuch->mode = mode;
     try {
-       if (mode == NOTMUCH_DATABASE_MODE_WRITABLE) {
+       if (mode == NOTMUCH_DATABASE_MODE_READ_WRITE) {
            notmuch->xapian_db = new Xapian::WritableDatabase (xapian_path,
                                                               Xapian::DB_CREATE_OR_OPEN);
        } else {
@@ -530,7 +530,7 @@ notmuch_database_open (const char *path,
 void
 notmuch_database_close (notmuch_database_t *notmuch)
 {
-    if (notmuch->mode == NOTMUCH_DATABASE_MODE_WRITABLE)
+    if (notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE)
        (static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();
 
     delete notmuch->term_gen;
@@ -583,7 +583,7 @@ notmuch_database_set_timestamp (notmuch_database_t *notmuch,
     notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
     char *db_key = NULL;
 
-    if (notmuch->mode == NOTMUCH_DATABASE_MODE_READONLY) {
+    if (notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY) {
        fprintf (stderr, "Attempted to update a read-only database.\n");
        return NOTMUCH_STATUS_READONLY_DATABASE;
     }
index 7ba06c99ae38fd7680b7fe34475d2bdbc2680541..069cedb29bb6183459461cb47e8c588d4be72500 100644 (file)
@@ -172,7 +172,7 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
     unsigned int doc_id;
     char *term;
 
-    if (notmuch->mode == NOTMUCH_DATABASE_MODE_READONLY) {
+    if (notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY) {
        *status_ret = NOTMUCH_PRIVATE_STATUS_READONLY_DATABASE;
        return NULL;
     }
@@ -552,7 +552,7 @@ _notmuch_message_sync (notmuch_message_t *message)
 {
     Xapian::WritableDatabase *db;
 
-    if (message->notmuch->mode == NOTMUCH_DATABASE_MODE_READONLY)
+    if (message->notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY)
        return;
 
     db = static_cast <Xapian::WritableDatabase *> (message->notmuch->xapian_db);
index 89ed7ad88b7eb91ead3d6cefe518f29b410cdfd2..bbeec559f0f8fdd95018d57c21f2330f6fcebd1d 100644 (file)
@@ -137,14 +137,14 @@ typedef struct _notmuch_tags notmuch_tags_t;
 notmuch_database_t *
 notmuch_database_create (const char *path);
 
-/* XXX: I think I'd like this to take an extra argument of
- * notmuch_status_t* for returning a status value on failure. */
-
 typedef enum {
-    NOTMUCH_DATABASE_MODE_READONLY = 0,
-    NOTMUCH_DATABASE_MODE_WRITABLE
+    NOTMUCH_DATABASE_MODE_READ_ONLY = 0,
+    NOTMUCH_DATABASE_MODE_READ_Write
 } notmuch_database_mode_t;
 
+/* XXX: I think I'd like this to take an extra argument of
+ * notmuch_status_t* for returning a status value on failure. */
+
 /* Open an existing notmuch database located at 'path'.
  *
  * The database should have been created at some time in the past,
index 86570d09070d26474210f5c62f4481b3fd5e7f8c..fc06f3f9a5625581432a4d3956b6cdcc8da411ec 100644 (file)
@@ -36,7 +36,7 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])
        return 1;
 
     notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_READONLY);
+                                    NOTMUCH_DATABASE_MODE_READ_ONLY);
     if (notmuch == NULL)
        return 1;
 
index f241edf94a838586aaa8fdf3b8a4904785702784..bc35b4e8cf32480e1a7d1cf87cb95d7b6e4e3e71 100644 (file)
@@ -414,7 +414,7 @@ notmuch_new_command (void *ctx,
        add_files_state.total_files = count;
     } else {
        notmuch = notmuch_database_open (db_path,
-                                        NOTMUCH_DATABASE_MODE_READONLY);
+                                        NOTMUCH_DATABASE_MODE_READ_ONLY);
        add_files_state.ignore_read_only_directories = TRUE;
        add_files_state.total_files = 0;
     }
index 291cd024d696126219d073a2a679af456619db0e..44e17661ea8a4cbc16c40727b61846e639e294bd 100644 (file)
@@ -224,7 +224,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
     }
 
     notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_READONLY);
+                                    NOTMUCH_DATABASE_MODE_READ_ONLY);
     if (notmuch == NULL)
        return 1;
 
index 001f3fcb762c71adf20a6af7dd3ff39ea6a3eb1c..1b9598dcee5ec1dd42c075d1255781333ddc5de5 100644 (file)
@@ -37,7 +37,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])
        return 1;
 
     notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_WRITABLE);
+                                    NOTMUCH_DATABASE_MODE_READ_WRITE);
     if (notmuch == NULL)
        return 1;
 
index cde97351b493514228ca7e2df69c5d5a65ca1eac..aa6662bd73b62b3708e363f196abc9abf39b0f0e 100644 (file)
@@ -130,7 +130,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
        return 1;
 
     notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_READONLY);
+                                    NOTMUCH_DATABASE_MODE_READ_ONLY);
     if (notmuch == NULL)
        return 1;
 
index a764e4438e678739a670625a42bb2de4a6a2a99b..d727f302d2f09324dc5dc7d30681d6dc0fb236ef 100644 (file)
@@ -221,7 +221,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
     }
 
     notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_READONLY);
+                                    NOTMUCH_DATABASE_MODE_READ_ONLY);
     if (notmuch == NULL)
        return 1;
 
index 75d464f20980d7ece09cd25cbec7c0b10582a355..e2311f61584ebb47557589cd50477ae483b612c3 100644 (file)
@@ -95,7 +95,7 @@ notmuch_tag_command (void *ctx, unused (int argc), unused (char *argv[]))
        return 1;
 
     notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_WRITABLE);
+                                    NOTMUCH_DATABASE_MODE_READ_WRITE);
     if (notmuch == NULL)
        return 1;