From 16f557cdf36ea89971877efc226acc53fd76e9c5 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 19 May 2017 01:41:07 +0100 Subject: [PATCH] rename the remaining plain structs struct b64_context struct B64Context struct binding_t struct Binding struct browser_state struct BrowserState struct command_t struct Command struct compile_options struct CompileOptions struct coord struct Coord struct crypt_cache struct CryptCache struct crypt_module_functions struct CryptModuleFunctions struct crypt_module_specs struct CryptModuleSpecs struct dn_array_s struct DnArrayS struct enriched_state struct EnrichedState struct extkey struct Extkey struct fgetconv_not struct FgetConvNot struct fgetconv_s struct FgetConvS struct folder_file struct FolderFile struct hash_elem struct HashElem struct hash_walk_state struct HashWalkState struct hdr_format_info struct HdrFormatInfo struct header_cache struct HeaderCache struct history struct History struct keymap_t struct Keymap struct line_t struct Line struct maildir struct Maildir struct mapping_t struct Mapping struct md5_ctx struct Md5Ctx struct mh_data struct MhData struct mh_sequences struct MhSequences struct m_update_t struct MUpdate struct mx_ops struct MxOps struct nm_ctxdata struct NmCtxdata struct nm_hdrdata struct NmHdrdata struct nm_hdrtag struct NmHdrtag struct option_t struct Option struct pattern_flags struct PatternFlags struct pgp_cache struct PgpCache struct pgp_command_context struct PgpCommandContext struct q_class_t struct QClass struct range_regexp struct RangeRegex struct resize struct Resize struct rfc2231_parameter struct Rfc2231Parameter struct smime_command_context struct SmimeCommandContext struct syntax_t struct Syntax struct sysexits struct Sysexits struct _tlssockdata struct TlsSockData struct tz_t struct Tz struct uri_tag struct UriTag --- addrbook.c | 2 +- browser.c | 86 +++++++++---------- browser.h | 6 +- charset.c | 14 +-- color.c | 6 +- commands.c | 2 +- compose.c | 4 +- compress.c | 18 ++-- compress.h | 2 +- context.h | 2 +- curs_main.c | 8 +- functions.h | 26 +++--- handler.c | 14 +-- hash.c | 26 +++--- hash.h | 16 ++-- hcache/hcache.c | 4 +- hcache/hcache.h | 2 +- hdrline.c | 6 +- headers.c | 4 +- help.c | 18 ++-- history.c | 26 +++--- imap/auth_cram.c | 2 +- imap/browse.c | 10 +-- imap/imap.c | 2 +- imap/imap.h | 6 +- init.c | 46 +++++----- init.h | 16 ++-- keymap.c | 52 +++++------ keymap.h | 42 ++++----- lib.c | 2 +- mapping.h | 8 +- mbox.c | 14 +-- md5.c | 14 +-- md5.h | 12 +-- mh.c | 112 ++++++++++++------------ mutt_commands.h | 6 +- mutt_lua.c | 12 +-- mutt_notmuch.c | 142 +++++++++++++++---------------- mutt_notmuch.h | 2 +- mutt_options.h | 8 +- mutt_ssl_gnutls.c | 2 +- mx.c | 2 +- mx.h | 14 +-- ncrypt/crypt_gpgme.c | 26 +++--- ncrypt/crypt_mod.h | 4 +- ncrypt/crypt_mod_pgp_classic.c | 2 +- ncrypt/crypt_mod_pgp_gpgme.c | 2 +- ncrypt/crypt_mod_smime_classic.c | 2 +- ncrypt/crypt_mod_smime_gpgme.c | 2 +- ncrypt/cryptglue.c | 8 +- ncrypt/pgpinvoke.c | 12 +-- ncrypt/pgpkey.c | 10 +-- ncrypt/smime.c | 8 +- nntp.c | 2 +- nntp.h | 2 +- pager.c | 104 +++++++++++----------- parse.c | 8 +- pattern.c | 12 +-- pgppubring.c | 2 +- pop.c | 2 +- pop.h | 2 +- pop_auth.c | 2 +- postpone.c | 2 +- protos.h | 4 +- query.c | 2 +- recvattach.c | 2 +- remailer.c | 16 ++-- rfc2231.c | 24 +++--- sendlib.c | 10 +-- sort.h | 2 +- thread.c | 2 +- url.c | 2 +- version.c | 6 +- 73 files changed, 551 insertions(+), 551 deletions(-) diff --git a/addrbook.c b/addrbook.c index 3d687a0f9..9feb3c020 100644 --- a/addrbook.c +++ b/addrbook.c @@ -37,7 +37,7 @@ #define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x -static const struct mapping_t AliasHelp[] = { +static const struct Mapping AliasHelp[] = { { N_("Exit"), OP_EXIT }, { N_("Del"), OP_DELETE }, { N_("Undel"), OP_UNDELETE }, { N_("Select"), OP_GENERIC_SELECT_ENTRY }, { N_("Help"), OP_HELP }, { NULL, 0 }, diff --git a/browser.c b/browser.c index 8f03f6500..2e3b2f53f 100644 --- a/browser.c +++ b/browser.c @@ -66,7 +66,7 @@ #include "mutt_notmuch.h" #endif -static const struct mapping_t FolderHelp[] = { +static const struct Mapping FolderHelp[] = { { N_("Exit"), OP_EXIT }, { N_("Chdir"), OP_CHANGE_DIRECTORY }, { N_("Goto"), OP_BROWSER_GOTO_FOLDER }, @@ -76,7 +76,7 @@ static const struct mapping_t FolderHelp[] = { }; #ifdef USE_NNTP -static struct mapping_t FolderNewsHelp[] = { +static struct Mapping FolderNewsHelp[] = { { N_("Exit"), OP_EXIT }, { N_("List"), OP_TOGGLE_MAILBOXES }, { N_("Subscribe"), OP_BROWSER_SUBSCRIBE }, @@ -90,7 +90,7 @@ static struct mapping_t FolderNewsHelp[] = { struct Folder { - struct folder_file *ff; + struct FolderFile *ff; int num; }; @@ -98,7 +98,7 @@ static char OldLastDir[_POSIX_PATH_MAX] = ""; static char LastDir[_POSIX_PATH_MAX] = ""; /* Frees up the memory allocated for the local-global variables. */ -static void destroy_state(struct browser_state *state) +static void destroy_state(struct BrowserState *state) { int c; @@ -115,8 +115,8 @@ static void destroy_state(struct browser_state *state) static int browser_compare_subject(const void *a, const void *b) { - struct folder_file *pa = (struct folder_file *) a; - struct folder_file *pb = (struct folder_file *) b; + struct FolderFile *pa = (struct FolderFile *) a; + struct FolderFile *pb = (struct FolderFile *) b; /* inbox should be sorted ahead of its siblings */ int r = mutt_inbox_cmp(pa->name, pb->name); @@ -127,8 +127,8 @@ static int browser_compare_subject(const void *a, const void *b) static int browser_compare_desc(const void *a, const void *b) { - struct folder_file *pa = (struct folder_file *) a; - struct folder_file *pb = (struct folder_file *) b; + struct FolderFile *pa = (struct FolderFile *) a; + struct FolderFile *pb = (struct FolderFile *) b; int r = mutt_strcoll(pa->desc, pb->desc); @@ -137,8 +137,8 @@ static int browser_compare_desc(const void *a, const void *b) static int browser_compare_date(const void *a, const void *b) { - struct folder_file *pa = (struct folder_file *) a; - struct folder_file *pb = (struct folder_file *) b; + struct FolderFile *pa = (struct FolderFile *) a; + struct FolderFile *pb = (struct FolderFile *) b; int r = pa->mtime - pb->mtime; @@ -147,8 +147,8 @@ static int browser_compare_date(const void *a, const void *b) static int browser_compare_size(const void *a, const void *b) { - struct folder_file *pa = (struct folder_file *) a; - struct folder_file *pb = (struct folder_file *) b; + struct FolderFile *pa = (struct FolderFile *) a; + struct FolderFile *pb = (struct FolderFile *) b; int r = pa->size - pb->size; @@ -157,8 +157,8 @@ static int browser_compare_size(const void *a, const void *b) static int browser_compare_count(const void *a, const void *b) { - struct folder_file *pa = (struct folder_file *) a; - struct folder_file *pb = (struct folder_file *) b; + struct FolderFile *pa = (struct FolderFile *) a; + struct FolderFile *pb = (struct FolderFile *) b; int r = 0; if (pa->has_buffy && pb->has_buffy) @@ -173,8 +173,8 @@ static int browser_compare_count(const void *a, const void *b) static int browser_compare_count_new(const void *a, const void *b) { - struct folder_file *pa = (struct folder_file *) a; - struct folder_file *pb = (struct folder_file *) b; + struct FolderFile *pa = (struct FolderFile *) a; + struct FolderFile *pb = (struct FolderFile *) b; int r = 0; if (pa->has_buffy && pb->has_buffy) @@ -193,8 +193,8 @@ static int browser_compare_count_new(const void *a, const void *b) */ static int browser_compare(const void *a, const void *b) { - struct folder_file *pa = (struct folder_file *) a; - struct folder_file *pb = (struct folder_file *) b; + struct FolderFile *pa = (struct FolderFile *) a; + struct FolderFile *pb = (struct FolderFile *) b; if ((mutt_strcoll(pa->desc, "../") == 0) || (mutt_strcoll(pa->desc, "..") == 0)) return -1; @@ -222,7 +222,7 @@ static int browser_compare(const void *a, const void *b) /* Call to qsort using browser_compare function. Some * specific sort methods are not used via NNTP. */ -static void browser_sort(struct browser_state *state) +static void browser_sort(struct BrowserState *state) { switch (BrowserSort & SORT_MASK) { @@ -239,7 +239,7 @@ static void browser_sort(struct browser_state *state) break; } - qsort(state->entry, state->entrylen, sizeof(struct folder_file), browser_compare); + qsort(state->entry, state->entrylen, sizeof(struct FolderFile), browser_compare); } static int link_is_dir(const char *folder, const char *path) @@ -581,14 +581,14 @@ static const char *newsgroup_format_str(char *dest, size_t destlen, size_t col, } #endif /* USE_NNTP */ -static void add_folder(struct Menu *m, struct browser_state *state, const char *name, +static void add_folder(struct Menu *m, struct BrowserState *state, const char *name, const char *desc, const struct stat *s, struct Buffy *b, void *data) { if (state->entrylen == state->entrymax) { /* need to allocate more space */ - safe_realloc(&state->entry, sizeof(struct folder_file) * (state->entrymax += 256)); - memset(&state->entry[state->entrylen], 0, sizeof(struct folder_file) * 256); + safe_realloc(&state->entry, sizeof(struct FolderFile) * (state->entrymax += 256)); + memset(&state->entry[state->entrylen], 0, sizeof(struct FolderFile) * 256); if (m) m->data = state->entry; } @@ -627,11 +627,11 @@ static void add_folder(struct Menu *m, struct browser_state *state, const char * (state->entrylen)++; } -static void init_state(struct browser_state *state, struct Menu *menu) +static void init_state(struct BrowserState *state, struct Menu *menu) { state->entrylen = 0; state->entrymax = 256; - state->entry = safe_calloc(state->entrymax, sizeof(struct folder_file)); + state->entry = safe_calloc(state->entrymax, sizeof(struct FolderFile)); #ifdef USE_IMAP state->imap_browse = false; #endif @@ -640,7 +640,7 @@ static void init_state(struct browser_state *state, struct Menu *menu) } /* get list of all files/newsgroups with mask */ -static int examine_directory(struct Menu *menu, struct browser_state *state, +static int examine_directory(struct Menu *menu, struct BrowserState *state, char *d, const char *prefix) { #ifdef USE_NNTP @@ -739,7 +739,7 @@ static int examine_directory(struct Menu *menu, struct browser_state *state, } #ifdef USE_NOTMUCH -static int examine_vfolders(struct Menu *menu, struct browser_state *state) +static int examine_vfolders(struct Menu *menu, struct BrowserState *state) { struct Buffy *tmp = VirtIncoming; @@ -764,7 +764,7 @@ static int examine_vfolders(struct Menu *menu, struct browser_state *state) #endif /* get list of mailboxes/subscribed newsgroups */ -static int examine_mailboxes(struct Menu *menu, struct browser_state *state) +static int examine_mailboxes(struct Menu *menu, struct BrowserState *state) { struct stat s; char buffer[LONG_STRING]; @@ -861,15 +861,15 @@ static int select_file_search(struct Menu *menu, regex_t *re, int n) { #ifdef USE_NNTP if (option(OPTNEWS)) - return (regexec(re, ((struct folder_file *) menu->data)[n].desc, 0, NULL, 0)); + return (regexec(re, ((struct FolderFile *) menu->data)[n].desc, 0, NULL, 0)); #endif - return (regexec(re, ((struct folder_file *) menu->data)[n].name, 0, NULL, 0)); + return (regexec(re, ((struct FolderFile *) menu->data)[n].name, 0, NULL, 0)); } #ifdef USE_NOTMUCH static int select_vfolder_search(struct Menu *menu, regex_t *re, int n) { - return (regexec(re, ((struct folder_file *) menu->data)[n].desc, 0, NULL, 0)); + return (regexec(re, ((struct FolderFile *) menu->data)[n].desc, 0, NULL, 0)); } #endif @@ -877,7 +877,7 @@ static void folder_entry(char *s, size_t slen, struct Menu *menu, int num) { struct Folder folder; - folder.ff = &((struct folder_file *) menu->data)[num]; + folder.ff = &((struct FolderFile *) menu->data)[num]; folder.num = num; #ifdef USE_NNTP @@ -895,7 +895,7 @@ static void vfolder_entry(char *s, size_t slen, struct Menu *menu, int num) { struct Folder folder; - folder.ff = &((struct folder_file *) menu->data)[num]; + folder.ff = &((struct FolderFile *) menu->data)[num]; folder.num = num; mutt_FormatString(s, slen, 0, MuttIndexWindow->cols, NONULL(VirtFolderFormat), @@ -907,7 +907,7 @@ static void vfolder_entry(char *s, size_t slen, struct Menu *menu, int num) * This function takes a menu and a state and defines the current * entry that should be highlighted. */ -static void browser_highlight_default(struct browser_state *state, struct Menu *menu) +static void browser_highlight_default(struct BrowserState *state, struct Menu *menu) { menu->top = 0; /* Reset menu position to 1. @@ -922,7 +922,7 @@ static void browser_highlight_default(struct browser_state *state, struct Menu * menu->current = 0; } -static void init_menu(struct browser_state *state, struct Menu *menu, char *title, +static void init_menu(struct BrowserState *state, struct Menu *menu, char *title, size_t titlelen, int buffy) { char path[_POSIX_PATH_MAX]; @@ -1011,7 +1011,7 @@ static void init_menu(struct browser_state *state, struct Menu *menu, char *titl static int file_tag(struct Menu *menu, int n, int m) { - struct folder_file *ff = &(((struct folder_file *) menu->data)[n]); + struct FolderFile *ff = &(((struct FolderFile *) menu->data)[n]); if (S_ISDIR(ff->mode) || (S_ISLNK(ff->mode) && link_is_dir(LastDir, ff->name))) { mutt_error(_("Can't attach a directory!")); @@ -1047,7 +1047,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf char prefix[_POSIX_PATH_MAX] = ""; char helpstr[LONG_STRING]; char title[STRING]; - struct browser_state state; + struct BrowserState state; struct Menu *menu = NULL; struct stat st; int i, killPrefix = 0; @@ -1062,7 +1062,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf buffy = buffy && folder; - memset(&state, 0, sizeof(struct browser_state)); + memset(&state, 0, sizeof(struct BrowserState)); #ifdef USE_NNTP if (option(OPTNEWS)) @@ -1451,7 +1451,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf tfiles = safe_calloc(*numfiles, sizeof(char *)); for (j = 0, k = 0; j < state.entrylen; j++) { - struct folder_file ff = state.entry[j]; + struct FolderFile ff = state.entry[j]; char full[_POSIX_PATH_MAX]; if (ff.tagged) { @@ -1560,8 +1560,8 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf /* and move all other entries up */ if (nentry + 1 < state.entrylen) memmove(state.entry + nentry, state.entry + nentry + 1, - sizeof(struct folder_file) * (state.entrylen - (nentry + 1))); - memset(&state.entry[state.entrylen - 1], 0, sizeof(struct folder_file)); + sizeof(struct FolderFile) * (state.entrylen - (nentry + 1))); + memset(&state.entry[state.entrylen - 1], 0, sizeof(struct FolderFile)); state.entrylen--; mutt_message(_("Mailbox deleted.")); init_menu(&state, menu, title, sizeof(title), buffy); @@ -1891,7 +1891,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf case OP_UNCATCHUP: if (option(OPTNEWS)) { - struct folder_file *ff = &state.entry[menu->current]; + struct FolderFile *ff = &state.entry[menu->current]; int rc; struct NntpData *nntp_data = NULL; @@ -2000,7 +2000,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf for (; j < state.entrylen; j++) { - struct folder_file *ff = &state.entry[j]; + struct FolderFile *ff = &state.entry[j]; if (i == OP_BROWSER_SUBSCRIBE || i == OP_BROWSER_UNSUBSCRIBE || regexec(rx, ff->name, 0, NULL, 0) == 0) diff --git a/browser.h b/browser.h index 5b608f378..075a21d3d 100644 --- a/browser.h +++ b/browser.h @@ -22,7 +22,7 @@ #include #include -struct folder_file +struct FolderFile { mode_t mode; off_t size; @@ -53,9 +53,9 @@ struct folder_file bool tagged : 1; }; -struct browser_state +struct BrowserState { - struct folder_file *entry; + struct FolderFile *entry; unsigned int entrylen; /* number of real entries */ unsigned int entrymax; /* max entry */ #ifdef USE_IMAP diff --git a/charset.c b/charset.c index f4ff183e1..78eff5b90 100644 --- a/charset.c +++ b/charset.c @@ -479,7 +479,7 @@ int mutt_convert_string(char **ps, const char *from, const char *to, int flags) * Used in sendlib.c for converting from mutt's Charset */ -struct fgetconv_s +struct FgetConvS { FILE *file; iconv_t cd; @@ -492,7 +492,7 @@ struct fgetconv_s ICONV_CONST char **inrepls; }; -struct fgetconv_not +struct FgetConvNot { FILE *file; iconv_t cd; @@ -504,7 +504,7 @@ struct fgetconv_not */ FGETCONV *fgetconv_open(FILE *file, const char *from, const char *to, int flags) { - struct fgetconv_s *fc = NULL; + struct FgetConvS *fc = NULL; iconv_t cd = (iconv_t) -1; static ICONV_CONST char *repls[] = { "\357\277\275", "?", 0 }; @@ -513,14 +513,14 @@ FGETCONV *fgetconv_open(FILE *file, const char *from, const char *to, int flags) if (cd != (iconv_t) -1) { - fc = safe_malloc(sizeof(struct fgetconv_s)); + fc = safe_malloc(sizeof(struct FgetConvS)); fc->p = fc->ob = fc->bufo; fc->ib = fc->bufi; fc->ibl = 0; fc->inrepls = mutt_is_utf8(to) ? repls : repls + 1; } else - fc = safe_malloc(sizeof(struct fgetconv_not)); + fc = safe_malloc(sizeof(struct FgetConvNot)); fc->file = file; fc->cd = cd; return (FGETCONV *) fc; @@ -549,7 +549,7 @@ char *fgetconvs(char *buf, size_t l, FGETCONV *_fc) int fgetconv(FGETCONV *_fc) { - struct fgetconv_s *fc = (struct fgetconv_s *) _fc; + struct FgetConvS *fc = (struct FgetConvS *) _fc; if (!fc) return EOF; @@ -602,7 +602,7 @@ int fgetconv(FGETCONV *_fc) void fgetconv_close(FGETCONV **_fc) { - struct fgetconv_s *fc = (struct fgetconv_s *) *_fc; + struct FgetConvS *fc = (struct FgetConvS *) *_fc; if (fc->cd != (iconv_t) -1) iconv_close(fc->cd); diff --git a/color.c b/color.c index e04271127..e184b01a7 100644 --- a/color.c +++ b/color.c @@ -72,7 +72,7 @@ struct ColorList static struct ColorList *ColorList = NULL; static int UserColors = 0; -static const struct mapping_t Colors[] = { +static const struct Mapping Colors[] = { { "black", COLOR_BLACK }, { "blue", COLOR_BLUE }, { "cyan", COLOR_CYAN }, @@ -89,7 +89,7 @@ static const struct mapping_t Colors[] = { #endif /* HAVE_COLOR */ -static const struct mapping_t Fields[] = { +static const struct Mapping Fields[] = { { "hdrdefault", MT_COLOR_HDEFAULT }, { "quoted", MT_COLOR_QUOTED }, { "signature", MT_COLOR_SIGNATURE }, @@ -135,7 +135,7 @@ static const struct mapping_t Fields[] = { { NULL, 0 }, }; -static const struct mapping_t ComposeFields[] = { +static const struct Mapping ComposeFields[] = { { "header", MT_COLOR_COMPOSE_HEADER }, { "security_encrypt", MT_COLOR_COMPOSE_SECURITY_ENCRYPT }, { "security_sign", MT_COLOR_COMPOSE_SECURITY_SIGN }, diff --git a/commands.c b/commands.c index 9bd83da6b..10126654b 100644 --- a/commands.c +++ b/commands.c @@ -146,7 +146,7 @@ int mutt_display_message(struct Header *cur) builtin = 1; else { - struct hdr_format_info hfi; + struct HdrFormatInfo hfi; hfi.ctx = Context; hfi.pager_progress = ExtPagerProgress; hfi.hdr = cur; diff --git a/compose.c b/compose.c index ae5b5ffb2..737df5365 100644 --- a/compose.c +++ b/compose.c @@ -114,7 +114,7 @@ static const char *const Prompts[] = { #endif }; -static const struct mapping_t ComposeHelp[] = { +static const struct Mapping ComposeHelp[] = { { N_("Send"), OP_COMPOSE_SEND_MESSAGE }, { N_("Abort"), OP_EXIT }, { "To", OP_COMPOSE_EDIT_TO }, @@ -127,7 +127,7 @@ static const struct mapping_t ComposeHelp[] = { }; #ifdef USE_NNTP -static struct mapping_t ComposeNewsHelp[] = { +static struct Mapping ComposeNewsHelp[] = { { N_("Send"), OP_COMPOSE_SEND_MESSAGE }, { N_("Abort"), OP_EXIT }, { "Newsgroups", OP_COMPOSE_EDIT_NEWSGROUPS }, diff --git a/compress.c b/compress.c index 94efd5725..c91ea8c9e 100644 --- a/compress.c +++ b/compress.c @@ -53,7 +53,7 @@ struct CompressInfo const char *close; /* close-hook command */ const char *open; /* open-hook command */ off_t size; /* size of the compressed file */ - struct mx_ops *child_ops; /* callbacks of de-compressed file */ + struct MxOps *child_ops; /* callbacks of de-compressed file */ int locked; /* if realpath is locked */ FILE *lockfp; /* fp used for locking */ }; @@ -607,7 +607,7 @@ static int comp_close_mailbox(struct Context *ctx) if (!ci) return -1; - struct mx_ops *ops = ci->child_ops; + struct MxOps *ops = ci->child_ops; if (!ops) { free_compress_info(ctx); @@ -688,7 +688,7 @@ static int comp_check_mailbox(struct Context *ctx, int *index_hint) if (!ci) return -1; - struct mx_ops *ops = ci->child_ops; + struct MxOps *ops = ci->child_ops; if (!ops) return -1; @@ -724,7 +724,7 @@ static int comp_open_message(struct Context *ctx, struct Message *msg, int msgno if (!ci) return -1; - struct mx_ops *ops = ci->child_ops; + struct MxOps *ops = ci->child_ops; if (!ops) return -1; @@ -744,7 +744,7 @@ static int comp_close_message(struct Context *ctx, struct Message *msg) if (!ci) return -1; - struct mx_ops *ops = ci->child_ops; + struct MxOps *ops = ci->child_ops; if (!ops) return -1; @@ -764,7 +764,7 @@ static int comp_commit_message(struct Context *ctx, struct Message *msg) if (!ci) return -1; - struct mx_ops *ops = ci->child_ops; + struct MxOps *ops = ci->child_ops; if (!ops) return -1; @@ -784,7 +784,7 @@ static int comp_open_new_message(struct Message *msg, struct Context *ctx, struc if (!ci) return -1; - struct mx_ops *ops = ci->child_ops; + struct MxOps *ops = ci->child_ops; if (!ops) return -1; @@ -874,7 +874,7 @@ static int comp_sync_mailbox(struct Context *ctx, int *index_hint) return -1; } - struct mx_ops *ops = ci->child_ops; + struct MxOps *ops = ci->child_ops; if (!ops) return -1; @@ -933,7 +933,7 @@ int mutt_comp_valid_command(const char *cmd) * Compress only uses open, close and check. * The message functions are delegated to mbox. */ -struct mx_ops mx_comp_ops = { +struct MxOps mx_comp_ops = { .open = comp_open_mailbox, .open_append = comp_open_append_mailbox, .close = comp_close_mailbox, diff --git a/compress.h b/compress.h index 6dec213f4..545714b0f 100644 --- a/compress.h +++ b/compress.h @@ -28,6 +28,6 @@ bool mutt_comp_can_append(struct Context *ctx); bool mutt_comp_can_read(const char *path); int mutt_comp_valid_command(const char *cmd); -extern struct mx_ops mx_comp_ops; +extern struct MxOps mx_comp_ops; #endif /* _MUTT_COMPRESS_H */ diff --git a/context.h b/context.h index 1f7ee52f7..aa1bff6e0 100644 --- a/context.h +++ b/context.h @@ -92,7 +92,7 @@ struct Context /* driver hooks */ void *data; /* driver specific data */ - struct mx_ops *mx_ops; + struct MxOps *mx_ops; }; #endif /* _MUTT_CONTEXT_H */ diff --git a/curs_main.c b/curs_main.c index 3e170227a..60ccac429 100644 --- a/curs_main.c +++ b/curs_main.c @@ -677,7 +677,7 @@ void mutt_draw_statusline(int cols, const char *buf, int buflen) int chunks = 0; int len = 0; - struct syntax_t + struct Syntax { int color; int first; @@ -712,7 +712,7 @@ void mutt_draw_statusline(int cols, const char *buf, int buflen) if (!found) { chunks++; - safe_realloc(&syntax, chunks * sizeof(struct syntax_t)); + safe_realloc(&syntax, chunks * sizeof(struct Syntax)); } i = chunks - 1; @@ -792,7 +792,7 @@ dsl_finish: FREE(&syntax); } -static const struct mapping_t IndexHelp[] = { +static const struct Mapping IndexHelp[] = { { N_("Quit"), OP_QUIT }, { N_("Del"), OP_DELETE }, { N_("Undel"), OP_UNDELETE }, @@ -805,7 +805,7 @@ static const struct mapping_t IndexHelp[] = { }; #ifdef USE_NNTP -struct mapping_t IndexNewsHelp[] = { +struct Mapping IndexNewsHelp[] = { { N_("Quit"), OP_QUIT }, { N_("Del"), OP_DELETE }, { N_("Undel"), OP_UNDELETE }, diff --git a/functions.h b/functions.h index 20f9263de..7338ee20d 100644 --- a/functions.h +++ b/functions.h @@ -42,7 +42,7 @@ #endif // clang-format off -const struct binding_t OpGeneric[] = { /* map: generic */ +const struct Binding OpGeneric[] = { /* map: generic */ /* ** ** The generic menu is not a real menu, but specifies common functions @@ -87,7 +87,7 @@ const struct binding_t OpGeneric[] = { /* map: generic */ { NULL, 0, NULL }, }; -const struct binding_t OpMain[] = { /* map: index */ +const struct Binding OpMain[] = { /* map: index */ { "create-alias", OP_CREATE_ALIAS, "a" }, { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, { "break-thread", OP_MAIN_BREAK_THREAD, "#" }, @@ -221,7 +221,7 @@ const struct binding_t OpMain[] = { /* map: index */ { NULL, 0, NULL }, }; -const struct binding_t OpPager[] = { /* map: pager */ +const struct Binding OpPager[] = { /* map: pager */ { "break-thread", OP_MAIN_BREAK_THREAD, "#" }, { "create-alias", OP_CREATE_ALIAS, "a" }, { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, @@ -355,7 +355,7 @@ const struct binding_t OpPager[] = { /* map: pager */ { NULL, 0, NULL }, }; -const struct binding_t OpAttach[] = { /* map: attachment */ +const struct Binding OpAttach[] = { /* map: attachment */ { "bounce-message", OP_BOUNCE_MESSAGE, "b" }, { "display-toggle-weed", OP_DISPLAY_HEADERS, "h" }, { "edit-type", OP_EDIT_TYPE, "\005" }, @@ -384,7 +384,7 @@ const struct binding_t OpAttach[] = { /* map: attachment */ { NULL, 0, NULL }, }; -const struct binding_t OpCompose[] = { /* map: compose */ +const struct Binding OpCompose[] = { /* map: compose */ { "attach-file", OP_COMPOSE_ATTACH_FILE, "a" }, { "attach-message", OP_COMPOSE_ATTACH_MESSAGE, "A" }, #ifdef USE_NNTP @@ -439,20 +439,20 @@ const struct binding_t OpCompose[] = { /* map: compose */ { NULL, 0, NULL }, }; -const struct binding_t OpPost[] = { /* map: postpone */ +const struct Binding OpPost[] = { /* map: postpone */ { "delete-entry", OP_DELETE, "d" }, { "undelete-entry", OP_UNDELETE, "u" }, { NULL, 0, NULL }, }; -const struct binding_t OpAlias[] = { /* map: alias */ +const struct Binding OpAlias[] = { /* map: alias */ { "delete-entry", OP_DELETE, "d" }, { "undelete-entry", OP_UNDELETE, "u" }, { NULL, 0, NULL }, }; /* The file browser */ -const struct binding_t OpBrowser[] = { /* map: browser */ +const struct Binding OpBrowser[] = { /* map: browser */ { "change-dir", OP_CHANGE_DIRECTORY, "c" }, { "display-filename", OP_BROWSER_TELL, "@" }, { "enter-mask", OP_ENTER_MASK, "m" }, @@ -487,7 +487,7 @@ const struct binding_t OpBrowser[] = { /* map: browser */ }; /* External Query Menu */ -const struct binding_t OpQuery[] = { /* map: query */ +const struct Binding OpQuery[] = { /* map: query */ { "create-alias", OP_CREATE_ALIAS, "a" }, { "mail", OP_MAIL, "m" }, { "query", OP_QUERY, "Q" }, @@ -495,7 +495,7 @@ const struct binding_t OpQuery[] = { /* map: query */ { NULL, 0, NULL }, }; -const struct binding_t OpEditor[] = { /* map: editor */ +const struct Binding OpEditor[] = { /* map: editor */ { "bol", OP_EDITOR_BOL, "\001" }, { "backward-char", OP_EDITOR_BACKWARD_CHAR, "\002" }, { "backward-word", OP_EDITOR_BACKWARD_WORD, "\033b" }, @@ -521,7 +521,7 @@ const struct binding_t OpEditor[] = { /* map: editor */ { NULL, 0, NULL }, }; -const struct binding_t OpPgp[] = { /* map: pgp */ +const struct Binding OpPgp[] = { /* map: pgp */ { "verify-key", OP_VERIFY_KEY, "c" }, { "view-name", OP_VIEW_ID, "%" }, { NULL, 0, NULL }, @@ -529,7 +529,7 @@ const struct binding_t OpPgp[] = { /* map: pgp */ /* When using the GPGME based backend we have some useful functions for the SMIME menu. */ -const struct binding_t OpSmime[] = { /* map: smime */ +const struct Binding OpSmime[] = { /* map: smime */ #ifdef CRYPT_BACKEND_GPGME { "verify-key", OP_VERIFY_KEY, "c" }, { "view-name", OP_VIEW_ID, "%" }, @@ -538,7 +538,7 @@ const struct binding_t OpSmime[] = { /* map: smime */ }; #ifdef MIXMASTER -const struct binding_t OpMix[] = { /* map: mixmaster */ +const struct Binding OpMix[] = { /* map: mixmaster */ { "accept", OP_MIX_USE, "\n" }, { "accept", OP_MIX_USE, "\r" }, { "append", OP_MIX_APPEND, "a" }, diff --git a/handler.c b/handler.c index f25fe5226..19519b971 100644 --- a/handler.c +++ b/handler.c @@ -509,7 +509,7 @@ static const struct { NULL, -1 }, }; -struct enriched_state +struct EnrichedState { wchar_t *buffer; wchar_t *line; @@ -528,7 +528,7 @@ struct enriched_state struct State *s; }; -static void enriched_wrap(struct enriched_state *stte) +static void enriched_wrap(struct EnrichedState *stte) { int x; int extra; @@ -638,7 +638,7 @@ static void enriched_wrap(struct enriched_state *stte) } } -static void enriched_flush(struct enriched_state *stte, int wrap) +static void enriched_flush(struct EnrichedState *stte, int wrap) { if (!stte->tag_level[RICH_NOFILL] && (stte->line_len + stte->word_len > @@ -665,7 +665,7 @@ static void enriched_flush(struct enriched_state *stte, int wrap) } -static void enriched_putwc(wchar_t c, struct enriched_state *stte) +static void enriched_putwc(wchar_t c, struct EnrichedState *stte) { if (stte->tag_level[RICH_PARAM]) { @@ -731,7 +731,7 @@ static void enriched_putwc(wchar_t c, struct enriched_state *stte) } } -static void enriched_puts(const char *s, struct enriched_state *stte) +static void enriched_puts(const char *s, struct EnrichedState *stte) { const char *c = NULL; @@ -748,7 +748,7 @@ static void enriched_puts(const char *s, struct enriched_state *stte) } } -static void enriched_set_flags(const wchar_t *tag, struct enriched_state *stte) +static void enriched_set_flags(const wchar_t *tag, struct EnrichedState *stte) { const wchar_t *tagptr = tag; int i, j; @@ -842,7 +842,7 @@ static int text_enriched_handler(struct Body *a, struct State *s) } state = TEXT; long bytes = a->length; - struct enriched_state stte; + struct EnrichedState stte; wchar_t wc = 0; int tag_len = 0; wchar_t tag[LONG_STRING + 1]; diff --git a/hash.c b/hash.c index 12a44c61f..cac06936b 100644 --- a/hash.c +++ b/hash.c @@ -78,7 +78,7 @@ static struct Hash *new_hash(int nelem) nelem = 2; table->nelem = nelem; table->curnelem = 0; - table->table = safe_calloc(nelem, sizeof(struct hash_elem *)); + table->table = safe_calloc(nelem, sizeof(struct HashElem *)); return table; } @@ -115,7 +115,7 @@ struct Hash *int_hash_create(int nelem, int flags) struct Hash *hash_resize(struct Hash *ptr, int nelem, int lower) { struct Hash *table = NULL; - struct hash_elem *elem = NULL, *tmp = NULL; + struct HashElem *elem = NULL, *tmp = NULL; int i; table = hash_create(nelem, lower); @@ -142,10 +142,10 @@ struct Hash *hash_resize(struct Hash *ptr, int nelem, int lower) */ static int union_hash_insert(struct Hash *table, union hash_key key, void *data) { - struct hash_elem *ptr = NULL; + struct HashElem *ptr = NULL; unsigned int h; - ptr = safe_malloc(sizeof(struct hash_elem)); + ptr = safe_malloc(sizeof(struct HashElem)); h = table->gen_hash(key, table->nelem); ptr->key = key; ptr->data = data; @@ -158,7 +158,7 @@ static int union_hash_insert(struct Hash *table, union hash_key key, void *data) } else { - struct hash_elem *tmp = NULL, *last = NULL; + struct HashElem *tmp = NULL, *last = NULL; int r; for (tmp = table->table[h], last = NULL; tmp; last = tmp, tmp = tmp->next) @@ -196,10 +196,10 @@ int int_hash_insert(struct Hash *table, unsigned int intkey, void *data) return union_hash_insert(table, key, data); } -static struct hash_elem *union_hash_find_elem(const struct Hash *table, union hash_key key) +static struct HashElem *union_hash_find_elem(const struct Hash *table, union hash_key key) { int hash; - struct hash_elem *ptr = NULL; + struct HashElem *ptr = NULL; if (!table) return NULL; @@ -216,7 +216,7 @@ static struct hash_elem *union_hash_find_elem(const struct Hash *table, union ha static void *union_hash_find(const struct Hash *table, union hash_key key) { - struct hash_elem *ptr = union_hash_find_elem(table, key); + struct HashElem *ptr = union_hash_find_elem(table, key); if (ptr) return ptr->data; else @@ -230,7 +230,7 @@ void *hash_find(const struct Hash *table, const char *strkey) return union_hash_find(table, key); } -struct hash_elem *hash_find_elem(const struct Hash *table, const char *strkey) +struct HashElem *hash_find_elem(const struct Hash *table, const char *strkey) { union hash_key key; key.strkey = strkey; @@ -244,7 +244,7 @@ void *int_hash_find(const struct Hash *table, unsigned int intkey) return union_hash_find(table, key); } -struct hash_elem *hash_find_bucket(const struct Hash *table, const char *strkey) +struct HashElem *hash_find_bucket(const struct Hash *table, const char *strkey) { union hash_key key; int hash; @@ -261,7 +261,7 @@ static void union_hash_delete(struct Hash *table, union hash_key key, const void void (*destroy)(void *)) { int hash; - struct hash_elem *ptr, **last; + struct HashElem *ptr, **last; if (!table) return; @@ -314,7 +314,7 @@ void hash_destroy(struct Hash **ptr, void (*destroy)(void *)) { int i; struct Hash *pptr = NULL; - struct hash_elem *elem = NULL, *tmp = NULL; + struct HashElem *elem = NULL, *tmp = NULL; if (!ptr || !*ptr) return; @@ -337,7 +337,7 @@ void hash_destroy(struct Hash **ptr, void (*destroy)(void *)) FREE(ptr); } -struct hash_elem *hash_walk(const struct Hash *table, struct hash_walk_state *state) +struct HashElem *hash_walk(const struct Hash *table, struct HashWalkState *state) { if (state->last && state->last->next) { diff --git a/hash.h b/hash.h index 4965bdf60..66bb29ce0 100644 --- a/hash.h +++ b/hash.h @@ -25,11 +25,11 @@ union hash_key { unsigned int intkey; }; -struct hash_elem +struct HashElem { union hash_key key; void *data; - struct hash_elem *next; + struct HashElem *next; }; struct Hash @@ -37,7 +37,7 @@ struct Hash int nelem, curnelem; bool strdup_keys : 1; /* if set, the key->strkey is strdup'ed */ bool allow_dups : 1; /* if set, duplicate keys are allowed */ - struct hash_elem **table; + struct HashElem **table; unsigned int (*gen_hash)(union hash_key, unsigned int); int (*cmp_key)(union hash_key, union hash_key); }; @@ -55,10 +55,10 @@ int int_hash_insert(struct Hash *table, unsigned int intkey, void *data); struct Hash *hash_resize(struct Hash *ptr, int nelem, int lower); void *hash_find(const struct Hash *table, const char *strkey); -struct hash_elem *hash_find_elem(const struct Hash *table, const char *strkey); +struct HashElem *hash_find_elem(const struct Hash *table, const char *strkey); void *int_hash_find(const struct Hash *table, unsigned int intkey); -struct hash_elem *hash_find_bucket(const struct Hash *table, const char *strkey); +struct HashElem *hash_find_bucket(const struct Hash *table, const char *strkey); void hash_delete(struct Hash *table, const char *strkey, const void *data, void (*destroy)(void *)); @@ -67,12 +67,12 @@ void int_hash_delete(struct Hash *table, unsigned int intkey, const void *data, void hash_destroy(struct Hash **ptr, void (*destroy)(void *)); -struct hash_walk_state +struct HashWalkState { int index; - struct hash_elem *last; + struct HashElem *last; }; -struct hash_elem *hash_walk(const struct Hash *table, struct hash_walk_state *state); +struct HashElem *hash_walk(const struct Hash *table, struct HashWalkState *state); #endif /* _MUTT_HASH_H */ diff --git a/hcache/hcache.c b/hcache/hcache.c index 9a85f80f4..f8a882157 100644 --- a/hcache/hcache.c +++ b/hcache/hcache.c @@ -63,7 +63,7 @@ static unsigned int hcachever = 0x0; * delete and close function pointers in hcache_open, and MAY store * backend-specific context in the ctx pointer. */ -struct header_cache +struct HeaderCache { char *folder; unsigned int crc; @@ -748,7 +748,7 @@ header_cache_t *mutt_hcache_open(const char *path, const char *folder, hcache_na unsigned char charval[16]; unsigned int intval; } digest; - struct md5_ctx ctx; + struct Md5Ctx ctx; struct ReplaceList *spam = NULL; struct RxList *nospam = NULL; diff --git a/hcache/hcache.h b/hcache/hcache.h index cbb92dfa0..a2622c1d2 100644 --- a/hcache/hcache.h +++ b/hcache/hcache.h @@ -24,7 +24,7 @@ #include struct Header; -typedef struct header_cache header_cache_t; +typedef struct HeaderCache header_cache_t; typedef int (*hcache_namer_t)(const char *path, char *dest, size_t dlen); diff --git a/hdrline.c b/hdrline.c index d476e16e8..2e178e70c 100644 --- a/hdrline.c +++ b/hdrline.c @@ -472,7 +472,7 @@ static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int co const char *ifstring, const char *elsestring, unsigned long data, format_flag flags) { - struct hdr_format_info *hfi = (struct hdr_format_info *) data; + struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data; struct Header *hdr = NULL, *htmp = NULL; struct Context *ctx = NULL; char fmt[SHORT_STRING], buf2[LONG_STRING], *p = NULL; @@ -1323,7 +1323,7 @@ static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int co void _mutt_make_string(char *dest, size_t destlen, const char *s, struct Context *ctx, struct Header *hdr, format_flag flags) { - struct hdr_format_info hfi; + struct HdrFormatInfo hfi; hfi.hdr = hdr; hfi.ctx = ctx; @@ -1334,7 +1334,7 @@ void _mutt_make_string(char *dest, size_t destlen, const char *s, struct Context } void mutt_make_string_info(char *dst, size_t dstlen, int cols, const char *s, - struct hdr_format_info *hfi, format_flag flags) + struct HdrFormatInfo *hfi, format_flag flags) { mutt_FormatString(dst, dstlen, 0, cols, s, hdr_format_str, (unsigned long) hfi, flags); } diff --git a/headers.c b/headers.c index ddccf9469..d31c1f26d 100644 --- a/headers.c +++ b/headers.c @@ -226,7 +226,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, static void label_ref_dec(struct Context *ctx, char *label) { - struct hash_elem *elem = NULL; + struct HashElem *elem = NULL; uintptr_t count; elem = hash_find_elem(ctx->label_hash, label); @@ -246,7 +246,7 @@ static void label_ref_dec(struct Context *ctx, char *label) static void label_ref_inc(struct Context *ctx, char *label) { - struct hash_elem *elem = NULL; + struct HashElem *elem = NULL; uintptr_t count; elem = hash_find_elem(ctx->label_hash, label); diff --git a/help.c b/help.c index 48c6e35f9..aea3da3ae 100644 --- a/help.c +++ b/help.c @@ -36,10 +36,10 @@ #include "pager.h" #include "protos.h" -static const struct binding_t *help_lookup_function(int op, int menu) +static const struct Binding *help_lookup_function(int op, int menu) { int i; - const struct binding_t *map = NULL; + const struct Binding *map = NULL; if (menu != MENU_PAGER) { @@ -70,7 +70,7 @@ void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op) d[0] = 0; } -char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct mapping_t *items) +char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items) { int i; size_t len; @@ -287,8 +287,8 @@ static void format_line(FILE *f, int ismacro, const char *t1, const char *t2, co static void dump_menu(FILE *f, int menu) { - struct keymap_t *map = NULL; - const struct binding_t *b = NULL; + struct Keymap *map = NULL; + const struct Binding *b = NULL; char buf[SHORT_STRING]; /* browse through the keymap table */ @@ -316,7 +316,7 @@ static void dump_menu(FILE *f, int menu) } } -static bool is_bound(struct keymap_t *map, int op) +static bool is_bound(struct Keymap *map, int op) { for (; map; map = map->next) if (map->op == op) @@ -324,8 +324,8 @@ static bool is_bound(struct keymap_t *map, int op) return false; } -static void dump_unbound(FILE *f, const struct binding_t *funcs, - struct keymap_t *map, struct keymap_t *aux) +static void dump_unbound(FILE *f, const struct Binding *funcs, + struct Keymap *map, struct Keymap *aux) { int i; @@ -342,7 +342,7 @@ void mutt_help(int menu) char buf[SHORT_STRING]; const char *desc = NULL; FILE *f = NULL; - const struct binding_t *funcs = NULL; + const struct Binding *funcs = NULL; mutt_mktemp(t, sizeof(t)); diff --git a/history.c b/history.c index 97e996c9f..4751550d2 100644 --- a/history.c +++ b/history.c @@ -66,7 +66,7 @@ * next oldest entry * HistSize entry */ -struct history +struct History { char **hist; short cur; @@ -75,12 +75,12 @@ struct history /* global vars used for the string-history routines */ -static struct history History[HC_LAST]; +static struct History History[HC_LAST]; static int OldSize = 0; #define GET_HISTORY(CLASS) ((CLASS >= HC_LAST) ? NULL : &History[CLASS]) -static void init_history(struct history *h) +static void init_history(struct History *h) { int i; @@ -139,7 +139,7 @@ void mutt_read_histfile(void) static int dup_hash_dec(struct Hash *dup_hash, char *s) { - struct hash_elem *elem; + struct HashElem *elem; uintptr_t count; elem = hash_find_elem(dup_hash, s); @@ -160,7 +160,7 @@ static int dup_hash_dec(struct Hash *dup_hash, char *s) static int dup_hash_inc(struct Hash *dup_hash, char *s) { - struct hash_elem *elem; + struct HashElem *elem; uintptr_t count; elem = hash_find_elem(dup_hash, s); @@ -315,12 +315,12 @@ static void save_history(history_class_t hclass, const char *s) } /* When removing dups, we want the created "blanks" to be right below the - * resulting h->last position. See the comment section above 'struct history'. + * resulting h->last position. See the comment section above 'struct History'. */ static void remove_history_dups(history_class_t hclass, const char *s) { int source, dest, old_last; - struct history *h = GET_HISTORY(hclass); + struct History *h = GET_HISTORY(hclass); if (!HistSize || !h) return; /* disabled */ @@ -375,7 +375,7 @@ void mutt_init_history(void) void mutt_history_add(history_class_t hclass, const char *s, int save) { int prev; - struct history *h = GET_HISTORY(hclass); + struct History *h = GET_HISTORY(hclass); if (!HistSize || !h) return; /* disabled */ @@ -407,7 +407,7 @@ void mutt_history_add(history_class_t hclass, const char *s, int save) char *mutt_history_next(history_class_t hclass) { int next; - struct history *h = GET_HISTORY(hclass); + struct History *h = GET_HISTORY(hclass); if (!HistSize || !h) return ""; /* disabled */ @@ -429,7 +429,7 @@ char *mutt_history_next(history_class_t hclass) char *mutt_history_prev(history_class_t hclass) { int prev; - struct history *h = GET_HISTORY(hclass); + struct History *h = GET_HISTORY(hclass); if (!HistSize || !h) return ""; /* disabled */ @@ -450,7 +450,7 @@ char *mutt_history_prev(history_class_t hclass) void mutt_reset_history_state(history_class_t hclass) { - struct history *h = GET_HISTORY(hclass); + struct History *h = GET_HISTORY(hclass); if (!HistSize || !h) return; /* disabled */ @@ -460,7 +460,7 @@ void mutt_reset_history_state(history_class_t hclass) int mutt_history_at_scratch(history_class_t hclass) { - struct history *h = GET_HISTORY(hclass); + struct History *h = GET_HISTORY(hclass); if (!HistSize || !h) return 0; /* disabled */ @@ -470,7 +470,7 @@ int mutt_history_at_scratch(history_class_t hclass) void mutt_history_save_scratch(history_class_t hclass, const char *s) { - struct history *h = GET_HISTORY(hclass); + struct History *h = GET_HISTORY(hclass); if (!HistSize || !h) return; /* disabled */ diff --git a/imap/auth_cram.c b/imap/auth_cram.c index b51481d1b..bd7b0b04b 100644 --- a/imap/auth_cram.c +++ b/imap/auth_cram.c @@ -135,7 +135,7 @@ bail: /* hmac_md5: produce CRAM-MD5 challenge response. */ static void hmac_md5(const char *password, char *challenge, unsigned char *response) { - struct md5_ctx ctx; + struct Md5Ctx ctx; unsigned char ipad[MD5_BLOCK_LEN], opad[MD5_BLOCK_LEN]; unsigned char secret[MD5_BLOCK_LEN + 1]; unsigned char hash_passwd[MD5_DIGEST_LEN]; diff --git a/imap/browse.c b/imap/browse.c index f93426b2c..a4b9358d4 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -44,7 +44,7 @@ * imap_unmunge_mbox_name(). */ static void imap_add_folder(char delim, char *folder, int noselect, int noinferiors, - struct browser_state *state, short isparent) + struct BrowserState *state, short isparent) { char tmp[LONG_STRING]; char relpath[LONG_STRING]; @@ -56,9 +56,9 @@ static void imap_add_folder(char delim, char *folder, int noselect, int noinferi if (state->entrylen + 1 == state->entrymax) { - safe_realloc(&state->entry, sizeof(struct folder_file) * (state->entrymax += 256)); + safe_realloc(&state->entry, sizeof(struct FolderFile) * (state->entrymax += 256)); memset(state->entry + state->entrylen, 0, - (sizeof(struct folder_file) * (state->entrymax - state->entrylen))); + (sizeof(struct FolderFile) * (state->entrymax - state->entrylen))); } /* render superiors as unix-standard ".." */ @@ -121,7 +121,7 @@ static void imap_add_folder(char delim, char *folder, int noselect, int noinferi } static int browse_add_list_result(struct ImapData *idata, const char *cmd, - struct browser_state *state, short isparent) + struct BrowserState *state, short isparent) { struct ImapList list; struct ImapMbox mx; @@ -161,7 +161,7 @@ static int browse_add_list_result(struct ImapData *idata, const char *cmd, /* imap_browse: IMAP hook into the folder browser, fills out browser_state, * given a current folder to browse */ -int imap_browse(char *path, struct browser_state *state) +int imap_browse(char *path, struct BrowserState *state) { struct ImapData *idata = NULL; struct ImapList list; diff --git a/imap/imap.c b/imap/imap.c index 997896c97..c27efe3b1 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -2181,7 +2181,7 @@ out: return rc < 0 ? -1 : rc; } -struct mx_ops mx_imap_ops = { +struct MxOps mx_imap_ops = { .open = imap_open_mailbox, .open_append = imap_open_mailbox_append, .close = imap_close_mailbox, diff --git a/imap/imap.h b/imap/imap.h index 816a5386a..2ec571feb 100644 --- a/imap/imap.h +++ b/imap/imap.h @@ -27,7 +27,7 @@ struct Header; struct Pattern; struct Context; struct Message; -struct browser_state; +struct BrowserState; /* -- data structures -- */ struct ImapMbox @@ -52,10 +52,10 @@ int imap_fast_trash(struct Context *ctx, char *dest); void imap_allow_reopen(struct Context *ctx); void imap_disallow_reopen(struct Context *ctx); -extern struct mx_ops mx_imap_ops; +extern struct MxOps mx_imap_ops; /* browse.c */ -int imap_browse(char *path, struct browser_state *state); +int imap_browse(char *path, struct BrowserState *state); int imap_mailbox_create(const char *folder); int imap_mailbox_rename(const char *mailbox); diff --git a/init.c b/init.c index b1e3dd9fe..9ea619182 100644 --- a/init.c +++ b/init.c @@ -241,7 +241,7 @@ int mutt_option_index(const char *s) } #ifdef USE_LUA -int mutt_option_to_string(const struct option_t *opt, char *val, size_t len) +int mutt_option_to_string(const struct Option *opt, char *val, size_t len) { mutt_debug(2, " * mutt_option_to_string(%s)\n", NONULL((char *) opt->data)); int idx = mutt_option_index((const char *) opt->option); @@ -250,7 +250,7 @@ int mutt_option_to_string(const struct option_t *opt, char *val, size_t len) return 0; } -const struct option_t *mutt_option_get(const char *s) +const struct Option *mutt_option_get(const char *s) { mutt_debug(2, " * mutt_option_get(%s)\n", s); int idx = mutt_option_index(s); @@ -258,7 +258,7 @@ const struct option_t *mutt_option_get(const char *s) return &MuttVars[idx]; else if (mutt_strncmp("my_", s, 3) == 0) { - struct option_t *opt = safe_malloc(sizeof(struct option_t)); + struct Option *opt = safe_malloc(sizeof(struct Option)); if (!myvar_get(s)) return NULL; opt->data = (unsigned long) safe_strdup(myvar_get(s)); @@ -326,7 +326,7 @@ static struct MbCharTable *parse_mbchar_table(const char *s) return t; } -static int parse_sort(short *val, const char *s, const struct mapping_t *map, struct Buffer *err) +static int parse_sort(short *val, const char *s, const struct Mapping *map, struct Buffer *err) { int i, flags = 0; @@ -354,7 +354,7 @@ static int parse_sort(short *val, const char *s, const struct mapping_t *map, st } #ifdef USE_LUA -int mutt_option_set(const struct option_t *val, struct Buffer *err) +int mutt_option_set(const struct Option *val, struct Buffer *err) { mutt_debug(2, " * mutt_option_set()\n"); int idx = mutt_option_index(val->option); @@ -403,7 +403,7 @@ int mutt_option_set(const struct option_t *val, struct Buffer *err) } case DT_SORT: { - const struct mapping_t *map = NULL; + const struct Mapping *map = NULL; struct Buffer *err2 = safe_malloc(sizeof(struct Buffer)); switch (MuttVars[idx].type & DT_SUBTYPE_MASK) @@ -497,7 +497,7 @@ int mutt_option_set(const struct option_t *val, struct Buffer *err) } #endif -static void free_opt(struct option_t *p) +static void free_opt(struct Option *p) { struct Regex *pp = NULL; @@ -785,7 +785,7 @@ static void remove_from_list(struct List **l, const char *str) * finish_source - 'finish' command: stop processing current config file * @tmp: Temporary space shared by all command handlers * @s: Current line of the config file - * @data: data field from init.h:struct command_t + * @data: data field from init.h:struct Command * @err: Buffer for any error message * * If the 'finish' command is found, we should stop reading the current file. @@ -809,7 +809,7 @@ static int finish_source(struct Buffer *tmp, struct Buffer *s, unsigned long dat * parse_ifdef - 'ifdef' command: conditional config * @tmp: Temporary space shared by all command handlers * @s: Current line of the config file - * @data: data field from init.h:struct command_t + * @data: data field from init.h:struct Command * @err: Buffer for any error message * * The 'ifdef' command allows conditional elements in the config file. @@ -849,7 +849,7 @@ static int parse_ifdef(struct Buffer *tmp, struct Buffer *s, unsigned long data, { for (i = 0; !res && (i < MENU_MAX); i++) { - const struct binding_t *b = km_get_table(Menus[i].value); + const struct Binding *b = km_get_table(Menus[i].value); if (!b) continue; @@ -1885,7 +1885,7 @@ static int parse_my_hdr(struct Buffer *buf, struct Buffer *s, unsigned long data return 0; } -static void set_default(struct option_t *p) +static void set_default(struct Option *p) { switch (p->type & DT_MASK) { @@ -1920,7 +1920,7 @@ static void set_default(struct option_t *p) } } -static void restore_default(struct option_t *p) +static void restore_default(struct Option *p) { switch (p->type & DT_MASK) { @@ -2102,7 +2102,7 @@ static void pretty_var(char *dst, size_t len, const char *option, const char *va *p = 0; } -static int check_charset(struct option_t *opt, const char *val) +static int check_charset(struct Option *opt, const char *val) { char *p = NULL, *q = NULL, *s = safe_strdup(val); int rc = 0; @@ -2821,7 +2821,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, s } else if (DTYPE(MuttVars[idx].type) == DT_SORT) { - const struct mapping_t *map = NULL; + const struct Mapping *map = NULL; switch (MuttVars[idx].type & DT_SUBTYPE_MASK) { @@ -3248,7 +3248,7 @@ static void candidate(char *dest, char *try, const char *src, int len) } #ifdef USE_LUA -const struct command_t *mutt_command_get(const char *s) +const struct Command *mutt_command_get(const char *s) { for (int i = 0; Commands[i].name; i++) if (mutt_strcmp(s, Commands[i].name) == 0) @@ -3257,7 +3257,7 @@ const struct command_t *mutt_command_get(const char *s) } #endif -void mutt_commands_apply(void *data, void (*application)(void *, const struct command_t *)) +void mutt_commands_apply(void *data, void (*application)(void *, const struct Command *)) { for (int i = 0; Commands[i].name; i++) application(data, &Commands[i]); @@ -3367,7 +3367,7 @@ int mutt_command_complete(char *buffer, size_t len, int pos, int numtabs) } else if (mutt_strncmp(buffer, "exec", 4) == 0) { - const struct binding_t *menu = km_get_table(CurrentMenu); + const struct Binding *menu = km_get_table(CurrentMenu); if (!menu && CurrentMenu != MENU_PAGER) menu = OpGeneric; @@ -3676,7 +3676,7 @@ int var_to_string(int idx, char *val, size_t len) } else if (DTYPE(MuttVars[idx].type) == DT_SORT) { - const struct mapping_t *map = NULL; + const struct Mapping *map = NULL; const char *p = NULL; switch (MuttVars[idx].type & DT_SUBTYPE_MASK) @@ -3813,7 +3813,7 @@ int mutt_dump_variables(int hide_sensitive) return 0; } -const char *mutt_getnamebyvalue(int val, const struct mapping_t *map) +const char *mutt_getnamebyvalue(int val, const struct Mapping *map) { int i; @@ -3823,7 +3823,7 @@ const char *mutt_getnamebyvalue(int val, const struct mapping_t *map) return NULL; } -int mutt_getvaluebyname(const char *name, const struct mapping_t *map) +int mutt_getvaluebyname(const char *name, const struct Mapping *map) { int i; @@ -4268,7 +4268,7 @@ void mutt_init(int skip_sys_rc, struct List *commands) int mutt_get_hook_type(const char *name) { - const struct command_t *c = NULL; + const struct Command *c = NULL; for (c = Commands; c->name; c++) if (c->func == mutt_parse_hook && (ascii_strcasecmp(c->name, name) == 0)) @@ -4404,8 +4404,8 @@ int mutt_label_complete(char *buffer, size_t len, int numtabs) /* first TAB. Collect all the matches */ if (numtabs == 1) { - struct hash_elem *entry = NULL; - struct hash_walk_state state; + struct HashElem *entry = NULL; + struct HashWalkState state; Num_matched = 0; strfcpy(User_typed, buffer, sizeof(User_typed)); diff --git a/init.h b/init.h index 233fc8df4..0c018c82f 100644 --- a/init.h +++ b/init.h @@ -76,7 +76,7 @@ struct Buffer; #define ISPELL "ispell" #endif -struct option_t MuttVars[] = { +struct Option MuttVars[] = { /*++*/ { "abort_noattach", DT_QUAD, R_NONE, OPT_ATTACH, MUTT_NO }, @@ -4355,7 +4355,7 @@ struct option_t MuttVars[] = { { NULL, 0, 0, 0, 0 }, }; -const struct mapping_t SortMethods[] = { +const struct Mapping SortMethods[] = { { "date", SORT_DATE }, { "date-sent", SORT_DATE }, { "date-received", SORT_RECEIVED }, @@ -4373,7 +4373,7 @@ const struct mapping_t SortMethods[] = { /* same as SortMethods, but with "threads" replaced by "date" */ -const struct mapping_t SortAuxMethods[] = { +const struct Mapping SortAuxMethods[] = { { "date", SORT_DATE }, { "date-sent", SORT_DATE }, { "date-received", SORT_RECEIVED }, @@ -4391,7 +4391,7 @@ const struct mapping_t SortAuxMethods[] = { { NULL, 0 }, }; -const struct mapping_t SortBrowserMethods[] = { +const struct Mapping SortBrowserMethods[] = { { "alpha", SORT_SUBJECT }, { "count", SORT_COUNT }, { "date", SORT_DATE }, @@ -4402,14 +4402,14 @@ const struct mapping_t SortBrowserMethods[] = { { NULL, 0 }, }; -const struct mapping_t SortAliasMethods[] = { +const struct Mapping SortAliasMethods[] = { { "alias", SORT_ALIAS }, { "address", SORT_ADDRESS }, { "unsorted", SORT_ORDER }, { NULL, 0 }, }; -const struct mapping_t SortKeyMethods[] = { +const struct Mapping SortKeyMethods[] = { { "address", SORT_ADDRESS }, { "date", SORT_DATE }, { "keyid", SORT_KEYID }, @@ -4417,7 +4417,7 @@ const struct mapping_t SortKeyMethods[] = { { NULL, 0 }, }; -const struct mapping_t SortSidebarMethods[] = { +const struct Mapping SortSidebarMethods[] = { { "alpha", SORT_PATH }, { "count", SORT_COUNT }, { "desc", SORT_DESC }, @@ -4477,7 +4477,7 @@ static int parse_tag_transforms(struct Buffer *, struct Buffer *, unsigned long, static int parse_tag_formats(struct Buffer *, struct Buffer *, unsigned long, struct Buffer *); #endif -const struct command_t Commands[] = { +const struct Command Commands[] = { { "alternates", parse_alternates, 0 }, { "unalternates", parse_unalternates, 0 }, #ifdef USE_SOCKET diff --git a/keymap.c b/keymap.c index d15209f95..0a6e3cd4c 100644 --- a/keymap.c +++ b/keymap.c @@ -38,7 +38,7 @@ #include "imap/imap.h" #endif -const struct mapping_t Menus[] = { +const struct Mapping Menus[] = { { "alias", MENU_ALIAS }, { "attach", MENU_ATTACH }, { "browser", MENU_FOLDER }, @@ -64,7 +64,7 @@ const struct mapping_t Menus[] = { { NULL, 0 }, }; -static struct mapping_t KeyNames[] = { +static struct Mapping KeyNames[] = { { "", KEY_PPAGE }, { "", KEY_NPAGE }, { "", KEY_UP }, @@ -126,13 +126,13 @@ static struct mapping_t KeyNames[] = { /* contains the last key the user pressed */ int LastKey; -struct keymap_t *Keymaps[MENU_MAX]; +struct Keymap *Keymaps[MENU_MAX]; -static struct keymap_t *alloc_keys(int len, keycode_t *keys) +static struct Keymap *alloc_keys(int len, keycode_t *keys) { - struct keymap_t *p = NULL; + struct Keymap *p = NULL; - p = safe_calloc(1, sizeof(struct keymap_t)); + p = safe_calloc(1, sizeof(struct Keymap)); p->len = len; p->keys = safe_malloc(len * sizeof(keycode_t)); memcpy(p->keys, keys, len * sizeof(keycode_t)); @@ -235,7 +235,7 @@ static int parsekeys(const char *str, keycode_t *d, int max) int km_bind_err(char *s, int menu, int op, char *macro, char *descr, struct Buffer *err) { int retval = 0; - struct keymap_t *map = NULL, *tmp = NULL, *last = NULL, *next = NULL; + struct Keymap *map = NULL, *tmp = NULL, *last = NULL, *next = NULL; keycode_t buf[MAX_SEQ]; int len, pos = 0, lastpos = 0; @@ -335,7 +335,7 @@ static int km_bindkey(char *s, int menu, int op) return km_bindkey_err(s, menu, op, NULL); } -static int get_op(const struct binding_t *bindings, const char *start, size_t len) +static int get_op(const struct Binding *bindings, const char *start, size_t len) { int i; @@ -349,7 +349,7 @@ static int get_op(const struct binding_t *bindings, const char *start, size_t le return OP_NULL; } -static char *get_func(const struct binding_t *bindings, int op) +static char *get_func(const struct Binding *bindings, int op) { int i; @@ -407,7 +407,7 @@ static void generic_tokenize_push_string(char *s, void (*generic_push)(int, int) * skip the '<' and the '>' when comparing */ for (i = 0; Menus[i].name; i++) { - const struct binding_t *binding = km_get_table(Menus[i].value); + const struct Binding *binding = km_get_table(Menus[i].value); if (binding) { op = get_op(binding, pp + 1, l - 2); @@ -461,7 +461,7 @@ static int retry_generic(int menu, keycode_t *keys, int keyslen, int lastkey) int km_dokey(int menu) { struct Event tmp; - struct keymap_t *map = Keymaps[menu]; + struct Keymap *map = Keymaps[menu]; int pos = 0; int n = 0; int i; @@ -515,7 +515,7 @@ int km_dokey(int menu) if (tmp.op) { char *func = NULL; - const struct binding_t *bindings = NULL; + const struct Binding *bindings = NULL; /* is this a valid op for this menu? */ if ((bindings = km_get_table(menu)) && (func = get_func(bindings, tmp.op))) @@ -592,7 +592,7 @@ int km_dokey(int menu) /* not reached */ } -static void create_bindings(const struct binding_t *map, int menu) +static void create_bindings(const struct Binding *map, int menu) { int i; @@ -632,7 +632,7 @@ static const char *km_keyname(int c) return buf; } -int km_expand_key(char *s, size_t len, struct keymap_t *map) +int km_expand_key(char *s, size_t len, struct Keymap *map) { size_t l; int p = 0; @@ -654,9 +654,9 @@ int km_expand_key(char *s, size_t len, struct keymap_t *map) /* not reached */ } -struct keymap_t *km_find_func(int menu, int func) +struct Keymap *km_find_func(int menu, int func) { - struct keymap_t *map = Keymaps[menu]; + struct Keymap *map = Keymaps[menu]; for (; map; map = map->next) if (map->op == func) @@ -665,13 +665,13 @@ struct keymap_t *km_find_func(int menu, int func) } #ifdef NCURSES_VERSION -struct extkey +struct Extkey { const char *name; const char *sym; }; -static const struct extkey ExtKeys[] = { +static const struct Extkey ExtKeys[] = { { "", "kUP5" }, { "", "kUP" }, { "", "kUP3" }, @@ -758,7 +758,7 @@ void init_extended_keys(void) void km_init(void) { - memset(Keymaps, 0, sizeof(struct keymap_t *) * MENU_MAX); + memset(Keymaps, 0, sizeof(struct Keymap *) * MENU_MAX); create_bindings(OpAttach, MENU_ATTACH); create_bindings(OpBrowser, MENU_FOLDER); @@ -879,7 +879,7 @@ void km_init(void) void km_error_key(int menu) { char buf[SHORT_STRING]; - struct keymap_t *key = NULL; + struct Keymap *key = NULL; int p, op; key = km_find_func(menu, OP_HELP); @@ -999,7 +999,7 @@ error: } static int try_bind(char *key, int menu, char *func, - const struct binding_t *bindings, struct Buffer *err) + const struct Binding *bindings, struct Buffer *err) { int i; @@ -1019,7 +1019,7 @@ static int try_bind(char *key, int menu, char *func, return -1; /* Couldn't find an existing function with this name */ } -const struct binding_t *km_get_table(int menu) +const struct Binding *km_get_table(int menu) { switch (menu) { @@ -1065,9 +1065,9 @@ const struct binding_t *km_get_table(int menu) /* bind menu-name '' function-name */ int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) { - const struct binding_t *bindings = NULL; + const struct Binding *bindings = NULL; char *key = NULL; - int menu[sizeof(Menus) / sizeof(struct mapping_t) - 1], r = 0, nummenus, i; + int menu[sizeof(Menus) / sizeof(struct Mapping) - 1], r = 0, nummenus, i; if ((key = parse_keymap(menu, s, sizeof(menu) / sizeof(menu[0]), &nummenus, err)) == NULL) return -1; @@ -1117,7 +1117,7 @@ int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, st /* macro */ int mutt_parse_macro(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err) { - int menu[sizeof(Menus) / sizeof(struct mapping_t) - 1], r = -1, nummenus, i; + int menu[sizeof(Menus) / sizeof(struct Mapping) - 1], r = -1, nummenus, i; char *seq = NULL; char *key = NULL; @@ -1168,7 +1168,7 @@ int mutt_parse_exec(struct Buffer *buf, struct Buffer *s, unsigned long data, st { int ops[128]; int nops = 0; - const struct binding_t *bindings = NULL; + const struct Binding *bindings = NULL; char *function = NULL; if (!MoreArgs(s)) diff --git a/keymap.h b/keymap.h index 287305eba..81cf5f722 100644 --- a/keymap.h +++ b/keymap.h @@ -33,19 +33,19 @@ int km_dokey(int menu); void init_extended_keys(void); /* entry in the keymap tree */ -struct keymap_t +struct Keymap { char *macro; /* macro expansion (op == OP_MACRO) */ char *descr; /* description of a macro for the help menu */ - struct keymap_t *next; /* next key in map */ + struct Keymap *next; /* next key in map */ short op; /* operation to perform */ short eq; /* number of leading keys equal to next entry */ short len; /* length of key sequence (unit: sizeof (keycode_t)) */ keycode_t *keys; /* key sequence */ }; -int km_expand_key(char *s, size_t len, struct keymap_t *map); -struct keymap_t *km_find_func(int menu, int func); +int km_expand_key(char *s, size_t len, struct Keymap *map); +struct Keymap *km_find_func(int menu, int func); void km_init(void); void km_error_key(int menu); void mutt_what_key(void); @@ -80,39 +80,39 @@ enum }; /* the keymap trees (one for each menu) */ -extern struct keymap_t *Keymaps[]; +extern struct Keymap *Keymaps[]; /* dokey() records the last real key pressed */ extern int LastKey; -extern const struct mapping_t Menus[]; +extern const struct Mapping Menus[]; -struct binding_t +struct Binding { char *name; /* name of the function */ int op; /* function id number */ char *seq; /* default key binding */ }; -const struct binding_t *km_get_table(int menu); +const struct Binding *km_get_table(int menu); -extern const struct binding_t OpGeneric[]; -extern const struct binding_t OpPost[]; -extern const struct binding_t OpMain[]; -extern const struct binding_t OpAttach[]; -extern const struct binding_t OpPager[]; -extern const struct binding_t OpCompose[]; -extern const struct binding_t OpBrowser[]; -extern const struct binding_t OpEditor[]; -extern const struct binding_t OpQuery[]; -extern const struct binding_t OpAlias[]; +extern const struct Binding OpGeneric[]; +extern const struct Binding OpPost[]; +extern const struct Binding OpMain[]; +extern const struct Binding OpAttach[]; +extern const struct Binding OpPager[]; +extern const struct Binding OpCompose[]; +extern const struct Binding OpBrowser[]; +extern const struct Binding OpEditor[]; +extern const struct Binding OpQuery[]; +extern const struct Binding OpAlias[]; -extern const struct binding_t OpPgp[]; +extern const struct Binding OpPgp[]; -extern const struct binding_t OpSmime[]; +extern const struct Binding OpSmime[]; #ifdef MIXMASTER -extern const struct binding_t OpMix[]; +extern const struct Binding OpMix[]; #endif #endif /* _MUTT_KEYMAP_H */ diff --git a/lib.c b/lib.c index 959f39f8e..10761a8d5 100644 --- a/lib.c +++ b/lib.c @@ -44,7 +44,7 @@ #define EX_OK 0 #endif -static const struct sysexits +static const struct Sysexits { int v; const char *str; diff --git a/mapping.h b/mapping.h index 91c85c746..589aacca4 100644 --- a/mapping.h +++ b/mapping.h @@ -20,15 +20,15 @@ #include -struct mapping_t +struct Mapping { const char *name; int value; }; -const char *mutt_getnamebyvalue(int val, const struct mapping_t *map); -char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct mapping_t *items); +const char *mutt_getnamebyvalue(int val, const struct Mapping *map); +char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items); -int mutt_getvaluebyname(const char *name, const struct mapping_t *map); +int mutt_getvaluebyname(const char *name, const struct Mapping *map); #endif /* _MUTT_MAPPING_H */ diff --git a/mbox.c b/mbox.c index c933254f5..54ddd9053 100644 --- a/mbox.c +++ b/mbox.c @@ -50,7 +50,7 @@ #include "thread.h" /* struct used by mutt_sync_mailbox() to store new offsets */ -struct m_update_t +struct MUpdate { short valid; LOFF_T hdr; @@ -1021,8 +1021,8 @@ static int mbox_sync_mailbox(struct Context *ctx, int *index_hint) int first = -1; /* first message to be written */ LOFF_T offset; /* location in mailbox to write changed messages */ struct stat statbuf; - struct m_update_t *newOffset = NULL; - struct m_update_t *oldOffset = NULL; + struct MUpdate *newOffset = NULL; + struct MUpdate *oldOffset = NULL; FILE *fp = NULL; struct Progress progress; char msgbuf[STRING]; @@ -1117,8 +1117,8 @@ static int mbox_sync_mailbox(struct Context *ctx, int *index_hint) offset -= (sizeof(MMDF_SEP) - 1); /* allocate space for the new offsets */ - newOffset = safe_calloc(ctx->msgcount - first, sizeof(struct m_update_t)); - oldOffset = safe_calloc(ctx->msgcount - first, sizeof(struct m_update_t)); + newOffset = safe_calloc(ctx->msgcount - first, sizeof(struct MUpdate)); + oldOffset = safe_calloc(ctx->msgcount - first, sizeof(struct MUpdate)); if (!ctx->quiet) { @@ -1396,7 +1396,7 @@ int mbox_check_empty(const char *path) return ((st.st_size == 0)); } -struct mx_ops mx_mbox_ops = { +struct MxOps mx_mbox_ops = { .open = mbox_open_mailbox, .open_append = mbox_open_mailbox_append, .close = mbox_close_mailbox, @@ -1408,7 +1408,7 @@ struct mx_ops mx_mbox_ops = { .sync = mbox_sync_mailbox, }; -struct mx_ops mx_mmdf_ops = { +struct MxOps mx_mmdf_ops = { .open = mbox_open_mailbox, .open_append = mbox_open_mailbox_append, .close = mbox_close_mailbox, diff --git a/md5.c b/md5.c index 42cc49e76..f8287d163 100644 --- a/md5.c +++ b/md5.c @@ -43,7 +43,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ -void md5_init_ctx(struct md5_ctx *ctx) +void md5_init_ctx(struct Md5Ctx *ctx) { ctx->A = 0x67452301; ctx->B = 0xefcdab89; @@ -64,7 +64,7 @@ static inline void set_uint32(char *cp, md5_uint32 v) /* Put result from CTX in first 16 bytes following RESBUF. The result must be in little endian byte order. */ -void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf) +void *md5_read_ctx(const struct Md5Ctx *ctx, void *resbuf) { char *r = resbuf; set_uint32(r + 0 * sizeof(ctx->A), SWAP(ctx->A)); @@ -77,7 +77,7 @@ void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf) /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. */ -void *md5_finish_ctx(struct md5_ctx *ctx, void *resbuf) +void *md5_finish_ctx(struct Md5Ctx *ctx, void *resbuf) { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; @@ -105,7 +105,7 @@ void *md5_finish_ctx(struct md5_ctx *ctx, void *resbuf) beginning at RESBLOCK. */ int md5_stream(FILE *stream, void *resblock) { - struct md5_ctx ctx; + struct Md5Ctx ctx; char buffer[BLOCKSIZE + 72]; size_t sum; @@ -169,7 +169,7 @@ process_partial_block: digest. */ void *md5_buffer(const char *buffer, size_t len, void *resblock) { - struct md5_ctx ctx; + struct Md5Ctx ctx; /* Initialize the computation context. */ md5_init_ctx(&ctx); @@ -182,7 +182,7 @@ void *md5_buffer(const char *buffer, size_t len, void *resblock) } -void md5_process_bytes(const void *buffer, size_t len, struct md5_ctx *ctx) +void md5_process_bytes(const void *buffer, size_t len, struct Md5Ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both * inputs first. */ @@ -258,7 +258,7 @@ void md5_process_bytes(const void *buffer, size_t len, struct md5_ctx *ctx) /* Process LEN bytes of Buffer, accumulating context into CTX. It is assumed that LEN % 64 == 0. */ -void md5_process_block(const void *buffer, size_t len, struct md5_ctx *ctx) +void md5_process_block(const void *buffer, size_t len, struct Md5Ctx *ctx) { md5_uint32 correct_words[16]; const md5_uint32 *words = buffer; diff --git a/md5.h b/md5.h index bb64fea76..330f49dec 100644 --- a/md5.h +++ b/md5.h @@ -31,7 +31,7 @@ typedef uint32_t md5_uint32; /* Structure to save state of computation between the single steps. */ -struct md5_ctx +struct Md5Ctx { md5_uint32 A; md5_uint32 B; @@ -50,30 +50,30 @@ struct md5_ctx /* Initialize structure containing state of computation. * (RFC 1321, 3.3: Step 3) */ -void md5_init_ctx(struct md5_ctx *ctx); +void md5_init_ctx(struct Md5Ctx *ctx); /* Starting with the result of former calls of this function (or the * initialization function update the context for the next LEN bytes * starting at Buffer. * It is necessary that LEN is a multiple of 64!!! */ -void md5_process_block(const void *buffer, size_t len, struct md5_ctx *ctx); +void md5_process_block(const void *buffer, size_t len, struct Md5Ctx *ctx); /* Starting with the result of former calls of this function (or the * initialization function update the context for the next LEN bytes * starting at Buffer. * It is NOT required that LEN is a multiple of 64. */ -void md5_process_bytes(const void *buffer, size_t len, struct md5_ctx *ctx); +void md5_process_bytes(const void *buffer, size_t len, struct Md5Ctx *ctx); /* Process the remaining bytes in the buffer and put result from CTX * in first 16 bytes following RESBUF. The result is always in little * endian byte order, so that a byte-wise output yields to the wanted * ASCII representation of the message digest. */ -void *md5_finish_ctx(struct md5_ctx *ctx, void *resbuf); +void *md5_finish_ctx(struct Md5Ctx *ctx, void *resbuf); /* Put result from CTX in first 16 bytes following RESBUF. The result is * always in little endian byte order, so that a byte-wise output yields * to the wanted ASCII representation of the message digest. */ -void *md5_read_ctx(const struct md5_ctx *ctx, void *resbuf); +void *md5_read_ctx(const struct Md5Ctx *ctx, void *resbuf); /* Compute MD5 message digest for bytes read from STREAM. The * resulting message digest number will be written into the 16 bytes diff --git a/mh.c b/mh.c index 9d77f76dc..982adb438 100644 --- a/mh.c +++ b/mh.c @@ -64,22 +64,22 @@ #define INS_SORT_THRESHOLD 6 -struct maildir +struct Maildir { struct Header *h; char *canon_fname; unsigned header_parsed : 1; ino_t inode; - struct maildir *next; + struct Maildir *next; }; -struct mh_sequences +struct MhSequences { int max; short *flags; }; -struct mh_data +struct MhData { time_t mtime_cur; mode_t mh_umask; @@ -91,12 +91,12 @@ struct mh_data #define MH_SEQ_REPLIED (1 << 1) #define MH_SEQ_FLAGGED (1 << 2) -static inline struct mh_data *mh_data(struct Context *ctx) +static inline struct MhData *mh_data(struct Context *ctx) { - return (struct mh_data *) ctx->data; + return (struct MhData *) ctx->data; } -static void mhs_alloc(struct mh_sequences *mhs, int i) +static void mhs_alloc(struct MhSequences *mhs, int i) { int j; int newmax; @@ -113,12 +113,12 @@ static void mhs_alloc(struct mh_sequences *mhs, int i) } } -static void mhs_free_sequences(struct mh_sequences *mhs) +static void mhs_free_sequences(struct MhSequences *mhs) { FREE(&mhs->flags); } -static short mhs_check(struct mh_sequences *mhs, int i) +static short mhs_check(struct MhSequences *mhs, int i) { if (!mhs->flags || i > mhs->max) return 0; @@ -126,7 +126,7 @@ static short mhs_check(struct mh_sequences *mhs, int i) return mhs->flags[i]; } -static short mhs_set(struct mh_sequences *mhs, int i, short f) +static short mhs_set(struct MhSequences *mhs, int i, short f) { mhs_alloc(mhs, i); mhs->flags[i] |= f; @@ -151,7 +151,7 @@ static int mh_read_token(char *t, int *first, int *last) return 0; } -static int mh_read_sequences(struct mh_sequences *mhs, const char *path) +static int mh_read_sequences(struct MhSequences *mhs, const char *path) { FILE *fp = NULL; int line = 1; @@ -206,7 +206,7 @@ out: static inline mode_t mh_umask(struct Context *ctx) { struct stat st; - struct mh_data *data = mh_data(ctx); + struct MhData *data = mh_data(ctx); if (data && data->mh_umask) return data->mh_umask; @@ -273,7 +273,7 @@ static bool mh_valid_message(const char *s) int mh_buffy(struct Buffy *mailbox, int check_stats) { int i; - struct mh_sequences mhs; + struct MhSequences mhs; int check_new = 1; int rc = 0; DIR *dirp = NULL; @@ -386,7 +386,7 @@ static int mh_mkstemp(struct Context *dest, FILE **fp, char **tgt) return 0; } -static void mhs_write_one_sequence(FILE *fp, struct mh_sequences *mhs, short f, +static void mhs_write_one_sequence(FILE *fp, struct MhSequences *mhs, short f, const char *tag) { int i; @@ -450,7 +450,7 @@ static void mh_update_sequences(struct Context *ctx) char seq_flagged[STRING]; - struct mh_sequences mhs; + struct MhSequences mhs; memset(&mhs, 0, sizeof(mhs)); snprintf(seq_unseen, sizeof(seq_unseen), "%s:", NONULL(MhUnseen)); @@ -607,7 +607,7 @@ static void mh_sequences_add_one(struct Context *ctx, int n, short unseen, short FREE(&tmpfname); } -static void mh_update_maildir(struct maildir *md, struct mh_sequences *mhs) +static void mh_update_maildir(struct Maildir *md, struct MhSequences *mhs) { int i; short f; @@ -631,7 +631,7 @@ static void mh_update_maildir(struct maildir *md, struct mh_sequences *mhs) } /* maildir support */ -static void maildir_free_entry(struct maildir **md) +static void maildir_free_entry(struct Maildir **md) { if (!md || !*md) return; @@ -643,9 +643,9 @@ static void maildir_free_entry(struct maildir **md) FREE(md); } -static void maildir_free_maildir(struct maildir **md) +static void maildir_free_maildir(struct Maildir **md) { - struct maildir *p = NULL, *q = NULL; + struct Maildir *p = NULL, *q = NULL; if (!md || !*md) return; @@ -717,7 +717,7 @@ static void maildir_update_mtime(struct Context *ctx) { char buf[_POSIX_PATH_MAX]; struct stat st; - struct mh_data *data = mh_data(ctx); + struct MhData *data = mh_data(ctx); if (ctx->magic == MUTT_MAILDIR) { @@ -792,14 +792,14 @@ struct Header *maildir_parse_message(int magic, const char *fname, int is_old, s return NULL; } -static int maildir_parse_dir(struct Context *ctx, struct maildir ***last, +static int maildir_parse_dir(struct Context *ctx, struct Maildir ***last, const char *subdir, int *count, struct Progress *progress) { DIR *dirp = NULL; struct dirent *de = NULL; char buf[_POSIX_PATH_MAX]; int is_old = 0; - struct maildir *entry = NULL; + struct Maildir *entry = NULL; struct Header *h = NULL; if (subdir) @@ -843,7 +843,7 @@ static int maildir_parse_dir(struct Context *ctx, struct maildir ***last, else h->path = safe_strdup(de->d_name); - entry = safe_calloc(sizeof(struct maildir), 1); + entry = safe_calloc(sizeof(struct Maildir), 1); entry->h = h; entry->inode = de->d_ino; **last = entry; @@ -861,7 +861,7 @@ static int maildir_parse_dir(struct Context *ctx, struct maildir ***last, return 0; } -static bool maildir_add_to_context(struct Context *ctx, struct maildir *md) +static bool maildir_add_to_context(struct Context *ctx, struct Maildir *md) { int oldmsgcount = ctx->msgcount; @@ -898,7 +898,7 @@ static bool maildir_add_to_context(struct Context *ctx, struct maildir *md) return false; } -static int maildir_move_to_context(struct Context *ctx, struct maildir **md) +static int maildir_move_to_context(struct Context *ctx, struct Maildir **md) { int r; r = maildir_add_to_context(ctx, *md); @@ -914,12 +914,12 @@ static size_t maildir_hcache_keylen(const char *fn) } #endif -static int md_cmp_inode(struct maildir *a, struct maildir *b) +static int md_cmp_inode(struct Maildir *a, struct Maildir *b) { return a->inode - b->inode; } -static int md_cmp_path(struct maildir *a, struct maildir *b) +static int md_cmp_path(struct Maildir *a, struct Maildir *b) { return strcmp(a->h->path, b->h->path); } @@ -927,11 +927,11 @@ static int md_cmp_path(struct maildir *a, struct maildir *b) /* * Merge two maildir lists according to the inode numbers. */ -static struct maildir *maildir_merge_lists(struct maildir *left, struct maildir *right, - int (*cmp)(struct maildir *, struct maildir *)) +static struct Maildir *maildir_merge_lists(struct Maildir *left, struct Maildir *right, + int (*cmp)(struct Maildir *, struct Maildir *)) { - struct maildir *head = NULL; - struct maildir *tail = NULL; + struct Maildir *head = NULL; + struct Maildir *tail = NULL; if (left && right) { @@ -983,10 +983,10 @@ static struct maildir *maildir_merge_lists(struct maildir *left, struct maildir return head; } -static struct maildir *maildir_ins_sort(struct maildir *list, - int (*cmp)(struct maildir *, struct maildir *)) +static struct Maildir *maildir_ins_sort(struct Maildir *list, + int (*cmp)(struct Maildir *, struct Maildir *)) { - struct maildir *tmp = NULL, *last = NULL, *ret = NULL, *back = NULL; + struct Maildir *tmp = NULL, *last = NULL, *ret = NULL, *back = NULL; ret = list; list = list->next; @@ -1014,11 +1014,11 @@ static struct maildir *maildir_ins_sort(struct maildir *list, /* * Sort maildir list according to inode. */ -static struct maildir *maildir_sort(struct maildir *list, size_t len, - int (*cmp)(struct maildir *, struct maildir *)) +static struct Maildir *maildir_sort(struct Maildir *list, size_t len, + int (*cmp)(struct Maildir *, struct Maildir *)) { - struct maildir *left = list; - struct maildir *right = list; + struct Maildir *left = list; + struct Maildir *right = list; size_t c = 0; if (!list || !list->next) @@ -1049,7 +1049,7 @@ static struct maildir *maildir_sort(struct maildir *list, size_t len, /* Sorts mailbox into its natural order. * Currently only defined for MH where files are numbered. */ -static void mh_sort_natural(struct Context *ctx, struct maildir **md) +static void mh_sort_natural(struct Context *ctx, struct Maildir **md) { if (!ctx || !md || !*md || ctx->magic != MUTT_MH || Sort != SORT_ORDER) return; @@ -1057,7 +1057,7 @@ static void mh_sort_natural(struct Context *ctx, struct maildir **md) *md = maildir_sort(*md, (size_t) -1, md_cmp_path); } -static struct maildir *skip_duplicates(struct maildir *p, struct maildir **last) +static struct Maildir *skip_duplicates(struct Maildir *p, struct Maildir **last) { /* * Skip ahead to the next non-duplicate message. @@ -1080,9 +1080,9 @@ static struct maildir *skip_duplicates(struct maildir *p, struct maildir **last) /* * This function does the second parsing pass */ -static void maildir_delayed_parsing(struct Context *ctx, struct maildir **md, struct Progress *progress) +static void maildir_delayed_parsing(struct Context *ctx, struct Maildir **md, struct Progress *progress) { - struct maildir *p, *last = NULL; + struct Maildir *p, *last = NULL; char fn[_POSIX_PATH_MAX]; int count; int sort = 0; @@ -1220,10 +1220,10 @@ static int mh_close_mailbox(struct Context *ctx) */ static int mh_read_dir(struct Context *ctx, const char *subdir) { - struct maildir *md = NULL; - struct mh_sequences mhs; - struct maildir **last; - struct mh_data *data = NULL; + struct Maildir *md = NULL; + struct MhSequences mhs; + struct Maildir **last; + struct MhData *data = NULL; int count; char msgbuf[STRING]; struct Progress progress; @@ -1237,7 +1237,7 @@ static int mh_read_dir(struct Context *ctx, const char *subdir) if (!ctx->data) { - ctx->data = safe_calloc(sizeof(struct mh_data), 1); + ctx->data = safe_calloc(sizeof(struct MhData), 1); } data = mh_data(ctx); @@ -1997,12 +1997,12 @@ static int maildir_check_mailbox(struct Context *ctx, int *index_hint) int occult = 0; /* messages were removed from the mailbox */ int have_new = 0; /* messages were added to the mailbox */ bool flags_changed = false; /* message flags were changed in the mailbox */ - struct maildir *md = NULL; /* list of messages in the mailbox */ - struct maildir **last = NULL, *p = NULL; + struct Maildir *md = NULL; /* list of messages in the mailbox */ + struct Maildir **last = NULL, *p = NULL; int i; struct Hash *fnames = NULL; /* hash table for quickly looking up the base filename for a maildir message */ - struct mh_data *data = mh_data(ctx); + struct MhData *data = mh_data(ctx); /* XXX seems like this check belongs in mx_check_mailbox() * rather than here. @@ -2149,12 +2149,12 @@ static int mh_check_mailbox(struct Context *ctx, int *index_hint) char buf[_POSIX_PATH_MAX]; struct stat st, st_cur; bool modified = false, have_new = false, occult = false, flags_changed = false; - struct maildir *md = NULL, *p = NULL; - struct maildir **last = NULL; - struct mh_sequences mhs; + struct Maildir *md = NULL, *p = NULL; + struct Maildir **last = NULL; + struct MhSequences mhs; struct Hash *fnames = NULL; int i; - struct mh_data *data = mh_data(ctx); + struct MhData *data = mh_data(ctx); if (!option(OPTCHECKNEW)) return 0; @@ -2569,7 +2569,7 @@ bool mx_is_mh(const char *path) return false; } -struct mx_ops mx_maildir_ops = { +struct MxOps mx_maildir_ops = { .open = maildir_open_mailbox, .open_append = maildir_open_mailbox_append, .close = mh_close_mailbox, @@ -2581,7 +2581,7 @@ struct mx_ops mx_maildir_ops = { .sync = mh_sync_mailbox, }; -struct mx_ops mx_mh_ops = { +struct MxOps mx_mh_ops = { .open = mh_open_mailbox, .open_append = mh_open_mailbox_append, .close = mh_close_mailbox, diff --git a/mutt_commands.h b/mutt_commands.h index f1c17dd3a..f5334b790 100644 --- a/mutt_commands.h +++ b/mutt_commands.h @@ -20,14 +20,14 @@ struct Buffer; -struct command_t +struct Command { char *name; int (*func)(struct Buffer *, struct Buffer *, unsigned long, struct Buffer *); unsigned long data; }; -const struct command_t *mutt_command_get(const char *s); -void mutt_commands_apply(void *data, void (*application)(void *, const struct command_t *)); +const struct Command *mutt_command_get(const char *s); +void mutt_commands_apply(void *data, void (*application)(void *, const struct Command *)); #endif /* _MUTT_COMMANDS_H */ diff --git a/mutt_lua.c b/mutt_lua.c index 725ccfb1a..3d843ebba 100644 --- a/mutt_lua.c +++ b/mutt_lua.c @@ -57,7 +57,7 @@ static int _lua_mutt_call(lua_State *l) mutt_debug(2, " * _lua_mutt_call()\n"); struct Buffer token, expn, err; char buffer[LONG_STRING] = ""; - const struct command_t *command = NULL; + const struct Command *command = NULL; int rv = 0; mutt_buffer_init(&token); @@ -116,15 +116,15 @@ static int _lua_mutt_set(lua_State *l) struct Buffer err; const char *param = lua_tostring(l, -2); mutt_debug(2, " * _lua_mutt_set(%s)\n", param); - struct option_t *value = safe_malloc(sizeof(struct option_t)); - const struct option_t *tmp = mutt_option_get(param); + struct Option *value = safe_malloc(sizeof(struct Option)); + const struct Option *tmp = mutt_option_get(param); if (tmp == NULL) { luaL_error(l, "Error getting parameter %s", param); return -1; } - memcpy(value, tmp, sizeof(struct option_t)); + memcpy(value, tmp, sizeof(struct Option)); if (value) { rv = 0; @@ -200,7 +200,7 @@ static int _lua_mutt_get(lua_State *l) { const char *param = lua_tostring(l, -1); mutt_debug(2, " * _lua_mutt_get(%s)\n", param); - const struct option_t *opt = mutt_option_get(param); + const struct Option *opt = mutt_option_get(param); if (opt) switch (opt->type & DT_MASK) { @@ -315,7 +315,7 @@ static int _lua_mutt_error(lua_State *l) return 0; } -static void _lua_expose_command(void *p, const struct command_t *cmd) +static void _lua_expose_command(void *p, const struct Command *cmd) { lua_State *l = (lua_State *) p; char buf[LONG_STRING]; diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 3cfaf5aa3..ef3a2600d 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -87,17 +87,17 @@ enum }; /** - * struct uri_tag - Parsed NotMuch-URI arguments + * struct UriTag - Parsed NotMuch-URI arguments * * The arguments in a URI are saved in a linked list. * * @sa nm_ctxdata#query_items */ -struct uri_tag +struct UriTag { char *name; char *value; - struct uri_tag *next; + struct UriTag *next; }; /** @@ -108,39 +108,39 @@ struct uri_tag * * @sa nm_hdrdata#tag_list */ -struct nm_hdrtag +struct NmHdrtag { char *tag; char *transformed; - struct nm_hdrtag *next; + struct NmHdrtag *next; }; /** - * struct nm_hdrdata - NotMuch data attached to an email + * struct NmHdrdata - NotMuch data attached to an email * * This stores all the NotMuch data associated with an email. * * @sa Header#data, MUTT_MBOX */ -struct nm_hdrdata +struct NmHdrdata { char *folder; /**< Location of the email */ char *tags; char *tags_transformed; - struct nm_hdrtag *tag_list; + struct NmHdrtag *tag_list; char *oldpath; char *virtual_id; /**< Unique NotMuch Id */ int magic; /**< Type of mailbox the email is in */ }; /** - * struct nm_ctxdata - NotMuch data attached to a context + * struct NmCtxdata - NotMuch data attached to a context * * This stores the global NotMuch data, such as the database connection. * * @sa Context#data, NotmuchDBLimit, NM_QUERY_TYPE_MESGS */ -struct nm_ctxdata +struct NmCtxdata { notmuch_database_t *db; @@ -149,7 +149,7 @@ struct nm_ctxdata int db_limit; /**< Maximum number of results to return */ int query_type; /**< Messages or Threads */ - struct uri_tag *query_items; + struct UriTag *query_items; struct Progress progress; /**< A progress bar */ int oldmsgcount; @@ -206,11 +206,11 @@ static void debug_print_tags(notmuch_message_t *msg) * url_free_tags - Free a list of tags * @param tags List of tags */ -static void url_free_tags(struct uri_tag *tags) +static void url_free_tags(struct UriTag *tags) { while (tags) { - struct uri_tag *next = tags->next; + struct UriTag *next = tags->next; FREE(&tags->name); FREE(&tags->value); FREE(&tags); @@ -234,11 +234,11 @@ static void url_free_tags(struct uri_tag *tags) * Extract the database filename (optional) and any search parameters (tags). * The tags will be saved in a linked list (#uri_tag). */ -static bool url_parse_query(const char *url, char **filename, struct uri_tag **tags) +static bool url_parse_query(const char *url, char **filename, struct UriTag **tags) { char *p = strstr(url, "://"); /* remote unsupported */ char *e = NULL; - struct uri_tag *tag, *last = NULL; + struct UriTag *tag, *last = NULL; *filename = NULL; *tags = NULL; @@ -263,7 +263,7 @@ static bool url_parse_query(const char *url, char **filename, struct uri_tag **t while (p && *p) { - tag = safe_calloc(1, sizeof(struct uri_tag)); + tag = safe_calloc(1, sizeof(struct UriTag)); if (!*tags) last = *tags = tag; @@ -303,9 +303,9 @@ err: return false; } -static void free_tag_list(struct nm_hdrtag **tag_list) +static void free_tag_list(struct NmHdrtag **tag_list) { - struct nm_hdrtag *tmp = NULL; + struct NmHdrtag *tmp = NULL; while ((tmp = *tag_list) != NULL) { @@ -318,7 +318,7 @@ static void free_tag_list(struct nm_hdrtag **tag_list) *tag_list = 0; } -static void free_hdrdata(struct nm_hdrdata *data) +static void free_hdrdata(struct NmHdrdata *data) { if (!data) return; @@ -333,7 +333,7 @@ static void free_hdrdata(struct nm_hdrdata *data) FREE(&data); } -static void free_ctxdata(struct nm_ctxdata *data) +static void free_ctxdata(struct NmCtxdata *data) { if (!data) return; @@ -354,14 +354,14 @@ static void free_ctxdata(struct nm_ctxdata *data) FREE(&data); } -static struct nm_ctxdata *new_ctxdata(char *uri) +static struct NmCtxdata *new_ctxdata(char *uri) { - struct nm_ctxdata *data = NULL; + struct NmCtxdata *data = NULL; if (!uri) return NULL; - data = safe_calloc(1, sizeof(struct nm_ctxdata)); + data = safe_calloc(1, sizeof(struct NmCtxdata)); mutt_debug(1, "nm: initialize context data %p\n", (void *) data); data->db_limit = NotmuchDBLimit; @@ -393,7 +393,7 @@ static int init_context(struct Context *ctx) static char *header_get_id(struct Header *h) { - return (h && h->data) ? ((struct nm_hdrdata *) h->data)->virtual_id : NULL; + return (h && h->data) ? ((struct NmHdrdata *) h->data)->virtual_id : NULL; } static char *header_get_fullpath(struct Header *h, char *buf, size_t bufsz) @@ -402,7 +402,7 @@ static char *header_get_fullpath(struct Header *h, char *buf, size_t bufsz) return buf; } -static struct nm_ctxdata *get_ctxdata(struct Context *ctx) +static struct NmCtxdata *get_ctxdata(struct Context *ctx) { if (ctx && (ctx->magic == MUTT_NOTMUCH)) return ctx->data; @@ -557,11 +557,11 @@ static bool windowed_query_from_query(const char *query, char *buf, size_t bufsz * result in buffy) or not (for the count in the sidebar). It is not aimed at * enabling/disabling the feature. */ -static char *get_query_string(struct nm_ctxdata *data, int window) +static char *get_query_string(struct NmCtxdata *data, int window) { mutt_debug(2, "nm: get_query_string(%d)\n", window); - struct uri_tag *item = NULL; + struct UriTag *item = NULL; if (!data) return NULL; @@ -612,17 +612,17 @@ static char *get_query_string(struct nm_ctxdata *data, int window) return data->db_query; } -static int get_limit(struct nm_ctxdata *data) +static int get_limit(struct NmCtxdata *data) { return data ? data->db_limit : 0; } -static int get_query_type(struct nm_ctxdata *data) +static int get_query_type(struct NmCtxdata *data) { return (data && data->query_type) ? data->query_type : string_to_query_type(NULL); } -static const char *get_db_filename(struct nm_ctxdata *data) +static const char *get_db_filename(struct NmCtxdata *data) { char *db_filename = NULL; @@ -679,7 +679,7 @@ static notmuch_database_t *do_database_open(const char *filename, int writable, return db; } -static notmuch_database_t *get_db(struct nm_ctxdata *data, int writable) +static notmuch_database_t *get_db(struct NmCtxdata *data, int writable) { if (!data) return NULL; @@ -693,7 +693,7 @@ static notmuch_database_t *get_db(struct nm_ctxdata *data, int writable) return data->db; } -static int release_db(struct nm_ctxdata *data) +static int release_db(struct NmCtxdata *data) { if (data && data->db) { @@ -711,7 +711,7 @@ static int release_db(struct nm_ctxdata *data) return -1; } -static int db_trans_begin(struct nm_ctxdata *data) +static int db_trans_begin(struct NmCtxdata *data) { if (!data || !data->db) return -1; @@ -728,7 +728,7 @@ static int db_trans_begin(struct nm_ctxdata *data) return 0; } -static int db_trans_end(struct nm_ctxdata *data) +static int db_trans_end(struct NmCtxdata *data) { if (!data || !data->db) return -1; @@ -744,12 +744,12 @@ static int db_trans_end(struct nm_ctxdata *data) return 0; } -static int is_longrun(struct nm_ctxdata *data) +static int is_longrun(struct NmCtxdata *data) { return data && data->longrun; } -static int get_database_mtime(struct nm_ctxdata *data, time_t *mtime) +static int get_database_mtime(struct NmCtxdata *data, time_t *mtime) { char path[_POSIX_PATH_MAX]; struct stat st; @@ -801,7 +801,7 @@ static void apply_exclude_tags(notmuch_query_t *query) FREE(&buf); } -static notmuch_query_t *get_query(struct nm_ctxdata *data, int writable) +static notmuch_query_t *get_query(struct NmCtxdata *data, int writable) { notmuch_database_t *db = NULL; notmuch_query_t *q = NULL; @@ -845,10 +845,10 @@ static void append_str_item(char **str, const char *item, int sep) static int update_header_tags(struct Header *h, notmuch_message_t *msg) { - struct nm_hdrdata *data = h->data; + struct NmHdrdata *data = h->data; notmuch_tags_t *tags = NULL; char *tstr = NULL, *ttstr = NULL; - struct nm_hdrtag *tag_list = NULL, *tmp = NULL; + struct NmHdrtag *tag_list = NULL, *tmp = NULL; mutt_debug(2, "nm: tags update requested (%s)\n", data->virtual_id); @@ -917,7 +917,7 @@ static int update_header_tags(struct Header *h, notmuch_message_t *msg) static int update_message_path(struct Header *h, const char *path) { - struct nm_hdrdata *data = h->data; + struct NmHdrdata *data = h->data; char *p = NULL; mutt_debug(2, "nm: path update requested path=%s, (%s)\n", path, data->virtual_id); @@ -997,14 +997,14 @@ static int init_header(struct Header *h, const char *path, notmuch_message_t *ms id = notmuch_message_get_message_id(msg); - h->data = safe_calloc(1, sizeof(struct nm_hdrdata)); + h->data = safe_calloc(1, sizeof(struct NmHdrdata)); h->free_cb = deinit_header; /* * Notmuch ensures that message Id exists (if not notmuch Notmuch will * generate an ID), so it's more safe than use mutt Header->env->id */ - ((struct nm_hdrdata *) h->data)->virtual_id = safe_strdup(id); + ((struct NmHdrdata *) h->data)->virtual_id = safe_strdup(id); mutt_debug(2, "nm: initialize header data: [hdr=%p, data=%p] (%s)\n", (void *) h, (void *) h->data, id); @@ -1036,7 +1036,7 @@ static const char *get_message_last_filename(notmuch_message_t *msg) static void progress_reset(struct Context *ctx) { - struct nm_ctxdata *data = NULL; + struct NmCtxdata *data = NULL; if (ctx->quiet) return; @@ -1054,7 +1054,7 @@ static void progress_reset(struct Context *ctx) static void progress_update(struct Context *ctx, notmuch_query_t *q) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); if (ctx->quiet || !data || data->noprogress) return; @@ -1117,7 +1117,7 @@ static void append_message(struct Context *ctx, notmuch_query_t *q, notmuch_mess const char *path = NULL; struct Header *h = NULL; - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); if (!data) return; @@ -1185,7 +1185,7 @@ static void append_message(struct Context *ctx, notmuch_query_t *q, notmuch_mess if (newpath) { /* remember that file has been moved -- nm_sync_mailbox() will update the DB */ - struct nm_hdrdata *hd = (struct nm_hdrdata *) h->data; + struct NmHdrdata *hd = (struct NmHdrdata *) h->data; if (hd) { @@ -1229,7 +1229,7 @@ static void append_thread(struct Context *ctx, notmuch_query_t *q, notmuch_threa static bool read_mesgs_query(struct Context *ctx, notmuch_query_t *q, int dedup) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); int limit; notmuch_messages_t *msgs = NULL; @@ -1262,7 +1262,7 @@ static bool read_mesgs_query(struct Context *ctx, notmuch_query_t *q, int dedup) static bool read_threads_query(struct Context *ctx, notmuch_query_t *q, int dedup, int limit) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); notmuch_threads_t *threads = NULL; if (!data) @@ -1476,7 +1476,7 @@ static int rename_maildir_filename(const char *old, char *newpath, size_t newsz, return 0; } -static int remove_filename(struct nm_ctxdata *data, const char *path) +static int remove_filename(struct NmCtxdata *data, const char *path) { notmuch_status_t st; notmuch_filenames_t *ls = NULL; @@ -1530,7 +1530,7 @@ static int remove_filename(struct nm_ctxdata *data, const char *path) return 0; } -static int rename_filename(struct nm_ctxdata *data, const char *old, +static int rename_filename(struct NmCtxdata *data, const char *old, const char *new, struct Header *h) { int rc = -1; @@ -1636,27 +1636,27 @@ static unsigned count_query(notmuch_database_t *db, const char *qstr) char *nm_header_get_folder(struct Header *h) { - return (h && h->data) ? ((struct nm_hdrdata *) h->data)->folder : NULL; + return (h && h->data) ? ((struct NmHdrdata *) h->data)->folder : NULL; } char *nm_header_get_tags(struct Header *h) { - return (h && h->data) ? ((struct nm_hdrdata *) h->data)->tags : NULL; + return (h && h->data) ? ((struct NmHdrdata *) h->data)->tags : NULL; } char *nm_header_get_tags_transformed(struct Header *h) { - return (h && h->data) ? ((struct nm_hdrdata *) h->data)->tags_transformed : NULL; + return (h && h->data) ? ((struct NmHdrdata *) h->data)->tags_transformed : NULL; } char *nm_header_get_tag_transformed(char *tag, struct Header *h) { - struct nm_hdrtag *tmp = NULL; + struct NmHdrtag *tmp = NULL; if (!h || !h->data) return NULL; - for (tmp = ((struct nm_hdrdata *) h->data)->tag_list; tmp != NULL; tmp = tmp->next) + for (tmp = ((struct NmHdrdata *) h->data)->tag_list; tmp != NULL; tmp = tmp->next) { if (strcmp(tag, tmp->tag) == 0) return tmp->transformed; @@ -1667,7 +1667,7 @@ char *nm_header_get_tag_transformed(char *tag, struct Header *h) void nm_longrun_init(struct Context *ctx, int writable) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); if (data && get_db(data, writable)) { @@ -1678,7 +1678,7 @@ void nm_longrun_init(struct Context *ctx, int writable) void nm_longrun_done(struct Context *ctx) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); if (data && (release_db(data) == 0)) mutt_debug(2, "nm: long run deinitialized\n"); @@ -1686,7 +1686,7 @@ void nm_longrun_done(struct Context *ctx) void nm_debug_check(struct Context *ctx) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); if (!data) return; @@ -1699,7 +1699,7 @@ void nm_debug_check(struct Context *ctx) int nm_read_entire_thread(struct Context *ctx, struct Header *h) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); const char *id = NULL; char *qstr = NULL; notmuch_query_t *q = NULL; @@ -1753,7 +1753,7 @@ done: char *nm_uri_from_query(struct Context *ctx, char *buf, size_t bufsz) { mutt_debug(2, "nm_uri_from_query (%s)\n", buf); - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); char uri[_POSIX_PATH_MAX + LONG_STRING + 32]; /* path to DB + query + URI "decoration" */ if (data) @@ -1795,7 +1795,7 @@ bool nm_normalize_uri(char *new_uri, const char *orig_uri, size_t new_uri_sz) char buf[LONG_STRING]; struct Context tmp_ctx; - struct nm_ctxdata tmp_ctxdata; + struct NmCtxdata tmp_ctxdata; tmp_ctx.magic = MUTT_NOTMUCH; tmp_ctx.data = &tmp_ctxdata; @@ -1867,7 +1867,7 @@ void nm_query_window_backward(void) int nm_modify_message_tags(struct Context *ctx, struct Header *hdr, char *buf) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); notmuch_database_t *db = NULL; notmuch_message_t *msg = NULL; int rc = -1; @@ -1900,7 +1900,7 @@ int nm_update_filename(struct Context *ctx, const char *old, const char *new, st { char buf[PATH_MAX]; int rc; - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); if (!data || !new) return -1; @@ -1921,7 +1921,7 @@ int nm_update_filename(struct Context *ctx, const char *old, const char *new, st int nm_nonctx_get_count(char *path, int *all, int *new) { - struct uri_tag *query_items = NULL, *item = NULL; + struct UriTag *query_items = NULL, *item = NULL; char *db_filename = NULL, *db_query = NULL; notmuch_database_t *db = NULL; int rc = -1, dflt = 0; @@ -2036,7 +2036,7 @@ int nm_record_message(struct Context *ctx, char *path, struct Header *h) notmuch_status_t st; notmuch_message_t *msg = NULL; int rc = -1, trans; - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); if (!path || !data || (access(path, F_OK) != 0)) return 0; @@ -2079,7 +2079,7 @@ done: int nm_get_all_tags(struct Context *ctx, char **tag_list, int *tag_count) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); notmuch_database_t *db = NULL; notmuch_tags_t *tags = NULL; const char *tag = NULL; @@ -2123,7 +2123,7 @@ done: static int nm_open_mailbox(struct Context *ctx) { notmuch_query_t *q = NULL; - struct nm_ctxdata *data = NULL; + struct NmCtxdata *data = NULL; int rc = -1; if (init_context(ctx) != 0) @@ -2192,7 +2192,7 @@ static int nm_close_mailbox(struct Context *ctx) static int nm_check_mailbox(struct Context *ctx, int *index_hint) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); time_t mtime = 0; notmuch_query_t *q = NULL; notmuch_messages_t *msgs = NULL; @@ -2306,7 +2306,7 @@ done: static int nm_sync_mailbox(struct Context *ctx, int *index_hint) { - struct nm_ctxdata *data = get_ctxdata(ctx); + struct NmCtxdata *data = get_ctxdata(ctx); int i, rc = 0; char msgbuf[STRING]; struct Progress progress; @@ -2329,7 +2329,7 @@ static int nm_sync_mailbox(struct Context *ctx, int *index_hint) { char old[_POSIX_PATH_MAX], new[_POSIX_PATH_MAX]; struct Header *h = ctx->hdrs[i]; - struct nm_hdrdata *hd = h->data; + struct NmHdrdata *hd = h->data; if (!ctx->quiet) mutt_progress_update(&progress, i, -1); @@ -2424,7 +2424,7 @@ static int nm_commit_message(struct Context *ctx, struct Message *msg) * * These functions are common to all mailbox types. */ -struct mx_ops mx_notmuch_ops = { +struct MxOps mx_notmuch_ops = { .open = nm_open_mailbox, /* calls init_context() */ .open_append = NULL, .close = nm_close_mailbox, diff --git a/mutt_notmuch.h b/mutt_notmuch.h index ef755078b..03ddee814 100644 --- a/mutt_notmuch.h +++ b/mutt_notmuch.h @@ -56,6 +56,6 @@ char *nm_header_get_tag_transformed(char *tag, struct Header *h); char *nm_header_get_tags_transformed(struct Header *h); char *nm_header_get_tags(struct Header *h); -extern struct mx_ops mx_notmuch_ops; +extern struct MxOps mx_notmuch_ops; #endif /* _MUTT_NOTMUCH_H */ diff --git a/mutt_options.h b/mutt_options.h index 0c4399909..00e2590c0 100644 --- a/mutt_options.h +++ b/mutt_options.h @@ -46,7 +46,7 @@ struct Buffer; #define DT_SORT_AUX 0x80 #define DT_SORT_SIDEBAR 0x100 -struct option_t +struct Option { char *option; short type; @@ -55,9 +55,9 @@ struct option_t unsigned long init; /* initial value */ }; -int mutt_option_to_string(const struct option_t *opt, char *val, size_t len); +int mutt_option_to_string(const struct Option *opt, char *val, size_t len); -const struct option_t *mutt_option_get(const char *s); -int mutt_option_set(const struct option_t *val, struct Buffer *err); +const struct Option *mutt_option_get(const char *s); +int mutt_option_set(const struct Option *val, struct Buffer *err); #endif /* _MUTT_OPTIONS_H */ diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c index 5b11abae0..c5e49c457 100644 --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -80,7 +80,7 @@ typedef gnutls_x509_crt gnutls_x509_crt_t; #endif -typedef struct _tlssockdata +typedef struct TlsSockData { gnutls_session_t state; gnutls_certificate_credentials_t xcred; diff --git a/mx.c b/mx.c index 82f2ff9da..604b432ad 100644 --- a/mx.c +++ b/mx.c @@ -72,7 +72,7 @@ #include "dotlock.h" #endif -struct mx_ops *mx_get_ops(int magic) +struct MxOps *mx_get_ops(int magic) { switch (magic) { diff --git a/mx.h b/mx.h index f2ea8e4c1..1274f8795 100644 --- a/mx.h +++ b/mx.h @@ -37,7 +37,7 @@ struct Message; struct stat; /* - * struct mx_ops - a structure to store operations on a mailbox + * struct MxOps - a structure to store operations on a mailbox * The following operations are mandatory: * - open * - close @@ -46,7 +46,7 @@ struct stat; * Optional operations * - open_new_msg */ -struct mx_ops +struct MxOps { int (*open)(struct Context *ctx); int (*open_append)(struct Context *ctx, int flags); @@ -113,10 +113,10 @@ void mx_update_tables(struct Context *ctx, int committing); int mx_lock_file(const char *path, int fd, int excl, int dot, int timeout); int mx_unlock_file(const char *path, int fd, int dot); -struct mx_ops *mx_get_ops(int magic); -extern struct mx_ops mx_maildir_ops; -extern struct mx_ops mx_mbox_ops; -extern struct mx_ops mx_mh_ops; -extern struct mx_ops mx_mmdf_ops; +struct MxOps *mx_get_ops(int magic); +extern struct MxOps mx_maildir_ops; +extern struct MxOps mx_mbox_ops; +extern struct MxOps mx_mh_ops; +extern struct MxOps mx_mmdf_ops; #endif /* _MUTT_MX_H */ diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 0529f934f..abe2ca567 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -79,14 +79,14 @@ * Type definitions. */ -struct crypt_cache +struct CryptCache { char *what; char *dflt; - struct crypt_cache *next; + struct CryptCache *next; }; -struct dn_array_s +struct DnArrayS { char *key; char *value; @@ -110,7 +110,7 @@ struct CryptEntry struct CryptKeyinfo *key; }; -static struct crypt_cache *id_defaults = NULL; +static struct CryptCache *id_defaults = NULL; static gpgme_key_t signature_key = NULL; static char *current_sender = NULL; @@ -3038,7 +3038,7 @@ static int crypt_compare_trust(const void *a, const void *b) /* Print the X.500 Distinguished Name part KEY from the array of parts DN to FP. */ -static int print_dn_part(FILE *fp, struct dn_array_s *dn, const char *key) +static int print_dn_part(FILE *fp, struct DnArrayS *dn, const char *key) { int any = 0; @@ -3056,7 +3056,7 @@ static int print_dn_part(FILE *fp, struct dn_array_s *dn, const char *key) } /* Print all parts of a DN in a standard sequence. */ -static void print_dn_parts(FILE *fp, struct dn_array_s *dn) +static void print_dn_parts(FILE *fp, struct DnArrayS *dn) { static const char *const stdpart[] = { "CN", "OU", "O", "STREET", "L", "ST", "C", NULL, @@ -3092,7 +3092,7 @@ static void print_dn_parts(FILE *fp, struct dn_array_s *dn) } /* Parse an RDN; this is a helper to parse_dn(). */ -static const char *parse_dn_part(struct dn_array_s *array, const char *string) +static const char *parse_dn_part(struct DnArrayS *array, const char *string) { const char *s = NULL, *s1 = NULL; size_t n; @@ -3180,9 +3180,9 @@ static const char *parse_dn_part(struct dn_array_s *array, const char *string) /* Parse a DN and return an array-ized one. This is not a validating parser and it does not support any old-stylish syntax; gpgme is expected to return only rfc2253 compatible strings. */ -static struct dn_array_s *parse_dn(const char *string) +static struct DnArrayS *parse_dn(const char *string) { - struct dn_array_s *array = NULL; + struct DnArrayS *array = NULL; size_t arrayidx, arraysize; int i; @@ -3197,7 +3197,7 @@ static struct dn_array_s *parse_dn(const char *string) break; /* ready */ if (arrayidx >= arraysize) { /* mutt lacks a real safe_realoc - so we need to copy */ - struct dn_array_s *a2 = NULL; + struct DnArrayS *a2 = NULL; arraysize += 5; a2 = safe_malloc((arraysize + 1) * sizeof(*array)); @@ -3257,7 +3257,7 @@ static void parse_and_print_user_id(FILE *fp, const char *userid) fputs(_("[Can't display this user ID (invalid encoding)]"), fp); else { - struct dn_array_s *dn = parse_dn(userid); + struct DnArrayS *dn = parse_dn(userid); if (!dn) fputs(_("[Can't display this user ID (invalid DN)]"), fp); else @@ -4253,7 +4253,7 @@ static struct CryptKeyinfo *crypt_ask_for_key(char *tag, char *whatfor, short ab { struct CryptKeyinfo *key = NULL; char resp[SHORT_STRING]; - struct crypt_cache *l = NULL; + struct CryptCache *l = NULL; int dummy; if (!forced_valid) @@ -4285,7 +4285,7 @@ static struct CryptKeyinfo *crypt_ask_for_key(char *tag, char *whatfor, short ab mutt_str_replace(&l->dflt, resp); else { - l = safe_malloc(sizeof(struct crypt_cache)); + l = safe_malloc(sizeof(struct CryptCache)); l->next = id_defaults; id_defaults = l; l->what = safe_strdup(whatfor); diff --git a/ncrypt/crypt_mod.h b/ncrypt/crypt_mod.h index d29c622d5..85ec55a60 100644 --- a/ncrypt/crypt_mod.h +++ b/ncrypt/crypt_mod.h @@ -67,7 +67,7 @@ typedef void (*crypt_func_set_sender_t)(const char *sender); /* A structure to keep all crypto module functions together. */ -typedef struct crypt_module_functions +typedef struct CryptModuleFunctions { /* Common/General functions. */ crypt_func_init_t init; @@ -101,7 +101,7 @@ typedef struct crypt_module_functions /* A structure to describe a crypto module. */ -typedef struct crypt_module_specs +typedef struct CryptModuleSpecs { int identifier; /* Identifying bit. */ crypt_module_functions_t functions; diff --git a/ncrypt/crypt_mod_pgp_classic.c b/ncrypt/crypt_mod_pgp_classic.c index ba383eb0f..e749bed6c 100644 --- a/ncrypt/crypt_mod_pgp_classic.c +++ b/ncrypt/crypt_mod_pgp_classic.c @@ -111,7 +111,7 @@ static void crypt_mod_pgp_extract_keys_from_attachment_list(FILE *fp, int tag, s pgp_extract_keys_from_attachment_list(fp, tag, top); } -struct crypt_module_specs crypt_mod_pgp_classic = { +struct CryptModuleSpecs crypt_mod_pgp_classic = { APPLICATION_PGP, { NULL, /* init */ diff --git a/ncrypt/crypt_mod_pgp_gpgme.c b/ncrypt/crypt_mod_pgp_gpgme.c index bff28bac7..e23f479c0 100644 --- a/ncrypt/crypt_mod_pgp_gpgme.c +++ b/ncrypt/crypt_mod_pgp_gpgme.c @@ -108,7 +108,7 @@ static void crypt_mod_pgp_set_sender(const char *sender) mutt_gpgme_set_sender(sender); } -struct crypt_module_specs crypt_mod_pgp_gpgme = { +struct CryptModuleSpecs crypt_mod_pgp_gpgme = { APPLICATION_PGP, { /* Common. */ diff --git a/ncrypt/crypt_mod_smime_classic.c b/ncrypt/crypt_mod_smime_classic.c index 426346863..4e332fe08 100644 --- a/ncrypt/crypt_mod_smime_classic.c +++ b/ncrypt/crypt_mod_smime_classic.c @@ -90,7 +90,7 @@ static void crypt_mod_smime_invoke_import(char *infile, char *mailbox) smime_invoke_import(infile, mailbox); } -struct crypt_module_specs crypt_mod_smime_classic = { +struct CryptModuleSpecs crypt_mod_smime_classic = { APPLICATION_SMIME, { NULL, /* init */ diff --git a/ncrypt/crypt_mod_smime_gpgme.c b/ncrypt/crypt_mod_smime_gpgme.c index 4d1419ac5..a08f8ef07 100644 --- a/ncrypt/crypt_mod_smime_gpgme.c +++ b/ncrypt/crypt_mod_smime_gpgme.c @@ -86,7 +86,7 @@ static int crypt_mod_smime_verify_sender(struct Header *h) return smime_gpgme_verify_sender(h); } -struct crypt_module_specs crypt_mod_smime_gpgme = { +struct CryptModuleSpecs crypt_mod_smime_gpgme = { APPLICATION_SMIME, { crypt_mod_smime_init, diff --git a/ncrypt/cryptglue.c b/ncrypt/cryptglue.c index f48aaaab4..0ee7ae6ee 100644 --- a/ncrypt/cryptglue.c +++ b/ncrypt/cryptglue.c @@ -49,16 +49,16 @@ struct State; */ #ifdef CRYPT_BACKEND_CLASSIC_PGP -extern struct crypt_module_specs crypt_mod_pgp_classic; +extern struct CryptModuleSpecs crypt_mod_pgp_classic; #endif #ifdef CRYPT_BACKEND_CLASSIC_SMIME -extern struct crypt_module_specs crypt_mod_smime_classic; +extern struct CryptModuleSpecs crypt_mod_smime_classic; #endif #ifdef CRYPT_BACKEND_GPGME -extern struct crypt_module_specs crypt_mod_pgp_gpgme; -extern struct crypt_module_specs crypt_mod_smime_gpgme; +extern struct CryptModuleSpecs crypt_mod_pgp_gpgme; +extern struct CryptModuleSpecs crypt_mod_smime_gpgme; #endif void crypt_init(void) diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index 6c7323e96..b23e4f28b 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -43,7 +43,7 @@ * The actual command line formatter. */ -struct pgp_command_context +struct PgpCommandContext { short need_passphrase; /* %p */ const char *fname; /* %f */ @@ -59,7 +59,7 @@ static const char *_mutt_fmt_pgp_command(char *dest, size_t destlen, size_t col, unsigned long data, format_flag flags) { char fmt[16]; - struct pgp_command_context *cctx = (struct pgp_command_context *) data; + struct PgpCommandContext *cctx = (struct PgpCommandContext *) data; int optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) @@ -139,7 +139,7 @@ static const char *_mutt_fmt_pgp_command(char *dest, size_t destlen, size_t col, } static void mutt_pgp_command(char *d, size_t dlen, - struct pgp_command_context *cctx, const char *fmt) + struct PgpCommandContext *cctx, const char *fmt) { mutt_FormatString(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), _mutt_fmt_pgp_command, (unsigned long) cctx, 0); @@ -155,7 +155,7 @@ static pid_t pgp_invoke(FILE **pgpin, FILE **pgpout, FILE **pgperr, int pgpinfd, const char *fname, const char *sig_fname, const char *signas, const char *ids, const char *format) { - struct pgp_command_context cctx; + struct PgpCommandContext cctx; char cmd[HUGE_STRING]; memset(&cctx, 0, sizeof(cctx)); @@ -238,7 +238,7 @@ void pgp_invoke_import(const char *fname) { char _fname[_POSIX_PATH_MAX + SHORT_STRING]; char cmd[HUGE_STRING]; - struct pgp_command_context cctx; + struct PgpCommandContext cctx; memset(&cctx, 0, sizeof(cctx)); @@ -259,7 +259,7 @@ void pgp_invoke_getkeys(struct Address *addr) char *personal = NULL; - struct pgp_command_context cctx; + struct PgpCommandContext cctx; if (!PgpGetkeysCommand) return; diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 967e45372..2ff91a0a4 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -54,14 +54,14 @@ struct List; -struct pgp_cache +struct PgpCache { char *what; char *dflt; - struct pgp_cache *next; + struct PgpCache *next; }; -static struct pgp_cache *id_defaults = NULL; +static struct PgpCache *id_defaults = NULL; static const char trust_flags[] = "?- +"; @@ -652,7 +652,7 @@ struct PgpKeyInfo *pgp_ask_for_key(char *tag, char *whatfor, short abilities, pg { struct PgpKeyInfo *key = NULL; char resp[SHORT_STRING]; - struct pgp_cache *l = NULL; + struct PgpCache *l = NULL; mutt_clear_error(); @@ -679,7 +679,7 @@ struct PgpKeyInfo *pgp_ask_for_key(char *tag, char *whatfor, short abilities, pg mutt_str_replace(&l->dflt, resp); else { - l = safe_malloc(sizeof(struct pgp_cache)); + l = safe_malloc(sizeof(struct PgpCache)); l->next = id_defaults; id_defaults = l; l->what = safe_strdup(whatfor); diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 65b28634a..a5fe65ca9 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -51,7 +51,7 @@ #include "rfc822.h" #include "state.h" -struct smime_command_context +struct SmimeCommandContext { const char *key; /* %k */ const char *cryptalg; /* %a */ @@ -152,7 +152,7 @@ static const char *_mutt_fmt_smime_command(char *dest, size_t destlen, size_t co unsigned long data, format_flag flags) { char fmt[16]; - struct smime_command_context *cctx = (struct smime_command_context *) data; + struct SmimeCommandContext *cctx = (struct SmimeCommandContext *) data; int optional = (flags & MUTT_FORMAT_OPTIONAL); switch (op) @@ -281,7 +281,7 @@ static const char *_mutt_fmt_smime_command(char *dest, size_t destlen, size_t co } static void smime_command(char *d, size_t dlen, - struct smime_command_context *cctx, const char *fmt) + struct SmimeCommandContext *cctx, const char *fmt) { mutt_FormatString(d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), _mutt_fmt_smime_command, (unsigned long) cctx, 0); @@ -294,7 +294,7 @@ static pid_t smime_invoke(FILE **smimein, FILE **smimeout, FILE **smimeerr, const char *digestalg, const char *key, const char *certificates, const char *intermediates, const char *format) { - struct smime_command_context cctx; + struct SmimeCommandContext cctx; char cmd[HUGE_STRING]; memset(&cctx, 0, sizeof(cctx)); diff --git a/nntp.c b/nntp.c index 24826f8ca..2e03d7c16 100644 --- a/nntp.c +++ b/nntp.c @@ -2404,7 +2404,7 @@ int nntp_check_children(struct Context *ctx, const char *msgid) return rc < 0 ? -1 : 0; } -struct mx_ops mx_nntp_ops = { +struct MxOps mx_nntp_ops = { .open = nntp_open_mailbox, .open_append = NULL, .close = nntp_fastclose_mailbox, diff --git a/nntp.h b/nntp.h index 63deab7f2..b23d28432 100644 --- a/nntp.h +++ b/nntp.h @@ -164,6 +164,6 @@ header_cache_t *nntp_hcache_open(struct NntpData *nntp_data); void nntp_hcache_update(struct NntpData *nntp_data, header_cache_t *hc); #endif -extern struct mx_ops mx_nntp_ops; +extern struct MxOps mx_nntp_ops; #endif /* _MUTT_NNTP_H */ diff --git a/pager.c b/pager.c index 1fe91b7de..bd248ba7c 100644 --- a/pager.c +++ b/pager.c @@ -111,33 +111,33 @@ static struct Header *OldHdr = NULL; break; \ } -struct q_class_t +struct QClass { int length; int index; int color; char *prefix; - struct q_class_t *next, *prev; - struct q_class_t *down, *up; + struct QClass *next, *prev; + struct QClass *down, *up; }; -struct syntax_t +struct Syntax { int color; int first; int last; }; -struct line_t +struct Line { LOFF_T offset; short type; short continuation; short chunks; short search_cnt; - struct syntax_t *syntax; - struct syntax_t *search; - struct q_class_t *quote; + struct Syntax *syntax; + struct Syntax *search; + struct QClass *quote; unsigned int is_cont_hdr; /* this line is a continuation of the previous header line */ }; @@ -159,7 +159,7 @@ struct AnsiAttr static short InHelp = 0; #if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM) -static struct resize +static struct Resize { int line; int SearchCompiled; @@ -169,7 +169,7 @@ static struct resize #define NumSigLines 4 -static int check_sig(const char *s, struct line_t *info, int n) +static int check_sig(const char *s, struct Line *info, int n) { int count = 0; @@ -200,7 +200,7 @@ static int check_sig(const char *s, struct line_t *info, int n) return 0; } -static void resolve_color(struct line_t *lineInfo, int n, int cnt, int flags, +static void resolve_color(struct Line *lineInfo, int n, int cnt, int flags, int special, struct AnsiAttr *a) { int def_color; /* color without syntax highlight */ @@ -233,7 +233,7 @@ static void resolve_color(struct line_t *lineInfo, int n, int cnt, int flags, if ((flags & MUTT_SHOWCOLOR) && lineInfo[m].type == MT_COLOR_QUOTED) { - struct q_class_t *class = lineInfo[m].quote; + struct QClass *class = lineInfo[m].quote; if (class) { @@ -333,7 +333,7 @@ static void resolve_color(struct line_t *lineInfo, int n, int cnt, int flags, } } -static void append_line(struct line_t *lineInfo, int n, int cnt) +static void append_line(struct Line *lineInfo, int n, int cnt) { int m; @@ -351,16 +351,16 @@ static void append_line(struct line_t *lineInfo, int n, int cnt) (lineInfo[n].continuation) ? cnt + (lineInfo[n].syntax)[0].last : cnt; } -static void new_class_color(struct q_class_t *class, int *q_level) +static void new_class_color(struct QClass *class, int *q_level) { class->index = (*q_level)++; class->color = ColorQuote[class->index % ColorQuoteUsed]; } -static void shift_class_colors(struct q_class_t *QuoteList, - struct q_class_t *new_class, int index, int *q_level) +static void shift_class_colors(struct QClass *QuoteList, + struct QClass *new_class, int index, int *q_level) { - struct q_class_t *q_list = NULL; + struct QClass *q_list = NULL; q_list = QuoteList; new_class->index = -1; @@ -394,9 +394,9 @@ static void shift_class_colors(struct q_class_t *QuoteList, (*q_level)++; } -static void cleanup_quote(struct q_class_t **QuoteList) +static void cleanup_quote(struct QClass **QuoteList) { - struct q_class_t *ptr = NULL; + struct QClass *ptr = NULL; while (*QuoteList) { @@ -412,11 +412,11 @@ static void cleanup_quote(struct q_class_t **QuoteList) return; } -static struct q_class_t *classify_quote(struct q_class_t **QuoteList, const char *qptr, +static struct QClass *classify_quote(struct QClass **QuoteList, const char *qptr, int length, int *force_redraw, int *q_level) { - struct q_class_t *q_list = *QuoteList; - struct q_class_t *class = NULL, *tmp = NULL, *ptr, *save = NULL; + struct QClass *q_list = *QuoteList; + struct QClass *class = NULL, *tmp = NULL, *ptr, *save = NULL; char *tail_qptr = NULL; int offset, tail_lng; int index = -1; @@ -427,7 +427,7 @@ static struct q_class_t *classify_quote(struct q_class_t **QuoteList, const char if (*QuoteList == NULL) { - class = safe_calloc(1, sizeof(struct q_class_t)); + class = safe_calloc(1, sizeof(struct QClass)); class->color = ColorQuote[0]; *QuoteList = class; } @@ -452,7 +452,7 @@ static struct q_class_t *classify_quote(struct q_class_t **QuoteList, const char if (tmp == NULL) { /* add a node above q_list */ - tmp = safe_calloc(1, sizeof(struct q_class_t)); + tmp = safe_calloc(1, sizeof(struct QClass)); tmp->prefix = safe_calloc(1, length + 1); strncpy(tmp->prefix, qptr, length); tmp->length = length; @@ -562,7 +562,7 @@ static struct q_class_t *classify_quote(struct q_class_t **QuoteList, const char if (tmp == NULL) { /* add a node above q_list */ - tmp = safe_calloc(1, sizeof(struct q_class_t)); + tmp = safe_calloc(1, sizeof(struct QClass)); tmp->prefix = safe_calloc(1, length + 1); strncpy(tmp->prefix, qptr, length); tmp->length = length; @@ -664,7 +664,7 @@ static struct q_class_t *classify_quote(struct q_class_t **QuoteList, const char /* still not found so far: add it as a sibling to the current node */ if (class == NULL) { - tmp = safe_calloc(1, sizeof(struct q_class_t)); + tmp = safe_calloc(1, sizeof(struct QClass)); tmp->prefix = safe_calloc(1, length + 1); strncpy(tmp->prefix, qptr, length); tmp->length = length; @@ -701,7 +701,7 @@ static struct q_class_t *classify_quote(struct q_class_t **QuoteList, const char if (class == NULL) { /* not found so far: add it as a top level class */ - class = safe_calloc(1, sizeof(struct q_class_t)); + class = safe_calloc(1, sizeof(struct QClass)); class->prefix = safe_calloc(1, length + 1); strncpy(class->prefix, qptr, length); class->length = length; @@ -733,8 +733,8 @@ static int check_attachment_marker(char *p) return (int) (*p - *q); } -static void resolve_types(char *buf, char *raw, struct line_t *lineInfo, int n, - int last, struct q_class_t **QuoteList, int *q_level, +static void resolve_types(char *buf, char *raw, struct Line *lineInfo, int n, + int last, struct QClass **QuoteList, int *q_level, int *force_redraw, int q_classify) { struct ColorLine *color_line = NULL; @@ -818,7 +818,7 @@ static void resolve_types(char *buf, char *raw, struct line_t *lineInfo, int n, if (lineInfo[i].chunks) { lineInfo[i].chunks = 0; - safe_realloc(&(lineInfo[n].syntax), sizeof(struct syntax_t)); + safe_realloc(&(lineInfo[n].syntax), sizeof(struct Syntax)); } lineInfo[i++].type = MT_COLOR_SIGNATURE; } @@ -907,7 +907,7 @@ static void resolve_types(char *buf, char *raw, struct line_t *lineInfo, int n, } if (++(lineInfo[n].chunks) > 1) safe_realloc(&(lineInfo[n].syntax), - (lineInfo[n].chunks) * sizeof(struct syntax_t)); + (lineInfo[n].chunks) * sizeof(struct Syntax)); } i = lineInfo[n].chunks - 1; pmatch[0].rm_so += offset; @@ -968,7 +968,7 @@ static void resolve_types(char *buf, char *raw, struct line_t *lineInfo, int n, { if (++(lineInfo[n].chunks) > 1) safe_realloc(&(lineInfo[n].syntax), - (lineInfo[n].chunks) * sizeof(struct syntax_t)); + (lineInfo[n].chunks) * sizeof(struct Syntax)); } i = lineInfo[n].chunks - 1; pmatch[0].rm_so += offset; @@ -1178,7 +1178,7 @@ static int fill_buffer(FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char * return b_read; } -static int format_line(struct line_t **lineInfo, int n, unsigned char *buf, +static int format_line(struct Line **lineInfo, int n, unsigned char *buf, int flags, struct AnsiAttr *pa, int cnt, int *pspace, int *pvch, int *pcol, int *pspecial, struct MuttWindow *pager_window) { @@ -1372,9 +1372,9 @@ static int format_line(struct line_t **lineInfo, int n, unsigned char *buf, * 0 normal exit, line was not displayed * >0 normal exit, line was displayed */ -static int display_line(FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, +static int display_line(FILE *f, LOFF_T *last_pos, struct Line **lineInfo, int n, int *last, int *max, int flags, - struct q_class_t **QuoteList, int *q_level, int *force_redraw, + struct QClass **QuoteList, int *q_level, int *force_redraw, regex_t *SearchRE, struct MuttWindow *pager_window) { unsigned char *buf = NULL, *fmt = NULL; @@ -1398,13 +1398,13 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, if (*last == *max) { - safe_realloc(lineInfo, sizeof(struct line_t) * (*max += LINES)); + safe_realloc(lineInfo, sizeof(struct Line) * (*max += LINES)); for (ch = *last; ch < *max; ch++) { - memset(&((*lineInfo)[ch]), 0, sizeof(struct line_t)); + memset(&((*lineInfo)[ch]), 0, sizeof(struct Line)); (*lineInfo)[ch].type = -1; (*lineInfo)[ch].search_cnt = -1; - (*lineInfo)[ch].syntax = safe_malloc(sizeof(struct syntax_t)); + (*lineInfo)[ch].syntax = safe_malloc(sizeof(struct Syntax)); ((*lineInfo)[ch].syntax)[0].first = ((*lineInfo)[ch].syntax)[0].last = -1; } } @@ -1473,9 +1473,9 @@ static int display_line(FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, { if (++((*lineInfo)[n].search_cnt) > 1) safe_realloc(&((*lineInfo)[n].search), - ((*lineInfo)[n].search_cnt) * sizeof(struct syntax_t)); + ((*lineInfo)[n].search_cnt) * sizeof(struct Syntax)); else - (*lineInfo)[n].search = safe_malloc(sizeof(struct syntax_t)); + (*lineInfo)[n].search = safe_malloc(sizeof(struct Syntax)); pmatch[0].rm_so += offset; pmatch[0].rm_eo += offset; ((*lineInfo)[n].search)[(*lineInfo)[n].search_cnt - 1].first = pmatch[0].rm_so; @@ -1613,7 +1613,7 @@ out: return rc; } -static int up_n_lines(int nlines, struct line_t *info, int cur, int hiding) +static int up_n_lines(int nlines, struct Line *info, int cur, int hiding) { while (cur > 0 && nlines > 0) { @@ -1625,10 +1625,10 @@ static int up_n_lines(int nlines, struct line_t *info, int cur, int hiding) return cur; } -static const struct mapping_t PagerHelp[] = { +static const struct Mapping PagerHelp[] = { { N_("Exit"), OP_EXIT }, { N_("PrevPg"), OP_PREV_PAGE }, { N_("NextPg"), OP_NEXT_PAGE }, { NULL, 0 }, }; -static const struct mapping_t PagerHelpExtra[] = { +static const struct Mapping PagerHelpExtra[] = { { N_("View Attachm."), OP_VIEW_ATTACHMENTS }, { N_("Del"), OP_DELETE }, { N_("Reply"), OP_REPLY }, @@ -1637,7 +1637,7 @@ static const struct mapping_t PagerHelpExtra[] = { }; #ifdef USE_NNTP -static struct mapping_t PagerNewsHelpExtra[] = { +static struct Mapping PagerNewsHelpExtra[] = { { N_("Post"), OP_POST }, { N_("Followup"), OP_FOLLOWUP }, { N_("Del"), OP_DELETE }, @@ -1668,7 +1668,7 @@ struct PagerRedrawData int has_types; int hideQuoted; int q_level; - struct q_class_t *QuoteList; + struct QClass *QuoteList; LOFF_T last_pos; LOFF_T last_offset; struct MuttWindow *index_status_window; @@ -1683,7 +1683,7 @@ struct PagerRedrawData const char *banner; char *helpstr; char *searchbuf; - struct line_t *lineInfo; + struct Line *lineInfo; FILE *fp; struct stat sb; }; @@ -1827,7 +1827,7 @@ static void pager_menu_redraw(struct Menu *pager_menu) rd->lineInfo[i].search_cnt = -1; rd->lineInfo[i].quote = NULL; - safe_realloc(&(rd->lineInfo[i].syntax), sizeof(struct syntax_t)); + safe_realloc(&(rd->lineInfo[i].syntax), sizeof(struct Syntax)); if (rd->SearchCompiled && rd->lineInfo[i].search) FREE(&(rd->lineInfo[i].search)); } @@ -1900,7 +1900,7 @@ static void pager_menu_redraw(struct Menu *pager_menu) if (pager_menu->redraw & REDRAW_STATUS) { - struct hdr_format_info hfi; + struct HdrFormatInfo hfi; char pager_progress_str[4]; hfi.ctx = Context; @@ -2024,13 +2024,13 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e mutt_set_flag(Context, extra->hdr, MUTT_READ, 1); } - rd.lineInfo = safe_malloc(sizeof(struct line_t) * (rd.maxLine = LINES)); + rd.lineInfo = safe_malloc(sizeof(struct Line) * (rd.maxLine = LINES)); for (i = 0; i < rd.maxLine; i++) { - memset(&rd.lineInfo[i], 0, sizeof(struct line_t)); + memset(&rd.lineInfo[i], 0, sizeof(struct Line)); rd.lineInfo[i].type = -1; rd.lineInfo[i].search_cnt = -1; - rd.lineInfo[i].syntax = safe_malloc(sizeof(struct syntax_t)); + rd.lineInfo[i].syntax = safe_malloc(sizeof(struct Syntax)); (rd.lineInfo[i].syntax)[0].first = (rd.lineInfo[i].syntax)[0].last = -1; } @@ -2192,7 +2192,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e if (!rd.lineInfo[i].continuation) rd.lines++; - Resize = safe_malloc(sizeof(struct resize)); + Resize = safe_malloc(sizeof(struct Resize)); Resize->line = rd.lines; Resize->SearchCompiled = rd.SearchCompiled; diff --git a/parse.c b/parse.c index 0c9408f3f..9e40e95b7 100644 --- a/parse.c +++ b/parse.c @@ -693,7 +693,7 @@ static const char *uncomment_timezone(char *buf, size_t buflen, const char *tz) return buf; } -static const struct tz_t +static const struct Tz { char tzname[5]; unsigned char zhours; @@ -849,10 +849,10 @@ time_t mutt_parse_date(const char *s, struct Header *h) } else { - struct tz_t *tz = NULL; + struct Tz *tz = NULL; - tz = bsearch(ptz, TimeZones, sizeof(TimeZones) / sizeof(struct tz_t), - sizeof(struct tz_t), (int (*)(const void *, const void *)) ascii_strcasecmp + tz = bsearch(ptz, TimeZones, sizeof(TimeZones) / sizeof(struct Tz), + sizeof(struct Tz), (int (*)(const void *, const void *)) ascii_strcasecmp /* This is safe to do: A pointer to a struct equals * a pointer to its first element */); diff --git a/pattern.c b/pattern.c index d064f774f..370bb9461 100644 --- a/pattern.c +++ b/pattern.c @@ -214,7 +214,7 @@ static const char *get_date(const char *s, struct tm *t, struct Buffer *err) #define RANGE_RX_GROUPS 5 -struct range_regexp +struct RangeRegex { const char *raw; /* regexp as string */ int lgrp; /* paren group matching the left side */ @@ -234,7 +234,7 @@ enum RANGE_K_INVALID }; -static struct range_regexp range_regexps[] = { +static struct RangeRegex range_regexps[] = { [RANGE_K_REL] = {.raw = RANGE_REL_RX, .lgrp = 1, .rgrp = 3, .ready = 0 }, [RANGE_K_ABS] = {.raw = RANGE_ABS_RX, .lgrp = 1, .rgrp = 3, .ready = 0 }, [RANGE_K_LT] = {.raw = RANGE_LT_RX, .lgrp = 1, .rgrp = 2, .ready = 0 }, @@ -711,7 +711,7 @@ static int eat_range_by_regexp(struct Pattern *pat, struct Buffer *s, int kind, { int regerr; regmatch_t pmatch[RANGE_RX_GROUPS]; - struct range_regexp *pspec = &range_regexps[kind]; + struct RangeRegex *pspec = &range_regexps[kind]; /* First time through, compile the big regexp */ if (!pspec->ready) @@ -798,7 +798,7 @@ static bool eat_message_range(struct Pattern *pat, struct Buffer *s, struct Buff return false; } -static const struct pattern_flags +static const struct PatternFlags { int tag; /* character used to represent this op */ int op; /* operation to perform */ @@ -1049,7 +1049,7 @@ static int msg_search(struct Context *ctx, struct Pattern *pat, int msgno) return match; } -static const struct pattern_flags *lookup_tag(char tag) +static const struct PatternFlags *lookup_tag(char tag) { int i; @@ -1112,7 +1112,7 @@ struct Pattern *mutt_pattern_comp(/* const */ char *s, int flags, struct Buffer bool or = false; bool implicit = true; /* used to detect logical AND operator */ bool isalias = false; - const struct pattern_flags *entry = NULL; + const struct PatternFlags *entry = NULL; char *p = NULL; char *buf = NULL; struct Buffer ps; diff --git a/pgppubring.c b/pgppubring.c index 9a5ef19e3..abf306141 100644 --- a/pgppubring.c +++ b/pgppubring.c @@ -196,7 +196,7 @@ static bool pgpring_string_matches_hint(const char *s, const char *hints[], int /* The actual key ring parser */ static void pgp_make_pgp2_fingerprint(unsigned char *buff, unsigned char *digest) { - struct md5_ctx ctx; + struct Md5Ctx ctx; unsigned int size = 0; md5_init_ctx(&ctx); diff --git a/pop.c b/pop.c index 648018e25..d4cf6196a 100644 --- a/pop.c +++ b/pop.c @@ -949,7 +949,7 @@ fail: FREE(&pop_data); } -struct mx_ops mx_pop_ops = { +struct MxOps mx_pop_ops = { .open = pop_open_mailbox, .open_append = NULL, .close = pop_close_mailbox, diff --git a/pop.h b/pop.h index d25235a21..1faddffad 100644 --- a/pop.h +++ b/pop.h @@ -108,6 +108,6 @@ void pop_logout(struct Context *ctx); /* pop.c */ void pop_fetch_mail(void); -extern struct mx_ops mx_pop_ops; +extern struct MxOps mx_pop_ops; #endif /* _MUTT_POP_H */ diff --git a/pop_auth.c b/pop_auth.c index afe8902bc..3fcf751c7 100644 --- a/pop_auth.c +++ b/pop_auth.c @@ -203,7 +203,7 @@ void pop_apop_timestamp(struct PopData *pop_data, char *buf) /* APOP authenticator */ static pop_auth_res_t pop_auth_apop(struct PopData *pop_data, const char *method) { - struct md5_ctx ctx; + struct Md5Ctx ctx; unsigned char digest[16]; char hash[33]; char buf[LONG_STRING]; diff --git a/postpone.c b/postpone.c index 1f28dfda3..5f65a53c9 100644 --- a/postpone.c +++ b/postpone.c @@ -51,7 +51,7 @@ #include "imap/imap.h" #endif -static const struct mapping_t PostponeHelp[] = { +static const struct Mapping PostponeHelp[] = { { N_("Exit"), OP_EXIT }, { N_("Del"), OP_DELETE }, { N_("Undel"), OP_UNDELETE }, diff --git a/protos.h b/protos.h index 0f6144b50..72f273440 100644 --- a/protos.h +++ b/protos.h @@ -54,7 +54,7 @@ struct passwd; void _mutt_make_string(char *dest, size_t destlen, const char *s, struct Context *ctx, struct Header *hdr, format_flag flags); -struct hdr_format_info +struct HdrFormatInfo { struct Context *ctx; struct Header *hdr; @@ -67,7 +67,7 @@ typedef enum { } XDGType; void mutt_make_string_info(char *dst, size_t dstlen, int cols, const char *s, - struct hdr_format_info *hfi, format_flag flags); + struct HdrFormatInfo *hfi, format_flag flags); void mutt_free_opts(void); diff --git a/query.c b/query.c index c71afa13c..5aabcc328 100644 --- a/query.c +++ b/query.c @@ -56,7 +56,7 @@ struct Entry struct Query *data; }; -static const struct mapping_t QueryHelp[] = { +static const struct Mapping QueryHelp[] = { { N_("Exit"), OP_EXIT }, { N_("Mail"), OP_MAIL }, { N_("New Query"), OP_QUERY }, diff --git a/recvattach.c b/recvattach.c index bda25facd..bd3812c79 100644 --- a/recvattach.c +++ b/recvattach.c @@ -59,7 +59,7 @@ static const char *Mailbox_is_read_only = N_("Mailbox is read-only."); break; \ } -static const struct mapping_t AttachHelp[] = { +static const struct Mapping AttachHelp[] = { { N_("Exit"), OP_EXIT }, { N_("Save"), OP_SAVE }, { N_("Pipe"), OP_PIPE }, { N_("Print"), OP_PRINT }, { N_("Help"), OP_HELP }, { NULL, 0 }, }; diff --git a/remailer.c b/remailer.c index c14793157..a9dda8c4c 100644 --- a/remailer.c +++ b/remailer.c @@ -45,7 +45,7 @@ #include "protos.h" #include "rfc822.h" -struct coord +struct Coord { short r, c; }; @@ -210,16 +210,16 @@ static void mix_free_type2_list(struct Remailer ***ttlp) #define MIX_MAXROW (MuttIndexWindow->rows - 1) -static void mix_screen_coordinates(struct Remailer **type2_list, struct coord **coordsp, +static void mix_screen_coordinates(struct Remailer **type2_list, struct Coord **coordsp, struct MixChain *chain, int i) { short c, r, oc; - struct coord *coords = NULL; + struct Coord *coords = NULL; if (!chain->cl) return; - safe_realloc(coordsp, sizeof(struct coord) * chain->cl); + safe_realloc(coordsp, sizeof(struct Coord) * chain->cl); coords = *coordsp; @@ -251,7 +251,7 @@ static void mix_screen_coordinates(struct Remailer **type2_list, struct coord ** } } -static void mix_redraw_ce(struct Remailer **type2_list, struct coord *coords, +static void mix_redraw_ce(struct Remailer **type2_list, struct Coord *coords, struct MixChain *chain, int i, short selected) { if (!coords || !chain) @@ -273,7 +273,7 @@ static void mix_redraw_ce(struct Remailer **type2_list, struct coord *coords, } } -static void mix_redraw_chain(struct Remailer **type2_list, struct coord *coords, +static void mix_redraw_chain(struct Remailer **type2_list, struct Coord *coords, struct MixChain *chain, int cur) { int i; @@ -441,7 +441,7 @@ static int mix_chain_add(struct MixChain *chain, const char *s, struct Remailer return 0; } -static const struct mapping_t RemailerHelp[] = { +static const struct Mapping RemailerHelp[] = { { N_("Append"), OP_MIX_APPEND }, { N_("Insert"), OP_MIX_INSERT }, { N_("Delete"), OP_MIX_DELETE }, { N_("Abort"), OP_EXIT }, { N_("OK"), OP_MIX_USE }, { NULL, 0 }, @@ -458,7 +458,7 @@ void mix_make_chain(struct List **chainp) struct Remailer **type2_list = NULL; size_t ttll = 0; - struct coord *coords = NULL; + struct Coord *coords = NULL; struct Menu *menu = NULL; char helpstr[LONG_STRING]; diff --git a/rfc2231.c b/rfc2231.c index 13cc3f54e..f1369c2f1 100644 --- a/rfc2231.c +++ b/rfc2231.c @@ -41,13 +41,13 @@ #include "protos.h" #include "rfc2047.h" -struct rfc2231_parameter +struct Rfc2231Parameter { char *attribute; char *value; int index; int encoded; - struct rfc2231_parameter *next; + struct Rfc2231Parameter *next; }; static void purge_empty_parameters(struct Parameter **headp) @@ -107,9 +107,9 @@ static void rfc2231_decode_one(char *dest, char *src) *d = '\0'; } -static struct rfc2231_parameter *rfc2231_new_parameter(void) +static struct Rfc2231Parameter *rfc2231_new_parameter(void) { - return safe_calloc(sizeof(struct rfc2231_parameter), 1); + return safe_calloc(sizeof(struct Rfc2231Parameter), 1); } /* insert parameter into an ordered list. @@ -117,10 +117,10 @@ static struct rfc2231_parameter *rfc2231_new_parameter(void) * Primary sorting key: attribute * Secondary sorting key: index */ -static void rfc2231_list_insert(struct rfc2231_parameter **list, struct rfc2231_parameter *par) +static void rfc2231_list_insert(struct Rfc2231Parameter **list, struct Rfc2231Parameter *par) { - struct rfc2231_parameter **last = list; - struct rfc2231_parameter *p = *list; + struct Rfc2231Parameter **last = list; + struct Rfc2231Parameter *p = *list; int c; while (p) @@ -137,7 +137,7 @@ static void rfc2231_list_insert(struct rfc2231_parameter **list, struct rfc2231_ *last = par; } -static void rfc2231_free_parameter(struct rfc2231_parameter **p) +static void rfc2231_free_parameter(struct Rfc2231Parameter **p) { if (*p) { @@ -148,9 +148,9 @@ static void rfc2231_free_parameter(struct rfc2231_parameter **p) } /* process continuation parameters */ -static void rfc2231_join_continuations(struct Parameter **head, struct rfc2231_parameter *par) +static void rfc2231_join_continuations(struct Parameter **head, struct Rfc2231Parameter *par) { - struct rfc2231_parameter *q = NULL; + struct Rfc2231Parameter *q = NULL; char attribute[STRING]; char charset[STRING]; @@ -204,8 +204,8 @@ void rfc2231_decode_parameters(struct Parameter **headp) struct Parameter **last; struct Parameter *p = NULL, *q = NULL; - struct rfc2231_parameter *conthead = NULL; - struct rfc2231_parameter *conttmp = NULL; + struct Rfc2231Parameter *conthead = NULL; + struct Rfc2231Parameter *conttmp = NULL; char *s = NULL, *t = NULL; char charset[STRING]; diff --git a/sendlib.c b/sendlib.c index 4664e139e..f3f64d9c7 100644 --- a/sendlib.c +++ b/sendlib.c @@ -217,14 +217,14 @@ static void encode_quoted(FGETCONV *fc, FILE *fout, int istext) } } -struct b64_context +struct B64Context { char buffer[3]; short size; short linelen; }; -static int b64_init(struct b64_context *ctx) +static int b64_init(struct B64Context *ctx) { memset(ctx->buffer, '\0', sizeof(ctx->buffer)); ctx->size = 0; @@ -233,7 +233,7 @@ static int b64_init(struct b64_context *ctx) return 0; } -static void b64_flush(struct b64_context *ctx, FILE *fout) +static void b64_flush(struct B64Context *ctx, FILE *fout) { /* for some reasons, mutt_to_base64 expects the * output buffer to be larger than 10B */ @@ -263,7 +263,7 @@ static void b64_flush(struct b64_context *ctx, FILE *fout) } -static void b64_putc(struct b64_context *ctx, char c, FILE *fout) +static void b64_putc(struct B64Context *ctx, char c, FILE *fout) { if (ctx->size == 3) b64_flush(ctx, fout); @@ -274,7 +274,7 @@ static void b64_putc(struct b64_context *ctx, char c, FILE *fout) static void encode_base64(FGETCONV *fc, FILE *fout, int istext) { - struct b64_context ctx; + struct B64Context ctx; int ch, ch1 = EOF; b64_init(&ctx); diff --git a/sort.h b/sort.h index a08fcebf0..c0c68ee17 100644 --- a/sort.h +++ b/sort.h @@ -77,7 +77,7 @@ WHERE short SidebarSortMethod INITVAL(SORT_ORDER); /* FIXME: This one does not belong to here */ WHERE short PgpSortKeys INITVAL(SORT_ADDRESS); -extern const struct mapping_t SortMethods[]; +extern const struct Mapping SortMethods[]; const char *mutt_get_name(struct Address *a); diff --git a/thread.c b/thread.c index 5a0935a74..2de82ad41 100644 --- a/thread.c +++ b/thread.c @@ -421,7 +421,7 @@ static struct List *make_subject_list(struct MuttThread *cur, time_t *dateptr) */ static struct MuttThread *find_subject(struct Context *ctx, struct MuttThread *cur) { - struct hash_elem *ptr = NULL; + struct HashElem *ptr = NULL; struct MuttThread *tmp = NULL, *last = NULL; struct List *subjects = NULL, *oldlist = NULL; time_t date = 0; diff --git a/url.c b/url.c index 55216f925..7c91c9b12 100644 --- a/url.c +++ b/url.c @@ -35,7 +35,7 @@ #include "rfc2047.h" #include "rfc822.h" -static const struct mapping_t UrlMap[] = { +static const struct Mapping UrlMap[] = { { "file", U_FILE }, { "imap", U_IMAP }, { "imaps", U_IMAPS }, { "pop", U_POP }, { "pops", U_POPS }, { "news", U_NNTP }, { "snews", U_NNTPS }, { "mailto", U_MAILTO }, diff --git a/version.c b/version.c index 1984a4340..ecf658d28 100644 --- a/version.c +++ b/version.c @@ -88,14 +88,14 @@ static const char *Notice = "Mutt is free software, and you are welcome to redistribute it\n" "under certain conditions; type `mutt -vv' for details.\n"); -struct compile_options +struct CompileOptions { const char *name; bool enabled; }; /* These are sorted by the display string */ -static struct compile_options comp_opts[] = { +static struct CompileOptions comp_opts[] = { { "attach_headers_color", 1 }, #ifdef HAVE_BKGDSET { "bkgdset", 1 }, @@ -465,7 +465,7 @@ void print_copyright(void) * * Many of the larger features of mutt can be disabled at compile time. * They define a symbol and use #ifdef's around their code. - * The symbols are mirrored in "struct compile_options comp_opts[]" in this + * The symbols are mirrored in "CompileOptions comp_opts[]" in this * file. * * This function checks if one of these symbols is present in the code. -- 2.40.0