NeoMutt  2018-07-16 +2481-68dcde
Teaching an old dog new tricks
DOXYGEN
hdrline.h File Reference

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

#include <stdbool.h>
#include <stdio.h>
#include "format_flags.h"
+ Include dependency graph for hdrline.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  HdrFormatInfo
 Data passed to index_format_str() More...
 

Macros

#define mutt_make_string(BUF, BUFLEN, S, CTX, M, E)   mutt_make_string_flags(BUF, BUFLEN, S, CTX, M, E, 0)
 

Functions

bool mutt_is_mail_list (const struct Address *addr)
 Is this the email address of a mailing list? More...
 
bool mutt_is_subscribed_list (const struct Address *addr)
 Is this the email address of a user-subscribed mailing list? More...
 
void mutt_make_string_flags (char *buf, size_t buflen, 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
  • Richard Russon
  • 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.h.

Macro Definition Documentation

◆ mutt_make_string

#define mutt_make_string (   BUF,
  BUFLEN,
  S,
  CTX,
  M,
 
)    mutt_make_string_flags(BUF, BUFLEN, S, CTX, M, E, 0)

Definition at line 61 of file hdrline.h.

Function Documentation

◆ mutt_is_mail_list()

bool mutt_is_mail_list ( const struct Address addr)

Is this the email address of a mailing list?

Parameters
addrAddress to test
Return values
trueIf it's a mailing list

Definition at line 101 of file hdrline.c.

102 {
104  return mutt_regexlist_match(&MailLists, addr->mailbox);
105  return false;
106 }
char * mailbox
Mailbox and host address.
Definition: address.h:37
bool mutt_regexlist_match(struct RegexList *rl, const char *str)
Does a string match any Regex in the list?
Definition: regex.c:191
struct RegexList MailLists
List of regexes to match mailing lists.
Definition: email_globals.c:50
struct RegexList UnMailLists
List of regexes to blacklist false matches in MailLists.
Definition: email_globals.c:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_is_subscribed_list()

bool mutt_is_subscribed_list ( const struct Address addr)

Is this the email address of a user-subscribed mailing list?

Parameters
addrAddress to test
Return values
trueIf it's a subscribed mailing list

Definition at line 113 of file hdrline.c.

114 {
115  if (!mutt_regexlist_match(&UnMailLists, addr->mailbox) &&
117  {
119  }
120  return false;
121 }
char * mailbox
Mailbox and host address.
Definition: address.h:37
bool mutt_regexlist_match(struct RegexList *rl, const char *str)
Does a string match any Regex in the list?
Definition: regex.c:191
struct RegexList SubscribedLists
List of regexes to match subscribed mailing lists.
Definition: email_globals.c:52
struct RegexList UnMailLists
List of regexes to blacklist false matches in MailLists.
Definition: email_globals.c:51
struct RegexList UnSubscribedLists
List of regexes to blacklist false matches in SubscribedLists.
Definition: email_globals.c:49
+ 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,
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
sprintf-line format string
ctxMailbox Context
mMailbox
eEmail
flagsFlags, see MuttFormatFlags

Definition at line 1497 of file hdrline.c.

1499 {
1500  struct HdrFormatInfo hfi;
1501 
1502  hfi.email = e;
1503  hfi.ctx = ctx;
1504  hfi.mailbox = m;
1505  hfi.pager_progress = 0;
1506 
1507  mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, s,
1508  index_format_str, (unsigned long) &hfi, flags);
1509 }
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, unsigned long data, MuttFormatFlags flags)
Expand expandos (x) in a string.
Definition: muttlib.c:844
struct Mailbox * mailbox
Definition: context.h:50
Data passed to index_format_str()
Definition: hdrline.h:45
struct MuttWindow * MuttIndexWindow
Index Window.
Definition: mutt_window.c:40
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, unsigned long data, MuttFormatFlags flags)
Format a string for the index list - Implements format_t.
Definition: hdrline.c:555
+ 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 1520 of file hdrline.c.

1522 {
1523  mutt_expando_format(buf, buflen, 0, cols, s, index_format_str, (unsigned long) hfi, flags);
1524 }
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t *callback, unsigned long data, MuttFormatFlags flags)
Expand expandos (x) in a string.
Definition: muttlib.c:844
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, unsigned long data, MuttFormatFlags flags)
Format a string for the index list - Implements format_t.
Definition: hdrline.c:555
+ 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.