return "Operation requires a database upgrade";
case NOTMUCH_STATUS_PATH_ERROR:
return "Path supplied is illegal for this function";
+ case NOTMUCH_STATUS_MALFORMED_CRYPTO_PROTOCOL:
+ return "Crypto protocol missing, malformed, or unintelligible";
+ case NOTMUCH_STATUS_FAILED_CRYPTO_CONTEXT_CREATION:
+ return "Crypto engine initialization failure";
+ case NOTMUCH_STATUS_UNKNOWN_CRYPTO_PROTOCOL:
+ return "Unknown crypto protocol";
default:
case NOTMUCH_STATUS_LAST_STATUS:
return "Unknown error status value";
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch, "A Xapian exception occurred finding message: %s.\n",
error.get_msg().c_str());
- notmuch->exception_reported = TRUE;
+ notmuch->exception_reported = true;
*message_ret = NULL;
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
* committed revision number until we commit the atomic section.
*/
if (notmuch->atomic_nesting)
- notmuch->atomic_dirty = TRUE;
+ notmuch->atomic_dirty = true;
else
notmuch->revision = new_revision;
}
notmuch = talloc_zero (NULL, notmuch_database_t);
- notmuch->exception_reported = FALSE;
+ notmuch->exception_reported = false;
notmuch->status_string = NULL;
notmuch->path = talloc_strdup (notmuch, path);
- if (notmuch->path[strlen (notmuch->path) - 1] == '/')
- notmuch->path[strlen (notmuch->path) - 1] = '\0';
+ strip_trailing(notmuch->path, '/');
notmuch->mode = mode;
notmuch->atomic_nesting = 0;
if (! notmuch->exception_reported) {
_notmuch_database_log (notmuch, "Error: A Xapian exception reopening database: %s\n",
error.get_msg ().c_str ());
- notmuch->exception_reported = TRUE;
+ notmuch->exception_reported = true;
}
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
notmuch_database_t *notmuch = NULL;
struct stat statbuf;
- notmuch_bool_t keep_backup;
+ bool keep_backup;
char *message = NULL;
local = talloc_new (NULL);
ret = NOTMUCH_STATUS_OUT_OF_MEMORY;
goto DONE;
}
- keep_backup = FALSE;
+ keep_backup = false;
}
else {
- keep_backup = TRUE;
+ keep_backup = true;
}
if (stat (backup_path, &statbuf) != -1) {
Xapian::WritableDatabase *db;
struct sigaction action;
struct itimerval timerval;
- notmuch_bool_t timer_is_active = FALSE;
+ bool timer_is_active = false;
enum _notmuch_features target_features, new_features;
notmuch_status_t status;
notmuch_private_status_t private_status;
timerval.it_value.tv_usec = 0;
setitimer (ITIMER_REAL, &timerval, NULL);
- timer_is_active = TRUE;
+ timer_is_active = true;
}
/* Figure out how much total work we need to do. */
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch, "A Xapian exception occurred beginning transaction: %s.\n",
error.get_msg().c_str());
- notmuch->exception_reported = TRUE;
+ notmuch->exception_reported = true;
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch, "A Xapian exception occurred committing transaction: %s.\n",
error.get_msg().c_str());
- notmuch->exception_reported = TRUE;
+ notmuch->exception_reported = true;
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
if (notmuch->atomic_dirty) {
++notmuch->revision;
- notmuch->atomic_dirty = FALSE;
+ notmuch->atomic_dirty = false;
}
DONE:
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch, "A Xapian exception occurred getting directory: %s.\n",
error.get_msg().c_str());
- notmuch->exception_reported = TRUE;
+ notmuch->exception_reported = true;
status = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
return status;
} catch (const Xapian::Error &error) {
_notmuch_database_log (notmuch, "Error: A Xapian exception occurred finding message by filename: %s\n",
error.get_msg().c_str());
- notmuch->exception_reported = TRUE;
+ notmuch->exception_reported = true;
status = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
} catch (const Xapian::Error &error) {
_notmuch_database_log (db, "A Xapian exception occurred getting tags: %s.\n",
error.get_msg().c_str());
- db->exception_reported = TRUE;
+ db->exception_reported = true;
return NULL;
}
}