#define _GNU_SOURCE /* for getline */
#endif
#include <stdio.h>
+#include <sysexits.h>
#include "compat.h"
-#include <gmime/gmime.h>
+#include "gmime-extra.h"
typedef GMimeCryptoContext notmuch_crypto_context_t;
/* This is automatically included only since gmime 2.6.10 */
notmuch_bool_t entire_thread;
notmuch_bool_t omit_excluded;
notmuch_bool_t output_body;
- notmuch_bool_t raw;
int part;
notmuch_crypto_t crypto;
notmuch_bool_t include_html;
+ GMimeStream *out_stream;
} notmuch_show_params_t;
/* There's no point in continuing when we've detected that we've done
str[strlen(str)-1] = '\0';
}
+/* Exit status code indicating temporary failure; user is invited to
+ * retry.
+ *
+ * For example, file(s) in the mail store were removed or renamed
+ * after notmuch new scanned the directories but before indexing the
+ * file(s). If the file was renamed, the indexing might not be
+ * complete, and the user is advised to re-run notmuch new.
+ */
+#define NOTMUCH_EXIT_TEMPFAIL EX_TEMPFAIL
+
/* Exit status code indicating the requested format version is too old
* (support for that version has been dropped). CLI code should use
* notmuch_exit_if_unsupported_format rather than directly exiting
* this. New (required) map fields can be added without increasing
* this.
*/
-#define NOTMUCH_FORMAT_CUR 2
+#define NOTMUCH_FORMAT_CUR 3
/* The minimum supported structured output format version. Requests
* for format versions below this will return an error. */
#define NOTMUCH_FORMAT_MIN 1
/* notmuch-config.c */
+typedef enum {
+ NOTMUCH_CONFIG_OPEN = 1 << 0,
+ NOTMUCH_CONFIG_CREATE = 1 << 1,
+} notmuch_config_mode_t;
+
notmuch_config_t *
notmuch_config_open (void *ctx,
const char *filename,
- notmuch_bool_t create_new);
+ notmuch_config_mode_t config_mode);
void
notmuch_config_close (notmuch_config_t *config);
typedef enum dump_includes {
DUMP_INCLUDE_TAGS = 1,
DUMP_INCLUDE_CONFIG = 2,
+ DUMP_INCLUDE_PROPERTIES = 4
} dump_include_t;
-#define NOTMUCH_DUMP_VERSION 2
+#define DUMP_INCLUDE_DEFAULT (DUMP_INCLUDE_TAGS | DUMP_INCLUDE_CONFIG | DUMP_INCLUDE_PROPERTIES)
+
+#define NOTMUCH_DUMP_VERSION 3
int
notmuch_database_dump (notmuch_database_t *notmuch,
const notmuch_database_t *database,
notmuch_status_t status);
+int
+status_to_exit (notmuch_status_t status);
+
#include "command-line-arguments.h"
extern char *notmuch_requested_db_uuid;