]> git.cworth.org Git - notmuch/commitdiff
cli: run uncrustify
authoruncrustify <david@tethera.net>
Sat, 13 Mar 2021 12:45:34 +0000 (08:45 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 13 Mar 2021 12:45:34 +0000 (08:45 -0400)
This is the result of running

     $ uncrustify --replace --config devel/uncrustify.cfg *.c *.h

in the top level source directory

Line breaks were then adjusted manually to keep argc and argv
together.

21 files changed:
command-line-arguments.c
gmime-filter-reply.h
mime-node.c
notmuch-client.h
notmuch-compact.c
notmuch-config.c
notmuch-count.c
notmuch-dump.c
notmuch-insert.c
notmuch-new.c
notmuch-reindex.c
notmuch-reply.c
notmuch-restore.c
notmuch-search.c
notmuch-show.c
notmuch-tag.c
notmuch-time.c
notmuch.c
sprinter-json.c
sprinter-sexp.c
sprinter-text.c

index 169b12a36b7be4edd5058626abc86fe6c98e6611..5dea8281b79e389fac4586a9f654a32633fa8f86 100644 (file)
@@ -47,17 +47,23 @@ _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, char next,
                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;
@@ -74,7 +80,8 @@ _process_boolean_arg (const notmuch_opt_desc_t *arg_desc, char next,
     } 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;
     }
 
@@ -202,6 +209,7 @@ parse_option (int argc, char **argv, const notmuch_opt_desc_t *options, int opt_
     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];
 
index 5a1e606e5079a5ac7f2c2688222b9150b37ff7c4..7cdefcd1f127ff45e5ca9cbd63bf0f541816e1c9 100644 (file)
 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;
index f552e03a780f56e0b6926550e52c649bc3f1b792..d29c4e48a8054055b7e49aa99fa9f83edfb897db 100644 (file)
@@ -243,7 +243,8 @@ node_verify (mime_node_t *node, GMimeObject *part)
 
     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 */
@@ -278,7 +279,8 @@ node_decrypt_and_verify (mime_node_t *node, GMimeObject *part)
     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. */
@@ -287,9 +289,11 @@ node_decrypt_and_verify (mime_node_t *node, GMimeObject *part)
            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) {
@@ -366,7 +370,8 @@ _mime_node_set_up_part (mime_node_t *node, GMimeObject *part, int numchild)
     }
 
     /* 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 "
@@ -385,19 +390,22 @@ _mime_node_set_up_part (mime_node_t *node, GMimeObject *part, int numchild)
            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) {
index f60f540626d94df074f0294d439892b52bf03b46..704586294c17fe8ed4cf3fb0151f62599b7e342b 100644 (file)
@@ -171,46 +171,60 @@ void
 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);
@@ -503,9 +517,10 @@ print_status_gzbytes (const char *loc,
                      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"
 
index 361583db878b1ba4863db1b1f8720bb6175152e5..cc45afa105992025bd94ac62056adb4f8b34cdb5 100644 (file)
@@ -27,7 +27,8 @@ status_update_cb (const char *msg, unused (void *closure))
 }
 
 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;
index 0193401fe4b531df971a0b80933ccee709fc5745..e1a583e62788f2cce437e4f54ce0cc0591bd6261 100644 (file)
@@ -510,7 +510,9 @@ notmuch_config_close (notmuch_config_t *config)
     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.
@@ -1105,7 +1107,8 @@ notmuch_config_command_list (notmuch_config_t *config)
 }
 
 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;
index 048b1f44f7e3fca2f54d26f5908f00b20785be1d..bfa0363ab3f141b2c456a2b18fd3e1592ca6f90d 100644 (file)
@@ -86,12 +86,12 @@ print_count (notmuch_database_t *notmuch, const char *query_str,
 
        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:
@@ -151,7 +151,8 @@ count_file (notmuch_database_t *notmuch, FILE *input, notmuch_config_values_t *e
 }
 
 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;
index d701792990f612134a7e2f72e485844f8b2fd1fa..04ecd6a38564c0359bff08d1897714a44fa9f344 100644 (file)
@@ -339,7 +339,7 @@ notmuch_database_dump (notmuch_database_t *notmuch,
        output = NULL;
        goto DONE;
     } else
-        output = NULL;
+       output = NULL;
 
     if (output_file_name) {
        ret = rename (tempname, output_file_name);
@@ -361,7 +361,8 @@ notmuch_database_dump (notmuch_database_t *notmuch,
 }
 
 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;
index 0f272e2e89a1f80a84feb69188b3eb2e121aff10..cc5aeefc1fc00b907b09e22e4ac17d909d7b20c5 100644 (file)
@@ -444,7 +444,8 @@ add_file (notmuch_database_t *notmuch, const char *path, tag_op_list_t *tag_ops,
 }
 
 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;
index 21e66af1c55b8d285a1ae9871a88d0e0bac75479..223d68bb2530ed7eb1981e3782721d40f99d254b 100644 (file)
@@ -673,8 +673,9 @@ add_files (notmuch_database_t *notmuch,
                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);
            }
@@ -756,8 +757,9 @@ add_files (notmuch_database_t *notmuch,
                                          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);
 
@@ -1043,7 +1045,8 @@ print_results (const add_files_state_t *state)
 }
 
 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);
@@ -1094,7 +1097,8 @@ _maybe_upgrade (notmuch_database_t *notmuch, add_files_state_t *state) {
 }
 
 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,
@@ -1155,7 +1159,7 @@ notmuch_new_command (unused(notmuch_config_t *config), notmuch_database_t *notmu
     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);
@@ -1233,7 +1237,8 @@ notmuch_new_command (unused(notmuch_config_t *config), notmuch_database_t *notmu
        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);
        }
     }
index fa84d4fc8f23f7f1e3f0674a7b83c0c2229dbe91..df566a7c9b588bd68019b6ea2168aed9d47b94c3 100644 (file)
@@ -83,7 +83,8 @@ reindex_query (notmuch_database_t *notmuch, const char *query_string,
 }
 
 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;
index 700f33978a14f1328a95e0dbbcf7c17d7bf7aa01..b40ce96bca2a1725dc126dda6ec24eec649fb927 100644 (file)
@@ -639,7 +639,9 @@ do_reply (notmuch_database_t *notmuch,
            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;
        }
 
@@ -703,7 +705,8 @@ do_reply (notmuch_database_t *notmuch,
 }
 
 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;
index ce07f89d927931e1dbb570197e27fb61ccb96ce1..081b504c93b044ba709669752e24f029697ff123 100644 (file)
@@ -219,7 +219,8 @@ parse_sup_line (void *ctx, char *line,
 }
 
 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;
@@ -343,7 +344,8 @@ notmuch_restore_command (unused(notmuch_config_t *config), notmuch_database_t *n
            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;
@@ -360,6 +362,7 @@ notmuch_restore_command (unused(notmuch_config_t *config), notmuch_database_t *n
     }
 
     char *p;
+
     for (p = line; (input_format == DUMP_FORMAT_AUTO) && *p; p++) {
        if (*p == '(')
            input_format = DUMP_FORMAT_SUP;
@@ -382,7 +385,8 @@ notmuch_restore_command (unused(notmuch_config_t *config), notmuch_database_t *n
 
        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;
index aba22799cb285af087553f9ebffa9dbf0c619486..a5c49477a516777746d805f5db0469438552c289 100644 (file)
@@ -794,7 +794,8 @@ static const notmuch_opt_desc_t common_options[] = {
 };
 
 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;
@@ -831,7 +832,8 @@ notmuch_search_command (unused(notmuch_config_t *config), notmuch_database_t *no
 
     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;
     }
 
@@ -860,7 +862,8 @@ notmuch_search_command (unused(notmuch_config_t *config), notmuch_database_t *no
 }
 
 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;
index c3c42caac52c06bf5113863983b80c44789d9e8e..b6b53991c652688e5d8108e357bbe8146623dded 100644 (file)
@@ -80,14 +80,16 @@ _get_disposition (GMimeObject *meta)
     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;
 }
@@ -438,6 +440,7 @@ format_part_sigstatus_sprinter (sprinter_t *sp, GMimeSignatureList *siglist)
     }
 
     int i;
+
     for (i = 0; i < g_mime_signature_list_length (siglist); i++) {
        GMimeSignature *signature = g_mime_signature_list_get_signature (siglist, i);
 
@@ -668,7 +671,8 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node,
                    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);
@@ -965,7 +969,8 @@ show_message (void *ctx,
     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)
@@ -973,12 +978,15 @@ show_message (void *ctx,
     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",
@@ -1064,7 +1072,9 @@ do_show_single (void *ctx,
        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;
     }
 
@@ -1157,9 +1167,9 @@ do_show_unthreaded (void *ctx,
        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);
@@ -1215,7 +1225,8 @@ static const notmuch_show_format_t *formatters[] = {
 };
 
 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;
@@ -1321,10 +1332,12 @@ notmuch_show_command (notmuch_config_t *config, unused(notmuch_database_t *notmu
        (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,
index 464874b4b8ffbe06487bc3e6993c399dfeae5a99..9c3d4f8b040d9ea87d9b0de7f5fb0d9c6a89ef4e 100644 (file)
@@ -187,7 +187,8 @@ tag_file (void *ctx, notmuch_database_t *notmuch, tag_op_flag_t flags,
 }
 
 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;
index cc7ffc239fb003249e5b8d62301870c1c2051305..cd45818b076a8141731d8cef4eb7e1bc9b44a675 100644 (file)
@@ -39,8 +39,8 @@
  *
  */
 #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)
index 7360e0e6d5872fe61e691e5da44e62de0e28d5f3..5e56209b69a7d6b599763efb310294beb338c9fa 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -31,7 +31,8 @@
  * 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;
@@ -125,7 +126,8 @@ notmuch_process_shared_indexing_options (notmuch_database_t *notmuch)
        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));
@@ -144,9 +146,11 @@ static command_t commands[] = {
     { "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." },
@@ -162,11 +166,14 @@ static command_t commands[] = {
       "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." },
@@ -248,14 +255,16 @@ void
 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",
@@ -265,7 +274,8 @@ 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);
     }
@@ -339,7 +349,8 @@ _help_for (const char *topic_name)
 }
 
 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;
 
index 273bdeca3d736dcb16f90acdf4ee6377efb281d0..c7f4851cdd53bc6231d7a56e1d19e80834a09536 100644 (file)
@@ -129,7 +129,7 @@ json_integer (struct sprinter *sp, int64_t val)
 {
     struct sprinter_json *spj = json_begin_value (sp);
 
-    fprintf (spj->stream, "%"PRId64, val);
+    fprintf (spj->stream, "%" PRId64, val);
 }
 
 static void
index 35c007d5a25f55d7bcebae9c588b5a6d35d1a615..63b254284b4a6d73861896587b12bc2a6281144f 100644 (file)
@@ -166,7 +166,7 @@ sexp_integer (struct sprinter *sp, int64_t val)
 {
     struct sprinter_sexp *sps = sexp_begin_value (sp);
 
-    fprintf (sps->stream, "%"PRId64, val);
+    fprintf (sps->stream, "%" PRId64, val);
 }
 
 static void
index 7b68f98ccbb17e7a494cbc925e954af6347e3b91..c75ec5be1cbc5632f56332b40563c87959367547 100644 (file)
@@ -49,7 +49,7 @@ text_integer (struct sprinter *sp, int64_t val)
 {
     struct sprinter_text *sptxt = (struct sprinter_text *) sp;
 
-    fprintf (sptxt->stream, "%"PRId64, val);
+    fprintf (sptxt->stream, "%" PRId64, val);
 }
 
 static void