continue;
*arg_desc->opt_keyword = keywords->value;
- fprintf (stderr, "Warning: No known keyword option given for \"%s\", choosing value \"%s\"."
- " Please specify the argument explicitly!\n", arg_desc->name, arg_desc->keyword_no_arg_value);
+ fprintf (stderr,
+ "Warning: No known keyword option given for \"%s\", choosing value \"%s\"."
+ " Please specify the argument explicitly!\n", arg_desc->name,
+ arg_desc->keyword_no_arg_value);
return OPT_GIVEBACK;
}
- fprintf (stderr, "No matching keyword for option \"%s\" and default value \"%s\" is invalid.\n", arg_str, arg_desc->name);
+ fprintf (stderr,
+ "No matching keyword for option \"%s\" and default value \"%s\" is invalid.\n",
+ arg_str,
+ arg_desc->name);
return OPT_FAILED;
}
if (next != '\0')
- fprintf (stderr, "Unknown keyword argument \"%s\" for option \"%s\".\n", arg_str, arg_desc->name);
+ fprintf (stderr, "Unknown keyword argument \"%s\" for option \"%s\".\n", arg_str,
+ arg_desc->name);
else
fprintf (stderr, "Option \"%s\" needs a keyword argument.\n", arg_desc->name);
return OPT_FAILED;
} else if (strcmp (arg_str, "false") == 0) {
value = false;
} else {
- fprintf (stderr, "Unknown argument \"%s\" for (boolean) option \"%s\".\n", arg_str, arg_desc->name);
+ fprintf (stderr, "Unknown argument \"%s\" for (boolean) option \"%s\".\n", arg_str,
+ arg_desc->name);
return OPT_FAILED;
}
const notmuch_opt_desc_t *try;
const char *next_arg = NULL;
+
if (opt_index < argc - 1 && strncmp (argv[opt_index + 1], "--", 2) != 0)
next_arg = argv[opt_index + 1];
G_BEGIN_DECLS
#define GMIME_TYPE_FILTER_REPLY (g_mime_filter_reply_get_type ())
-#define GMIME_FILTER_REPLY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMIME_TYPE_FILTER_REPLY, GMimeFilterReply))
-#define GMIME_FILTER_REPLY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMIME_TYPE_FILTER_REPLY, GMimeFilterReplyClass))
-#define GMIME_IS_FILTER_REPLY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMIME_TYPE_FILTER_REPLY))
-#define GMIME_IS_FILTER_REPLY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GMIME_TYPE_FILTER_REPLY))
-#define GMIME_FILTER_REPLY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMIME_TYPE_FILTER_REPLY, GMimeFilterReplyClass))
+#define GMIME_FILTER_REPLY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ GMIME_TYPE_FILTER_REPLY, \
+ GMimeFilterReply))
+#define GMIME_FILTER_REPLY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMIME_TYPE_FILTER_REPLY, \
+ GMimeFilterReplyClass))
+#define GMIME_IS_FILTER_REPLY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ GMIME_TYPE_FILTER_REPLY))
+#define GMIME_IS_FILTER_REPLY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ GMIME_TYPE_FILTER_REPLY))
+#define GMIME_FILTER_REPLY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMIME_TYPE_FILTER_REPLY, \
+ GMimeFilterReplyClass))
typedef struct _GMimeFilterReply GMimeFilterReply;
typedef struct _GMimeFilterReplyClass GMimeFilterReplyClass;
status = _notmuch_message_crypto_potential_sig_list (node->ctx->msg_crypto, node->sig_list);
if (status) /* this is a warning, not an error */
- fprintf (stderr, "Warning: failed to note signature status: %s.\n", notmuch_status_to_string (status));
+ fprintf (stderr, "Warning: failed to note signature status: %s.\n", notmuch_status_to_string (
+ status));
}
/* Decrypt and optionally verify an encrypted mime node */
node->decrypt_success = true;
status = _notmuch_message_crypto_successful_decryption (node->ctx->msg_crypto);
if (status) /* this is a warning, not an error */
- fprintf (stderr, "Warning: failed to note decryption status: %s.\n", notmuch_status_to_string (status));
+ fprintf (stderr, "Warning: failed to note decryption status: %s.\n",
+ notmuch_status_to_string (status));
if (decrypt_result) {
/* This may be NULL if the part is not signed. */
node->verify_attempted = true;
g_object_ref (node->sig_list);
set_signature_list_destructor (node);
- status = _notmuch_message_crypto_potential_sig_list (node->ctx->msg_crypto, node->sig_list);
+ status = _notmuch_message_crypto_potential_sig_list (node->ctx->msg_crypto,
+ node->sig_list);
if (status) /* this is a warning, not an error */
- fprintf (stderr, "Warning: failed to note signature status: %s.\n", notmuch_status_to_string (status));
+ fprintf (stderr, "Warning: failed to note signature status: %s.\n",
+ notmuch_status_to_string (status));
}
if (node->ctx->crypto->decrypt == NOTMUCH_DECRYPT_TRUE && message) {
}
/* Handle PGP/MIME parts (by definition not cryptographic payload parts) */
- if (GMIME_IS_MULTIPART_ENCRYPTED (part) && (node->ctx->crypto->decrypt != NOTMUCH_DECRYPT_FALSE)) {
+ if (GMIME_IS_MULTIPART_ENCRYPTED (part) && (node->ctx->crypto->decrypt !=
+ NOTMUCH_DECRYPT_FALSE)) {
if (node->nchildren != 2) {
/* this violates RFC 3156 section 4, so we won't bother with it. */
fprintf (stderr, "Error: %d part(s) for a multipart/encrypted "
node_verify (node, part);
}
} else if (GMIME_IS_APPLICATION_PKCS7_MIME (part) &&
- GMIME_SECURE_MIME_TYPE_SIGNED_DATA == g_mime_application_pkcs7_mime_get_smime_type (GMIME_APPLICATION_PKCS7_MIME (part))) {
+ GMIME_SECURE_MIME_TYPE_SIGNED_DATA == g_mime_application_pkcs7_mime_get_smime_type (
+ GMIME_APPLICATION_PKCS7_MIME (part))) {
/* If node->ctx->crypto->verify is false, it would be better
* to just unwrap (instead of verifying), but
* https://github.com/jstedfast/gmime/issues/67 */
node_verify (node, part);
} else if (GMIME_IS_APPLICATION_PKCS7_MIME (part) &&
- GMIME_SECURE_MIME_TYPE_ENVELOPED_DATA == g_mime_application_pkcs7_mime_get_smime_type (GMIME_APPLICATION_PKCS7_MIME (part)) &&
+ GMIME_SECURE_MIME_TYPE_ENVELOPED_DATA == g_mime_application_pkcs7_mime_get_smime_type (
+ GMIME_APPLICATION_PKCS7_MIME (part)) &&
(node->ctx->crypto->decrypt != NOTMUCH_DECRYPT_FALSE)) {
node_decrypt_and_verify (node, part);
if (node->unwrapped_child && node->nchildren == 0)
node->nchildren = 1;
} else {
- if (_notmuch_message_crypto_potential_payload (node->ctx->msg_crypto, part, node->parent ? node->parent->part : NULL, numchild) &&
+ if (_notmuch_message_crypto_potential_payload (node->ctx->msg_crypto, part, node->parent ?
+ node->parent->part : NULL, numchild) &&
node->ctx->msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL) {
GMimeObject *clean_payload = _notmuch_repair_crypto_payload_skip_legacy_display (part);
if (clean_payload != part) {
notmuch_exit_if_unsupported_format (void);
int
-notmuch_count_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_count_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_dump_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_dump_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_new_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_new_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_insert_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_insert_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_reindex_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_reindex_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_reply_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_reply_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_restore_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_restore_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_search_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_search_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_address_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_address_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_setup_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_setup_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_show_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_show_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_tag_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_tag_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_config_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_config_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
int
-notmuch_compact_command (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+notmuch_compact_command (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
const char *
notmuch_time_relative_date (const void *ctx, time_t then);
int bytes);
/* the __location__ macro is defined in talloc.h */
-#define ASSERT_GZBYTES(file, bytes) ((print_status_gzbytes (__location__, file, bytes)) ? exit (1) : 0)
+#define ASSERT_GZBYTES(file, bytes) ((print_status_gzbytes (__location__, file, bytes)) ? exit (1) : \
+ 0)
#define GZPRINTF(file, fmt, ...) ASSERT_GZBYTES (file, gzprintf (file, fmt, ##__VA_ARGS__));
-#define GZPUTS(file, str) ASSERT_GZBYTES(file, gzputs (file, str));
+#define GZPUTS(file, str) ASSERT_GZBYTES (file, gzputs (file, str));
#include "command-line-arguments.h"
}
int
-notmuch_compact_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_compact_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
const char *backup_path = NULL;
notmuch_status_t ret;
talloc_free (config);
}
-const char *_notmuch_config_get_path (notmuch_config_t *config) {
+const char *
+_notmuch_config_get_path (notmuch_config_t *config)
+{
return config->filename;
}
/* Save any changes made to the notmuch configuration.
}
int
-notmuch_config_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch), int argc, char *argv[])
+notmuch_config_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch),
+ int argc, char *argv[])
{
int ret;
int opt_index;
status = notmuch_query_add_tag_exclude (query,
notmuch_config_values_get (exclude_tags));
- if (status && status != NOTMUCH_STATUS_IGNORED) {
- print_status_query ("notmuch count", query, status);
- ret = -1;
- goto DONE;
- }
+ if (status && status != NOTMUCH_STATUS_IGNORED) {
+ print_status_query ("notmuch count", query, status);
+ ret = -1;
+ goto DONE;
}
+ }
switch (output) {
case OUTPUT_MESSAGES:
}
int
-notmuch_count_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_count_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
char *query_str;
int opt_index;
output = NULL;
goto DONE;
} else
- output = NULL;
+ output = NULL;
if (output_file_name) {
ret = rename (tempname, output_file_name);
}
int
-notmuch_dump_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch , int argc, char *argv[])
+notmuch_dump_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
const char *query_str = NULL;
int ret;
}
int
-notmuch_insert_command (unused(notmuch_config_t *config),notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_insert_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
notmuch_status_t status, close_status;
struct sigaction action;
char *absolute = talloc_asprintf (state->removed_directories,
"%s/%s", path, filename);
if (state->debug)
- printf ("(D) add_files, pass 2: queuing passed directory %s for deletion from database\n",
- absolute);
+ printf (
+ "(D) add_files, pass 2: queuing passed directory %s for deletion from database\n",
+ absolute);
_filename_list_add (state->removed_directories, absolute);
}
notmuch_filenames_get (db_subdirs));
if (state->debug)
- printf ("(D) add_files, pass 3: queuing leftover directory %s for deletion from database\n",
- absolute);
+ printf (
+ "(D) add_files, pass 3: queuing leftover directory %s for deletion from database\n",
+ absolute);
_filename_list_add (state->removed_directories, absolute);
}
static int
-_maybe_upgrade (notmuch_database_t *notmuch, add_files_state_t *state) {
+_maybe_upgrade (notmuch_database_t *notmuch, add_files_state_t *state)
+{
if (notmuch_database_needs_upgrade (notmuch)) {
time_t now = time (NULL);
struct tm *gm_time = gmtime (&now);
}
int
-notmuch_new_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_new_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
add_files_state_t add_files_state = {
.verbosity = VERBOSITY_NORMAL,
for (notmuch_config_values_start (add_files_state.new_tags);
notmuch_config_values_valid (add_files_state.new_tags);
notmuch_config_values_move_to_next (add_files_state.new_tags)) {
- const char *tag,*error_msg;
+ const char *tag, *error_msg;
tag = notmuch_config_values_get (add_files_state.new_tags);
error_msg = illegal_tag (tag, false);
if (do_print_progress) {
do_print_progress = 0;
generic_print_progress ("Cleaned up", "messages",
- tv_start, add_files_state.removed_messages + add_files_state.renamed_messages,
+ tv_start, add_files_state.removed_messages +
+ add_files_state.renamed_messages,
add_files_state.removed_files->count);
}
}
}
int
-notmuch_reindex_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_reindex_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
char *query_string = NULL;
struct sigaction action;
return 1;
if (count != 1) {
- fprintf (stderr, "Error: search term did not match precisely one message (matched %u messages).\n", count);
+ fprintf (stderr,
+ "Error: search term did not match precisely one message (matched %u messages).\n",
+ count);
return 1;
}
}
int
-notmuch_reply_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_reply_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
notmuch_query_t *query;
char *query_string;
}
int
-notmuch_restore_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_restore_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
bool accumulate = false;
tag_op_flag_t flags = 0;
if (ret)
goto DONE;
}
- if ((include & DUMP_INCLUDE_PROPERTIES) && line_len >= 2 && line[0] == '#' && line[1] == '=') {
+ if ((include & DUMP_INCLUDE_PROPERTIES) && line_len >= 2 && line[0] == '#' && line[1] ==
+ '=') {
ret = process_properties_line (notmuch, line + 2);
if (ret)
goto DONE;
}
char *p;
+
for (p = line; (input_format == DUMP_FORMAT_AUTO) && *p; p++) {
if (*p == '(')
input_format = DUMP_FORMAT_SUP;
line_ctx = talloc_new (notmuch);
- if ((include & DUMP_INCLUDE_PROPERTIES) && line_len >= 2 && line[0] == '#' && line[1] == '=') {
+ if ((include & DUMP_INCLUDE_PROPERTIES) && line_len >= 2 && line[0] == '#' && line[1] ==
+ '=') {
ret = process_properties_line (notmuch, line + 2);
if (ret)
goto DONE;
};
int
-notmuch_search_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_search_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
search_context_t *ctx = &search_context;
int opt_index, ret;
if (ctx->output != OUTPUT_FILES && ctx->output != OUTPUT_MESSAGES &&
ctx->dupe != -1) {
- fprintf (stderr, "Error: --duplicate=N is only supported with --output=files and --output=messages.\n");
+ fprintf (stderr,
+ "Error: --duplicate=N is only supported with --output=files and --output=messages.\n");
return EXIT_FAILURE;
}
}
int
-notmuch_address_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_address_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
search_context_t *ctx = &search_context;
int opt_index, ret;
return g_mime_content_disposition_get_disposition (disposition);
}
-static bool _get_message_flag (notmuch_message_t *message, notmuch_message_flag_t flag) {
+static bool
+_get_message_flag (notmuch_message_t *message, notmuch_message_flag_t flag)
+{
notmuch_bool_t is_set;
notmuch_status_t status;
status = notmuch_message_get_flag_st (message, flag, &is_set);
if (print_status_message ("notmuch show", message, status))
- INTERNAL_ERROR("unexpected error getting message flag\n");
+ INTERNAL_ERROR ("unexpected error getting message flag\n");
return is_set;
}
}
int i;
+
for (i = 0; i < g_mime_signature_list_length (siglist); i++) {
GMimeSignature *signature = g_mime_signature_list_get_signature (siglist, i);
sp->map_key (sp, "decrypted");
sp->begin_map (sp);
sp->map_key (sp, "status");
- sp->string (sp, msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL ? "full" : "partial");
+ sp->string (sp, msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL ?
+ "full" : "partial");
if (msg_crypto->payload_subject) {
const char *subject = g_mime_message_get_subject GMIME_MESSAGE (node->part);
notmuch_status_t session_key_count_error = NOTMUCH_STATUS_SUCCESS;
if (params->crypto.decrypt == NOTMUCH_DECRYPT_TRUE)
- session_key_count_error = notmuch_message_count_properties (message, "session-key", &session_keys);
+ session_key_count_error = notmuch_message_count_properties (message, "session-key",
+ &session_keys);
status = mime_node_open (local, message, &(params->crypto), &root);
if (status)
part = mime_node_seek_dfs (root, (params->part < 0 ? 0 : params->part));
if (part)
status = format->part (local, sp, part, indent, params);
- if (params->crypto.decrypt == NOTMUCH_DECRYPT_TRUE && session_key_count_error == NOTMUCH_STATUS_SUCCESS) {
+ if (params->crypto.decrypt == NOTMUCH_DECRYPT_TRUE && session_key_count_error ==
+ NOTMUCH_STATUS_SUCCESS) {
unsigned int new_session_keys = 0;
- if (notmuch_message_count_properties (message, "session-key", &new_session_keys) == NOTMUCH_STATUS_SUCCESS &&
+ if (notmuch_message_count_properties (message, "session-key", &new_session_keys) ==
+ NOTMUCH_STATUS_SUCCESS &&
new_session_keys > session_keys) {
/* try a quiet re-indexing */
- notmuch_indexopts_t *indexopts = notmuch_database_get_default_indexopts (notmuch_message_get_database (message));
+ notmuch_indexopts_t *indexopts = notmuch_database_get_default_indexopts (
+ notmuch_message_get_database (message));
if (indexopts) {
notmuch_indexopts_set_decrypt_policy (indexopts, NOTMUCH_DECRYPT_AUTO);
print_status_message ("Error re-indexing message with --decrypt=stash",
return 1;
if (count != 1) {
- fprintf (stderr, "Error: search term did not match precisely one message (matched %u messages).\n", count);
+ fprintf (stderr,
+ "Error: search term did not match precisely one message (matched %u messages).\n",
+ count);
return 1;
}
notmuch_message_set_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH, TRUE);
excluded = _get_message_flag (message, NOTMUCH_MESSAGE_FLAG_EXCLUDED);
- if (!excluded || !params->omit_excluded) {
+ if (! excluded || ! params->omit_excluded) {
status = show_message (ctx, format, sp, message, 0, params);
- if (status && !res)
+ if (status && ! res)
res = status;
} else {
sp->null (sp);
};
int
-notmuch_show_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch), int argc, char *argv[])
+notmuch_show_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch),
+ int argc, char *argv[])
{
notmuch_database_t *notmuch;
notmuch_query_t *query;
(format != NOTMUCH_FORMAT_TEXT &&
format != NOTMUCH_FORMAT_JSON &&
format != NOTMUCH_FORMAT_SEXP)) {
- fprintf (stderr, "Warning: --include-html only implemented for format=text, format=json and format=sexp\n");
+ fprintf (stderr,
+ "Warning: --include-html only implemented for format=text, format=json and format=sexp\n");
}
notmuch_database_mode_t mode = NOTMUCH_DATABASE_MODE_READ_ONLY;
+
if (params.crypto.decrypt == NOTMUCH_DECRYPT_TRUE)
mode = NOTMUCH_DATABASE_MODE_READ_WRITE;
if (notmuch_database_open_with_config (NULL,
}
int
-notmuch_tag_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch, int argc, char *argv[])
+notmuch_tag_command (unused(notmuch_config_t *config), notmuch_database_t *notmuch,
+ int argc, char *argv[])
{
tag_op_list_t *tag_ops = NULL;
char *query_string = NULL;
*
*/
#define MINUTE (60)
-#define HOUR (60 *MINUTE)
-#define DAY (24 *HOUR)
+#define HOUR (60 * MINUTE)
+#define DAY (24 * HOUR)
#define RELATIVE_DATE_MAX 20
const char *
notmuch_time_relative_date (const void *ctx, time_t then)
* Each subcommand should be passed either a config object, or an open
* database
*/
-typedef int (*command_function_t) (notmuch_config_t *config, notmuch_database_t *notmuch, int argc, char *argv[]);
+typedef int (*command_function_t) (notmuch_config_t *config, notmuch_database_t *notmuch,
+ int argc, char *argv[]);
typedef struct command {
const char *name;
notmuch_status_t status;
if (indexing_cli_choices.opts == NULL)
return NOTMUCH_STATUS_OUT_OF_MEMORY;
- status = notmuch_indexopts_set_decrypt_policy (indexing_cli_choices.opts, indexing_cli_choices.decrypt_policy);
+ status = notmuch_indexopts_set_decrypt_policy (indexing_cli_choices.opts,
+ indexing_cli_choices.decrypt_policy);
if (status != NOTMUCH_STATUS_SUCCESS) {
fprintf (stderr, "Error: Failed to set index decryption policy to %d. (%s)\n",
indexing_cli_choices.decrypt_policy, notmuch_status_to_string (status));
{ "setup", notmuch_setup_command, NOTMUCH_COMMAND_CONFIG_OPEN | NOTMUCH_COMMAND_CONFIG_CREATE,
"Interactively set up notmuch for first use." },
{ "new", notmuch_new_command,
- NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE | NOTMUCH_COMMAND_DATABASE_CREATE,
+ NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE |
+ NOTMUCH_COMMAND_DATABASE_CREATE,
"Find and import new messages to the notmuch database." },
- { "insert", notmuch_insert_command, NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE,
+ { "insert", notmuch_insert_command, NOTMUCH_COMMAND_DATABASE_EARLY |
+ NOTMUCH_COMMAND_DATABASE_WRITE,
"Add a new message into the maildir and notmuch database." },
{ "search", notmuch_search_command, NOTMUCH_COMMAND_DATABASE_EARLY,
"Search for messages matching the given search terms." },
"Add/remove tags for all messages matching the search terms." },
{ "dump", notmuch_dump_command, NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE,
"Create a plain-text dump of the tags for each message." },
- { "restore", notmuch_restore_command, NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE,
+ { "restore", notmuch_restore_command, NOTMUCH_COMMAND_DATABASE_EARLY |
+ NOTMUCH_COMMAND_DATABASE_WRITE,
"Restore the tags from the given dump file (see 'dump')." },
- { "compact", notmuch_compact_command, NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE,
+ { "compact", notmuch_compact_command, NOTMUCH_COMMAND_DATABASE_EARLY |
+ NOTMUCH_COMMAND_DATABASE_WRITE,
"Compact the notmuch database." },
- { "reindex", notmuch_reindex_command, NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE,
+ { "reindex", notmuch_reindex_command, NOTMUCH_COMMAND_DATABASE_EARLY |
+ NOTMUCH_COMMAND_DATABASE_WRITE,
"Re-index all messages matching the search terms." },
{ "config", notmuch_config_command, NOTMUCH_COMMAND_CONFIG_OPEN,
"Get or set settings in the notmuch configuration file." },
notmuch_exit_if_unsupported_format (void)
{
if (notmuch_format_version > NOTMUCH_FORMAT_CUR) {
- fprintf (stderr, "\
+ fprintf (stderr,
+ "\
A caller requested output format version %d, but the installed notmuch\n\
CLI only supports up to format version %d. You may need to upgrade your\n\
notmuch CLI.\n",
notmuch_format_version, NOTMUCH_FORMAT_CUR);
exit (NOTMUCH_EXIT_FORMAT_TOO_NEW);
} else if (notmuch_format_version < NOTMUCH_FORMAT_MIN) {
- fprintf (stderr, "\
+ fprintf (stderr,
+ "\
A caller requested output format version %d, which is no longer supported\n\
by the notmuch CLI (it requires at least version %d). You may need to\n\
upgrade your notmuch front-end.\n",
/* Warn about old version requests so compatibility issues are
* less likely when we drop support for a deprecated format
* versions. */
- fprintf (stderr, "\
+ fprintf (stderr,
+ "\
A caller requested deprecated output format version %d, which may not\n\
be supported in the future.\n", notmuch_format_version);
}
}
static int
-notmuch_help_command (unused (notmuch_config_t *config), unused(notmuch_database_t *notmuch), int argc, char *argv[])
+notmuch_help_command (unused (notmuch_config_t *config), unused(notmuch_database_t *notmuch), int
+ argc, char *argv[])
{
int opt_index;
{
struct sprinter_json *spj = json_begin_value (sp);
- fprintf (spj->stream, "%"PRId64, val);
+ fprintf (spj->stream, "%" PRId64, val);
}
static void
{
struct sprinter_sexp *sps = sexp_begin_value (sp);
- fprintf (sps->stream, "%"PRId64, val);
+ fprintf (sps->stream, "%" PRId64, val);
}
static void
{
struct sprinter_text *sptxt = (struct sprinter_text *) sp;
- fprintf (sptxt->stream, "%"PRId64, val);
+ fprintf (sptxt->stream, "%" PRId64, val);
}
static void