From: Richard Russon Date: Wed, 24 Jan 2018 13:26:33 +0000 (+0000) Subject: rename functions X-Git-Tag: neomutt-20180223~29^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9af3bf17cc369cfebe6f153a00bf71e02da4ef3b;p=neomutt rename functions --- diff --git a/enter.c b/enter.c index 35b2b9c27..722dd0e7a 100644 --- a/enter.c +++ b/enter.c @@ -245,23 +245,23 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul { case OP_EDITOR_HISTORY_UP: state->curpos = state->lastchar; - if (mutt_history_at_scratch(hclass)) + if (mutt_hist_at_scratch(hclass)) { mutt_mb_wcstombs(buf, buflen, state->wbuf, state->curpos); - mutt_history_save_scratch(hclass, buf); + mutt_hist_save_scratch(hclass, buf); } - replace_part(state, 0, mutt_history_prev(hclass)); + replace_part(state, 0, mutt_hist_prev(hclass)); redraw = MUTT_REDRAW_INIT; break; case OP_EDITOR_HISTORY_DOWN: state->curpos = state->lastchar; - if (mutt_history_at_scratch(hclass)) + if (mutt_hist_at_scratch(hclass)) { mutt_mb_wcstombs(buf, buflen, state->wbuf, state->curpos); - mutt_history_save_scratch(hclass, buf); + mutt_hist_save_scratch(hclass, buf); } - replace_part(state, 0, mutt_history_next(hclass)); + replace_part(state, 0, mutt_hist_next(hclass)); redraw = MUTT_REDRAW_INIT; break; @@ -592,7 +592,7 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul { mutt_pretty_mailbox(buf, buflen); if (!pass) - mutt_history_add(hclass, buf, true); + mutt_hist_add(hclass, buf, true); rc = 0; goto bye; } @@ -711,7 +711,7 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul /* Convert from wide characters */ mutt_mb_wcstombs(buf, buflen, state->wbuf, state->lastchar); if (!pass) - mutt_history_add(hclass, buf, true); + mutt_hist_add(hclass, buf, true); if (multiple) { @@ -747,7 +747,7 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul bye: - mutt_reset_history_state(hclass); + mutt_hist_reset_state(hclass); FREE(&tempbuf); return rc; } diff --git a/history.c b/history.c index ee6261900..bac7a38f6 100644 --- a/history.c +++ b/history.c @@ -120,7 +120,7 @@ static void init_history(struct History *h) h->last = 0; } -void mutt_read_histfile(void) +void mutt_hist_read_file(void) { FILE *f = NULL; int line = 0, hclass, read; @@ -148,7 +148,7 @@ void mutt_read_histfile(void) if (p) { mutt_ch_convert_string(&p, "utf-8", Charset, 0); - mutt_history_add(hclass, p, false); + mutt_hist_add(hclass, p, false); FREE(&p); } } @@ -390,7 +390,7 @@ static void remove_history_dups(enum HistoryClass hclass, const char *s) h->hist[dest--] = NULL; } -void mutt_init_history(void) +void mutt_hist_init(void) { if (History == OldSize) return; @@ -401,7 +401,7 @@ void mutt_init_history(void) OldSize = History; } -void mutt_history_add(enum HistoryClass hclass, const char *s, bool save) +void mutt_hist_add(enum HistoryClass hclass, const char *s, bool save) { int prev; struct History *h = get_history(hclass); @@ -433,7 +433,7 @@ void mutt_history_add(enum HistoryClass hclass, const char *s, bool save) h->cur = h->last; /* reset to the last entry */ } -char *mutt_history_next(enum HistoryClass hclass) +char *mutt_hist_next(enum HistoryClass hclass) { int next; struct History *h = get_history(hclass); @@ -455,7 +455,7 @@ char *mutt_history_next(enum HistoryClass hclass) return (h->hist[h->cur] ? h->hist[h->cur] : ""); } -char *mutt_history_prev(enum HistoryClass hclass) +char *mutt_hist_prev(enum HistoryClass hclass) { int prev; struct History *h = get_history(hclass); @@ -477,7 +477,7 @@ char *mutt_history_prev(enum HistoryClass hclass) return (h->hist[h->cur] ? h->hist[h->cur] : ""); } -void mutt_reset_history_state(enum HistoryClass hclass) +void mutt_hist_reset_state(enum HistoryClass hclass) { struct History *h = get_history(hclass); @@ -487,7 +487,7 @@ void mutt_reset_history_state(enum HistoryClass hclass) h->cur = h->last; } -bool mutt_history_at_scratch(enum HistoryClass hclass) +bool mutt_hist_at_scratch(enum HistoryClass hclass) { struct History *h = get_history(hclass); @@ -497,7 +497,7 @@ bool mutt_history_at_scratch(enum HistoryClass hclass) return h->cur == h->last; } -void mutt_history_save_scratch(enum HistoryClass hclass, const char *s) +void mutt_hist_save_scratch(enum HistoryClass hclass, const char *s) { struct History *h = get_history(hclass); diff --git a/history.h b/history.h index 4d33925a0..5d08282e4 100644 --- a/history.h +++ b/history.h @@ -46,13 +46,13 @@ enum HistoryClass HC_LAST }; -void mutt_init_history(void); -void mutt_read_histfile(void); -void mutt_history_add(enum HistoryClass hclass, const char *s, bool save); -char *mutt_history_next(enum HistoryClass hclass); -char *mutt_history_prev(enum HistoryClass hclass); -void mutt_reset_history_state(enum HistoryClass hclass); -bool mutt_history_at_scratch(enum HistoryClass hclass); -void mutt_history_save_scratch(enum HistoryClass hclass, const char *s); +void mutt_hist_add(enum HistoryClass hclass, const char *str, bool save); +bool mutt_hist_at_scratch(enum HistoryClass hclass); +void mutt_hist_init(void); +char *mutt_hist_next(enum HistoryClass hclass); +char *mutt_hist_prev(enum HistoryClass hclass); +void mutt_hist_read_file(void); +void mutt_hist_reset_state(enum HistoryClass hclass); +void mutt_hist_save_scratch(enum HistoryClass hclass, const char *str); #endif /* _MUTT_HISTORY_H */ diff --git a/init.c b/init.c index b1911746d..021e1006d 100644 --- a/init.c +++ b/init.c @@ -2769,7 +2769,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, { if (*ptr < 0) *ptr = 0; - mutt_init_history(); + mutt_hist_init(); } else if (mutt_str_strcmp(MuttVars[idx].name, "debug_level") == 0) { @@ -4109,7 +4109,7 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands) Suspend = false; #endif - mutt_init_history(); + mutt_hist_init(); /* RFC2368, "4. Unsafe headers" * The creator of a mailto URL cannot expect the resolver of a URL to @@ -4228,7 +4228,7 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands) mutt_file_mkdir(Tmpdir, S_IRWXU); - mutt_read_histfile(); + mutt_hist_read_file(); #ifdef USE_NOTMUCH if (VirtualSpoolfile)