From: Richard Russon Date: Tue, 28 Nov 2017 15:25:35 +0000 (+0000) Subject: move rfc822_new_address to address.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=046d62a9b1c084c0eb87df3071a11c3fbd6a0bb4;p=neomutt move rfc822_new_address to address.c --- diff --git a/address.c b/address.c index 6f0ab2d1e..ef0a96d80 100644 --- a/address.c +++ b/address.c @@ -86,6 +86,17 @@ const char *const RFC822Errors[] = { "bad route in <>", "bad address in <>", "bad address spec", }; +/** + * rfc822_new_address - Create a new Address + * @retval ptr Newly allocated Address + * + * Free the result with free_address() or rfc822_free_address() + */ +struct Address *rfc822_new_address(void) +{ + return mutt_mem_calloc(1, sizeof(struct Address)); +} + /** * free_address - Free a single Address * @param a Address to free diff --git a/address.h b/address.h index a38410945..f7c59bf51 100644 --- a/address.h +++ b/address.h @@ -51,6 +51,7 @@ enum AddressError ERR_BAD_ADDR_SPEC }; +struct Address *rfc822_new_address(void); void rfc822_free_address(struct Address **p); void rfc822_qualify(struct Address *addr, const char *host); struct Address *rfc822_parse_adrlist(struct Address *top, const char *s); @@ -69,15 +70,4 @@ extern const char RFC822Specials[]; #define rfc822_error(x) RFC822Errors[x] -/** - * rfc822_new_address - Create a new Address - * @retval ptr Newly allocated Address - * - * Free the result with free_address() or rfc822_free_address() - */ -static inline struct Address *rfc822_new_address(void) -{ - return mutt_mem_calloc(1, sizeof(struct Address)); -} - #endif /* _MUTT_ADDRESS_H */ diff --git a/commands.c b/commands.c index be4cc61d4..8a6afaa08 100644 --- a/commands.c +++ b/commands.c @@ -36,6 +36,7 @@ #include #include "mutt/mutt.h" #include "mutt.h" +#include "address.h" #include "alias.h" #include "body.h" #include "buffy.h" @@ -58,7 +59,6 @@ #include "pager.h" #include "parameter.h" #include "protos.h" -#include "address.h" #include "sort.h" #ifdef USE_IMAP #include "imap/imap.h" diff --git a/compose.c b/compose.c index 734a7e0a0..ef06acdb0 100644 --- a/compose.c +++ b/compose.c @@ -35,6 +35,7 @@ #include "mutt/mutt.h" #include "conn/conn.h" #include "mutt.h" +#include "address.h" #include "alias.h" #include "attach.h" #include "body.h" @@ -55,7 +56,6 @@ #include "opcodes.h" #include "options.h" #include "protos.h" -#include "address.h" #include "sort.h" #ifdef MIXMASTER #include "remailer.h" diff --git a/edit.c b/edit.c index 187c6be6f..349d4bfeb 100644 --- a/edit.c +++ b/edit.c @@ -35,6 +35,7 @@ #include #include "mutt/mutt.h" #include "mutt.h" +#include "address.h" #include "alias.h" #include "body.h" #include "context.h" @@ -45,7 +46,6 @@ #include "mutt_idna.h" #include "options.h" #include "protos.h" -#include "address.h" /* * SLcurses_waddnstr() can't take a "const char *", so this is only diff --git a/mutt_lua.c b/mutt_lua.c index 7bfc2efb8..8ac9a5958 100644 --- a/mutt_lua.c +++ b/mutt_lua.c @@ -32,6 +32,7 @@ #include "mutt/mutt.h" #include "mutt.h" #include "mutt_lua.h" +#include "address.h" #include "globals.h" #include "mailbox.h" #include "mbtable.h" @@ -39,7 +40,6 @@ #include "mutt_options.h" #include "options.h" #include "protos.h" -#include "address.h" static int handle_panic(lua_State *l) { diff --git a/parse.c b/parse.c index c651966eb..dada31fec 100644 --- a/parse.c +++ b/parse.c @@ -30,6 +30,7 @@ #include #include "mutt/mutt.h" #include "mutt.h" +#include "address.h" #include "body.h" #include "charset.h" #include "envelope.h" @@ -44,7 +45,6 @@ #include "protos.h" #include "rfc2047.h" #include "rfc2231.h" -#include "address.h" #include "url.h" struct Address; diff --git a/pop_auth.c b/pop_auth.c index b9e3b3e50..f7788a337 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -27,13 +27,13 @@ #include "mutt/mutt.h" #include "conn/conn.h" #include "mutt.h" +#include "address.h" #include "globals.h" #include "mutt_account.h" #include "mutt_socket.h" #include "options.h" #include "pop.h" #include "protos.h" -#include "address.h" #ifdef USE_SASL #include #include diff --git a/recvcmd.c b/recvcmd.c index f3ca65b3c..c6aeb0b2a 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -27,6 +27,7 @@ #include #include "mutt/mutt.h" #include "mutt.h" +#include "address.h" #include "alias.h" #include "attach.h" #include "body.h" @@ -38,7 +39,6 @@ #include "mutt_idna.h" #include "options.h" #include "protos.h" -#include "address.h" #include "state.h" /** diff --git a/url.c b/url.c index 557ea0779..50960729c 100644 --- a/url.c +++ b/url.c @@ -31,12 +31,12 @@ #include "mutt/mutt.h" #include "mutt.h" #include "url.h" +#include "address.h" #include "envelope.h" #include "globals.h" #include "mime.h" #include "protos.h" #include "rfc2047.h" -#include "address.h" static const struct Mapping UrlMap[] = { { "file", U_FILE }, { "imap", U_IMAP }, { "imaps", U_IMAPS },