}
/* This function is called in a few places after endwin()
- * e.g. _mutt_pipe_message(). */
+ * e.g. mutt_pipe_message(). */
output_progress = !isendwin();
if (output_progress)
mutt_message(_("Fetching message..."));
}
else if (query || *s->dptr != '=')
{
- char _tmp[LONG_STRING];
+ char tmp2[LONG_STRING];
const char *val = NULL;
if (myvar)
}
else if (DTYPE(MuttVars[idx].type) == DT_ADDRESS)
{
- _tmp[0] = '\0';
- rfc822_write_address(_tmp, sizeof(_tmp),
+ tmp2[0] = '\0';
+ rfc822_write_address(tmp2, sizeof(tmp2),
*((struct Address **) MuttVars[idx].data), 0);
- val = _tmp;
+ val = tmp2;
}
else if (DTYPE(MuttVars[idx].type) == DT_PATH)
{
- _tmp[0] = '\0';
- mutt_str_strfcpy(_tmp, NONULL(*((char **) MuttVars[idx].data)), sizeof(_tmp));
- mutt_pretty_mailbox(_tmp, sizeof(_tmp));
- val = _tmp;
+ tmp2[0] = '\0';
+ mutt_str_strfcpy(tmp2, NONULL(*((char **) MuttVars[idx].data)), sizeof(tmp2));
+ mutt_pretty_mailbox(tmp2, sizeof(tmp2));
+ val = tmp2;
}
else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE)
{
void mbox_reset_atime(struct Context *ctx, struct stat *st)
{
struct utimbuf utimebuf;
- struct stat _st;
+ struct stat st2;
if (!st)
{
- if (stat(ctx->path, &_st) < 0)
+ if (stat(ctx->path, &st2) < 0)
return;
- st = &_st;
+ st = &st2;
}
utimebuf.actime = st->st_atime;
* out a fake header structure generated by lazy maildir parsing.
*/
struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname,
- bool is_old, struct Header *_h)
+ bool is_old, struct Header *h)
{
- struct Header *h = _h;
struct stat st;
if (!h)
/**
* mutt_cs_fgetconv_close - Close an fgetconv handle
- * @param _fc fgetconv handle
+ * @param handle fgetconv handle
*/
-void mutt_cs_fgetconv_close(FGETCONV **_fc)
+void mutt_cs_fgetconv_close(FGETCONV **handle)
{
- struct FgetConv *fc = (struct FgetConv *) *_fc;
+ struct FgetConv *fc = (struct FgetConv *) *handle;
if (fc->cd != (iconv_t) -1)
iconv_close(fc->cd);
- FREE(_fc);
+ FREE(handle);
}
/**
* mutt_cs_fgetconv - Convert a file's character set
- * @param _fc fgetconv handle
+ * @param handle fgetconv handle
* @retval num Next character in the converted file
* @retval EOF Error
*
* Each call to this function will return one converted character.
* The buffer is refilled automatically when empty.
*/
-int mutt_cs_fgetconv(FGETCONV *_fc)
+int mutt_cs_fgetconv(FGETCONV *handle)
{
- struct FgetConv *fc = (struct FgetConv *) _fc;
+ struct FgetConv *fc = (struct FgetConv *) handle;
if (!fc)
return EOF;
/**
* mutt_cs_fgetconvs - Convert a file's charset into a string buffer
- * @param buf Buffer for result
- * @param l Length of buffer
- * @param _fc fgetconv handle
+ * @param buf Buffer for result
+ * @param l Length of buffer
+ * @param handle fgetconv handle
* @retval ptr Result buffer on success
* @retval NULL Error
*
* Read a file into a buffer, converting the character set as it goes.
*/
-char *mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *_fc)
+char *mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *handle)
{
int c;
size_t r;
for (r = 0; r + 1 < l;)
{
- c = mutt_cs_fgetconv(_fc);
+ c = mutt_cs_fgetconv(handle);
if (c == EOF)
break;
buf[r++] = (char) c;
typedef void *FGETCONV;
/**
- * struct FgetConv - Cursor for converting a file's encoding
+ * struct EgetConv - Cursor for converting a file's encoding
*/
struct FgetConv
{
void mutt_cs_canonical_charset(char *dest, size_t dlen, const char *name);
int mutt_cs_chscmp(const char *s, const char *chs);
-void mutt_cs_fgetconv_close(FGETCONV **fc);
-int mutt_cs_fgetconv(FGETCONV *fc);
-char * mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *fc);
+void mutt_cs_fgetconv_close(FGETCONV **handle);
+int mutt_cs_fgetconv(FGETCONV *handle);
+char * mutt_cs_fgetconvs(char *buf, size_t l, FGETCONV *handle);
char * mutt_cs_get_default_charset(void);
size_t mutt_cs_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft, const char **inrepls, const char *outrepl);
void mutt_cs_set_langinfo_charset(void);
}
errno = 0;
- char _path[PATH_MAX];
+ char tmp_path[PATH_MAX];
const size_t len = strlen(path);
- if (len >= sizeof(_path))
+ if (len >= sizeof(tmp_path))
{
errno = ENAMETOOLONG;
return -1;
return 0;
/* Create a mutable copy */
- mutt_str_strfcpy(_path, path, sizeof(_path));
+ mutt_str_strfcpy(tmp_path, path, sizeof(tmp_path));
- for (char *p = _path + 1; *p; p++)
+ for (char *p = tmp_path + 1; *p; p++)
{
if (*p != '/')
continue;
/* Temporarily truncate the path */
*p = '\0';
- if ((mkdir(_path, S_IRWXU | S_IRWXG | S_IRWXO) != 0) && (errno != EEXIST))
+ if ((mkdir(tmp_path, S_IRWXU | S_IRWXG | S_IRWXO) != 0) && (errno != EEXIST))
return -1;
*p = '/';
}
- if ((mkdir(_path, mode) != 0) && (errno != EEXIST))
+ if ((mkdir(tmp_path, mode) != 0) && (errno != EEXIST))
return -1;
return 0;
time_t mutt_file_decrease_mtime(const char *f, struct stat *st)
{
struct utimbuf utim;
- struct stat _st;
+ struct stat st2;
time_t mtime;
if (!st)
{
- if (stat(f, &_st) == -1)
+ if (stat(f, &st2) == -1)
return -1;
- st = &_st;
+ st = &st2;
}
mtime = st->st_mtime;
*/
int mutt_file_chmod_add_stat(const char *path, mode_t mode, struct stat *st)
{
- struct stat _st;
+ struct stat st2;
if (!st)
{
- if (stat(path, &_st) == -1)
+ if (stat(path, &st2) == -1)
return -1;
- st = &_st;
+ st = &st2;
}
return chmod(path, st->st_mode | mode);
}
*/
int mutt_file_chmod_rm_stat(const char *path, mode_t mode, struct stat *st)
{
- struct stat _st;
+ struct stat st2;
if (!st)
{
- if (stat(path, &_st) == -1)
+ if (stat(path, &st2) == -1)
return -1;
- st = &_st;
+ st = &st2;
}
return chmod(path, st->st_mode & ~mode);
}
#endif
/* @def The definition in <notmuch.h> is broken */
-#define LIBNOTMUCH_CHECK_VERSION(_major, _minor, _micro) \
- (LIBNOTMUCH_MAJOR_VERSION > (_major) || \
- (LIBNOTMUCH_MAJOR_VERSION == (_major) && LIBNOTMUCH_MINOR_VERSION > (_minor)) || \
- (LIBNOTMUCH_MAJOR_VERSION == (_major) && LIBNOTMUCH_MINOR_VERSION == (_minor) && \
- LIBNOTMUCH_MICRO_VERSION >= (_micro)))
+#define LIBNOTMUCH_CHECK_VERSION(major, minor, micro) \
+ (LIBNOTMUCH_MAJOR_VERSION > (major) || \
+ (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION > (minor)) || \
+ (LIBNOTMUCH_MAJOR_VERSION == (major) && LIBNOTMUCH_MINOR_VERSION == (minor) && \
+ LIBNOTMUCH_MICRO_VERSION >= (micro)))
/**
* enum NmQueryType - Notmuch Query Types
int maildir_check_empty(const char *path);
struct Header *maildir_parse_message(int magic, const char *fname, bool is_old, struct Header *h);
-struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *_h);
+struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname, bool is_old, struct Header *h);
void maildir_parse_flags(struct Header *h, const char *path);
bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n);
void maildir_flags(char *dest, size_t destlen, struct Header *hdr);
/* decode the backslash-escaped user ids. */
-static char *_chs = NULL;
+static char *chs = NULL;
static void fix_uid(char *uid)
{
}
*d = '\0';
- if (_chs && (cd = mutt_iconv_open(_chs, "utf-8", 0)) != (iconv_t) -1)
+ if (chs && (cd = mutt_iconv_open(chs, "utf-8", 0)) != (iconv_t) -1)
{
int n = s - uid + 1; /* chars available in original buffer */
char *buf = NULL;
if (devnull == -1)
return NULL;
- mutt_str_replace(&_chs, Charset);
+ mutt_str_replace(&chs, Charset);
thepid = pgp_invoke_list_keys(NULL, &fp, NULL, -1, -1, devnull, keyring, hints);
if (thepid == -1)
void pgp_invoke_import(const char *fname)
{
- char _fname[_POSIX_PATH_MAX + SHORT_STRING];
+ char tmp_fname[_POSIX_PATH_MAX + SHORT_STRING];
char cmd[HUGE_STRING];
struct PgpCommandContext cctx;
memset(&cctx, 0, sizeof(cctx));
- mutt_file_quote_filename(_fname, sizeof(_fname), fname);
- cctx.fname = _fname;
+ mutt_file_quote_filename(tmp_fname, sizeof(tmp_fname), fname);
+ cctx.fname = tmp_fname;
cctx.signas = PgpSignAs;
mutt_pgp_command(cmd, sizeof(cmd), &cctx, PgpImportCommand);
short version = 2;
short secring = 0;
- const char *_kring = NULL;
+ const char *tmp_kring = NULL;
char *env_pgppath = NULL, *env_home = NULL;
char pgppath[_POSIX_PATH_MAX];
case 'k':
{
- _kring = optarg;
+ tmp_kring = optarg;
break;
}
}
}
- if (_kring)
- mutt_str_strfcpy(kring, _kring, sizeof(kring));
+ if (tmp_kring)
+ mutt_str_strfcpy(kring, tmp_kring, sizeof(kring));
else
{
if ((env_pgppath = getenv("PGPPATH")))
return parent;
}
-static void include_header(int quote, FILE *ifp, struct Header *hdr, FILE *ofp, char *_prefix)
+static void include_header(int quote, FILE *ifp, struct Header *hdr, FILE *ofp, char *prefix)
{
int chflags = CH_DECODE;
- char prefix[SHORT_STRING];
+ char prefix2[SHORT_STRING];
if (option(OPT_WEED))
chflags |= CH_WEED | CH_REORDER;
if (quote)
{
- if (_prefix)
- mutt_str_strfcpy(prefix, _prefix, sizeof(prefix));
+ if (prefix)
+ mutt_str_strfcpy(prefix2, prefix, sizeof(prefix2));
else if (!option(OPT_TEXT_FLOWED))
- mutt_make_string_flags(prefix, sizeof(prefix), NONULL(IndentString), Context, hdr, 0);
+ mutt_make_string_flags(prefix2, sizeof(prefix2), NONULL(IndentString), Context, hdr, 0);
else
- mutt_str_strfcpy(prefix, ">", sizeof(prefix));
+ mutt_str_strfcpy(prefix2, ">", sizeof(prefix2));
chflags |= CH_PREFIX;
}
- mutt_copy_header(ifp, hdr, ofp, chflags, quote ? prefix : NULL);
+ mutt_copy_header(ifp, hdr, ofp, chflags, quote ? prefix2 : NULL);
}
/**
* In addition, this function returns a 0 if the command works on a file,
* and 1 if the command works on a pipe.
*/
-int rfc1524_expand_command(struct Body *a, char *filename, char *_type, char *command, int clen)
+int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *command, int clen)
{
int x = 0, y = 0;
int needspipe = true;
char buf[LONG_STRING];
- char type[LONG_STRING];
+ char type2[LONG_STRING];
- mutt_str_strfcpy(type, _type, sizeof(type));
+ mutt_str_strfcpy(type2, type, sizeof(type2));
if (option(OPT_MAILCAP_SANITIZE))
- mutt_file_sanitize_filename(type, 0);
+ mutt_file_sanitize_filename(type2, 0);
while (x < clen - 1 && command[x] && y < sizeof(buf) - 1)
{
{
char param[STRING];
char pvalue[STRING];
- char *_pvalue = NULL;
+ char *pvalue2 = NULL;
int z = 0;
x++;
param[z++] = command[x++];
param[z] = '\0';
- _pvalue = mutt_param_get(param, a->parameter);
- mutt_str_strfcpy(pvalue, NONULL(_pvalue), sizeof(pvalue));
+ pvalue2 = mutt_param_get(param, a->parameter);
+ mutt_str_strfcpy(pvalue, NONULL(pvalue2), sizeof(pvalue));
if (option(OPT_MAILCAP_SANITIZE))
mutt_file_sanitize_filename(pvalue, 0);
}
else if (command[x] == 't')
{
- y += mutt_file_quote_filename(buf + y, sizeof(buf) - y, type);
+ y += mutt_file_quote_filename(buf + y, sizeof(buf) - y, type2);
}
x++;
}
struct Rfc1524MailcapEntry *rfc1524_new_entry(void);
void rfc1524_free_entry(struct Rfc1524MailcapEntry **entry);
-int rfc1524_expand_command(struct Body *a, char *filename, char *_type, char *command, int clen);
+int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *command, int clen);
int rfc1524_expand_filename(char *nametemplate, char *oldfile, char *newfile, size_t nflen);
int rfc1524_mailcap_lookup(struct Body *a, char *type, struct Rfc1524MailcapEntry *entry, int opt);