Skip to content

Commit

Permalink
rename format parameters/variables
Browse files Browse the repository at this point in the history
flatcap committed Nov 26, 2017
1 parent eb9b7f4 commit cdab3c5
Showing 24 changed files with 641 additions and 643 deletions.
32 changes: 16 additions & 16 deletions addrbook.c
Original file line number Diff line number Diff line change
@@ -47,46 +47,46 @@ static const struct Mapping AliasHelp[] = {
{ N_("Help"), OP_HELP }, { NULL, 0 },
};

static const char *alias_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,
static const char *alias_format_str(char *buf, size_t buflen, size_t col, int cols,
char op, const char *src, const char *prec,
const char *if_str, const char *else_str,
unsigned long data, enum FormatFlag flags)
{
char tmp[SHORT_STRING], adr[SHORT_STRING];
char fmt[SHORT_STRING], adr[SHORT_STRING];
struct Alias *alias = (struct Alias *) data;

switch (op)
{
case 'f':
snprintf(tmp, sizeof(tmp), "%%%ss", fmt);
snprintf(dest, destlen, tmp, alias->del ? "D" : " ");
snprintf(fmt, sizeof(fmt), "%%%ss", prec);
snprintf(buf, buflen, fmt, alias->del ? "D" : " ");
break;
case 'a':
mutt_format_s(dest, destlen, fmt, alias->name);
mutt_format_s(buf, buflen, prec, alias->name);
break;
case 'r':
adr[0] = '\0';
rfc822_write_address(adr, sizeof(adr), alias->addr, 1);
snprintf(tmp, sizeof(tmp), "%%%ss", fmt);
snprintf(dest, destlen, tmp, adr);
snprintf(fmt, sizeof(fmt), "%%%ss", prec);
snprintf(buf, buflen, fmt, adr);
break;
case 'n':
snprintf(tmp, sizeof(tmp), "%%%sd", fmt);
snprintf(dest, destlen, tmp, alias->num + 1);
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
snprintf(buf, buflen, fmt, alias->num + 1);
break;
case 't':
dest[0] = alias->tagged ? '*' : ' ';
dest[1] = '\0';
buf[0] = alias->tagged ? '*' : ' ';
buf[1] = '\0';
break;
}

return src;
}

static void alias_entry(char *s, size_t slen, struct Menu *m, int num)
static void alias_entry(char *buf, size_t buflen, struct Menu *menu, int num)
{
mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(AliasFormat), alias_format_str,
(unsigned long) ((struct Alias **) m->data)[num],
mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, NONULL(AliasFormat), alias_format_str,
(unsigned long) ((struct Alias **) menu->data)[num],
MUTT_FORMAT_ARROWCURSOR);
}

Loading

0 comments on commit cdab3c5

Please sign in to comment.