NeoMutt  2020-04-24
Teaching an old dog new tricks
DOXYGEN
mutt.h File Reference

Many unsorted constants and some structs. More...

#include "config.h"
#include <stddef.h>
#include <limits.h>
#include <stdint.h>
#include "keymap.h"
+ Include dependency graph for mutt.h:

Go to the source code of this file.

Macros

#define PATH_MAX   4096
 
#define MUTT_COMP_NO_FLAGS   0
 No flags are set. More...
 
#define MUTT_ALIAS   (1 << 0)
 Do alias "completion" by calling up the alias-menu. More...
 
#define MUTT_FILE   (1 << 1)
 Do file completion. More...
 
#define MUTT_EFILE   (1 << 2)
 Do file completion, plus incoming folders. More...
 
#define MUTT_CMD   (1 << 3)
 Do completion on previous word. More...
 
#define MUTT_PASS   (1 << 4)
 Password mode (no echo) More...
 
#define MUTT_CLEAR   (1 << 5)
 Clear input if printable character is pressed. More...
 
#define MUTT_COMMAND   (1 << 6)
 Do command completion. More...
 
#define MUTT_PATTERN   (1 << 7)
 Pattern mode - only used for history classes. More...
 
#define MUTT_LABEL   (1 << 8)
 Do label completion. More...
 
#define MUTT_NM_QUERY   (1 << 9)
 Notmuch query mode. More...
 
#define MUTT_NM_TAG   (1 << 10)
 Notmuch tag +/- mode. More...
 
#define MUTT_TOKEN_NO_FLAGS   0
 No flags are set. More...
 
#define MUTT_TOKEN_EQUAL   (1 << 0)
 Treat '=' as a special. More...
 
#define MUTT_TOKEN_CONDENSE   (1 << 1)
 ^(char) to control chars (macros) More...
 
#define MUTT_TOKEN_SPACE   (1 << 2)
 Don't treat whitespace as a term. More...
 
#define MUTT_TOKEN_QUOTE   (1 << 3)
 Don't interpret quotes. More...
 
#define MUTT_TOKEN_PATTERN   (1 << 4)
 ~%=!| are terms (for patterns) More...
 
#define MUTT_TOKEN_COMMENT   (1 << 5)
 Don't reap comments. More...
 
#define MUTT_TOKEN_SEMICOLON   (1 << 6)
 Don't treat ; as special. More...
 
#define MUTT_TOKEN_BACKTICK_VARS   (1 << 7)
 Expand variables within backticks. More...
 
#define MUTT_TOKEN_NOSHELL   (1 << 8)
 Don't expand environment variables. More...
 
#define MUTT_TOKEN_QUESTION   (1 << 9)
 Treat '?' as a special. More...
 
#define MUTT_SPAM   1
 
#define MUTT_NOSPAM   2
 

Typedefs

typedef uint16_t CompletionFlags
 Flags for mutt_enter_string_full(), e.g. MUTT_ALIAS. More...
 
typedef uint16_t TokenFlags
 Flags for mutt_extract_token(), e.g. MUTT_TOKEN_EQUAL. More...
 

Enumerations

enum  MessageType {
  MUTT_ALL = 1, MUTT_NONE, MUTT_NEW, MUTT_OLD,
  MUTT_REPLIED, MUTT_READ, MUTT_UNREAD, MUTT_DELETE,
  MUTT_UNDELETE, MUTT_PURGE, MUTT_DELETED, MUTT_FLAG,
  MUTT_TAG, MUTT_UNTAG, MUTT_LIMIT, MUTT_EXPIRED,
  MUTT_SUPERSEDED, MUTT_TRASH, MUTT_MT_MAX
}
 To set flags or match patterns. More...
 

Functions

char * mutt_compile_help (char *buf, size_t buflen, enum MenuType menu, const struct Mapping *items)
 Create the text for the help menu. More...
 
void reset_value (const char *name)
 

Detailed Description

Many unsorted constants and some structs.

Authors
  • Michael R. Elkins
  • g10 Code GmbH

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 mutt.h.

Macro Definition Documentation

◆ PATH_MAX

#define PATH_MAX   4096

Definition at line 44 of file mutt.h.

◆ MUTT_COMP_NO_FLAGS

#define MUTT_COMP_NO_FLAGS   0

No flags are set.

Definition at line 56 of file mutt.h.

◆ MUTT_ALIAS

#define MUTT_ALIAS   (1 << 0)

Do alias "completion" by calling up the alias-menu.

Definition at line 57 of file mutt.h.

◆ MUTT_FILE

#define MUTT_FILE   (1 << 1)

Do file completion.

Definition at line 58 of file mutt.h.

◆ MUTT_EFILE

#define MUTT_EFILE   (1 << 2)

Do file completion, plus incoming folders.

Definition at line 59 of file mutt.h.

◆ MUTT_CMD

#define MUTT_CMD   (1 << 3)

Do completion on previous word.

Definition at line 60 of file mutt.h.

◆ MUTT_PASS

#define MUTT_PASS   (1 << 4)

Password mode (no echo)

Definition at line 61 of file mutt.h.

◆ MUTT_CLEAR

#define MUTT_CLEAR   (1 << 5)

Clear input if printable character is pressed.

Definition at line 62 of file mutt.h.

◆ MUTT_COMMAND

#define MUTT_COMMAND   (1 << 6)

Do command completion.

Definition at line 63 of file mutt.h.

◆ MUTT_PATTERN

#define MUTT_PATTERN   (1 << 7)

Pattern mode - only used for history classes.

Definition at line 64 of file mutt.h.

◆ MUTT_LABEL

#define MUTT_LABEL   (1 << 8)

Do label completion.

Definition at line 65 of file mutt.h.

◆ MUTT_NM_QUERY

#define MUTT_NM_QUERY   (1 << 9)

Notmuch query mode.

Definition at line 66 of file mutt.h.

◆ MUTT_NM_TAG

#define MUTT_NM_TAG   (1 << 10)

Notmuch tag +/- mode.

Definition at line 67 of file mutt.h.

◆ MUTT_TOKEN_NO_FLAGS

#define MUTT_TOKEN_NO_FLAGS   0

No flags are set.

Definition at line 70 of file mutt.h.

◆ MUTT_TOKEN_EQUAL

#define MUTT_TOKEN_EQUAL   (1 << 0)

Treat '=' as a special.

Definition at line 71 of file mutt.h.

◆ MUTT_TOKEN_CONDENSE

#define MUTT_TOKEN_CONDENSE   (1 << 1)

^(char) to control chars (macros)

Definition at line 72 of file mutt.h.

◆ MUTT_TOKEN_SPACE

#define MUTT_TOKEN_SPACE   (1 << 2)

Don't treat whitespace as a term.

Definition at line 73 of file mutt.h.

◆ MUTT_TOKEN_QUOTE

#define MUTT_TOKEN_QUOTE   (1 << 3)

Don't interpret quotes.

Definition at line 74 of file mutt.h.

◆ MUTT_TOKEN_PATTERN

#define MUTT_TOKEN_PATTERN   (1 << 4)

~%=!| are terms (for patterns)

Definition at line 75 of file mutt.h.

◆ MUTT_TOKEN_COMMENT

#define MUTT_TOKEN_COMMENT   (1 << 5)

Don't reap comments.

Definition at line 76 of file mutt.h.

◆ MUTT_TOKEN_SEMICOLON

#define MUTT_TOKEN_SEMICOLON   (1 << 6)

Don't treat ; as special.

Definition at line 77 of file mutt.h.

◆ MUTT_TOKEN_BACKTICK_VARS

#define MUTT_TOKEN_BACKTICK_VARS   (1 << 7)

Expand variables within backticks.

Definition at line 78 of file mutt.h.

◆ MUTT_TOKEN_NOSHELL

#define MUTT_TOKEN_NOSHELL   (1 << 8)

Don't expand environment variables.

Definition at line 79 of file mutt.h.

◆ MUTT_TOKEN_QUESTION

#define MUTT_TOKEN_QUESTION   (1 << 9)

Treat '?' as a special.

Definition at line 80 of file mutt.h.

◆ MUTT_SPAM

#define MUTT_SPAM   1

Definition at line 112 of file mutt.h.

◆ MUTT_NOSPAM

#define MUTT_NOSPAM   2

Definition at line 113 of file mutt.h.

Typedef Documentation

◆ CompletionFlags

typedef uint16_t CompletionFlags

Flags for mutt_enter_string_full(), e.g. MUTT_ALIAS.

Definition at line 55 of file mutt.h.

◆ TokenFlags

typedef uint16_t TokenFlags

Flags for mutt_extract_token(), e.g. MUTT_TOKEN_EQUAL.

Definition at line 69 of file mutt.h.

Enumeration Type Documentation

◆ MessageType

To set flags or match patterns.

See also
mutt_set_flag(), mutt_pattern_func()
Enumerator
MUTT_ALL 

All messages.

MUTT_NONE 

No messages.

MUTT_NEW 

New messages.

MUTT_OLD 

Old messages.

MUTT_REPLIED 

Messages that have been replied to.

MUTT_READ 

Messages that have been read.

MUTT_UNREAD 

Unread messages.

MUTT_DELETE 

Messages to be deleted.

MUTT_UNDELETE 

Messages to be un-deleted.

MUTT_PURGE 

Messages to be purged (bypass trash)

MUTT_DELETED 

Deleted messages.

MUTT_FLAG 

Flagged messages.

MUTT_TAG 

Tagged messages.

MUTT_UNTAG 

Messages to be un-tagged.

MUTT_LIMIT 

Messages in limited view.

MUTT_EXPIRED 

Expired messages.

MUTT_SUPERSEDED 

Superseded messages.

MUTT_TRASH 

Trashed messages.

MUTT_MT_MAX 

Definition at line 87 of file mutt.h.

88 {
89  MUTT_ALL = 1,
90  MUTT_NONE,
91  MUTT_NEW,
92  MUTT_OLD,
93  MUTT_REPLIED,
94  MUTT_READ,
95  MUTT_UNREAD,
96  MUTT_DELETE,
98  MUTT_PURGE,
99  MUTT_DELETED,
100  MUTT_FLAG,
101  MUTT_TAG,
102  MUTT_UNTAG,
103  MUTT_LIMIT,
104  MUTT_EXPIRED,
106  MUTT_TRASH,
107 
108  MUTT_MT_MAX,
109 };
Deleted messages.
Definition: mutt.h:99
Messages in limited view.
Definition: mutt.h:103
Messages to be un-deleted.
Definition: mutt.h:97
Flagged messages.
Definition: mutt.h:100
No messages.
Definition: mutt.h:90
Messages to be purged (bypass trash)
Definition: mutt.h:98
Messages that have been replied to.
Definition: mutt.h:93
All messages.
Definition: mutt.h:89
Old messages.
Definition: mutt.h:92
Messages to be deleted.
Definition: mutt.h:96
Superseded messages.
Definition: mutt.h:105
Tagged messages.
Definition: mutt.h:101
New messages.
Definition: mutt.h:91
Messages that have been read.
Definition: mutt.h:94
Expired messages.
Definition: mutt.h:104
Unread messages.
Definition: mutt.h:95
Messages to be un-tagged.
Definition: mutt.h:102
Trashed messages.
Definition: mutt.h:106

Function Documentation

◆ mutt_compile_help()

char* mutt_compile_help ( char *  buf,
size_t  buflen,
enum MenuType  menu,
const struct Mapping items 
)

Create the text for the help menu.

Parameters
bufBuffer for the result
buflenLength of buffer
menuCurrent Menu, e.g. MENU_PAGER
itemsMap of functions to display in the help bar
Return values
ptrBuffer containing result

Definition at line 116 of file help.c.

118 {
119  char *pbuf = buf;
120 
121  for (int i = 0; items[i].name && buflen > 2; i++)
122  {
123  if (i)
124  {
125  *pbuf++ = ' ';
126  *pbuf++ = ' ';
127  buflen -= 2;
128  }
129  mutt_make_help(pbuf, buflen, _(items[i].name), menu, items[i].value);
130  const size_t len = mutt_str_strlen(pbuf);
131  pbuf += len;
132  buflen -= len;
133  }
134  return buf;
135 }
#define _(a)
Definition: message.h:28
size_t mutt_str_strlen(const char *a)
Calculate the length of a string, safely.
Definition: string.c:692
const char * name
Definition: pgpmicalg.c:46
void mutt_make_help(char *buf, size_t buflen, const char *txt, enum MenuType menu, int op)
Create one entry for the help bar.
Definition: help.c:93
const char * name
Definition: mapping.h:31
static unsigned char * pbuf
Cache PGP data packet.
Definition: pgppacket.c:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_value()

void reset_value ( const char *  name)