From: Richard Russon Date: Tue, 7 Nov 2017 15:11:14 +0000 (+0000) Subject: rename static functions with a leading underscore X-Git-Tag: neomutt-20171208~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac79e77800e68771a4b10434fa0816495a989070;p=neomutt rename static functions with a leading underscore --- diff --git a/color.c b/color.c index d884a3eaa..2364f392c 100644 --- a/color.c +++ b/color.c @@ -484,14 +484,14 @@ static void do_uncolor(struct Buffer *buf, struct Buffer *s, } /** - * _mutt_parse_uncolor - Parse an 'uncolor' command + * parse_uncolor - Parse an 'uncolor' command * * usage: * * uncolor index pattern [pattern...] * * unmono index pattern [pattern...] */ -static int _mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, - struct Buffer *err, short parse_uncolor) +static int parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, + struct Buffer *err, short parse_uncolor) { int object = 0, do_cache = 0; @@ -581,7 +581,7 @@ static int _mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned lo int mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) { - return _mutt_parse_uncolor(buf, s, data, err, 1); + return parse_uncolor(buf, s, data, err, 1); } #endif @@ -589,7 +589,7 @@ int mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, int mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) { - return _mutt_parse_uncolor(buf, s, data, err, 0); + return parse_uncolor(buf, s, data, err, 0); } static int add_pattern(struct ColorLineHead *top, const char *s, int sensitive, int fg, @@ -814,13 +814,13 @@ static int fgbgattr_to_color(int fg, int bg, int attr) } /** - * _mutt_parse_color - Parse a "color" command + * parse_color - Parse a "color" command * * usage: color OBJECT FG BG [ REGEX ] * mono OBJECT ATTR [ REGEX ] */ -static int _mutt_parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, - parser_callback_t callback, bool dry_run) +static int parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, + parser_callback_t callback, bool dry_run) { int object = 0, attr = 0, fg = 0, bg = 0, q_level = 0; int r = 0, match = 0; @@ -980,7 +980,7 @@ int mutt_parse_color(struct Buffer *buff, struct Buffer *s, unsigned long data, if (option(OPT_NO_CURSES) || !has_colors()) dry_run = true; - return _mutt_parse_color(buff, s, err, parse_color_pair, dry_run); + return parse_color(buff, s, err, parse_color_pair, dry_run); } #endif @@ -998,5 +998,5 @@ int mutt_parse_mono(struct Buffer *buff, struct Buffer *s, unsigned long data, dry_run = true; #endif - return _mutt_parse_color(buff, s, err, parse_attr_spec, dry_run); + return parse_color(buff, s, err, parse_attr_spec, dry_run); } diff --git a/commands.c b/commands.c index 3a1b43d74..3484f20e7 100644 --- a/commands.c +++ b/commands.c @@ -388,12 +388,12 @@ static void pipe_msg(struct Header *h, FILE *fp, int decode, int print) } /** - * _mutt_pipe_message - Pipe message to a command + * pipe_message - Pipe message to a command * * The following code is shared between printing and piping. */ -static int _mutt_pipe_message(struct Header *h, char *cmd, int decode, - int print, int split, char *sep) +static int pipe_message(struct Header *h, char *cmd, int decode, int print, + int split, char *sep) { int rc = 0; pid_t thepid; @@ -513,7 +513,7 @@ void mutt_pipe_message(struct Header *h) return; mutt_expand_path(buffer, sizeof(buffer)); - _mutt_pipe_message(h, buffer, option(OPT_PIPE_DECODE), 0, option(OPT_PIPE_SPLIT), PipeSep); + pipe_message(h, buffer, option(OPT_PIPE_DECODE), 0, option(OPT_PIPE_SPLIT), PipeSep); } void mutt_print_message(struct Header *h) @@ -528,8 +528,8 @@ void mutt_print_message(struct Header *h) h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES) return; - if (_mutt_pipe_message(h, PrintCommand, option(OPT_PRINT_DECODE), 1, - option(OPT_PRINT_SPLIT), "\f") == 0) + if (pipe_message(h, PrintCommand, option(OPT_PRINT_DECODE), 1, + option(OPT_PRINT_SPLIT), "\f") == 0) mutt_message(h ? _("Message printed") : _("Messages printed")); else mutt_message(h ? _("Message could not be printed") : @@ -1053,7 +1053,7 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp) return structure_changed; } -static int _mutt_check_traditional_pgp(struct Header *h, int *redraw) +static int check_traditional_pgp(struct Header *h, int *redraw) { struct Message *msg = NULL; int rv = 0; @@ -1080,14 +1080,14 @@ int mutt_check_traditional_pgp(struct Header *h, int *redraw) { int rv = 0; if (h && !(h->security & PGP_TRADITIONAL_CHECKED)) - rv = _mutt_check_traditional_pgp(h, redraw); + rv = check_traditional_pgp(h, redraw); else { for (int i = 0; i < Context->msgcount; i++) { if (message_is_tagged(Context, i) && !(Context->hdrs[i]->security & PGP_TRADITIONAL_CHECKED)) { - rv = _mutt_check_traditional_pgp(Context->hdrs[i], redraw) || rv; + rv = check_traditional_pgp(Context->hdrs[i], redraw) || rv; } } } diff --git a/copy.c b/copy.c index af214667d..c2bcdbb99 100644 --- a/copy.c +++ b/copy.c @@ -768,7 +768,7 @@ int mutt_copy_message(FILE *fpout, struct Context *src, struct Header *hdr, } /** - * _mutt_append_message - appends a copy of the given message to a mailbox + * append_message - appends a copy of the given message to a mailbox * @param dest destination mailbox * @param fpin where to get input * @param src source mailbox @@ -779,9 +779,8 @@ int mutt_copy_message(FILE *fpout, struct Context *src, struct Header *hdr, * @retval 0 on success * @retval -1 on error */ -static int _mutt_append_message(struct Context *dest, FILE *fpin, - struct Context *src, struct Header *hdr, - struct Body *body, int flags, int chflags) +static int append_message(struct Context *dest, FILE *fpin, struct Context *src, + struct Header *hdr, struct Body *body, int flags, int chflags) { char buf[STRING]; struct Message *msg = NULL; @@ -820,7 +819,7 @@ int mutt_append_message(struct Context *dest, struct Context *src, msg = mx_open_message(src, hdr->msgno); if (!msg) return -1; - r = _mutt_append_message(dest, msg->fp, src, hdr, hdr->content, cmflags, chflags); + r = append_message(dest, msg->fp, src, hdr, hdr->content, cmflags, chflags); mx_close_message(src, &msg); return r; } diff --git a/hook.c b/hook.c index 0087b0d28..be058fec5 100644 --- a/hook.c +++ b/hook.c @@ -500,7 +500,7 @@ void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr) mutt_pretty_mailbox(path, pathlen); } -static char *_mutt_string_hook(const char *match, int hook) +static char *string_hook(const char *match, int hook) { struct Hook *tmp = NULL; @@ -513,7 +513,7 @@ static char *_mutt_string_hook(const char *match, int hook) return NULL; } -static void _mutt_list_hook(struct ListHead *matches, const char *match, int hook) +static void list_hook(struct ListHead *matches, const char *match, int hook) { struct Hook *tmp = NULL; @@ -527,17 +527,17 @@ static void _mutt_list_hook(struct ListHead *matches, const char *match, int hoo char *mutt_charset_hook(const char *chs) { - return _mutt_string_hook(chs, MUTT_CHARSETHOOK); + return string_hook(chs, MUTT_CHARSETHOOK); } char *mutt_iconv_hook(const char *chs) { - return _mutt_string_hook(chs, MUTT_ICONVHOOK); + return string_hook(chs, MUTT_ICONVHOOK); } void mutt_crypt_hook(struct ListHead *list, struct Address *adr) { - _mutt_list_hook(list, adr->mailbox, MUTT_CRYPTHOOK); + list_hook(list, adr->mailbox, MUTT_CRYPTHOOK); } #ifdef USE_SOCKET diff --git a/init.c b/init.c index aadd7214c..9e22f933a 100644 --- a/init.c +++ b/init.c @@ -1149,7 +1149,7 @@ static int parse_unstailq(struct Buffer *buf, struct Buffer *s, return 0; } -static void _alternates_clean(void) +static void alternates_clean(void) { if (Context && Context->msgcount) { @@ -1163,7 +1163,7 @@ static int parse_alternates(struct Buffer *buf, struct Buffer *s, { struct GroupContext *gc = NULL; - _alternates_clean(); + alternates_clean(); do { @@ -1192,7 +1192,7 @@ bail: static int parse_unalternates(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) { - _alternates_clean(); + alternates_clean(); do { mutt_extract_token(buf, s, 0); @@ -1528,9 +1528,9 @@ bail: } /** - * _attachments_clean - always wise to do what someone else did before + * attachments_clean - always wise to do what someone else did before */ -static void _attachments_clean(void) +static void attachments_clean(void) { if (Context && Context->msgcount) { @@ -1601,7 +1601,7 @@ static int parse_attach_list(struct Buffer *buf, struct Buffer *s, mutt_list_insert_tail(head, (char *) a); } while (MoreArgs(s)); - _attachments_clean(); + attachments_clean(); return 0; } @@ -1657,7 +1657,7 @@ static int parse_unattach_list(struct Buffer *buf, struct Buffer *s, } while (MoreArgs(s)); FREE(&tmp); - _attachments_clean(); + attachments_clean(); return 0; } diff --git a/mh.c b/mh.c index 32e9085dc..6367c1bcf 100644 --- a/mh.c +++ b/mh.c @@ -1558,7 +1558,7 @@ static int maildir_open_new_message(struct Message *msg, struct Context *dest, } /** - * _maildir_commit_message - Commit a message to a maildir folder + * md_commit_message - Commit a message to a maildir folder * * msg->path contains the file name of a file in tmp/. We take the * flags from this file's name. @@ -1576,7 +1576,7 @@ static int maildir_open_new_message(struct Message *msg, struct Context *dest, * * See also maildir_open_new_message(). */ -static int _maildir_commit_message(struct Context *ctx, struct Message *msg, struct Header *hdr) +static int md_commit_message(struct Context *ctx, struct Message *msg, struct Header *hdr) { char subdir[4]; char suffix[16]; @@ -1607,7 +1607,7 @@ static int _maildir_commit_message(struct Context *ctx, struct Message *msg, str (long long) time(NULL), mutt_rand64(), NONULL(ShortHostname), suffix); snprintf(full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path); - mutt_debug(2, "_maildir_commit_message (): renaming %s to %s.\n", msg->path, full); + mutt_debug(2, "md_commit_message (): renaming %s to %s.\n", msg->path, full); if (safe_rename(msg->path, full) == 0) { @@ -1625,8 +1625,7 @@ static int _maildir_commit_message(struct Context *ctx, struct Message *msg, str ut.modtime = msg->received; if (utime(full, &ut)) { - mutt_perror( - _("_maildir_commit_message(): unable to set time on file")); + mutt_perror(_("md_commit_message(): unable to set time on file")); goto post_rename_err; } } @@ -1655,15 +1654,15 @@ static int _maildir_commit_message(struct Context *ctx, struct Message *msg, str static int maildir_commit_message(struct Context *ctx, struct Message *msg) { - return _maildir_commit_message(ctx, msg, NULL); + return md_commit_message(ctx, msg, NULL); } /* * commit a message to an MH folder. */ -static int _mh_commit_message(struct Context *ctx, struct Message *msg, - struct Header *hdr, short updseq) +static int mh_commit_msg(struct Context *ctx, struct Message *msg, + struct Header *hdr, short updseq) { DIR *dirp = NULL; struct dirent *de = NULL; @@ -1741,7 +1740,7 @@ static int _mh_commit_message(struct Context *ctx, struct Message *msg, static int mh_commit_message(struct Context *ctx, struct Message *msg) { - return _mh_commit_message(ctx, msg, NULL, 1); + return mh_commit_msg(ctx, msg, NULL, 1); } /** @@ -1775,9 +1774,9 @@ static int mh_rewrite_message(struct Context *ctx, int msgno) strfcpy(partpath, h->path, _POSIX_PATH_MAX); if (ctx->magic == MUTT_MAILDIR) - rc = _maildir_commit_message(ctx, dest, h); + rc = md_commit_message(ctx, dest, h); else - rc = _mh_commit_message(ctx, dest, h, 0); + rc = mh_commit_msg(ctx, dest, h, 0); mx_close_message(ctx, &dest); @@ -2416,14 +2415,14 @@ bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header * } /** - * _maildir_open_find_message - Find a message in a maildir folder + * md_open_find_message - Find a message in a maildir folder * * These functions try to find a message in a maildir folder when it * has moved under our feet. Note that this code is rather expensive, but * then again, it's called rarely. */ -static FILE *_maildir_open_find_message(const char *folder, const char *unique, - const char *subfolder, char **newname) +static FILE *md_open_find_message(const char *folder, const char *unique, + const char *subfolder, char **newname) { char dir[_POSIX_PATH_MAX]; char tunique[_POSIX_PATH_MAX]; @@ -2475,8 +2474,7 @@ FILE *maildir_open_find_message(const char *folder, const char *msg, char **newn maildir_canon_filename(unique, msg, sizeof(unique)); - if ((fp = _maildir_open_find_message( - folder, unique, new_hits > cur_hits ? "new" : "cur", newname)) || + if ((fp = md_open_find_message(folder, unique, new_hits > cur_hits ? "new" : "cur", newname)) || errno != ENOENT) { if (new_hits < UINT_MAX && cur_hits < UINT_MAX) @@ -2487,8 +2485,7 @@ FILE *maildir_open_find_message(const char *folder, const char *msg, char **newn return fp; } - if ((fp = _maildir_open_find_message( - folder, unique, new_hits > cur_hits ? "cur" : "new", newname)) || + if ((fp = md_open_find_message(folder, unique, new_hits > cur_hits ? "cur" : "new", newname)) || errno != ENOENT) { if (new_hits < UINT_MAX && cur_hits < UINT_MAX) diff --git a/mutt_lua.c b/mutt_lua.c index c6f7d805b..bac8db918 100644 --- a/mutt_lua.c +++ b/mutt_lua.c @@ -41,7 +41,7 @@ #include "protos.h" #include "rfc822.h" -static int _handle_panic(lua_State *l) +static int handle_panic(lua_State *l) { mutt_debug(1, "lua runtime panic: %s\n", lua_tostring(l, -1)); mutt_error("Lua runtime panic: %s\n", lua_tostring(l, -1)); @@ -49,7 +49,7 @@ static int _handle_panic(lua_State *l) return -1; } -static int _handle_error(lua_State *l) +static int handle_error(lua_State *l) { mutt_debug(1, "lua runtime error: %s\n", lua_tostring(l, -1)); mutt_error("Lua runtime error: %s\n", lua_tostring(l, -1)); @@ -57,9 +57,9 @@ static int _handle_error(lua_State *l) return -1; } -static int _lua_mutt_call(lua_State *l) +static int lua_mutt_call(lua_State *l) { - mutt_debug(2, " * _lua_mutt_call()\n"); + mutt_debug(2, " * lua_mutt_call()\n"); struct Buffer token, expn, err; char buffer[LONG_STRING] = ""; const struct Command *command = NULL; @@ -103,7 +103,7 @@ static int _lua_mutt_call(lua_State *l) else { if (lua_pushstring(l, err.data) == NULL) - _handle_error(l); + handle_error(l); else rv++; } @@ -113,11 +113,11 @@ static int _lua_mutt_call(lua_State *l) return rv; } -static int _lua_mutt_set(lua_State *l) +static int lua_mutt_set(lua_State *l) { int rv = -1; const char *param = lua_tostring(l, -2); - mutt_debug(2, " * _lua_mutt_set(%s)\n", param); + mutt_debug(2, " * lua_mutt_set(%s)\n", param); struct Option opt; char err_str[LONG_STRING]; struct Buffer err; @@ -192,10 +192,10 @@ static int _lua_mutt_set(lua_State *l) return rv; } -static int _lua_mutt_get(lua_State *l) +static int lua_mutt_get(lua_State *l) { const char *param = lua_tostring(l, -1); - mutt_debug(2, " * _lua_mutt_get(%s)\n", param); + mutt_debug(2, " * lua_mutt_get(%s)\n", param); struct Option opt; if (mutt_option_get(param, &opt)) @@ -258,14 +258,14 @@ static int _lua_mutt_get(lua_State *l) return -1; } } - mutt_debug(2, " * _lua_mutt_get() -> error\n"); + mutt_debug(2, " * lua_mutt_get() -> error\n"); luaL_error(l, "NeoMutt parameter not found %s", param); return -1; } -static int _lua_mutt_enter(lua_State *l) +static int lua_mutt_enter(lua_State *l) { - mutt_debug(2, " * _lua_mutt_enter()\n"); + mutt_debug(2, " * lua_mutt_enter()\n"); struct Buffer token, err; char *buffer = safe_strdup(lua_tostring(l, -1)); int rv = 0; @@ -284,7 +284,7 @@ static int _lua_mutt_enter(lua_State *l) else { if (lua_pushstring(l, err.data) == NULL) - _handle_error(l); + handle_error(l); else rv++; } @@ -295,25 +295,25 @@ static int _lua_mutt_enter(lua_State *l) return rv; } -static int _lua_mutt_message(lua_State *l) +static int lua_mutt_message(lua_State *l) { - mutt_debug(2, " * _lua_mutt_message()\n"); + mutt_debug(2, " * lua_mutt_message()\n"); const char *msg = lua_tostring(l, -1); if (msg) mutt_message(msg); return 0; } -static int _lua_mutt_error(lua_State *l) +static int lua_mutt_error(lua_State *l) { - mutt_debug(2, " * _lua_mutt_error()\n"); + mutt_debug(2, " * lua_mutt_error()\n"); const char *msg = lua_tostring(l, -1); if (msg) mutt_error(msg); return 0; } -static void _lua_expose_command(void *p, const struct Command *cmd) +static void lua_expose_command(void *p, const struct Command *cmd) { lua_State *l = (lua_State *) p; char buf[LONG_STRING]; @@ -324,10 +324,10 @@ static void _lua_expose_command(void *p, const struct Command *cmd) } static const luaL_Reg luaMuttDecl[] = { - { "set", _lua_mutt_set }, { "get", _lua_mutt_get }, - { "call", _lua_mutt_call }, { "enter", _lua_mutt_enter }, - { "print", _lua_mutt_message }, { "message", _lua_mutt_message }, - { "error", _lua_mutt_error }, { NULL, NULL }, + { "set", lua_mutt_set }, { "get", lua_mutt_get }, + { "call", lua_mutt_call }, { "enter", lua_mutt_enter }, + { "print", lua_mutt_message }, { "message", lua_mutt_message }, + { "error", lua_mutt_error }, { NULL, NULL }, }; #define lua_add_lib_member(LUA, TABLE, KEY, VALUE, DATATYPE_HANDLER) \ @@ -353,10 +353,10 @@ static void luaopen_mutt(lua_State *l) { luaL_requiref(l, "mutt", luaopen_mutt_decl, 1); (void) luaL_dostring(l, "mutt.command = {}"); - mutt_commands_apply((void *) l, &_lua_expose_command); + mutt_commands_apply((void *) l, &lua_expose_command); } -static bool _lua_init(lua_State **l) +static bool lua_init(lua_State **l) { if (!*l) { @@ -369,7 +369,7 @@ static bool _lua_init(lua_State **l) return false; } - lua_atpanic(*l, _handle_panic); + lua_atpanic(*l, handle_panic); /* load various Lua libraries */ luaL_openlibs(*l); @@ -385,7 +385,7 @@ lua_State *Lua = NULL; int mutt_lua_parse(struct Buffer *tmp, struct Buffer *s, unsigned long data, struct Buffer *err) { - _lua_init(&Lua); + lua_init(&Lua); mutt_debug(2, " * mutt_lua_parse(%s)\n", tmp->data); if (luaL_dostring(Lua, s->dptr)) @@ -405,7 +405,7 @@ int mutt_lua_source_file(struct Buffer *tmp, struct Buffer *s, { mutt_debug(2, " * mutt_lua_source()\n"); - _lua_init(&Lua); + lua_init(&Lua); char path[_POSIX_PATH_MAX]; diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index f0d2f289d..2efc58968 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -3112,9 +3112,9 @@ static void crypt_entry(char *s, size_t l, struct Menu *menu, int num) } /** - * _crypt_compare_address - Compare Key addresses and IDs for sorting + * compare_key_address - Compare Key addresses and IDs for sorting */ -static int _crypt_compare_address(const void *a, const void *b) +static int compare_key_address(const void *a, const void *b) { struct CryptKeyInfo **s = (struct CryptKeyInfo **) a; struct CryptKeyInfo **t = (struct CryptKeyInfo **) b; @@ -3128,14 +3128,14 @@ static int _crypt_compare_address(const void *a, const void *b) static int crypt_compare_address(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_address(a, b) : - _crypt_compare_address(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_key_address(a, b) : + compare_key_address(a, b)); } /** - * _crypt_compare_keyid - Compare Key IDs and addresses for sorting + * compare_keyid - Compare Key IDs and addresses for sorting */ -static int _crypt_compare_keyid(const void *a, const void *b) +static int compare_keyid(const void *a, const void *b) { struct CryptKeyInfo **s = (struct CryptKeyInfo **) a; struct CryptKeyInfo **t = (struct CryptKeyInfo **) b; @@ -3149,14 +3149,13 @@ static int _crypt_compare_keyid(const void *a, const void *b) static int crypt_compare_keyid(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_keyid(a, b) : - _crypt_compare_keyid(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_keyid(a, b) : compare_keyid(a, b)); } /** - * _crypt_compare_date - Compare Key creation dates and addresses for sorting + * compare_key_date - Compare Key creation dates and addresses for sorting */ -static int _crypt_compare_date(const void *a, const void *b) +static int compare_key_date(const void *a, const void *b) { struct CryptKeyInfo **s = (struct CryptKeyInfo **) a; struct CryptKeyInfo **t = (struct CryptKeyInfo **) b; @@ -3177,17 +3176,16 @@ static int _crypt_compare_date(const void *a, const void *b) static int crypt_compare_date(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_date(a, b) : - _crypt_compare_date(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_key_date(a, b) : compare_key_date(a, b)); } /** - * _crypt_compare_trust - Compare the trust of keys for sorting + * compare_key_trust - Compare the trust of keys for sorting * * Compare two trust values, the key length, the creation dates. the addresses * and the key IDs. */ -static int _crypt_compare_trust(const void *a, const void *b) +static int compare_key_trust(const void *a, const void *b) { struct CryptKeyInfo **s = (struct CryptKeyInfo **) a; struct CryptKeyInfo **t = (struct CryptKeyInfo **) b; @@ -3225,8 +3223,8 @@ static int _crypt_compare_trust(const void *a, const void *b) static int crypt_compare_trust(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_crypt_compare_trust(a, b) : - _crypt_compare_trust(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_key_trust(a, b) : + compare_key_trust(a, b)); } /** diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index a5fd71325..0f65f8679 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -120,7 +120,7 @@ bool pgp_use_gpg_agent(void) return true; } -static struct PgpKeyInfo *_pgp_parent(struct PgpKeyInfo *k) +static struct PgpKeyInfo *key_parent(struct PgpKeyInfo *k) { if ((k->flags & KEYFLAG_SUBKEY) && k->parent && option(OPT_PGP_IGNORE_SUBKEYS)) k = k->parent; @@ -130,21 +130,21 @@ static struct PgpKeyInfo *_pgp_parent(struct PgpKeyInfo *k) char *pgp_long_keyid(struct PgpKeyInfo *k) { - k = _pgp_parent(k); + k = key_parent(k); return k->keyid; } char *pgp_short_keyid(struct PgpKeyInfo *k) { - k = _pgp_parent(k); + k = key_parent(k); return k->keyid + 8; } char *pgp_keyid(struct PgpKeyInfo *k) { - k = _pgp_parent(k); + k = key_parent(k); return _pgp_keyid(k); } @@ -159,7 +159,7 @@ char *_pgp_keyid(struct PgpKeyInfo *k) static char *pgp_fingerprint(struct PgpKeyInfo *k) { - k = _pgp_parent(k); + k = key_parent(k); return k->fingerprint; } diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index 0ab8f6b38..6f8d18265 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -57,11 +57,10 @@ struct PgpCommandContext const char *ids; /**< %r */ }; -static const char *_mutt_fmt_pgp_command(char *dest, size_t destlen, size_t col, - int cols, char op, const char *src, - const char *prefix, const char *ifstring, - const char *elsestring, - unsigned long data, enum FormatFlag flags) +static const char *fmt_pgp_command(char *dest, size_t destlen, size_t col, int cols, + char op, const char *src, const char *prefix, + const char *ifstring, const char *elsestring, + unsigned long data, enum FormatFlag flags) { char fmt[16]; struct PgpCommandContext *cctx = (struct PgpCommandContext *) data; @@ -136,10 +135,9 @@ static const char *_mutt_fmt_pgp_command(char *dest, size_t destlen, size_t col, } if (optional) - mutt_expando_format(dest, destlen, col, cols, ifstring, _mutt_fmt_pgp_command, data, 0); + mutt_expando_format(dest, destlen, col, cols, ifstring, fmt_pgp_command, data, 0); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(dest, destlen, col, cols, elsestring, - _mutt_fmt_pgp_command, data, 0); + mutt_expando_format(dest, destlen, col, cols, elsestring, fmt_pgp_command, data, 0); return src; } @@ -148,7 +146,7 @@ static void mutt_pgp_command(char *d, size_t dlen, struct PgpCommandContext *cctx, const char *fmt) { mutt_expando_format(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), - _mutt_fmt_pgp_command, (unsigned long) cctx, 0); + fmt_pgp_command, (unsigned long) cctx, 0); mutt_debug(2, "mutt_pgp_command: %s\n", d); } diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 8aeebc386..ccd7daff6 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -307,7 +307,7 @@ static void pgp_entry(char *s, size_t l, struct Menu *menu, int num) pgp_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR); } -static int _pgp_compare_address(const void *a, const void *b) +static int compare_key_address(const void *a, const void *b) { int r; @@ -323,11 +323,11 @@ static int _pgp_compare_address(const void *a, const void *b) static int pgp_compare_address(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_address(a, b) : - _pgp_compare_address(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_key_address(a, b) : + compare_key_address(a, b)); } -static int _pgp_compare_keyid(const void *a, const void *b) +static int compare_keyid(const void *a, const void *b) { int r; @@ -342,11 +342,10 @@ static int _pgp_compare_keyid(const void *a, const void *b) static int pgp_compare_keyid(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_keyid(a, b) : - _pgp_compare_keyid(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_keyid(a, b) : compare_keyid(a, b)); } -static int _pgp_compare_date(const void *a, const void *b) +static int compare_key_date(const void *a, const void *b) { int r; struct PgpUid **s = (struct PgpUid **) a; @@ -359,11 +358,10 @@ static int _pgp_compare_date(const void *a, const void *b) static int pgp_compare_date(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_date(a, b) : - _pgp_compare_date(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_key_date(a, b) : compare_key_date(a, b)); } -static int _pgp_compare_trust(const void *a, const void *b) +static int compare_key_trust(const void *a, const void *b) { int r; @@ -387,8 +385,8 @@ static int _pgp_compare_trust(const void *a, const void *b) static int pgp_compare_trust(const void *a, const void *b) { - return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_trust(a, b) : - _pgp_compare_trust(a, b)); + return ((PgpSortKeys & SORT_REVERSE) ? !compare_key_trust(a, b) : + compare_key_trust(a, b)); } static bool pgp_key_is_valid(struct PgpKeyInfo *k) diff --git a/ncrypt/pgplib.c b/ncrypt/pgplib.c index 54f191dd3..e0ebf35cd 100644 --- a/ncrypt/pgplib.c +++ b/ncrypt/pgplib.c @@ -139,7 +139,7 @@ struct PgpUid *pgp_copy_uids(struct PgpUid *up, struct PgpKeyInfo *parent) return l; } -static void _pgp_free_key(struct PgpKeyInfo **kpp) +static void free_key(struct PgpKeyInfo **kpp) { struct PgpKeyInfo *kp = NULL; @@ -205,12 +205,12 @@ void pgp_free_key(struct PgpKeyInfo **kpp) for (q = p->next; q && q->parent == p; q = r) { r = q->next; - _pgp_free_key(&q); + free_key(&q); } if (p->parent) - _pgp_free_key(&p->parent); + free_key(&p->parent); - _pgp_free_key(&p); + free_key(&p); } *kpp = NULL; diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 20479a29a..3195db0ec 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -155,15 +155,14 @@ int smime_valid_passphrase(void) */ /** - * _mutt_fmt_smime_command - Format an SMIME command + * fmt_smime_command - Format an SMIME command * * This is almost identical to pgp's invoking interface. */ -static const char *_mutt_fmt_smime_command(char *dest, size_t destlen, size_t col, - int cols, char op, const char *src, - const char *prefix, const char *ifstring, - const char *elsestring, - unsigned long data, enum FormatFlag flags) +static const char *fmt_smime_command(char *dest, size_t destlen, size_t col, int cols, + char op, const char *src, const char *prefix, + const char *ifstring, const char *elsestring, + unsigned long data, enum FormatFlag flags) { char fmt[16]; struct SmimeCommandContext *cctx = (struct SmimeCommandContext *) data; @@ -286,11 +285,9 @@ static const char *_mutt_fmt_smime_command(char *dest, size_t destlen, size_t co } if (optional) - mutt_expando_format(dest, destlen, col, cols, ifstring, - _mutt_fmt_smime_command, data, 0); + mutt_expando_format(dest, destlen, col, cols, ifstring, fmt_smime_command, data, 0); else if (flags & MUTT_FORMAT_OPTIONAL) - mutt_expando_format(dest, destlen, col, cols, elsestring, - _mutt_fmt_smime_command, data, 0); + mutt_expando_format(dest, destlen, col, cols, elsestring, fmt_smime_command, data, 0); return src; } @@ -299,7 +296,7 @@ static void smime_command(char *d, size_t dlen, struct SmimeCommandContext *cctx, const char *fmt) { mutt_expando_format(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), - _mutt_fmt_smime_command, (unsigned long) cctx, 0); + fmt_smime_command, (unsigned long) cctx, 0); mutt_debug(2, "smime_command: %s\n", d); } @@ -762,12 +759,12 @@ static struct SmimeKey *smime_ask_for_key(char *prompt, short abilities, short p } /** - * _smime_getkeys - Get the keys for a mailbox + * getkeys - Get the keys for a mailbox * * This sets the '*ToUse' variables for an upcoming decryption, where the * required key is different from SmimeDefaultKey. */ -static void _smime_getkeys(char *mailbox) +static void getkeys(char *mailbox) { struct SmimeKey *key = NULL; char *k = NULL; @@ -840,17 +837,17 @@ void smime_getkeys(struct Envelope *env) if (mutt_addr_is_user(t)) { found = true; - _smime_getkeys(t->mailbox); + getkeys(t->mailbox); } for (t = env->cc; !found && t; t = t->next) if (mutt_addr_is_user(t)) { found = true; - _smime_getkeys(t->mailbox); + getkeys(t->mailbox); } if (!found && (t = mutt_default_from())) { - _smime_getkeys(t->mailbox); + getkeys(t->mailbox); rfc822_free_address(&t); } } diff --git a/sendlib.c b/sendlib.c index 7257b45be..ce6a91e4e 100644 --- a/sendlib.c +++ b/sendlib.c @@ -2748,8 +2748,8 @@ void mutt_unprepare_envelope(struct Envelope *env) rfc2047_decode(&env->subject); } -static int _mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to, - const char *resent_from, struct Address *env_from) +static int bounce_message(FILE *fp, struct Header *h, struct Address *to, + const char *resent_from, struct Address *env_from) { int ret = 0; FILE *f = NULL; @@ -2761,7 +2761,7 @@ static int _mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to, /* Try to bounce each message out, aborting if we get any failures. */ for (int i = 0; i < Context->msgcount; i++) if (message_is_tagged(Context, i)) - ret |= _mutt_bounce_message(fp, Context->hdrs[i], to, resent_from, env_from); + ret |= bounce_message(fp, Context->hdrs[i], to, resent_from, env_from); return ret; } @@ -2859,7 +2859,7 @@ int mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to) resent_to = rfc822_cpy_adr(to, 0); rfc2047_encode_adrlist(resent_to, "Resent-To"); - ret = _mutt_bounce_message(fp, h, resent_to, resent_from, from); + ret = bounce_message(fp, h, resent_to, resent_from, from); rfc822_free_address(&resent_to); rfc822_free_address(&from); diff --git a/status.c b/status.c index 688d96c10..bdd2895b7 100644 --- a/status.c +++ b/status.c @@ -45,9 +45,8 @@ static char *get_sort_str(char *buf, size_t buflen, int method) return buf; } -static void _menu_status_line(char *buf, size_t buflen, size_t col, int cols, - struct Menu *menu, const char *p); - +static void status_line(char *buf, size_t buflen, size_t col, int cols, + struct Menu *menu, const char *p); /** * status_format_str - Format a string for the status bar * @@ -317,15 +316,15 @@ static const char *status_format_str(char *buf, size_t buflen, size_t col, int c } if (optional) - _menu_status_line(buf, buflen, col, cols, menu, ifstring); + status_line(buf, buflen, col, cols, menu, ifstring); else if (flags & MUTT_FORMAT_OPTIONAL) - _menu_status_line(buf, buflen, col, cols, menu, elsestring); + status_line(buf, buflen, col, cols, menu, elsestring); return src; } -static void _menu_status_line(char *buf, size_t buflen, size_t col, int cols, - struct Menu *menu, const char *p) +static void status_line(char *buf, size_t buflen, size_t col, int cols, + struct Menu *menu, const char *p) { mutt_expando_format(buf, buflen, col, cols, p, status_format_str, (unsigned long) menu, 0);