String processing routines to generate the mail index. More...
#include "config.h"
#include <stdbool.h>
#include <stdio.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 "hdrline.h"
#include "attach/lib.h"
#include "color/lib.h"
#include "expando/lib.h"
#include "ncrypt/lib.h"
#include "hook.h"
#include "maillist.h"
#include "mutt_thread.h"
#include "muttlib.h"
#include "mx.h"
#include "sort.h"
#include "subjectrx.h"
#include "notmuch/lib.h"
Go to the source code of this file.
Data Structures | |
struct | HdrFormatInfo |
Data passed to index_format_str() More... | |
Enumerations | |
enum | FieldType { DISP_TO , DISP_CC , DISP_BCC , DISP_FROM , DISP_PLAIN , DISP_MAX } |
Header types. More... | |
enum | IndexDateChoice { SENT_SENDER , SENT_LOCAL , RECV_LOCAL } |
Which email date to display in the Index. More... | |
Functions | |
static const char * | make_from_prefix (enum FieldType disp) |
Create a prefix for an author field. | |
static void | make_from (struct Envelope *env, char *buf, size_t buflen, bool do_lists, MuttFormatFlags flags) |
Generate a From: field (with optional prefix) | |
static void | make_from_addr (struct Envelope *env, char *buf, size_t buflen, bool do_lists) |
Create a 'from' address for a reply email. | |
static bool | user_in_addr (struct AddressList *al) |
Do any of the addresses refer to the user? | |
static enum ToChars | user_is_recipient (struct Email *e) |
Is the user a recipient of the message. | |
static bool | thread_is_new (struct Email *e) |
Does the email thread contain any new emails? | |
static bool | thread_is_old (struct Email *e) |
Does the email thread contain any unread emails? | |
long | index_date_recv_local_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Local received date and time - Implements ExpandoRenderData::get_number() -. | |
static void | index_email_date (const struct ExpandoNode *node, const struct Email *e, enum IndexDateChoice which, MuttFormatFlags flags, struct Buffer *buf, const char *format) |
Index: Sent/Received Local/Sender date and time. | |
void | index_date_recv_local (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Received local date and time - Implements ExpandoRenderData::get_string() -. | |
long | index_date_local_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Local date and time - Implements ExpandoRenderData::get_number() -. | |
void | index_date_local (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent local date and time - Implements ExpandoRenderData::get_string() -. | |
long | index_date_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Sender's date and time - Implements ExpandoRenderData::get_number() -. | |
void | index_date (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent date and time - Implements ExpandoRenderData::get_string() -. | |
void | index_format_hook (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: index-format-hook - Implements ExpandoRenderData::get_string() -. | |
void | index_a (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Author Address - Implements ExpandoRenderData::get_string() -. | |
void | index_A (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Reply-to address - Implements ExpandoRenderData::get_string() -. | |
void | index_b (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Filename - Implements ExpandoRenderData::get_string() -. | |
void | index_B (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Email list - Implements ExpandoRenderData::get_string() -. | |
long | index_c_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of bytes - Implements ExpandoRenderData::get_number() -. | |
void | index_c (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Number of bytes - Implements ExpandoRenderData::get_string() -. | |
void | index_cr (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Number of raw bytes - Implements ExpandoRenderData::get_string() -. | |
long | index_C_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Index number - Implements ExpandoRenderData::get_number() -. | |
long | index_d_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Senders Date and time - Implements ExpandoRenderData::get_number() -. | |
void | index_d (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent date and time - Implements ExpandoRenderData::get_string() -. | |
void | index_D (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sent local date and time - Implements ExpandoRenderData::get_string() -. | |
long | index_D_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Local Date and time - Implements ExpandoRenderData::get_number() -. | |
long | index_e_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Thread index number - Implements ExpandoRenderData::get_number() -. | |
long | index_E_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of messages thread - Implements ExpandoRenderData::get_number() -. | |
void | index_f (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Sender - Implements ExpandoRenderData::get_string() -. | |
void | index_F (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Author name - Implements ExpandoRenderData::get_string() -. | |
void | index_Fp (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Plain author name - Implements ExpandoRenderData::get_string() -. | |
void | index_g (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message tags - Implements ExpandoRenderData::get_string() -. | |
void | index_G (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Individual tag - Implements ExpandoRenderData::get_string() -. | |
void | index_H (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Spam attributes - Implements ExpandoRenderData::get_string() -. | |
void | index_i (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message-id - Implements ExpandoRenderData::get_string() -. | |
void | index_I (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Initials of author - Implements ExpandoRenderData::get_string() -. | |
void | index_J (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Tags - Implements ExpandoRenderData::get_string() -. | |
void | index_K (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Mailing list - Implements ExpandoRenderData::get_string() -. | |
long | index_l_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of lines - Implements ExpandoRenderData::get_number() -. | |
void | index_L (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: List address - Implements ExpandoRenderData::get_string() -. | |
long | index_m_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Total number of message - Implements ExpandoRenderData::get_number() -. | |
void | index_M (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Number of hidden messages - Implements ExpandoRenderData::get_string() -. | |
long | index_M_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of hidden messages - Implements ExpandoRenderData::get_number() -. | |
void | index_n (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Author's real name - Implements ExpandoRenderData::get_string() -. | |
long | index_N_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Message score - Implements ExpandoRenderData::get_number() -. | |
void | index_O (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: List Name or Save folder - Implements ExpandoRenderData::get_string() -. | |
void | index_P (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Progress indicator - Implements ExpandoRenderData::get_string() -. | |
void | index_q (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Newsgroup name - Implements ExpandoRenderData::get_string() -. | |
void | index_r (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: To recipients - Implements ExpandoRenderData::get_string() -. | |
void | index_R (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Cc recipients - Implements ExpandoRenderData::get_string() -. | |
void | index_s (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Subject - Implements ExpandoRenderData::get_string() -. | |
void | index_S (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Status flag - Implements ExpandoRenderData::get_string() -. | |
void | index_t (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: To field - Implements ExpandoRenderData::get_string() -. | |
void | index_T (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: $to_chars flag - Implements ExpandoRenderData::get_string() -. | |
void | index_tree (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Thread tree - Implements ExpandoRenderData::get_string() -. | |
void | index_u (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: User name - Implements ExpandoRenderData::get_string() -. | |
void | index_v (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: First name - Implements ExpandoRenderData::get_string() -. | |
void | index_W (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Organization - Implements ExpandoRenderData::get_string() -. | |
void | index_x (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: X-Comment-To - Implements ExpandoRenderData::get_string() -. | |
long | index_X_num (const struct ExpandoNode *node, void *data, MuttFormatFlags flags) |
Index: Number of MIME attachments - Implements ExpandoRenderData::get_number() -. | |
void | index_y (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: X-Label - Implements ExpandoRenderData::get_string() -. | |
void | index_Y (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: X-Label (if different) - Implements ExpandoRenderData::get_string() -. | |
void | index_zc (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message crypto flags - Implements ExpandoRenderData::get_string() -. | |
void | index_zs (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message status flags - Implements ExpandoRenderData::get_string() -. | |
void | index_zt (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Message tag flags - Implements ExpandoRenderData::get_string() -. | |
void | index_Z (const struct ExpandoNode *node, void *data, MuttFormatFlags flags, struct Buffer *buf) |
Index: Status flags - Implements ExpandoRenderData::get_string() -. | |
int | mutt_make_string (struct Buffer *buf, size_t max_cols, const struct Expando *exp, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress) |
Create formatted strings using mailbox expandos. | |
Variables | |
const struct ExpandoRenderData | IndexRenderData [] |
Callbacks for Index Expandos. | |
String processing routines to generate the mail index.
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.
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 |
enum IndexDateChoice |
Which email date to display in the Index.
Enumerator | |
---|---|
SENT_SENDER | Date sent in the sender's timezone. |
SENT_LOCAL | Date sent in the local timezone. |
RECV_LOCAL | Date received in the local timezone. |
|
static |
Create a prefix for an author field.
disp | Type of field |
ptr | Prefix 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 101 of file hdrline.c.
|
static |
Generate a From: field (with optional prefix)
env | Envelope of the email |
buf | Buffer to store the result |
buflen | Size of the buffer |
do_lists | Should we check for mailing lists? |
flags | Format 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 137 of file hdrline.c.
|
static |
Create a 'from' address for a reply email.
env | Envelope of current email |
buf | Buffer for the result |
buflen | Length of buffer |
do_lists | If true, check for mailing lists |
Definition at line 193 of file hdrline.c.
|
static |
Do any of the addresses refer to the user?
al | AddressList |
true | Any of the addresses match one of the user's addresses |
Definition at line 223 of file hdrline.c.
Is the user a recipient of the message.
e | Email to test |
enum | Character index into the $to_chars config variable |
Definition at line 237 of file hdrline.c.
|
static |
Does the email thread contain any new emails?
e |
true | Thread contains new mail |
Definition at line 289 of file hdrline.c.
|
static |
|
static |
Index: Sent/Received Local/Sender date and time.
node | ExpandoNode containing the callback |
e | |
which | Which date to use |
flags | Flags, see MuttFormatFlags |
buf | Buffer for the result |
format | Format string |
Definition at line 336 of file hdrline.c.
int mutt_make_string | ( | struct Buffer * | buf, |
size_t | max_cols, | ||
const struct Expando * | exp, | ||
struct Mailbox * | m, | ||
int | inpgr, | ||
struct Email * | e, | ||
MuttFormatFlags | flags, | ||
const char * | progress | ||
) |
Create formatted strings using mailbox expandos.
buf | Buffer for the result |
max_cols | Number of screen columns (-1 means unlimited) |
exp | Expando containing expando tree |
m | Mailbox |
inpgr | Message shown in the pager |
e | |
flags | Flags, see MuttFormatFlags |
progress | Pager progress string |
num | Number of screen columns used |
Definition at line 1719 of file hdrline.c.
const struct ExpandoRenderData IndexRenderData |
Callbacks for Index Expandos.