From: Richard Russon Date: Wed, 7 Aug 2019 21:14:09 +0000 (+0100) Subject: add whitespace for clarity X-Git-Tag: 2019-10-25~97^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=beba5f98e200882009a6c224c1f242da9a7b5378;p=neomutt add whitespace for clarity --- diff --git a/autocrypt/autocrypt.h b/autocrypt/autocrypt.h index aee4b5f2c..74bb34321 100644 --- a/autocrypt/autocrypt.h +++ b/autocrypt/autocrypt.h @@ -94,15 +94,15 @@ enum AutocryptRec AUTOCRYPT_REC_YES, ///< Autocrypt should be used }; -int mutt_autocrypt_init (int); -void mutt_autocrypt_cleanup (void); -int mutt_autocrypt_process_autocrypt_header (struct Email *e, struct Envelope *env); -int mutt_autocrypt_process_gossip_header (struct Email *e, struct Envelope *prot_headers); -enum AutocryptRec mutt_autocrypt_ui_recommendation (struct Email *e, char **keylist); -int mutt_autocrypt_set_sign_as_default_key (struct Email *e); -int mutt_autocrypt_write_autocrypt_header (struct Envelope *env, FILE *fp); -int mutt_autocrypt_write_gossip_headers (struct Envelope *env, FILE *fp); -int mutt_autocrypt_generate_gossip_list (struct Email *e); -void mutt_autocrypt_account_menu (void); +void mutt_autocrypt_account_menu (void); +void mutt_autocrypt_cleanup (void); +int mutt_autocrypt_generate_gossip_list (struct Email *e); +int mutt_autocrypt_init (int); +int mutt_autocrypt_process_autocrypt_header(struct Email *e, struct Envelope *env); +int mutt_autocrypt_process_gossip_header (struct Email *e, struct Envelope *prot_headers); +int mutt_autocrypt_set_sign_as_default_key (struct Email *e); +enum AutocryptRec mutt_autocrypt_ui_recommendation (struct Email *e, char **keylist); +int mutt_autocrypt_write_autocrypt_header (struct Envelope *env, FILE *fp); +int mutt_autocrypt_write_gossip_headers (struct Envelope *env, FILE *fp); #endif /* MUTT_AUTOCRYPT_AUTOCRYPT_H */ diff --git a/autocrypt/autocrypt_private.h b/autocrypt/autocrypt_private.h index 9e0c1080c..5570a57ea 100644 --- a/autocrypt/autocrypt_private.h +++ b/autocrypt/autocrypt_private.h @@ -30,44 +30,39 @@ struct Address; struct AddressList; struct Buffer; -int mutt_autocrypt_account_init (int prompt); -void mutt_autocrypt_scan_mailboxes (void); -int mutt_autocrypt_db_init (int can_create); -void mutt_autocrypt_db_close (void); +int mutt_autocrypt_account_init(int prompt); +void mutt_autocrypt_scan_mailboxes(void); -void mutt_autocrypt_db_normalize_addr(struct Address *a); -void mutt_autocrypt_db_normalize_addrlist(struct AddressList *al); +int mutt_autocrypt_db_account_delete(struct AutocryptAccount *acct); +void mutt_autocrypt_db_account_free(struct AutocryptAccount **account); +int mutt_autocrypt_db_account_get(struct Address *addr, struct AutocryptAccount **account); +int mutt_autocrypt_db_account_get_all(struct AutocryptAccount ***accounts, int *num_accounts); +int mutt_autocrypt_db_account_insert(struct Address *addr, const char *keyid, const char *keydata, int prefer_encrypt); +struct AutocryptAccount * mutt_autocrypt_db_account_new(void); +int mutt_autocrypt_db_account_update(struct AutocryptAccount *acct); +void mutt_autocrypt_db_close(void); +void mutt_autocrypt_db_gossip_history_free(struct AutocryptGossipHistory **gossip_hist); +int mutt_autocrypt_db_gossip_history_insert(struct Address *addr, struct AutocryptGossipHistory *gossip_hist); +struct AutocryptGossipHistory *mutt_autocrypt_db_gossip_history_new(void); +int mutt_autocrypt_db_init(int can_create); +void mutt_autocrypt_db_normalize_addr(struct Address *a); +void mutt_autocrypt_db_normalize_addrlist(struct AddressList *al); +void mutt_autocrypt_db_peer_free(struct AutocryptPeer **peer); +int mutt_autocrypt_db_peer_get(struct Address *addr, struct AutocryptPeer **peer); +void mutt_autocrypt_db_peer_history_free(struct AutocryptPeerHistory **peerhist); +int mutt_autocrypt_db_peer_history_insert(struct Address *addr, struct AutocryptPeerHistory *peerhist); +struct AutocryptPeerHistory * mutt_autocrypt_db_peer_history_new(void); +int mutt_autocrypt_db_peer_insert(struct Address *addr, struct AutocryptPeer *peer); +struct AutocryptPeer * mutt_autocrypt_db_peer_new(void); +int mutt_autocrypt_db_peer_update(struct AutocryptPeer *peer); -struct AutocryptAccount *mutt_autocrypt_db_account_new (void); -void mutt_autocrypt_db_account_free (struct AutocryptAccount **account); -int mutt_autocrypt_db_account_get (struct Address *addr, struct AutocryptAccount **account); -int mutt_autocrypt_db_account_insert (struct Address *addr, const char *keyid, - const char *keydata, int prefer_encrypt); -int mutt_autocrypt_db_account_update (struct AutocryptAccount *acct); -int mutt_autocrypt_db_account_delete (struct AutocryptAccount *acct); -int mutt_autocrypt_db_account_get_all (struct AutocryptAccount ***accounts, int *num_accounts); +int mutt_autocrypt_schema_init(void); +int mutt_autocrypt_schema_update(void); -struct AutocryptPeer *mutt_autocrypt_db_peer_new (void); -void mutt_autocrypt_db_peer_free (struct AutocryptPeer **peer); -int mutt_autocrypt_db_peer_get (struct Address *addr, struct AutocryptPeer **peer); -int mutt_autocrypt_db_peer_insert (struct Address *addr, struct AutocryptPeer *peer); -int mutt_autocrypt_db_peer_update (struct AutocryptPeer *peer); - -struct AutocryptPeerHistory *mutt_autocrypt_db_peer_history_new (void); -void mutt_autocrypt_db_peer_history_free (struct AutocryptPeerHistory **peerhist); -int mutt_autocrypt_db_peer_history_insert (struct Address *addr, struct AutocryptPeerHistory *peerhist); - -struct AutocryptGossipHistory *mutt_autocrypt_db_gossip_history_new (void); -void mutt_autocrypt_db_gossip_history_free (struct AutocryptGossipHistory **gossip_hist); -int mutt_autocrypt_db_gossip_history_insert (struct Address *addr, struct AutocryptGossipHistory *gossip_hist); - -int mutt_autocrypt_schema_init (void); -int mutt_autocrypt_schema_update (void); - -int mutt_autocrypt_gpgme_init (void); -int mutt_autocrypt_gpgme_create_key (struct Address *addr, struct Buffer *keyid, struct Buffer *keydata); -int mutt_autocrypt_gpgme_import_key (const char *keydata, struct Buffer *keyid); -int mutt_autocrypt_gpgme_is_valid_key (const char *keyid); +int mutt_autocrypt_gpgme_create_key(struct Address *addr, struct Buffer *keyid, struct Buffer *keydata); +int mutt_autocrypt_gpgme_import_key(const char *keydata, struct Buffer *keyid); +int mutt_autocrypt_gpgme_init(void); +int mutt_autocrypt_gpgme_is_valid_key(const char *keyid); #endif /* MUTT_AUTOCRYPT_AUTOCRYPT_PRIVATE_H */ diff --git a/autocrypt/autocrypt_schema.c b/autocrypt/autocrypt_schema.c index 41a72f5ee..211ecdfb5 100644 --- a/autocrypt/autocrypt_schema.c +++ b/autocrypt/autocrypt_schema.c @@ -36,51 +36,51 @@ int mutt_autocrypt_schema_init(void) schema = "BEGIN TRANSACTION; " - "CREATE TABLE account (" - "email_addr text primary key not null, " - "keyid text, " - "keydata text, " - "prefer_encrypt int, " - "enabled int);" - - "CREATE TABLE peer (" - "email_addr text primary key not null, " - "last_seen int, " - "autocrypt_timestamp int, " - "keyid text, " - "keydata text, " - "prefer_encrypt int, " - "gossip_timestamp int, " - "gossip_keyid text, " - "gossip_keydata text);" - - "CREATE TABLE peer_history (" - "peer_email_addr text not null, " - "email_msgid text, " - "timestamp int, " - "keydata text);" - - "CREATE INDEX peer_history_email " - "ON peer_history (" - "peer_email_addr);" - - "CREATE TABLE gossip_history (" - "peer_email_addr text not null, " - "sender_email_addr text, " - "email_msgid text, " - "timestamp int, " - "gossip_keydata text);" - - "CREATE INDEX gossip_history_email " - "ON gossip_history (" - "peer_email_addr);" - - "CREATE TABLE schema (" - "version int);" - - "INSERT into schema (version) values (1);" - - "COMMIT TRANSACTION"; + "CREATE TABLE account (" + "email_addr text primary key not null, " + "keyid text, " + "keydata text, " + "prefer_encrypt int, " + "enabled int);" + + "CREATE TABLE peer (" + "email_addr text primary key not null, " + "last_seen int, " + "autocrypt_timestamp int, " + "keyid text, " + "keydata text, " + "prefer_encrypt int, " + "gossip_timestamp int, " + "gossip_keyid text, " + "gossip_keydata text);" + + "CREATE TABLE peer_history (" + "peer_email_addr text not null, " + "email_msgid text, " + "timestamp int, " + "keydata text);" + + "CREATE INDEX peer_history_email " + "ON peer_history (" + "peer_email_addr);" + + "CREATE TABLE gossip_history (" + "peer_email_addr text not null, " + "sender_email_addr text, " + "email_msgid text, " + "timestamp int, " + "gossip_keydata text);" + + "CREATE INDEX gossip_history_email " + "ON gossip_history (" + "peer_email_addr);" + + "CREATE TABLE schema (" + "version int);" + + "INSERT into schema (version) values (1);" + + "COMMIT TRANSACTION"; if (sqlite3_exec(AutocryptDB, schema, NULL, NULL, &errmsg) != SQLITE_OK) { diff --git a/functions.h b/functions.h index 26e38ed4a..4786d51ea 100644 --- a/functions.h +++ b/functions.h @@ -102,7 +102,7 @@ const struct Binding OpGeneric[] = { /* map: generic */ */ const struct Binding OpMain[] = { /* map: index */ #ifdef USE_AUTOCRYPT - { "autocrypt-acct-menu", OP_AUTOCRYPT_ACCT_MENU, "A" }, + { "autocrypt-acct-menu", OP_AUTOCRYPT_ACCT_MENU, "A" }, #endif { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, { "break-thread", OP_MAIN_BREAK_THREAD, "#" },