NeoMutt  2020-06-26-30-g76c339
Teaching an old dog new tricks
DOXYGEN
hdrline.c File Reference

String processing routines to generate the mail index. More...

#include "config.h"
#include <locale.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "alias/lib.h"
#include "gui/lib.h"
#include "hdrline.h"
#include "context.h"
#include "format_flags.h"
#include "globals.h"
#include "hook.h"
#include "maillist.h"
#include "mutt_menu.h"
#include "mutt_parse.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "sort.h"
#include "ncrypt/lib.h"
+ Include dependency graph for hdrline.c:

Go to the source code of this file.

Enumerations

enum  FlagChars {
  FLAG_CHAR_TAGGED, FLAG_CHAR_IMPORTANT, FLAG_CHAR_DELETED, FLAG_CHAR_DELETED_ATTACH,
  FLAG_CHAR_REPLIED, FLAG_CHAR_OLD, FLAG_CHAR_NEW, FLAG_CHAR_OLD_THREAD,
  FLAG_CHAR_NEW_THREAD, FLAG_CHAR_SEMPTY, FLAG_CHAR_ZEMPTY
}
 Index into the C_FlagChars variable ($flag_chars) More...
 
enum  CryptChars {
  FLAG_CHAR_CRYPT_GOOD_SIGN, FLAG_CHAR_CRYPT_ENCRYPTED, FLAG_CHAR_CRYPT_SIGNED, FLAG_CHAR_CRYPT_CONTAINS_KEY,
  FLAG_CHAR_CRYPT_NO_CRYPTO
}
 Index into the C_CryptChars variable ($crypt_chars) More...
 
enum  FieldType {
  DISP_TO, DISP_CC, DISP_BCC, DISP_FROM,
  DISP_PLAIN, DISP_MAX
}
 Header types. More...
 

Functions

static size_t add_index_color (char *buf, size_t buflen, MuttFormatFlags flags, char color)
 Insert a color marker into a string. More...
 
static const char * get_nth_wchar (struct MbTable *table, int index)
 Extract one char from a multi-byte table. More...
 
static const char * make_from_prefix (enum FieldType disp)
 Create a prefix for an author field. More...
 
static void make_from (struct Envelope *env, char *buf, size_t buflen, bool do_lists, MuttFormatFlags flags)
 Generate a From: field (with optional prefix) More...
 
static void make_from_addr (struct Envelope *env, char *buf, size_t buflen, bool do_lists)
 Create a 'from' address for a reply email. More...
 
static bool user_in_addr (struct AddressList *al)
 Do any of the addresses refer to the user? More...
 
static int user_is_recipient (struct Email *e)
 Is the user a recipient of the message. More...
 
static char * apply_subject_mods (struct Envelope *env)
 Apply regex modifications to the subject. More...
 
static bool thread_is_new (struct Context *ctx, struct Email *e)
 Does the email thread contain any new emails? More...
 
static bool thread_is_old (struct Context *ctx, struct Email *e)
 Does the email thread contain any unread emails? More...
 
static const char * index_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, intptr_t data, MuttFormatFlags flags)
 Format a string for the index list - Implements format_t. More...
 
void mutt_make_string_flags (char *buf, size_t buflen, int cols, const char *s, struct Context *ctx, struct Mailbox *m, struct Email *e, MuttFormatFlags flags)
 Create formatted strings using mailbox expandos. More...
 
void mutt_make_string_info (char *buf, size_t buflen, int cols, const char *s, struct HdrFormatInfo *hfi, MuttFormatFlags flags)
 Create pager status bar string. More...
 

Variables

struct MbTableC_CryptChars
 Config: User-configurable crypto flags: signed, encrypted etc. More...
 
struct MbTableC_FlagChars
 Config: User-configurable index flags: tagged, new, etc. More...
 
struct MbTableC_FromChars
 Config: User-configurable index flags: to address, cc address, etc. More...
 
struct MbTableC_ToChars
 Config: Indicator characters for the 'To' field in the index. More...
 

Detailed Description

String processing routines to generate the mail index.

Authors
  • Michael R. Elkins
  • Richard Russon
  • Ian Zimmerman
  • Pietro Cerutti

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file hdrline.c.

Enumeration Type Documentation

◆ FlagChars

enum FlagChars

Index into the C_FlagChars variable ($flag_chars)

Enumerator
FLAG_CHAR_TAGGED 

Character denoting a tagged email.

FLAG_CHAR_IMPORTANT 

Character denoting a important (flagged) email.

FLAG_CHAR_DELETED 

Character denoting a deleted email.

FLAG_CHAR_DELETED_ATTACH 

Character denoting a deleted attachment.

FLAG_CHAR_REPLIED 

Character denoting an email that has been replied to.

FLAG_CHAR_OLD 

Character denoting an email that has been read.

FLAG_CHAR_NEW 

Character denoting an unread email.

FLAG_CHAR_OLD_THREAD 

Character denoting a thread of emails that has been read.

FLAG_CHAR_NEW_THREAD 

Character denoting a thread containing at least one new email.

FLAG_CHAR_SEMPTY 

Character denoting a read email, $index_format S expando.

FLAG_CHAR_ZEMPTY 

Character denoting a read email, $index_format Z expando.

Definition at line 69 of file hdrline.c.

70 {
82 };
Character denoting a tagged email.
Definition: hdrline.c:71
Character denoting a important (flagged) email.
Definition: hdrline.c:72
Character denoting a thread containing at least one new email.
Definition: hdrline.c:79
Character denoting a read email, $index_format S expando.
Definition: hdrline.c:80
Character denoting a deleted attachment.
Definition: hdrline.c:74
Character denoting an email that has been read.
Definition: hdrline.c:76
Character denoting a thread of emails that has been read.
Definition: hdrline.c:78
Character denoting an email that has been replied to.
Definition: hdrline.c:75
Character denoting a read email, $index_format Z expando.
Definition: hdrline.c:81
Character denoting a deleted email.
Definition: hdrline.c:73
Character denoting an unread email.
Definition: hdrline.c:77

◆ CryptChars

enum CryptChars

Index into the C_CryptChars variable ($crypt_chars)

Enumerator
FLAG_CHAR_CRYPT_GOOD_SIGN 

Character denoting a message signed with a verified key.

FLAG_CHAR_CRYPT_ENCRYPTED 

Character denoting a message is PGP-encrypted.

FLAG_CHAR_CRYPT_SIGNED 

Character denoting a message is signed.

FLAG_CHAR_CRYPT_CONTAINS_KEY 

Character denoting a message contains a PGP key.

FLAG_CHAR_CRYPT_NO_CRYPTO 

Character denoting a message has no cryptography information.

Definition at line 87 of file hdrline.c.

88 {
94 };
Character denoting a message contains a PGP key.
Definition: hdrline.c:92
Character denoting a message signed with a verified key.
Definition: hdrline.c:89
Character denoting a message is PGP-encrypted.
Definition: hdrline.c:90
Character denoting a message has no cryptography information.
Definition: hdrline.c:93
Character denoting a message is signed.
Definition: hdrline.c:91

◆ FieldType

enum FieldType

Header types.

Strings for printing headers

Enumerator
DISP_TO 

To: string.

DISP_CC 

Cc: string.

DISP_BCC 

Bcc: string.

DISP_FROM 

From: string.

DISP_PLAIN 

Empty string.

DISP_MAX 

Definition at line 101 of file hdrline.c.

102 {
103  DISP_TO,
104  DISP_CC,
105  DISP_BCC,
106  DISP_FROM,
107  DISP_PLAIN,
108  DISP_MAX,
109 };
Bcc: string.
Definition: hdrline.c:105
Cc: string.
Definition: hdrline.c:104
Empty string.
Definition: hdrline.c:107
From: string.
Definition: hdrline.c:106
To: string.
Definition: hdrline.c:103

Function Documentation

◆ add_index_color()

static size_t add_index_color ( char *  buf,
size_t  buflen,
MuttFormatFlags  flags,
char  color 
)
static

Insert a color marker into a string.

Parameters
bufBuffer to store marker
buflenBuffer length
flagsFlags, see MuttFormatFlags
colorColor, e.g. MT_COLOR_MESSAGE
Return values
numCharacters written

The colors are stored as "magic" strings embedded in the text.

Definition at line 121 of file hdrline.c.

122 {
123  /* only add color markers if we are operating on main index entries. */
124  if (!(flags & MUTT_FORMAT_INDEX))
125  return 0;
126 
127  /* this item is going to be passed to an external filter */
128  if (flags & MUTT_FORMAT_NOFILTER)
129  return 0;
130 
131  if (color == MT_COLOR_INDEX)
132  { /* buf might be uninitialized other cases */
133  const size_t len = mutt_str_len(buf);
134  buf += len;
135  buflen -= len;
136  }
137 
138  if (buflen <= 2)
139  return 0;
140 
141  buf[0] = MUTT_SPECIAL_INDEX;
142  buf[1] = color;
143  buf[2] = '\0';
144 
145  return 2;
146 }
#define MUTT_FORMAT_INDEX
This is a main index entry.
Definition: format_flags.h:36
Colour indicator.
Definition: mutt_menu.h:74
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:639
#define MUTT_FORMAT_NOFILTER
Do not allow filtering on this pass.
Definition: format_flags.h:37
Index: default colour (takes a pattern)
Definition: color.h:100
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_nth_wchar()

static const char* get_nth_wchar ( struct MbTable table,
int  index 
)
static

Extract one char from a multi-byte table.

Parameters
tableMulti-byte table
indexSelect this character
Return values
ptrString pointer to the character

Extract one multi-byte character from a string table. If the index is invalid, then a space character will be returned. If the character selected is '
' (Ctrl-M), then "" will be returned.

Definition at line 158 of file hdrline.c.

159 {
160  if (!table || !table->chars || (index < 0) || (index >= table->len))
161  return " ";
162 
163  if (table->chars[index][0] == '\r')
164  return "";
165 
166  return table->chars[index];
167 }
char ** chars
The array of multibyte character strings.
Definition: mbtable.h:39
int len
Number of characters.
Definition: mbtable.h:38
+ Here is the caller graph for this function:

◆ make_from_prefix()

static const char* make_from_prefix ( enum FieldType  disp)
static

Create a prefix for an author field.

Parameters
dispType of field
Return values
ptrPrefix string (do not free it)

If $from_chars is set, pick an appropriate character from it. If not, use the default prefix: "To", "Cc", etc

Definition at line 177 of file hdrline.c.

178 {
179  /* need 2 bytes at the end, one for the space, another for NUL */
180  static char padded[8];
181  static const char *long_prefixes[DISP_MAX] = {
182  [DISP_TO] = "To ", [DISP_CC] = "Cc ", [DISP_BCC] = "Bcc ",
183  [DISP_FROM] = "", [DISP_PLAIN] = "",
184  };
185 
186  if (!C_FromChars || !C_FromChars->chars || (C_FromChars->len == 0))
187  return long_prefixes[disp];
188 
189  const char *pchar = get_nth_wchar(C_FromChars, disp);
190  if (mutt_str_len(pchar) == 0)
191  return "";
192 
193  snprintf(padded, sizeof(padded), "%s ", pchar);
194  return padded;
195 }
Bcc: string.
Definition: hdrline.c:105
char ** chars
The array of multibyte character strings.
Definition: mbtable.h:39
Cc: string.
Definition: hdrline.c:104
struct MbTable * C_FromChars
Config: User-configurable index flags: to address, cc address, etc.
Definition: hdrline.c:63
Empty string.
Definition: hdrline.c:107
From: string.
Definition: hdrline.c:106
static const char * get_nth_wchar(struct MbTable *table, int index)
Extract one char from a multi-byte table.
Definition: hdrline.c:158
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:639
To: string.
Definition: hdrline.c:103
int len
Number of characters.
Definition: mbtable.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_from()

static void make_from ( struct Envelope env,
char *  buf,
size_t  buflen,
bool  do_lists,
MuttFormatFlags  flags 
)
static

Generate a From: field (with optional prefix)

Parameters
envEnvelope of the email
bufBuffer to store the result
buflenSize of the buffer
do_listsShould we check for mailing lists?
flagsFormat flags, see MuttFormatFlags

Generate the F or L field in $index_format. This is the author, or recipient of the email.

The field can optionally be prefixed by a character from $from_chars. If $from_chars is not set, the prefix will be, "To", "Cc", etc

Definition at line 211 of file hdrline.c.

213 {
214  if (!env || !buf)
215  return;
216 
217  bool me;
218  enum FieldType disp;
219  struct AddressList *name = NULL;
220 
221  me = mutt_addr_is_user(TAILQ_FIRST(&env->from));
222 
223  if (do_lists || me)
224  {
225  if (check_for_mailing_list(&env->to, make_from_prefix(DISP_TO), buf, buflen))
226  return;
227  if (check_for_mailing_list(&env->cc, make_from_prefix(DISP_CC), buf, buflen))
228  return;
229  }
230 
231  if (me && !TAILQ_EMPTY(&env->to))
232  {
233  disp = (flags & MUTT_FORMAT_PLAIN) ? DISP_PLAIN : DISP_TO;
234  name = &env->to;
235  }
236  else if (me && !TAILQ_EMPTY(&env->cc))
237  {
238  disp = DISP_CC;
239  name = &env->cc;
240  }
241  else if (me && !TAILQ_EMPTY(&env->bcc))
242  {
243  disp = DISP_BCC;
244  name = &env->bcc;
245  }
246  else if (!TAILQ_EMPTY(&env->from))
247  {
248  disp = DISP_FROM;
249  name = &env->from;
250  }
251  else
252  {
253  *buf = '\0';
254  return;
255  }
256 
257  snprintf(buf, buflen, "%s%s", make_from_prefix(disp), mutt_get_name(TAILQ_FIRST(name)));
258 }
Bcc: string.
Definition: hdrline.c:105
#define TAILQ_FIRST(head)
Definition: queue.h:716
struct AddressList bcc
Email&#39;s &#39;Bcc&#39; list.
Definition: envelope.h:60
Cc: string.
Definition: hdrline.c:104
bool check_for_mailing_list(struct AddressList *al, const char *pfx, char *buf, int buflen)
Search list of addresses for a mailing list.
Definition: maillist.c:79
struct AddressList from
Email&#39;s &#39;From&#39; list.
Definition: envelope.h:57
struct AddressList cc
Email&#39;s &#39;Cc&#39; list.
Definition: envelope.h:59
Empty string.
Definition: hdrline.c:107
From: string.
Definition: hdrline.c:106
static const char * make_from_prefix(enum FieldType disp)
Create a prefix for an author field.
Definition: hdrline.c:177
#define MUTT_FORMAT_PLAIN
Do not prepend DISP_TO, DISP_CC ...
Definition: format_flags.h:38
To: string.
Definition: hdrline.c:103
FieldType
Header types.
Definition: hdrline.c:101
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition: alias.c:545
struct AddressList to
Email&#39;s &#39;To&#39; list.
Definition: envelope.h:58
#define TAILQ_EMPTY(head)
Definition: queue.h:714
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
Definition: sort.c:157
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_from_addr()

static void make_from_addr ( struct Envelope env,
char *  buf,
size_t  buflen,
bool  do_lists 
)
static

Create a 'from' address for a reply email.

Parameters
envEnvelope of current email
bufBuffer for the result
buflenLength of buffer
do_listsIf true, check for mailing lists

Definition at line 267 of file hdrline.c.

268 {
269  if (!env || !buf)
270  return;
271 
272  bool me = mutt_addr_is_user(TAILQ_FIRST(&env->from));
273 
274  if (do_lists || me)
275  {
276  if (check_for_mailing_list_addr(&env->to, buf, buflen))
277  return;
278  if (check_for_mailing_list_addr(&env->cc, buf, buflen))
279  return;
280  }
281 
282  if (me && !TAILQ_EMPTY(&env->to))
283  snprintf(buf, buflen, "%s", TAILQ_FIRST(&env->to)->mailbox);
284  else if (me && !TAILQ_EMPTY(&env->cc))
285  snprintf(buf, buflen, "%s", TAILQ_FIRST(&env->cc)->mailbox);
286  else if (!TAILQ_EMPTY(&env->from))
287  mutt_str_copy(buf, TAILQ_FIRST(&env->from)->mailbox, buflen);
288  else
289  *buf = '\0';
290 }
#define TAILQ_FIRST(head)
Definition: queue.h:716
struct AddressList from
Email&#39;s &#39;From&#39; list.
Definition: envelope.h:57
struct AddressList cc
Email&#39;s &#39;Cc&#39; list.
Definition: envelope.h:59
bool check_for_mailing_list_addr(struct AddressList *al, char *buf, int buflen)
Check an address list for a mailing list.
Definition: maillist.c:103
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:724
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition: alias.c:545
struct AddressList to
Email&#39;s &#39;To&#39; list.
Definition: envelope.h:58
#define TAILQ_EMPTY(head)
Definition: queue.h:714
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ user_in_addr()

static bool user_in_addr ( struct AddressList *  al)
static

Do any of the addresses refer to the user?

Parameters
alAddressList
Return values
trueIf any of the addresses match one of the user's addresses

Definition at line 297 of file hdrline.c.

298 {
299  struct Address *a = NULL;
300  TAILQ_FOREACH(a, al, entries)
301  if (mutt_addr_is_user(a))
302  return true;
303  return false;
304 }
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:718
An email address.
Definition: address.h:34
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition: alias.c:545
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ user_is_recipient()

static int user_is_recipient ( struct Email e)
static

Is the user a recipient of the message.

Parameters
eEmail to test
Return values
0User is not in list
1User is unique recipient
2User is in the TO list
3User is in the CC list
4User is originator
5Sent to a subscribed mailinglist
6User is in the Reply-To list

Definition at line 317 of file hdrline.c.

318 {
319  if (!e || !e->env)
320  return 0;
321 
322  struct Envelope *env = e->env;
323 
324  if (!e->recip_valid)
325  {
326  e->recip_valid = true;
327 
328  if (mutt_addr_is_user(TAILQ_FIRST(&env->from)))
329  e->recipient = 4;
330  else if (user_in_addr(&env->to))
331  {
332  if (TAILQ_NEXT(TAILQ_FIRST(&env->to), entries) || !TAILQ_EMPTY(&env->cc))
333  e->recipient = 2; /* non-unique recipient */
334  else
335  e->recipient = 1; /* unique recipient */
336  }
337  else if (user_in_addr(&env->cc))
338  e->recipient = 3;
339  else if (check_for_mailing_list(&env->to, NULL, NULL, 0))
340  e->recipient = 5;
341  else if (check_for_mailing_list(&env->cc, NULL, NULL, 0))
342  e->recipient = 5;
343  else if (user_in_addr(&env->reply_to))
344  e->recipient = 6;
345  else
346  e->recipient = 0;
347  }
348 
349  return e->recipient;
350 }
#define TAILQ_FIRST(head)
Definition: queue.h:716
struct AddressList reply_to
Email&#39;s &#39;reply-to&#39;.
Definition: envelope.h:62
static bool user_in_addr(struct AddressList *al)
Do any of the addresses refer to the user?
Definition: hdrline.c:297
short recipient
User_is_recipient()&#39;s return value, cached.
Definition: email.h:77
bool check_for_mailing_list(struct AddressList *al, const char *pfx, char *buf, int buflen)
Search list of addresses for a mailing list.
Definition: maillist.c:79
struct AddressList from
Email&#39;s &#39;From&#39; list.
Definition: envelope.h:57
struct Envelope * env
Envelope information.
Definition: email.h:89
struct AddressList cc
Email&#39;s &#39;Cc&#39; list.
Definition: envelope.h:59
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition: alias.c:545
bool recip_valid
Is_recipient is valid.
Definition: email.h:58
struct AddressList to
Email&#39;s &#39;To&#39; list.
Definition: envelope.h:58
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825
#define TAILQ_EMPTY(head)
Definition: queue.h:714
The header of an Email.
Definition: envelope.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_subject_mods()

static char* apply_subject_mods ( struct Envelope env)
static

Apply regex modifications to the subject.

Parameters
envEnvelope of email
Return values
ptrModified subject
NULLNo modification made

Definition at line 358 of file hdrline.c.

359 {
360  if (!env)
361  return NULL;
362 
364  return env->subject;
365 
366  if (!env->subject || (*env->subject == '\0'))
367  {
368  env->disp_subj = NULL;
369  return NULL;
370  }
371 
373  return env->disp_subj;
374 }
char * disp_subj
Display subject (modified copy of subject)
Definition: envelope.h:68
char * mutt_replacelist_apply(struct ReplaceList *rl, char *buf, size_t buflen, const char *str)
Apply replacements to a buffer.
Definition: regex.c:351
char * subject
Email&#39;s subject.
Definition: envelope.h:66
#define STAILQ_EMPTY(head)
Definition: queue.h:345
struct ReplaceList SubjectRegexList
List of regexes to tidy the view of the email&#39;s subject.
Definition: email_globals.c:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ thread_is_new()

static bool thread_is_new ( struct Context ctx,
struct Email e 
)
static

Does the email thread contain any new emails?

Parameters
ctxMailbox
eEmail
Return values
trueIf thread contains new mail

Definition at line 382 of file hdrline.c.

383 {
384  return e->collapsed && (e->num_hidden > 1) &&
385  (mutt_thread_contains_unread(ctx, e) == 1);
386 }
size_t num_hidden
Number of hidden messages in this view.
Definition: email.h:75
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:73
#define mutt_thread_contains_unread(ctx, e)
Definition: mutt_thread.h:60
+ Here is the caller graph for this function:

◆ thread_is_old()

static bool thread_is_old ( struct Context ctx,
struct Email e 
)
static

Does the email thread contain any unread emails?

Parameters
ctxMailbox
eEmail
Return values
trueIf thread contains unread mail

Definition at line 394 of file hdrline.c.

395 {
396  return e->collapsed && (e->num_hidden > 1) &&
397  (mutt_thread_contains_unread(ctx, e) == 2);
398 }
size_t num_hidden
Number of hidden messages in this view.
Definition: email.h:75
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:73
#define mutt_thread_contains_unread(ctx, e)
Definition: mutt_thread.h:60
+ Here is the caller graph for this function:

◆ index_format_str()

static const char* index_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,
intptr_t  data,
MuttFormatFlags  flags 
)
static

Format a string for the index list - Implements format_t.

Expando Description
%a Address of the author
%A Reply-to address (if present; otherwise: address of author)
%b Filename of the original message folder (think mailbox)
%B The list to which the email was sent, or else the folder name (b)
%C Current message number
%c Number of characters (bytes) in the body of the message
%cr Number of characters (bytes) in the message, including header
%D Date and time of message using $date_format and local timezone
%d Date and time of message using $date_format and sender's timezone
%e Current message number in thread
%E Number of messages in current thread
%Fp Like F, but plain. No contextual formatting is applied to recipient name
%F Author name, or recipient name if the message is from you
%f Sender (address + real name), either From: or Return-Path:
%Gx Individual message tag (e.g. notmuch tags/imap flags)
%g Message tags (e.g. notmuch tags/imap flags)
%H Spam attribute(s) of this message
%I Initials of author
%i Message-id of the current message
%J Message tags (if present, tree unfolded, and != parent's tags)
%K The list to which the email was sent (if any; otherwise: empty)
%L Like F, except 'lists' are displayed first
%l Number of lines in the message
%M Number of hidden messages if the thread is collapsed
%m Total number of message in the mailbox
%n Author's real name (or address if missing)
%N Message score
%O Like L, except using address instead of name
%P Progress indicator for the built-in pager (how much of the file has been displayed)
%q Newsgroup name (if compiled with NNTP support)
%R Comma separated list of Cc: recipients
%r Comma separated list of To: recipients
%S Single character status of the message (N/O/D/d/!/r/-)
%s Subject of the message
%t 'To:' field (recipients)
%T The appropriate character from the $to_chars string
%u User (login) name of the author
%v First name of the author, or the recipient if the message is from you
%W Name of organization of author ('Organization:' field)
%x 'X-Comment-To:' field (if present and compiled with NNTP support)
%X Number of MIME attachments
%y 'X-Label:' field (if present)
%Y 'X-Label:' field (if present, tree unfolded, and != parent's x-label)
%zc Message crypto flags
%zs Message status flags
%zt Message tag flags
%Z Combined message flags
%(fmt) Date/time when the message was received
%[fmt] Message date/time converted to the local time zone
%{fmt} Message date/time converted to sender's time zone

Definition at line 456 of file hdrline.c.

460 {
461  struct HdrFormatInfo *hfi = (struct HdrFormatInfo *) data;
462  char fmt[128], tmp[1024];
463  char *p = NULL, *tags = NULL;
464  bool optional = (flags & MUTT_FORMAT_OPTIONAL);
465  int threads = ((C_Sort & SORT_MASK) == SORT_THREADS);
466  int is_index = (flags & MUTT_FORMAT_INDEX);
467  size_t colorlen;
468 
469  struct Email *e = hfi->email;
470  struct Context *ctx = hfi->ctx;
471  struct Mailbox *m = hfi->mailbox;
472 
473  if (!e || !e->env)
474  return src;
475 
476  const struct Address *reply_to = TAILQ_FIRST(&e->env->reply_to);
477  const struct Address *from = TAILQ_FIRST(&e->env->from);
478  const struct Address *to = TAILQ_FIRST(&e->env->to);
479  const struct Address *cc = TAILQ_FIRST(&e->env->cc);
480 
481  buf[0] = '\0';
482  switch (op)
483  {
484  case 'A':
485  case 'I':
486  if (op == 'A')
487  {
488  if (reply_to && reply_to->mailbox)
489  {
490  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
491  mutt_format_s(buf + colorlen, buflen - colorlen, prec,
492  mutt_addr_for_display(reply_to));
493  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
494  break;
495  }
496  }
497  else
498  {
499  if (mutt_mb_get_initials(mutt_get_name(from), tmp, sizeof(tmp)))
500  {
501  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
502  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
503  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
504  break;
505  }
506  }
507  /* fallthrough */
508 
509  case 'a':
510  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
511  if (from && from->mailbox)
512  {
513  mutt_format_s(buf + colorlen, buflen - colorlen, prec, mutt_addr_for_display(from));
514  }
515  else
516  mutt_format_s(buf + colorlen, buflen - colorlen, prec, "");
517  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
518  break;
519 
520  case 'B':
521  case 'K':
522  if (!first_mailing_list(buf, buflen, &e->env->to) &&
523  !first_mailing_list(buf, buflen, &e->env->cc))
524  {
525  buf[0] = '\0';
526  }
527  if (buf[0] != '\0')
528  {
529  mutt_str_copy(tmp, buf, sizeof(tmp));
530  mutt_format_s(buf, buflen, prec, tmp);
531  break;
532  }
533  if (op == 'K')
534  {
535  if (optional)
536  optional = false;
537  /* break if 'K' returns nothing */
538  break;
539  }
540  /* if 'B' returns nothing */
541  /* fallthrough */
542 
543  case 'b':
544  if (m)
545  {
546  p = strrchr(mailbox_path(m), '/');
547  if (p)
548  mutt_str_copy(buf, p + 1, buflen);
549  else
550  mutt_str_copy(buf, mailbox_path(m), buflen);
551  }
552  else
553  mutt_str_copy(buf, "(null)", buflen);
554  mutt_str_copy(tmp, buf, sizeof(tmp));
555  mutt_format_s(buf, buflen, prec, tmp);
556  break;
557 
558  case 'c':
559  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_SIZE);
560  if (src[0] == 'r')
561  {
562  mutt_str_pretty_size(tmp, sizeof(tmp), email_size(e));
563  src++;
564  }
565  else
566  {
567  mutt_str_pretty_size(tmp, sizeof(tmp), e->content->length);
568  }
569  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
570  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
571  break;
572 
573  case 'C':
574  colorlen = add_index_color(fmt, sizeof(fmt), flags, MT_COLOR_INDEX_NUMBER);
575  snprintf(fmt + colorlen, sizeof(fmt) - colorlen, "%%%sd", prec);
576  add_index_color(fmt + colorlen, sizeof(fmt) - colorlen, flags, MT_COLOR_INDEX);
577  snprintf(buf, buflen, fmt, e->msgno + 1);
578  break;
579 
580  case 'd':
581  case 'D':
582  case '{':
583  case '[':
584  case '(':
585  case '<':
586  /* preprocess $date_format to handle %Z */
587  {
588  const char *cp = NULL;
589  time_t now;
590  int j = 0;
591 
592  if (optional && ((op == '[') || (op == '(')))
593  {
594  now = mutt_date_epoch();
595  struct tm tm = mutt_date_localtime(now);
596  now -= (op == '(') ? e->received : e->date_sent;
597 
598  char *is = (char *) prec;
599  bool invert = false;
600  if (*is == '>')
601  {
602  invert = true;
603  is++;
604  }
605 
606  while (*is && (*is != '?'))
607  {
608  int t = strtol(is, &is, 10);
609  /* semi-broken (assuming 30 days in all months) */
610  switch (*(is++))
611  {
612  case 'y':
613  if (t > 1)
614  {
615  t--;
616  t *= (60 * 60 * 24 * 365);
617  }
618  t += ((tm.tm_mon * 60 * 60 * 24 * 30) + (tm.tm_mday * 60 * 60 * 24) +
619  (tm.tm_hour * 60 * 60) + (tm.tm_min * 60) + tm.tm_sec);
620  break;
621 
622  case 'm':
623  if (t > 1)
624  {
625  t--;
626  t *= (60 * 60 * 24 * 30);
627  }
628  t += ((tm.tm_mday * 60 * 60 * 24) + (tm.tm_hour * 60 * 60) +
629  (tm.tm_min * 60) + tm.tm_sec);
630  break;
631 
632  case 'w':
633  if (t > 1)
634  {
635  t--;
636  t *= (60 * 60 * 24 * 7);
637  }
638  t += ((tm.tm_wday * 60 * 60 * 24) + (tm.tm_hour * 60 * 60) +
639  (tm.tm_min * 60) + tm.tm_sec);
640  break;
641 
642  case 'd':
643  if (t > 1)
644  {
645  t--;
646  t *= (60 * 60 * 24);
647  }
648  t += ((tm.tm_hour * 60 * 60) + (tm.tm_min * 60) + tm.tm_sec);
649  break;
650 
651  case 'H':
652  if (t > 1)
653  {
654  t--;
655  t *= (60 * 60);
656  }
657  t += ((tm.tm_min * 60) + tm.tm_sec);
658  break;
659 
660  case 'M':
661  if (t > 1)
662  {
663  t--;
664  t *= (60);
665  }
666  t += (tm.tm_sec);
667  break;
668 
669  default:
670  break;
671  }
672  j += t;
673  }
674 
675  if (j < 0)
676  j *= -1;
677 
678  if (((now > j) || (now < (-1 * j))) ^ invert)
679  optional = false;
680  break;
681  }
682 
683  p = buf;
684 
685  cp = ((op == 'd') || (op == 'D')) ? (NONULL(C_DateFormat)) : src;
686  bool do_locales;
687  if (*cp == '!')
688  {
689  do_locales = false;
690  cp++;
691  }
692  else
693  do_locales = true;
694 
695  size_t len = buflen - 1;
696  while ((len > 0) &&
697  ((((op == 'd') || (op == 'D')) && *cp) ||
698  ((op == '{') && (*cp != '}')) || ((op == '[') && (*cp != ']')) ||
699  ((op == '(') && (*cp != ')')) || ((op == '<') && (*cp != '>'))))
700  {
701  if (*cp == '%')
702  {
703  cp++;
704  if (((*cp == 'Z') || (*cp == 'z')) && ((op == 'd') || (op == '{')))
705  {
706  if (len >= 5)
707  {
708  sprintf(p, "%c%02u%02u", e->zoccident ? '-' : '+', e->zhours, e->zminutes);
709  p += 5;
710  len -= 5;
711  }
712  else
713  break; /* not enough space left */
714  }
715  else
716  {
717  if (len >= 2)
718  {
719  *p++ = '%';
720  *p++ = *cp;
721  len -= 2;
722  }
723  else
724  break; /* not enough space */
725  }
726  cp++;
727  }
728  else
729  {
730  *p++ = *cp++;
731  len--;
732  }
733  }
734  *p = '\0';
735 
736  struct tm tm;
737  if ((op == '[') || (op == 'D'))
739  else if (op == '(')
740  tm = mutt_date_localtime(e->received);
741  else if (op == '<')
742  {
744  }
745  else
746  {
747  /* restore sender's time zone */
748  now = e->date_sent;
749  if (e->zoccident)
750  now -= (e->zhours * 3600 + e->zminutes * 60);
751  else
752  now += (e->zhours * 3600 + e->zminutes * 60);
753  tm = mutt_date_gmtime(now);
754  }
755 
756  if (!do_locales)
757  setlocale(LC_TIME, "C");
758  strftime(tmp, sizeof(tmp), buf, &tm);
759  if (!do_locales)
760  setlocale(LC_TIME, "");
761 
762  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_DATE);
763  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
764  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
765 
766  if ((len > 0) && (op != 'd') && (op != 'D')) /* Skip ending op */
767  src = cp + 1;
768  break;
769  }
770 
771  case 'e':
772  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
773  snprintf(buf, buflen, fmt, mutt_messages_in_thread(m, e, 1));
774  break;
775 
776  case 'E':
777  if (!optional)
778  {
779  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
780  snprintf(buf, buflen, fmt, mutt_messages_in_thread(m, e, 0));
781  }
782  else if (mutt_messages_in_thread(m, e, 0) <= 1)
783  optional = false;
784  break;
785 
786  case 'f':
787  tmp[0] = '\0';
788  mutt_addrlist_write(&e->env->from, tmp, sizeof(tmp), true);
789  mutt_format_s(buf, buflen, prec, tmp);
790  break;
791 
792  case 'F':
793  if (!optional)
794  {
795  const bool is_plain = (src[0] == 'p');
796  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
797  make_from(e->env, tmp, sizeof(tmp), false,
798  (is_plain ? MUTT_FORMAT_PLAIN : MUTT_FORMAT_NO_FLAGS));
799  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
800  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
801 
802  if (is_plain)
803  src++;
804  }
805  else if (mutt_addr_is_user(from))
806  {
807  optional = false;
808  }
809  break;
810 
811  case 'g':
812  tags = driver_tags_get_transformed(&e->tags);
813  if (!optional)
814  {
815  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_TAGS);
816  mutt_format_s(buf + colorlen, buflen - colorlen, prec, NONULL(tags));
817  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
818  }
819  else if (!tags)
820  optional = false;
821  FREE(&tags);
822  break;
823 
824  case 'G':
825  {
826  char format[3];
827  char *tag = NULL;
828 
829  if (!optional)
830  {
831  format[0] = op;
832  format[1] = *src;
833  format[2] = '\0';
834 
835  tag = mutt_hash_find(TagFormats, format);
836  if (tag)
837  {
838  tags = driver_tags_get_transformed_for(&e->tags, tag);
839  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_TAG);
840  mutt_format_s(buf + colorlen, buflen - colorlen, prec, NONULL(tags));
841  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
842  FREE(&tags);
843  }
844  src++;
845  }
846  else
847  {
848  format[0] = op;
849  format[1] = *prec;
850  format[2] = '\0';
851 
852  tag = mutt_hash_find(TagFormats, format);
853  if (tag)
854  {
855  tags = driver_tags_get_transformed_for(&e->tags, tag);
856  if (!tags)
857  optional = false;
858  FREE(&tags);
859  }
860  }
861  break;
862  }
863 
864  case 'H':
865  /* (Hormel) spam score */
866  if (optional)
867  optional = !mutt_buffer_is_empty(&e->env->spam);
868 
869  mutt_format_s(buf, buflen, prec, mutt_b2s(&e->env->spam));
870  break;
871 
872  case 'i':
873  mutt_format_s(buf, buflen, prec, e->env->message_id ? e->env->message_id : "<no.id>");
874  break;
875 
876  case 'J':
877  {
878  bool have_tags = true;
879  tags = driver_tags_get_transformed(&e->tags);
880  if (tags)
881  {
882  if (flags & MUTT_FORMAT_TREE)
883  {
884  char *parent_tags = NULL;
885  if (e->thread->prev && e->thread->prev->message)
886  {
887  parent_tags = driver_tags_get_transformed(&e->thread->prev->message->tags);
888  }
889  if (!parent_tags && e->thread->parent && e->thread->parent->message)
890  {
891  parent_tags =
893  }
894  if (parent_tags && mutt_istr_equal(tags, parent_tags))
895  have_tags = false;
896  FREE(&parent_tags);
897  }
898  }
899  else
900  have_tags = false;
901 
902  if (optional)
903  optional = have_tags;
904 
905  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_TAGS);
906  if (have_tags)
907  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tags);
908  else
909  mutt_format_s(buf + colorlen, buflen - colorlen, prec, "");
910  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
911  FREE(&tags);
912  break;
913  }
914 
915  case 'l':
916  if (!optional)
917  {
918  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
919  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_SIZE);
920  snprintf(buf + colorlen, buflen - colorlen, fmt, (int) e->lines);
921  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
922  }
923  else if (e->lines <= 0)
924  optional = false;
925  break;
926 
927  case 'L':
928  if (!optional)
929  {
930  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
931  make_from(e->env, tmp, sizeof(tmp), true, flags);
932  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
933  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
934  }
935  else if (!check_for_mailing_list(&e->env->to, NULL, NULL, 0) &&
936  !check_for_mailing_list(&e->env->cc, NULL, NULL, 0))
937  {
938  optional = false;
939  }
940  break;
941 
942  case 'm':
943  if (m)
944  {
945  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
946  snprintf(buf, buflen, fmt, m->msg_count);
947  }
948  else
949  mutt_str_copy(buf, "(null)", buflen);
950  break;
951 
952  case 'n':
953  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
954  mutt_format_s(buf + colorlen, buflen - colorlen, prec, mutt_get_name(from));
955  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
956  break;
957 
958  case 'M':
959  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
960  if (!optional)
961  {
962  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_COLLAPSED);
963  if (threads && is_index && e->collapsed && (e->num_hidden > 1))
964  {
965  snprintf(buf + colorlen, buflen - colorlen, fmt, e->num_hidden);
966  add_index_color(buf, buflen - colorlen, flags, MT_COLOR_INDEX);
967  }
968  else if (is_index && threads)
969  {
970  mutt_format_s(buf + colorlen, buflen - colorlen, prec, " ");
971  add_index_color(buf, buflen - colorlen, flags, MT_COLOR_INDEX);
972  }
973  else
974  *buf = '\0';
975  }
976  else
977  {
978  if (!(threads && is_index && e->collapsed && (e->num_hidden > 1)))
979  optional = false;
980  }
981  break;
982 
983  case 'N':
984  if (!optional)
985  {
986  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
987  snprintf(buf, buflen, fmt, e->score);
988  }
989  else
990  {
991  if (e->score == 0)
992  optional = false;
993  }
994  break;
995 
996  case 'O':
997  if (!optional)
998  {
999  make_from_addr(e->env, tmp, sizeof(tmp), true);
1000  if (!C_SaveAddress && (p = strpbrk(tmp, "%@")))
1001  *p = '\0';
1002  mutt_format_s(buf, buflen, prec, tmp);
1003  }
1004  else if (!check_for_mailing_list_addr(&e->env->to, NULL, 0) &&
1005  !check_for_mailing_list_addr(&e->env->cc, NULL, 0))
1006  {
1007  optional = false;
1008  }
1009  break;
1010 
1011  case 'P':
1012  mutt_str_copy(buf, hfi->pager_progress, buflen);
1013  break;
1014 
1015 #ifdef USE_NNTP
1016  case 'q':
1017  mutt_format_s(buf, buflen, prec, e->env->newsgroups ? e->env->newsgroups : "");
1018  break;
1019 #endif
1020 
1021  case 'r':
1022  tmp[0] = '\0';
1023  mutt_addrlist_write(&e->env->to, tmp, sizeof(tmp), true);
1024  if (optional && (tmp[0] == '\0'))
1025  optional = false;
1026  mutt_format_s(buf, buflen, prec, tmp);
1027  break;
1028 
1029  case 'R':
1030  tmp[0] = '\0';
1031  mutt_addrlist_write(&e->env->cc, tmp, sizeof(tmp), true);
1032  if (optional && (tmp[0] == '\0'))
1033  optional = false;
1034  mutt_format_s(buf, buflen, prec, tmp);
1035  break;
1036 
1037  case 's':
1038  {
1039  char *subj = NULL;
1040  if (e->env->disp_subj)
1041  subj = e->env->disp_subj;
1042  else if (!STAILQ_EMPTY(&SubjectRegexList))
1043  subj = apply_subject_mods(e->env);
1044  else
1045  subj = e->env->subject;
1046  if (flags & MUTT_FORMAT_TREE && !e->collapsed)
1047  {
1048  if (flags & MUTT_FORMAT_FORCESUBJ)
1049  {
1050  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_SUBJECT);
1051  mutt_format_s(buf + colorlen, buflen - colorlen, "", NONULL(subj));
1052  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
1053  snprintf(tmp, sizeof(tmp), "%s%s", e->tree, buf);
1054  mutt_format_s_tree(buf, buflen, prec, tmp);
1055  }
1056  else
1057  mutt_format_s_tree(buf, buflen, prec, e->tree);
1058  }
1059  else
1060  {
1061  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_SUBJECT);
1062  mutt_format_s(buf + colorlen, buflen - colorlen, prec, NONULL(subj));
1063  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
1064  }
1065  break;
1066  }
1067 
1068  case 'S':
1069  {
1070  const char *wch = NULL;
1071  if (e->deleted)
1073  else if (e->attach_del)
1075  else if (e->tagged)
1077  else if (e->flagged)
1079  else if (e->replied)
1081  else if (e->read && (ctx && (ctx->msg_not_read_yet != e->msgno)))
1083  else if (e->old)
1085  else
1087 
1088  snprintf(tmp, sizeof(tmp), "%s", wch);
1089  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_FLAGS);
1090  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
1091  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
1092  break;
1093  }
1094 
1095  case 't':
1096  tmp[0] = '\0';
1097  if (!check_for_mailing_list(&e->env->to, "To ", tmp, sizeof(tmp)) &&
1098  !check_for_mailing_list(&e->env->cc, "Cc ", tmp, sizeof(tmp)))
1099  {
1100  if (to)
1101  snprintf(tmp, sizeof(tmp), "To %s", mutt_get_name(to));
1102  else if (cc)
1103  snprintf(tmp, sizeof(tmp), "Cc %s", mutt_get_name(cc));
1104  }
1105  mutt_format_s(buf, buflen, prec, tmp);
1106  break;
1107 
1108  case 'T':
1109  {
1110  int i;
1111  snprintf(fmt, sizeof(fmt), "%%%ss", prec);
1112  snprintf(buf, buflen, fmt,
1113  (C_ToChars && ((i = user_is_recipient(e))) < C_ToChars->len) ?
1114  C_ToChars->chars[i] :
1115  " ");
1116  break;
1117  }
1118 
1119  case 'u':
1120  if (from && from->mailbox)
1121  {
1122  mutt_str_copy(tmp, mutt_addr_for_display(from), sizeof(tmp));
1123  p = strpbrk(tmp, "%@");
1124  if (p)
1125  *p = '\0';
1126  }
1127  else
1128  tmp[0] = '\0';
1129  mutt_format_s(buf, buflen, prec, tmp);
1130  break;
1131 
1132  case 'v':
1133  if (mutt_addr_is_user(from))
1134  {
1135  if (to)
1136  mutt_format_s(tmp, sizeof(tmp), prec, mutt_get_name(to));
1137  else if (cc)
1138  mutt_format_s(tmp, sizeof(tmp), prec, mutt_get_name(cc));
1139  else
1140  *tmp = '\0';
1141  }
1142  else
1143  mutt_format_s(tmp, sizeof(tmp), prec, mutt_get_name(from));
1144  p = strpbrk(tmp, " %@");
1145  if (p)
1146  *p = '\0';
1147  mutt_format_s(buf, buflen, prec, tmp);
1148  break;
1149 
1150  case 'W':
1151  if (!optional)
1152  {
1153  mutt_format_s(buf, buflen, prec, e->env->organization ? e->env->organization : "");
1154  }
1155  else if (!e->env->organization)
1156  optional = false;
1157  break;
1158 
1159 #ifdef USE_NNTP
1160  case 'x':
1161  if (!optional)
1162  {
1163  mutt_format_s(buf, buflen, prec, e->env->x_comment_to ? e->env->x_comment_to : "");
1164  }
1165  else if (!e->env->x_comment_to)
1166  optional = false;
1167  break;
1168 #endif
1169 
1170  case 'X':
1171  {
1172  int count = mutt_count_body_parts(m, e);
1173 
1174  /* The recursion allows messages without depth to return 0. */
1175  if (optional)
1176  optional = (count != 0);
1177 
1178  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
1179  snprintf(buf, buflen, fmt, count);
1180  break;
1181  }
1182 
1183  case 'y':
1184  if (optional)
1185  optional = (e->env->x_label != NULL);
1186 
1187  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_LABEL);
1188  mutt_format_s(buf + colorlen, buflen - colorlen, prec, NONULL(e->env->x_label));
1189  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
1190  break;
1191 
1192  case 'Y':
1193  {
1194  bool label = true;
1195  if (e->env->x_label)
1196  {
1197  struct Email *e_tmp = NULL;
1198  if (flags & MUTT_FORMAT_TREE && (e->thread->prev && e->thread->prev->message &&
1199  e->thread->prev->message->env->x_label))
1200  {
1201  e_tmp = e->thread->prev->message;
1202  }
1203  else if (flags & MUTT_FORMAT_TREE &&
1204  (e->thread->parent && e->thread->parent->message &&
1205  e->thread->parent->message->env->x_label))
1206  {
1207  e_tmp = e->thread->parent->message;
1208  }
1209  if (e_tmp && mutt_istr_equal(e->env->x_label, e_tmp->env->x_label))
1210  label = false;
1211  }
1212  else
1213  label = false;
1214 
1215  if (optional)
1216  optional = label;
1217 
1218  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_LABEL);
1219  if (label)
1220  mutt_format_s(buf + colorlen, buflen - colorlen, prec, NONULL(e->env->x_label));
1221  else
1222  mutt_format_s(buf + colorlen, buflen - colorlen, prec, "");
1223  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
1224  break;
1225  }
1226 
1227  case 'z':
1228  if (src[0] == 's') /* status: deleted/new/old/replied */
1229  {
1230  const char *ch = NULL;
1231  if (e->deleted)
1233  else if (e->attach_del)
1235  else if (threads && thread_is_new(ctx, e))
1237  else if (threads && thread_is_old(ctx, e))
1239  else if (e->read && (ctx && (ctx->msg_not_read_yet != e->msgno)))
1240  {
1241  if (e->replied)
1243  else
1245  }
1246  else
1247  {
1248  if (e->old)
1250  else
1252  }
1253 
1254  snprintf(tmp, sizeof(tmp), "%s", ch);
1255  src++;
1256  }
1257  else if (src[0] == 'c') /* crypto */
1258  {
1259  const char *ch = "";
1260  if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
1262  else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
1264  else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
1266  else if (((WithCrypto & APPLICATION_PGP) != 0) && ((e->security & PGP_KEY) == PGP_KEY))
1267  {
1269  }
1270  else
1272 
1273  snprintf(tmp, sizeof(tmp), "%s", ch);
1274  src++;
1275  }
1276  else if (src[0] == 't') /* tagged, flagged, recipient */
1277  {
1278  const char *ch = "";
1279  if (e->tagged)
1281  else if (e->flagged)
1283  else
1285 
1286  snprintf(tmp, sizeof(tmp), "%s", ch);
1287  src++;
1288  }
1289  else /* fallthrough */
1290  break;
1291 
1292  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_FLAGS);
1293  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
1294  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
1295  break;
1296 
1297  case 'Z':
1298  {
1299  /* New/Old for threads; replied; New/Old for messages */
1300  const char *first = NULL;
1301  if (threads && thread_is_new(ctx, e))
1303  else if (threads && thread_is_old(ctx, e))
1305  else if (e->read && (ctx && (ctx->msg_not_read_yet != e->msgno)))
1306  {
1307  if (e->replied)
1309  else
1311  }
1312  else
1313  {
1314  if (e->old)
1316  else
1318  }
1319 
1320  /* Marked for deletion; deleted attachments; crypto */
1321  const char *second = "";
1322  if (e->deleted)
1324  else if (e->attach_del)
1326  else if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
1328  else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
1330  else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
1332  else if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & PGP_KEY))
1334  else
1336 
1337  /* Tagged, flagged and recipient flag */
1338  const char *third = "";
1339  if (e->tagged)
1341  else if (e->flagged)
1343  else
1345 
1346  snprintf(tmp, sizeof(tmp), "%s%s%s", first, second, third);
1347  }
1348 
1349  colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_FLAGS);
1350  mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
1351  add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
1352  break;
1353 
1354  case '@':
1355  {
1356  const char *end = src;
1357  static unsigned char recurse = 0;
1358 
1359  while ((*end != '\0') && (*end != '@'))
1360  end++;
1361  if ((*end == '@') && (recurse < 20))
1362  {
1363  recurse++;
1364  mutt_strn_copy(tmp, src, end - src, sizeof(tmp));
1365  mutt_expando_format(tmp, sizeof(tmp), col, cols,
1366  NONULL(mutt_idxfmt_hook(tmp, m, e)),
1367  index_format_str, data, flags);
1368  mutt_format_s_x(buf, buflen, prec, tmp, true);
1369  recurse--;
1370 
1371  src = end + 1;
1372  break;
1373  }
1374  }
1375  /* fallthrough */
1376 
1377  default:
1378  snprintf(buf, buflen, "%%%s%c", prec, op);
1379  break;
1380  }
1381 
1382  if (optional)
1383  {
1384  mutt_expando_format(buf, buflen, col, cols, if_str, index_format_str,
1385  (intptr_t) hfi, flags);
1386  }
1387  else if (flags & MUTT_FORMAT_OPTIONAL)
1388  {
1389  mutt_expando_format(buf, buflen, col, cols, else_str, index_format_str,
1390  (intptr_t) hfi, flags);
1391  }
1392 
1393  return src;
1394 }
void * mutt_hash_find(const struct HashTable *table, const char *strkey)
Find the HashElem data in a Hash Table element using a key.
Definition: hash.c:354
time_t mutt_date_epoch(void)
Return the number of seconds since the Unix epoch.
Definition: date.c:414
struct Context * ctx
Definition: hdrline.h:47
The "current" mailbox.
Definition: context.h:37
Character denoting a tagged email.
Definition: hdrline.c:71
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox&#39;s path string.
Definition: mailbox.h:194
Index: index number.
Definition: color.h:109
Character denoting a important (flagged) email.
Definition: hdrline.c:72
int lines
How many lines in the body of this message?
Definition: email.h:84
#define NONULL(x)
Definition: string2.h:37
int msg_count
Total number of messages.
Definition: mailbox.h:91
#define WithCrypto
Definition: lib.h:163
The envelope/body of an email.
Definition: email.h:37
Index: tags field (g, J)
Definition: color.h:111
#define TAILQ_FIRST(head)
Definition: queue.h:716
char ** chars
The array of multibyte character strings.
Definition: mbtable.h:39
struct AddressList reply_to
Email&#39;s &#39;reply-to&#39;.
Definition: envelope.h:62
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
Definition: date.c:641
#define MUTT_FORMAT_FORCESUBJ
Print the subject even if unchanged.
Definition: format_flags.h:31
struct MuttThread * thread
Thread of Emails.
Definition: email.h:94
static bool thread_is_new(struct Context *ctx, struct Email *e)
Does the email thread contain any new emails?
Definition: hdrline.c:382
char * disp_subj
Display subject (modified copy of subject)
Definition: envelope.h:68
Character denoting a thread containing at least one new email.
Definition: hdrline.c:79
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:125
bool attach_del
Has an attachment marked for deletion.
Definition: email.h:49
static int const char * fmt
Definition: acutest.h:488
struct Body * content
List of MIME parts.
Definition: email.h:90
Character denoting a message contains a PGP key.
Definition: hdrline.c:92
An email address.
Definition: address.h:34
#define MUTT_DATE_NOW
Constant representing the &#39;current time&#39;, see: mutt_date_gmtime(), mutt_date_localtime() ...
Definition: date.h:37
struct MuttThread * parent
Parent of this Thread.
Definition: thread.h:45
char * mailbox
Mailbox and host address.
Definition: address.h:37
Character denoting a read email, $index_format S expando.
Definition: hdrline.c:80
struct tm mutt_date_gmtime(time_t t)
Converts calendar time to a broken-down time structure expressed in UTC timezone. ...
Definition: date.c:659
bool zoccident
True, if west of UTC, False if east.
Definition: email.h:65
Index: number of messages in collapsed thread.
Definition: color.h:106
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
Definition: format_flags.h:30
struct MbTable * C_ToChars
Config: Indicator characters for the &#39;To&#39; field in the index.
Definition: hdrline.c:64
static char * apply_subject_mods(struct Envelope *env)
Apply regex modifications to the subject.
Definition: hdrline.c:358
static void make_from(struct Envelope *env, char *buf, size_t buflen, bool do_lists, MuttFormatFlags flags)
Generate a From: field (with optional prefix)
Definition: hdrline.c:211
bool check_for_mailing_list(struct AddressList *al, const char *pfx, char *buf, int buflen)
Search list of addresses for a mailing list.
Definition: maillist.c:79
Index: author field (takes a pattern)
Definition: color.h:101
bool tagged
Email is tagged.
Definition: email.h:44
bool read
Email is read.
Definition: email.h:51
const char * mutt_addr_for_display(const struct Address *a)
Convert an Address for display purposes.
Definition: address.c:986
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t *callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string.
Definition: muttlib.c:862
char * message_id
Message ID.
Definition: envelope.h:69
struct MuttThread * prev
Previous sibling Thread.
Definition: thread.h:48
#define MUTT_FORMAT_TREE
Draw the thread tree.
Definition: format_flags.h:32
bool old
Email is seen, but unread.
Definition: email.h:50
Data passed to index_format_str()
Definition: hdrline.h:45
struct AddressList from
Email&#39;s &#39;From&#39; list.
Definition: envelope.h:57
struct Envelope * env
Envelope information.
Definition: email.h:89
Index: tag field (g, takes a pattern)
Definition: color.h:104
Character denoting a deleted attachment.
Definition: hdrline.c:74
struct Mailbox * mailbox
Definition: hdrline.h:48
struct AddressList cc
Email&#39;s &#39;Cc&#39; list.
Definition: envelope.h:59
Character denoting an email that has been read.
Definition: hdrline.c:76
static int user_is_recipient(struct Email *e)
Is the user a recipient of the message.
Definition: hdrline.c:317
Character denoting a thread of emails that has been read.
Definition: hdrline.c:78
WHERE short C_Sort
Config: Sort method for the index.
Definition: sort.h:58
struct TagList tags
For drivers that support server tagging.
Definition: email.h:102
char * mutt_strn_copy(char *dest, const char *src, size_t len, size_t dsize)
Copy a sub-string into a buffer.
Definition: string.c:531
int score
Message score.
Definition: email.h:88
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:891
int msg_not_read_yet
Which msg "new" in pager, -1 if none.
Definition: context.h:44
time_t date_sent
Time when the message was sent (UTC)
Definition: email.h:81
#define mutt_b2s(buf)
Definition: buffer.h:41
Index: date field.
Definition: color.h:107
char * x_comment_to
List of &#39;X-comment-to&#39; fields.
Definition: envelope.h:78
const char * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
Definition: hook.c:867
Sort by email threads.
Definition: sort2.h:56
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:137
Character denoting an email that has been replied to.
Definition: hdrline.c:75
Index: size field.
Definition: color.h:110
char * driver_tags_get_transformed_for(struct TagList *head, const char *name)
Get transformed tag for a tag name from a header.
Definition: tags.c:169
LOFF_T length
length (in bytes) of attachment
Definition: body.h:45
A mailbox.
Definition: mailbox.h:81
void mutt_format_s_x(char *buf, size_t buflen, const char *prec, const char *s, bool arboreal)
Format a string like snprintf()
Definition: curs_lib.c:1186
bool check_for_mailing_list_addr(struct AddressList *al, char *buf, int buflen)
Check an address list for a mailing list.
Definition: maillist.c:103
static void make_from_addr(struct Envelope *env, char *buf, size_t buflen, bool do_lists)
Create a &#39;from&#39; address for a reply email.
Definition: hdrline.c:267
size_t num_hidden
Number of hidden messages in this view.
Definition: email.h:75
WHERE struct HashTable * TagFormats
Hash Table of tag-formats (tag -> format string)
Definition: globals.h:60
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num)
Display an abbreviated size, like 3.4K.
Definition: muttlib.c:1749
static bool thread_is_old(struct Context *ctx, struct Email *e)
Does the email thread contain any unread emails?
Definition: hdrline.c:394
Character denoting a message signed with a verified key.
Definition: hdrline.c:89
bool mutt_mb_get_initials(const char *name, char *buf, size_t buflen)
Turn a name into initials.
Definition: mbyte.c:84
static size_t add_index_color(char *buf, size_t buflen, MuttFormatFlags flags, char color)
Insert a color marker into a string.
Definition: hdrline.c:121
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:73
Character denoting a message is PGP-encrypted.
Definition: hdrline.c:90
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, int flag)
Count the messages in a thread.
Definition: mutt_thread.c:1413
unsigned int zhours
Hours away from UTC.
Definition: email.h:63
char * tree
Character string to print thread tree.
Definition: email.h:93
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib...
Definition: email.h:39
struct Email * message
Email this Thread refers to.
Definition: thread.h:49
static const char * get_nth_wchar(struct MbTable *table, int index)
Extract one char from a multi-byte table.
Definition: hdrline.c:158
#define SEC_SIGN
Email is signed.
Definition: lib.h:126
Character denoting a read email, $index_format Z expando.
Definition: hdrline.c:81
#define MUTT_FORMAT_INDEX
This is a main index entry.
Definition: format_flags.h:36
Index: label field.
Definition: color.h:108
char * subject
Email&#39;s subject.
Definition: envelope.h:66
Index: subject field (takes a pattern)
Definition: color.h:103
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
Definition: curs_lib.c:1223
#define PGP_KEY
Definition: lib.h:146
#define MUTT_FORMAT_PLAIN
Do not prepend DISP_TO, DISP_CC ...
Definition: format_flags.h:38
bool flagged
Marked important?
Definition: email.h:43
char * newsgroups
List of newsgroups.
Definition: envelope.h:75
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:724
Character denoting a deleted email.
Definition: hdrline.c:73
struct MbTable * C_FlagChars
Config: User-configurable index flags: tagged, new, etc.
Definition: hdrline.c:62
char * driver_tags_get_transformed(struct TagList *list)
Get transformed tags.
Definition: tags.c:130
bool deleted
Email is deleted.
Definition: email.h:45
bool replied
Email has been replied to.
Definition: email.h:54
WHERE char * C_DateFormat
Config: strftime format string for the d expando.
Definition: globals.h:106
Character denoting an unread email.
Definition: hdrline.c:77
Character denoting a message has no cryptography information.
Definition: hdrline.c:93
#define FREE(x)
Definition: memory.h:40
bool mutt_addr_is_user(const struct Address *addr)
Does the address belong to the user.
Definition: alias.c:545
const char * pager_progress
Definition: hdrline.h:50
char * organization
Organisation header.
Definition: envelope.h:73
Character denoting a message is signed.
Definition: hdrline.c:91
#define STAILQ_EMPTY(head)
Definition: queue.h:345
#define MUTT_FORMAT_OPTIONAL
Allow optional field processing.
Definition: format_flags.h:33
struct AddressList to
Email&#39;s &#39;To&#39; list.
Definition: envelope.h:58
int mutt_count_body_parts(struct Mailbox *m, struct Email *e)
Count the MIME Body parts.
Definition: mutt_parse.c:205
bool first_mailing_list(char *buf, size_t buflen, struct AddressList *al)
Get the first mailing list in the list of addresses.
Definition: maillist.c:125
Index: default colour (takes a pattern)
Definition: color.h:100
struct MbTable * C_CryptChars
Config: User-configurable crypto flags: signed, encrypted etc.
Definition: hdrline.c:61
struct Email * email
Definition: hdrline.h:49
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:252
char * x_label
X-Label.
Definition: envelope.h:72
#define SEC_GOODSIGN
Email has a valid signature.
Definition: lib.h:127
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
Definition: address.c:1147
unsigned int zminutes
Minutes away from UTC.
Definition: email.h:64
size_t email_size(const struct Email *e)
compute the size of an email
Definition: email.c:110
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:85
time_t received
Time when the message was placed in the mailbox.
Definition: email.h:82
static const char * index_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, intptr_t data, MuttFormatFlags flags)
Format a string for the index list - Implements format_t.
Definition: hdrline.c:456
Index: flags field (takes a pattern)
Definition: color.h:102
WHERE bool C_SaveAddress
Config: Use sender&#39;s full address as a default save folder.
Definition: globals.h:240
struct Buffer spam
Spam header.
Definition: envelope.h:80
int len
Number of characters.
Definition: mbtable.h:38
void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string with tree characters.
Definition: curs_lib.c:1235
int msgno
Number displayed to the user.
Definition: email.h:86
const char * mutt_get_name(const struct Address *a)
Pick the best name to display from an address.
Definition: sort.c:157
struct ReplaceList SubjectRegexList
List of regexes to tidy the view of the email&#39;s subject.
Definition: email_globals.c:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_make_string_flags()

void mutt_make_string_flags ( char *  buf,
size_t  buflen,
int  cols,
const char *  s,
struct Context ctx,
struct Mailbox m,
struct Email e,
MuttFormatFlags  flags 
)

Create formatted strings using mailbox expandos.

Parameters
bufBuffer for the result
buflenBuffer length
colsNumber of screen columns (OPTIONAL)
sprintf-line format string
ctxMailbox Context
mMailbox
eEmail
flagsFlags, see MuttFormatFlags

Definition at line 1407 of file hdrline.c.

1410 {
1411  struct HdrFormatInfo hfi;
1412 
1413  hfi.email = e;
1414  hfi.ctx = ctx;
1415  hfi.mailbox = m;
1416  hfi.pager_progress = 0;
1417 
1418  mutt_expando_format(buf, buflen, 0, cols, s, index_format_str, (intptr_t) &hfi, flags);
1419 }
struct Context * ctx
Definition: hdrline.h:47
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t *callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string.
Definition: muttlib.c:862
struct Mailbox * mailbox
Definition: context.h:50
Data passed to index_format_str()
Definition: hdrline.h:45
struct Email * email
Definition: hdrline.h:49
static const char * index_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, intptr_t data, MuttFormatFlags flags)
Format a string for the index list - Implements format_t.
Definition: hdrline.c:456
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_make_string_info()

void mutt_make_string_info ( char *  buf,
size_t  buflen,
int  cols,
const char *  s,
struct HdrFormatInfo hfi,
MuttFormatFlags  flags 
)

Create pager status bar string.

Parameters
bufBuffer for the result
buflenBuffer length
colsNumber of screen columns
sprintf-line format string
hfiMailbox data to pass to the formatter
flagsFlags, see MuttFormatFlags

Definition at line 1430 of file hdrline.c.

1432 {
1433  mutt_expando_format(buf, buflen, 0, cols, s, index_format_str, (intptr_t) hfi, flags);
1434 }
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t *callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string.
Definition: muttlib.c:862
static const char * index_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, intptr_t data, MuttFormatFlags flags)
Format a string for the index list - Implements format_t.
Definition: hdrline.c:456
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ C_CryptChars

struct MbTable* C_CryptChars

Config: User-configurable crypto flags: signed, encrypted etc.

Definition at line 61 of file hdrline.c.

◆ C_FlagChars

struct MbTable* C_FlagChars

Config: User-configurable index flags: tagged, new, etc.

Definition at line 62 of file hdrline.c.

◆ C_FromChars

struct MbTable* C_FromChars

Config: User-configurable index flags: to address, cc address, etc.

Definition at line 63 of file hdrline.c.

◆ C_ToChars

struct MbTable* C_ToChars

Config: Indicator characters for the 'To' field in the index.

Definition at line 64 of file hdrline.c.