Local variable names should be lower case (with optional underscores).
struct BrowserState state;
struct Menu *menu = NULL;
struct stat st;
- int i, killPrefix = 0;
+ int i, kill_prefix = 0;
int multiple = (flags & MUTT_SEL_MULTI) ? 1 : 0;
int folder = (flags & MUTT_SEL_FOLDER) ? 1 : 0;
int buffy = (flags & MUTT_SEL_BUFFY) ? 1 : 0;
mutt_str_strfcpy(prefix, f, sizeof(prefix));
else
mutt_str_strfcpy(prefix, f + i + 1, sizeof(prefix));
- killPrefix = 1;
+ kill_prefix = 1;
#ifdef USE_IMAP
}
#endif
}
destroy_state(&state);
- if (killPrefix)
+ if (kill_prefix)
{
prefix[0] = 0;
- killPrefix = 0;
+ kill_prefix = 0;
}
buffy = 0;
#ifdef USE_IMAP
mutt_error(_("Error scanning directory."));
goto bail;
}
- killPrefix = 0;
+ kill_prefix = 0;
if (!state.entrylen)
{
mutt_error(_("No files match the file mask"));
}
destroy_state(&state);
prefix[0] = 0;
- killPrefix = 0;
+ kill_prefix = 0;
if (buffy)
{
int r = -1; /* return value */
int op = 0;
int loop = 1;
- int fccSet = 0; /* has the user edited the Fcc: field ? */
+ int fcc_set = 0; /* has the user edited the Fcc: field ? */
struct Context *ctx = NULL, *this = NULL;
/* Sort, SortAux could be changed in mutt_index_menu() */
- int oldSort, oldSortAux;
+ int old_sort, old_sort_aux;
struct stat st;
struct ComposeRedrawData rd;
#ifdef USE_NNTP
mutt_pretty_mailbox(fcc, fcclen);
mutt_window_move(MuttIndexWindow, HDR_FCC, HDR_XOFFSET);
mutt_paddstr(W, fcc);
- fccSet = 1;
+ fcc_set = 1;
}
mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
break;
}
this = Context; /* remember current folder and sort methods */
- oldSort = Sort;
- oldSortAux = SortAux;
+ old_sort = Sort;
+ old_sort_aux = SortAux;
Context = ctx;
set_option(OPT_ATTACH_MSG);
/* go back to the folder we started from */
Context = this;
/* Restore old $sort and $sort_aux */
- Sort = oldSort;
- SortAux = oldSortAux;
+ Sort = old_sort;
+ SortAux = old_sort_aux;
menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
break;
}
/* go back to the folder we started from */
Context = this;
/* Restore old $sort and $sort_aux */
- Sort = oldSort;
- SortAux = oldSortAux;
+ Sort = old_sort;
+ SortAux = old_sort_aux;
}
mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
break;
break;
#endif
- if (!fccSet && *fcc)
+ if (!fcc_set && *fcc)
{
if ((i = query_quadoption(OPT_COPY,
_("Save a copy of this message?"))) == MUTT_ABORT)
static int run_decode_and_handler(struct Body *b, struct State *s,
handler_t handler, int plaintext)
{
- int origType;
- char *savePrefix = NULL;
+ int orig_type;
+ char *save_prefix = NULL;
FILE *fp = NULL;
#ifndef USE_FMEMOPEN
char tempfile[_POSIX_PATH_MAX];
* with 8bit encoding.
*/
{
- origType = b->type;
+ orig_type = b->type;
if (!plaintext)
{
/* if we are decoding binary bodies, we don't want to prefix each
* line with the prefix or else the data will get corrupted.
*/
- savePrefix = s->prefix;
+ save_prefix = s->prefix;
s->prefix = NULL;
decode = 1;
unlink(tempfile);
#endif
/* restore the prefix */
- s->prefix = savePrefix;
+ s->prefix = save_prefix;
}
- b->type = origType;
+ b->type = orig_type;
}
/* process the (decoded) body part */
char tmp[_POSIX_PATH_MAX];
struct Address *adr = NULL;
struct Envelope *env = hdr->env;
- bool fromMe = mutt_addr_is_user(env->from);
+ bool from_me = mutt_addr_is_user(env->from);
- if (!fromMe && env->reply_to && env->reply_to->mailbox)
+ if (!from_me && env->reply_to && env->reply_to->mailbox)
adr = env->reply_to;
- else if (!fromMe && env->from && env->from->mailbox)
+ else if (!from_me && env->from && env->from->mailbox)
adr = env->from;
else if (env->to && env->to->mailbox)
adr = env->to;
*/
static int parse_keycode(const char *s)
{
- char *endChar = NULL;
- long int result = strtol(s + 1, &endChar, 8);
+ char *end_char = NULL;
+ long int result = strtol(s + 1, &end_char, 8);
/* allow trailing whitespace, eg. < 1001 > */
- while (ISSPACE(*endChar))
- endChar++;
+ while (ISSPACE(*end_char))
+ end_char++;
/* negative keycodes don't make sense, also detect overflow */
- if (*endChar != '>' || result < 0 || result == LONG_MAX)
+ if (*end_char != '>' || result < 0 || result == LONG_MAX)
{
return -1;
}
{
char folder[_POSIX_PATH_MAX] = "";
char *subject = NULL;
- char *includeFile = NULL;
- char *draftFile = NULL;
- char *newMagic = NULL;
+ char *include_file = NULL;
+ char *draft_file = NULL;
+ char *new_magic = NULL;
struct Header *msg = NULL;
struct ListHead attach = STAILQ_HEAD_INITIALIZER(attach);
struct ListHead commands = STAILQ_HEAD_INITIALIZER(commands);
break;
case 'H':
- draftFile = optarg;
+ draft_file = optarg;
break;
case 'i':
- includeFile = optarg;
+ include_file = optarg;
break;
case 'l':
case 'm':
/* should take precedence over .neomuttrc setting, so save it for later */
- newMagic = optarg;
+ new_magic = optarg;
break;
case 'n':
/* Initialize crypto backends. */
crypt_init();
- if (newMagic)
- mx_set_magic(newMagic);
+ if (new_magic)
+ mx_set_magic(new_magic);
if (!STAILQ_EMPTY(&queries))
{
mutt_free_windows();
mutt_endwin(NULL);
}
- else if (subject || msg || sendflags || draftFile || includeFile ||
+ else if (subject || msg || sendflags || draft_file || include_file ||
!STAILQ_EMPTY(&attach) || optind < argc)
{
FILE *fin = NULL;
msg->env->to = mutt_addr_parse_list(msg->env->to, argv[i]);
}
- if (!draftFile && option(OPT_AUTOEDIT) && !msg->env->to && !msg->env->cc)
+ if (!draft_file && option(OPT_AUTOEDIT) && !msg->env->to && !msg->env->cc)
{
if (!option(OPT_NO_CURSES))
mutt_endwin(NULL);
if (subject)
msg->env->subject = mutt_str_strdup(subject);
- if (draftFile)
+ if (draft_file)
{
- infile = draftFile;
- includeFile = NULL;
+ infile = draft_file;
+ include_file = NULL;
}
- else if (includeFile)
- infile = includeFile;
+ else if (include_file)
+ infile = include_file;
else
edit_infile = false;
}
/* Copy input to a tempfile, and re-point fin to the tempfile.
- * Note: stdin is always copied to a tempfile, ensuring draftFile
+ * Note: stdin is always copied to a tempfile, ensuring draft_file
* can stat and get the correct st_size below.
*/
if (!edit_infile)
}
}
/* If editing the infile, keep it around afterwards so
- * it doesn't get unlinked, and we can rebuild the draftFile
+ * it doesn't get unlinked, and we can rebuild the draft_file
*/
else
sendflags |= SENDNOFREEHEADER;
- /* Parse the draftFile into the full Header/Body structure.
+ /* Parse the draft_file into the full Header/Body structure.
* Set SENDDRAFTFILE so ci_send_message doesn't overwrite
* our msg->content.
*/
- if (draftFile)
+ if (draft_file)
{
struct Header *context_hdr = NULL;
struct Envelope *opts_env = msg->env;
context_hdr->content = mutt_new_body();
if (fstat(fileno(fin), &st))
{
- perror(draftFile);
+ perror(draft_file);
exit(1);
}
context_hdr->content->length = st.st_size;
mutt_env_free(&opts_env);
mutt_free_header(&context_hdr);
}
- /* Editing the includeFile: pass it directly in.
+ /* Editing the include_file: pass it directly in.
* Note that SENDNOFREEHEADER is set above so it isn't unlinked.
*/
else if (edit_infile)
bodyfile = expanded_infile;
- /* For bodytext and unedited includeFile: use the tempfile.
+ /* For bodytext and unedited include_file: use the tempfile.
*/
else
bodyfile = tempfile;
if (edit_infile)
{
- if (includeFile)
+ if (include_file)
msg->content->unlink = false;
- else if (draftFile)
+ else if (draft_file)
{
if (truncate(expanded_infile, 0) == -1)
{
mutt_free_header(&msg);
}
- /* !edit_infile && draftFile will leave the tempfile around */
+ /* !edit_infile && draft_file will leave the tempfile around */
if (tempfile)
{
unlink(tempfile);
int first = -1; /* first message to be written */
LOFF_T offset; /* location in mailbox to write changed messages */
struct stat statbuf;
- struct MUpdate *newOffset = NULL;
- struct MUpdate *oldOffset = NULL;
+ struct MUpdate *new_offset = NULL;
+ struct MUpdate *old_offset = NULL;
FILE *fp = NULL;
struct Progress progress;
char msgbuf[STRING];
offset -= (sizeof(MMDF_SEP) - 1);
/* allocate space for the new offsets */
- newOffset = mutt_mem_calloc(ctx->msgcount - first, sizeof(struct MUpdate));
- oldOffset = mutt_mem_calloc(ctx->msgcount - first, sizeof(struct MUpdate));
+ new_offset = mutt_mem_calloc(ctx->msgcount - first, sizeof(struct MUpdate));
+ old_offset = mutt_mem_calloc(ctx->msgcount - first, sizeof(struct MUpdate));
if (!ctx->quiet)
{
* something fails.
*/
- oldOffset[i - first].valid = 1;
- oldOffset[i - first].hdr = ctx->hdrs[i]->offset;
- oldOffset[i - first].body = ctx->hdrs[i]->content->offset;
- oldOffset[i - first].lines = ctx->hdrs[i]->lines;
- oldOffset[i - first].length = ctx->hdrs[i]->content->length;
+ old_offset[i - first].valid = 1;
+ old_offset[i - first].hdr = ctx->hdrs[i]->offset;
+ old_offset[i - first].body = ctx->hdrs[i]->content->offset;
+ old_offset[i - first].lines = ctx->hdrs[i]->lines;
+ old_offset[i - first].length = ctx->hdrs[i]->content->length;
if (!ctx->hdrs[i]->deleted)
{
* temporary file only contains saved message which are located after
* `offset' in the real mailbox
*/
- newOffset[i - first].hdr = ftello(fp) + offset;
+ new_offset[i - first].hdr = ftello(fp) + offset;
if (mutt_copy_message_ctx(fp, ctx, ctx->hdrs[i], MUTT_CM_UPDATE,
CH_FROM | CH_UPDATE | CH_UPDATE_LEN) != 0)
* we just flush the in memory cache so that the message will be reparsed
* if the user accesses it later.
*/
- newOffset[i - first].body = ftello(fp) - ctx->hdrs[i]->content->length + offset;
+ new_offset[i - first].body = ftello(fp) - ctx->hdrs[i]->content->length + offset;
mutt_free_body(&ctx->hdrs[i]->content->parts);
switch (ctx->magic)
mutt_debug(1, "unable to reopen temp copy of mailbox!\n");
mutt_perror(tempfile);
mutt_sleep(5);
- FREE(&newOffset);
- FREE(&oldOffset);
+ FREE(&new_offset);
+ FREE(&old_offset);
return -1;
}
mutt_pretty_mailbox(savefile, sizeof(savefile));
mutt_error(_("Write failed! Saved partial mailbox to %s"), savefile);
mutt_sleep(5);
- FREE(&newOffset);
- FREE(&oldOffset);
+ FREE(&new_offset);
+ FREE(&old_offset);
return -1;
}
mutt_sig_unblock();
mx_fastclose_mailbox(ctx);
mutt_error(_("Fatal error! Could not reopen mailbox!"));
- FREE(&newOffset);
- FREE(&oldOffset);
+ FREE(&new_offset);
+ FREE(&old_offset);
return -1;
}
{
if (!ctx->hdrs[i]->deleted)
{
- ctx->hdrs[i]->offset = newOffset[i - first].hdr;
- ctx->hdrs[i]->content->hdr_offset = newOffset[i - first].hdr;
- ctx->hdrs[i]->content->offset = newOffset[i - first].body;
+ ctx->hdrs[i]->offset = new_offset[i - first].hdr;
+ ctx->hdrs[i]->content->hdr_offset = new_offset[i - first].hdr;
+ ctx->hdrs[i]->content->offset = new_offset[i - first].body;
ctx->hdrs[i]->index = j++;
}
}
- FREE(&newOffset);
- FREE(&oldOffset);
+ FREE(&new_offset);
+ FREE(&old_offset);
unlink(tempfile); /* remove partial copy of the mailbox */
mutt_sig_unblock();
mutt_file_fclose(&fp);
/* restore offsets, as far as they are valid */
- if (first >= 0 && oldOffset)
+ if (first >= 0 && old_offset)
{
- for (i = first; i < ctx->msgcount && oldOffset[i - first].valid; i++)
+ for (i = first; i < ctx->msgcount && old_offset[i - first].valid; i++)
{
- ctx->hdrs[i]->offset = oldOffset[i - first].hdr;
- ctx->hdrs[i]->content->hdr_offset = oldOffset[i - first].hdr;
- ctx->hdrs[i]->content->offset = oldOffset[i - first].body;
- ctx->hdrs[i]->lines = oldOffset[i - first].lines;
- ctx->hdrs[i]->content->length = oldOffset[i - first].length;
+ ctx->hdrs[i]->offset = old_offset[i - first].hdr;
+ ctx->hdrs[i]->content->hdr_offset = old_offset[i - first].hdr;
+ ctx->hdrs[i]->content->offset = old_offset[i - first].body;
+ ctx->hdrs[i]->lines = old_offset[i - first].lines;
+ ctx->hdrs[i]->content->length = old_offset[i - first].length;
}
}
mbox_unlock_mailbox(ctx);
mutt_sig_unblock();
- FREE(&newOffset);
- FREE(&oldOffset);
+ FREE(&new_offset);
+ FREE(&old_offset);
ctx->fp = freopen(ctx->path, "r", ctx->fp);
if (!ctx->fp)
int search_dir;
regex_t re;
char buf[SHORT_STRING];
- char *searchBuf =
+ char *search_buf =
menu->menu >= 0 && menu->menu < MENU_MAX ? SearchBuffers[menu->menu] : NULL;
- if (!(searchBuf && *searchBuf) || (op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE))
+ if (!(search_buf && *search_buf) || (op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE))
{
- mutt_str_strfcpy(buf, searchBuf && *searchBuf ? searchBuf : "", sizeof(buf));
+ mutt_str_strfcpy(buf, search_buf && *search_buf ? search_buf : "", sizeof(buf));
if (mutt_get_field((op == OP_SEARCH || op == OP_SEARCH_NEXT) ?
_("Search for: ") :
_("Reverse search for: "),
if (menu->menu >= 0 && menu->menu < MENU_MAX)
{
mutt_str_replace(&SearchBuffers[menu->menu], buf);
- searchBuf = SearchBuffers[menu->menu];
+ search_buf = SearchBuffers[menu->menu];
}
menu->search_dir =
(op == OP_SEARCH || op == OP_SEARCH_NEXT) ? MUTT_SEARCH_DOWN : MUTT_SEARCH_UP;
if (op == OP_SEARCH_OPPOSITE)
search_dir = -search_dir;
- if (searchBuf)
- r = REGCOMP(&re, searchBuf, REG_NOSUB | mutt_which_case(searchBuf));
+ if (search_buf)
+ r = REGCOMP(&re, search_buf, REG_NOSUB | mutt_which_case(search_buf));
if (r != 0)
{
static const char DaysPerMonth[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
};
- int nLeap;
+ int leap;
while (tm->tm_sec < 0)
{
}
tm->tm_mday += DaysPerMonth[tm->tm_mon] + is_leap_year_feb(tm);
}
- while (tm->tm_mday > (DaysPerMonth[tm->tm_mon] + (nLeap = is_leap_year_feb(tm))))
+ while (tm->tm_mday > (DaysPerMonth[tm->tm_mon] + (leap = is_leap_year_feb(tm))))
{
- tm->tm_mday -= DaysPerMonth[tm->tm_mon] + nLeap;
+ tm->tm_mday -= DaysPerMonth[tm->tm_mon] + leap;
if (tm->tm_mon < 11)
tm->tm_mon++;
else
{
int i, move_messages = 0, purge = 1, read_msgs = 0;
int check;
- int isSpool = 0;
+ int is_spool = 0;
struct Context f;
char mbox[_POSIX_PATH_MAX];
char buf[SHORT_STRING];
if ((p = mutt_find_hook(MUTT_MBOXHOOK, ctx->path)))
{
- isSpool = 1;
+ is_spool = 1;
mutt_str_strfcpy(mbox, p, sizeof(mbox));
}
else
{
mutt_str_strfcpy(mbox, NONULL(Mbox), sizeof(mbox));
- isSpool = mutt_is_spool(ctx->path) && !mutt_is_spool(mbox);
+ is_spool = mutt_is_spool(ctx->path) && !mutt_is_spool(mbox);
}
- if (isSpool && *mbox)
+ if (is_spool && *mbox)
{
mutt_expand_path(mbox, sizeof(mbox));
snprintf(buf, sizeof(buf), _("Move %d read messages to %s?"), read_msgs, mbox);
size_t n;
char *p = NULL;
- /* parse attributeType */
+ /* parse attribute type */
for (s = string + 1; *s && *s != '='; s++)
;
if (!*s)
LOFF_T tmpoffset = 0;
size_t tmplength = 0;
- int origType = sigbdy->type;
- char *savePrefix = NULL;
+ int orig_type = sigbdy->type;
+ char *save_prefix = NULL;
snprintf(signedfile, sizeof(signedfile), "%s.sig", tempfile);
/* if we are decoding binary bodies, we don't want to prefix each
* line with the prefix or else the data will get corrupted.
*/
- savePrefix = s->prefix;
+ save_prefix = s->prefix;
s->prefix = NULL;
mutt_decode_attachment(sigbdy, s);
s->fpin = fopen(signedfile, "r");
/* restore the prefix */
- s->prefix = savePrefix;
+ s->prefix = save_prefix;
- sigbdy->type = origType;
+ sigbdy->type = orig_type;
mutt_mktemp(smimeerrfile, sizeof(smimeerrfile));
smimeerr = mutt_file_fopen(smimeerrfile, "w+");
*
* This can either be a signed or an encrypted message.
*/
-static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *outFile)
+static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *out_file)
{
int len = 0;
int c;
fflush(smimeout);
rewind(smimeout);
- if (outFile)
- fpout = outFile;
+ if (out_file)
+ fpout = out_file;
else
{
mutt_mktemp(tmptmpfname, sizeof(tmptmpfname));
smimeout = NULL;
mutt_file_unlink(outfile);
- if (!outFile)
+ if (!out_file)
{
mutt_file_fclose(&fpout);
mutt_file_unlink(tmptmpfname);
struct State s;
LOFF_T tmpoffset = b->offset;
size_t tmplength = b->length;
- int origType = b->type;
+ int orig_type = b->type;
FILE *tmpfp = NULL;
int rc = 0;
(*cur)->badsig = b->badsig;
bail:
- b->type = origType;
+ b->type = orig_type;
b->length = tmplength;
b->offset = tmpoffset;
mutt_file_fclose(&tmpfp);
return class;
}
-static int brailleLine = -1;
-static int brailleCol = -1;
+static int braille_line = -1;
+static int braille_col = -1;
static int check_attachment_marker(char *p)
{
if (buf[0] == '\n') /* end of header */
{
line_info[n].type = MT_COLOR_NORMAL;
- getyx(stdscr, brailleLine, brailleCol);
+ getyx(stdscr, braille_line, braille_col);
}
else
{
if (option(OPT_BRAILLE_FRIENDLY))
{
- if (brailleLine != -1)
+ if (braille_line != -1)
{
- move(brailleLine + 1, 0);
- brailleLine = -1;
+ move(braille_line + 1, 0);
+ braille_line = -1;
}
}
else
};
static const char *parse_date_range(const char *pc, struct tm *min, struct tm *max,
- int haveMin, struct tm *baseMin, struct Buffer *err)
+ int have_min, struct tm *base_min, struct Buffer *err)
{
int flag = MUTT_PDR_NONE;
while (*pc && ((flag & MUTT_PDR_DONE) == 0))
else
{
/* reestablish initial base minimum if not specified */
- if (!haveMin)
- memcpy(min, baseMin, sizeof(struct tm));
+ if (!have_min)
+ memcpy(min, base_min, sizeof(struct tm));
flag |= (MUTT_PDR_ABSOLUTE | MUTT_PDR_DONE); /* done good */
}
}
else
{
pc = pt;
- if (flag == MUTT_PDR_NONE && !haveMin)
+ if (flag == MUTT_PDR_NONE && !have_min)
{ /* the very first "-3d" without a previous absolute date */
max->tm_year = min->tm_year;
max->tm_mon = min->tm_mon;
}
break;
case '+':
- { /* enlarge plusRange */
+ { /* enlarge plus range */
pt = get_offset(max, pc, 1);
if (pc == pt)
flag |= MUTT_PDR_ERRORDONE;
{
const char *pc = buffer.data;
- int haveMin = false;
- int untilNow = false;
+ int have_min = false;
+ int until_now = false;
if (isdigit((unsigned char) *pc))
{
/* minimum date specified */
FREE(&buffer.data);
return false;
}
- haveMin = true;
+ have_min = true;
SKIPWS(pc);
if (*pc == '-')
{
const char *pt = pc + 1;
SKIPWS(pt);
- untilNow = (*pt == '\0');
+ until_now = (*pt == '\0');
}
}
- if (!untilNow)
+ if (!until_now)
{ /* max date or relative range/window */
- struct tm baseMin;
+ struct tm base_min;
- if (!haveMin)
+ if (!have_min)
{ /* save base minimum and set current date, e.g. for "-3d+1d" */
time_t now = time(NULL);
struct tm *tm = localtime(&now);
- memcpy(&baseMin, &min, sizeof(baseMin));
+ memcpy(&base_min, &min, sizeof(base_min));
memcpy(&min, tm, sizeof(min));
min.tm_hour = min.tm_sec = min.tm_min = 0;
}
max.tm_mon = min.tm_mon;
max.tm_mday = min.tm_mday;
- if (!parse_date_range(pc, &min, &max, haveMin, &baseMin, err))
+ if (!parse_date_range(pc, &min, &max, have_min, &base_min, err))
{ /* bail out on any parsing error */
FREE(&buffer.data);
return false;