}
#ifdef USE_NNTP
-static const char *newsgroup_format_str(char *dest, size_t destlen, size_t col, int cols,
- char op, const char *src, const char *fmt,
- const char *ifstring, const char *elsestring,
- unsigned long data, enum FormatFlag flags)
+static const char *group_index_format_str(char *dest, size_t destlen, size_t col,
+ int cols, char op, const char *src,
+ const char *fmt, const char *ifstring,
+ const char *elsestring,
+ unsigned long data, enum FormatFlag flags)
{
char fn[SHORT_STRING], tmp[SHORT_STRING];
struct Folder *folder = (struct Folder *) data;
{
if (folder->ff->nd->unread != 0)
mutt_expando_format(dest, destlen, col, cols, ifstring,
- newsgroup_format_str, data, flags);
+ group_index_format_str, data, flags);
else
mutt_expando_format(dest, destlen, col, cols, elsestring,
- newsgroup_format_str, data, flags);
+ group_index_format_str, data, flags);
}
else if (Context && Context->data == folder->ff->nd)
{
#ifdef USE_NNTP
if (option(OPT_NEWS))
mutt_expando_format(s, slen, 0, MuttIndexWindow->cols,
- NONULL(GroupIndexFormat), newsgroup_format_str,
+ NONULL(GroupIndexFormat), group_index_format_str,
(unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
else
#endif
struct AttachCtx *actx = (struct AttachCtx *) menu->data;
mutt_expando_format(b, blen, 0, MuttIndexWindow->cols, NONULL(AttachFormat),
- mutt_attach_fmt, (unsigned long) (actx->idx[actx->v2r[num]]),
+ attach_format_str, (unsigned long) (actx->idx[actx->v2r[num]]),
MUTT_FORMAT_STAT_FILE | MUTT_FORMAT_ARROWCURSOR);
}
}
/**
- * cb_format_str - Expand the filenames in the command string
+ * compress_format_str - Expand the filenames in the command string
* @param dest Buffer in which to save string
* @param destlen Buffer length
* @param col Starting column, UNUSED
* @param flags Format flags, UNUSED
* @retval src (unchanged)
*
- * cb_format_str is a callback function for mutt_expando_format. It understands
+ * compress_format_str is a callback function for mutt_expando_format. It understands
* two operators. '%f' : 'from' filename, '%t' : 'to' filename.
*/
-static const char *cb_format_str(char *dest, size_t destlen, size_t col, int cols,
- char op, const char *src, const char *fmt,
- const char *ifstring, const char *elsestring,
- unsigned long data, enum FormatFlag flags)
+static const char *compress_format_str(char *dest, size_t destlen, size_t col, int cols,
+ char op, const char *src, const char *fmt,
+ const char *ifstring, const char *elsestring,
+ unsigned long data, enum FormatFlag flags)
{
if (!dest || (data == 0))
return src;
*
* This function takes a hook command and expands the filename placeholders
* within it. The function calls mutt_expando_format() to do the replacement
- * which calls our callback function cb_format_str(). e.g.
+ * which calls our callback function compress_format_str(). e.g.
*
* Template command:
* gzip -cd '%f' > '%t'
if (!ctx || !cmd || !buf)
return;
- mutt_expando_format(buf, buflen, 0, buflen, cmd, cb_format_str, (unsigned long) ctx, 0);
+ mutt_expando_format(buf, buflen, 0, buflen, cmd, compress_format_str,
+ (unsigned long) ctx, 0);
}
/**
MUTT_FORMAT_TREE = (1 << 1), /**< draw the thread tree */
MUTT_FORMAT_MAKEPRINT = (1 << 2), /**< make sure that all chars are printable */
MUTT_FORMAT_OPTIONAL = (1 << 3), /**< allow optional field processing */
- MUTT_FORMAT_STAT_FILE = (1 << 4), /**< used by mutt_attach_fmt */
+ MUTT_FORMAT_STAT_FILE = (1 << 4), /**< used by attach_format_str */
MUTT_FORMAT_ARROWCURSOR = (1 << 5), /**< reserve space for arrow_cursor */
MUTT_FORMAT_INDEX = (1 << 6), /**< this is a main index entry */
MUTT_FORMAT_NOFILTER = (1 << 7) /**< do not allow filtering on this pass */
}
/**
- * hdr_format_str - Format a string, like printf()
+ * index_format_str - Format a string, like printf()
*
* | Expando | Description
* |:--------|:-----------------------------------------------------------------
* | \%zt | message tag flags
* | \%Z | combined message flags
*/
-static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int cols,
- char op, const char *src, const char *prefix,
- const char *ifstring, const char *elsestring,
- unsigned long data, enum FormatFlag flags)
+static const char *index_format_str(char *dest, size_t destlen, size_t col, int cols,
+ char op, const char *src, const char *prefix,
+ const char *ifstring, const char *elsestring,
+ unsigned long data, enum FormatFlag flags)
{
struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data;
struct Header *hdr = NULL, *htmp = NULL;
}
if (optional)
- mutt_expando_format(dest, destlen, col, cols, ifstring, hdr_format_str,
+ mutt_expando_format(dest, destlen, col, cols, ifstring, index_format_str,
(unsigned long) hfi, flags);
else if (flags & MUTT_FORMAT_OPTIONAL)
- mutt_expando_format(dest, destlen, col, cols, elsestring, hdr_format_str,
+ mutt_expando_format(dest, destlen, col, cols, elsestring, index_format_str,
(unsigned long) hfi, flags);
return src;
hfi.pager_progress = 0;
mutt_expando_format(dest, destlen, 0, MuttIndexWindow->cols, s,
- hdr_format_str, (unsigned long) &hfi, flags);
+ index_format_str, (unsigned long) &hfi, flags);
}
void mutt_make_string_info(char *dst, size_t dstlen, int cols, const char *s,
struct HdrFormatInfo *hfi, enum FormatFlag flags)
{
- mutt_expando_format(dst, dstlen, 0, cols, s, hdr_format_str, (unsigned long) hfi, flags);
+ mutt_expando_format(dst, dstlen, 0, cols, s, index_format_str, (unsigned long) hfi, flags);
}
}
/**
- * crypt_entry_fmt - Format an entry on the CRYPT key selection menu
+ * crypt_format_str - Format an entry on the CRYPT key selection menu
*
* * \%u user id
* * \%n number
* * \%F flags of the principal key
* * \%C capabilities of the principal key
*/
-static const char *crypt_entry_fmt(char *dest, size_t destlen, size_t col, int cols,
- char op, const char *src, const char *prefix,
- const char *ifstring, const char *elsestring,
- unsigned long data, enum FormatFlag flags)
+static const char *crypt_format_str(char *dest, size_t destlen, size_t col, int cols,
+ char op, const char *src, const char *prefix,
+ const char *ifstring, const char *elsestring,
+ unsigned long data, enum FormatFlag flags)
{
char fmt[16];
struct CryptEntry *entry = NULL;
}
if (optional)
- mutt_expando_format(dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, ifstring, attach_format_str, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
- mutt_expando_format(dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, elsestring, attach_format_str, data, 0);
return src;
}
entry.num = num + 1;
mutt_expando_format(s, l, 0, MuttIndexWindow->cols, NONULL(PgpEntryFormat),
- crypt_entry_fmt, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR);
+ crypt_format_str, (unsigned long) &entry, MUTT_FORMAT_ARROWCURSOR);
}
/**
}
if (optional)
- mutt_expando_format(dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, ifstring, attach_format_str, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
- mutt_expando_format(dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, elsestring, attach_format_str, data, 0);
return src;
}
struct Header *hdr, enum FormatFlag flags);
/**
- * struct HdrFormatInfo - Data passed to hdr_format_str()
+ * struct HdrFormatInfo - Data passed to index_format_str()
*/
struct HdrFormatInfo
{
int is_from(const char *s, char *path, size_t pathlen, time_t *tp);
-const char *mutt_attach_fmt(char *dest, size_t destlen, size_t col, int cols,
+const char *attach_format_str(char *dest, size_t destlen, size_t col, int cols,
char op, const char *src, const char *prefix,
const char *ifstring, const char *elsestring,
unsigned long data, enum FormatFlag flags);
}
/**
- * mutt_attach_fmt - Format string for attachment menu
+ * attach_format_str - Format string for attachment menu
*
* | Expando | Description
* |:--------|:--------------------------------------------------------
* | \%s | size
* | \%u | unlink
*/
-const char *mutt_attach_fmt(char *dest, size_t destlen, size_t col, int cols,
- char op, const char *src, const char *prefix,
- const char *ifstring, const char *elsestring,
- unsigned long data, enum FormatFlag flags)
+const char *attach_format_str(char *dest, size_t destlen, size_t col, int cols,
+ char op, const char *src, const char *prefix,
+ const char *ifstring, const char *elsestring,
+ unsigned long data, enum FormatFlag flags)
{
char fmt[16];
char tmp[SHORT_STRING];
}
if (optional)
- mutt_expando_format(dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, ifstring, attach_format_str, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
- mutt_expando_format(dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, elsestring, attach_format_str, data, 0);
return src;
}
struct AttachCtx *actx = (struct AttachCtx *) menu->data;
mutt_expando_format(b, blen, 0, MuttIndexWindow->cols, NONULL(AttachFormat),
- mutt_attach_fmt, (unsigned long) (actx->idx[actx->v2r[num]]),
+ attach_format_str, (unsigned long) (actx->idx[actx->v2r[num]]),
MUTT_FORMAT_ARROWCURSOR);
}
}
/**
- * mix_entry_fmt - Format an entry for the remailer menu
+ * mix_format_str - Format an entry for the remailer menu
*
* * %n number
* * %c capabilities
* * %s short name
* * %a address
*/
-static const char *mix_entry_fmt(char *dest, size_t destlen, size_t col, int cols,
- char op, const char *src, const char *prefix,
- const char *ifstring, const char *elsestring,
- unsigned long data, enum FormatFlag flags)
+static const char *mix_format_str(char *dest, size_t destlen, size_t col, int cols,
+ char op, const char *src, const char *prefix,
+ const char *ifstring, const char *elsestring,
+ unsigned long data, enum FormatFlag flags)
{
char fmt[16];
struct Remailer *remailer = (struct Remailer *) data;
}
if (optional)
- mutt_expando_format(dest, destlen, col, cols, ifstring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, ifstring, attach_format_str, data, 0);
else if (flags & MUTT_FORMAT_OPTIONAL)
- mutt_expando_format(dest, destlen, col, cols, elsestring, mutt_attach_fmt, data, 0);
+ mutt_expando_format(dest, destlen, col, cols, elsestring, attach_format_str, data, 0);
return src;
}
static void mix_entry(char *b, size_t blen, struct Menu *menu, int num)
{
struct Remailer **type2_list = (struct Remailer **) menu->data;
- mutt_expando_format(b, blen, 0, MuttIndexWindow->cols, NONULL(MixEntryFormat), mix_entry_fmt,
+ mutt_expando_format(b, blen, 0, MuttIndexWindow->cols, NONULL(MixEntryFormat), mix_format_str,
(unsigned long) type2_list[num], MUTT_FORMAT_ARROWCURSOR);
}
} sidebar_source = SB_SRC_INCOMING;
/**
- * cb_format_str - Create the string to show in the sidebar
+ * sidebar_format_str - Create the string to show in the sidebar
* @param[out] dest Buffer in which to save string
* @param[in] destlen Buffer length
* @param[in] col Starting column, UNUSED
* @param[in] flags Format flags, e.g. MUTT_FORMAT_OPTIONAL
* @retval src (unchanged)
*
- * cb_format_str is a callback function for mutt_expando_format. It understands
+ * sidebar_format_str is a callback function for mutt_expando_format. It understands
* six operators. '%B' : Mailbox name, '%F' : Number of flagged messages,
* '%N' : Number of new messages, '%S' : Size (total number of messages),
* '%!' : Icon denoting number of flagged messages.
* '%n' : N if folder has new mail, blank otherwise.
*/
-static const char *cb_format_str(char *dest, size_t destlen, size_t col, int cols,
- char op, const char *src, const char *prefix,
- const char *ifstring, const char *elsestring,
- unsigned long data, enum FormatFlag flags)
+static const char *sidebar_format_str(char *dest, size_t destlen, size_t col, int cols,
+ char op, const char *src, const char *prefix,
+ const char *ifstring, const char *elsestring,
+ unsigned long data, enum FormatFlag flags)
{
struct SbEntry *sbe = (struct SbEntry *) data;
unsigned int optional;
if (optional)
mutt_expando_format(dest, destlen, col, SidebarWidth, ifstring,
- cb_format_str, (unsigned long) sbe, flags);
+ sidebar_format_str, (unsigned long) sbe, flags);
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_expando_format(dest, destlen, col, SidebarWidth, elsestring,
- cb_format_str, (unsigned long) sbe, flags);
+ sidebar_format_str, (unsigned long) sbe, flags);
/* We return the format string, unchanged */
return src;
*
* Take all the relevant mailbox data and the desired screen width and then get
* mutt_expando_format to do the actual work. mutt_expando_format will callback to
- * us using cb_format_str() for the sidebar specific formatting characters.
+ * us using sidebar_format_str() for the sidebar specific formatting characters.
*/
static void make_sidebar_entry(char *buf, unsigned int buflen, int width,
char *box, struct SbEntry *sbe)
mutt_str_strfcpy(sbe->box, box, sizeof(sbe->box));
mutt_expando_format(buf, buflen, 0, width, NONULL(SidebarFormat),
- cb_format_str, (unsigned long) sbe, 0);
+ sidebar_format_str, (unsigned long) sbe, 0);
/* Force string to be exactly the right width */
int w = mutt_strwidth(buf);