NeoMutt  2018-07-16 +2481-68dcde
Teaching an old dog new tricks
DOXYGEN
mutt.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_MUTT_H
25 #define MUTT_MUTT_H
26 
27 #include "config.h"
28 #include <stddef.h>
29 #include <limits.h>
30 #include <regex.h>
31 #include <stdbool.h>
32 #include <stdint.h>
33 #include "config/lib.h"
34 #include "email/lib.h"
35 #include "hook.h"
36 #include "keymap.h"
37 #include "mutt_commands.h"
38 
39 struct Buffer;
40 struct ListHead;
41 struct Mapping;
42 
43 /* On OS X 10.5.x, wide char functions are inlined by default breaking
44  * --without-wc-funcs compilation
45  */
46 #ifdef __APPLE_CC__
47 #define _DONT_USE_CTYPE_INLINE_
48 #endif
49 
50 /* PATH_MAX is undefined on the hurd */
51 #ifndef PATH_MAX
52 #define PATH_MAX 4096
53 #endif
54 
55 #ifdef HAVE_FGETS_UNLOCKED
56 #define fgets fgets_unlocked
57 #endif
58 
59 #ifdef HAVE_FGETC_UNLOCKED
60 #define fgetc fgetc_unlocked
61 #endif
62 
63 typedef uint16_t CompletionFlags;
64 #define MUTT_COMP_NO_FLAGS 0
65 #define MUTT_ALIAS (1 << 0)
66 #define MUTT_FILE (1 << 1)
67 #define MUTT_EFILE (1 << 2)
68 #define MUTT_CMD (1 << 3)
69 #define MUTT_PASS (1 << 4)
70 #define MUTT_CLEAR (1 << 5)
71 #define MUTT_COMMAND (1 << 6)
72 #define MUTT_PATTERN (1 << 7)
73 #define MUTT_LABEL (1 << 8)
74 #define MUTT_NM_QUERY (1 << 9)
75 #define MUTT_NM_TAG (1 << 10)
76 
77 typedef uint16_t TokenFlags;
78 #define MUTT_TOKEN_NO_FLAGS 0
79 #define MUTT_TOKEN_EQUAL (1 << 0)
80 #define MUTT_TOKEN_CONDENSE (1 << 1)
81 #define MUTT_TOKEN_SPACE (1 << 2)
82 #define MUTT_TOKEN_QUOTE (1 << 3)
83 #define MUTT_TOKEN_PATTERN (1 << 4)
84 #define MUTT_TOKEN_COMMENT (1 << 5)
85 #define MUTT_TOKEN_SEMICOLON (1 << 6)
86 #define MUTT_TOKEN_BACKTICK_VARS (1 << 7)
87 #define MUTT_TOKEN_NOSHELL (1 << 8)
88 #define MUTT_TOKEN_QUESTION (1 << 9)
89 
90 
96 {
97  MUTT_ALL = 1,
115 
117 };
118 
119 /* flags for parse_spam_list */
120 #define MUTT_SPAM 1
121 #define MUTT_NOSPAM 2
122 
123 int mutt_init(bool skip_sys_rc, struct ListHead *commands);
124 struct ConfigSet *init_config(size_t size);
125 
132 {
133  const char *major;
135  const char *minor;
136  regex_t minor_regex;
137 };
138 
139 #define EXEC_SHELL "/bin/sh"
140 
141 char *mutt_compile_help(char *buf, size_t buflen, enum MenuType menu, const struct Mapping *items);
142 
143 int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags);
144 void mutt_opts_free(void);
145 enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt);
146 int mutt_label_complete(char *buf, size_t buflen, int numtabs);
147 int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs);
148 int mutt_var_value_complete(char *buf, size_t buflen, int pos);
149 void myvar_set(const char *var, const char *val);
150 bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs);
151 bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs);
152 HookFlags mutt_get_hook_type(const char *name);
153 enum CommandResult mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
154 int mutt_query_variables(struct ListHead *queries);
155 void reset_value(const char *name);
156 
157 #ifdef HAVE_LIBUNWIND
158 void show_backtrace(void);
159 #endif
160 
161 #endif /* MUTT_MUTT_H */
Deleted messages.
Definition: mutt.h:107
bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs)
Complete to the nearest notmuch tag.
Definition: init.c:3648
Container for lots of config items.
Definition: set.h:187
Manage keymappings.
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:33
uint16_t CompletionFlags
Flags for mutt_enter_string_full(), e.g. MUTT_ALIAS.
Definition: mutt.h:63
Structs that make up an email.
MenuType
Types of GUI selections.
Definition: keymap.h:60
Messages in limited view.
Definition: mutt.h:111
char * mutt_compile_help(char *buf, size_t buflen, enum MenuType menu, const struct Mapping *items)
Create the text for the help menu.
Definition: help.c:115
String manipulation buffer.
Definition: buffer.h:33
Messages to be un-deleted.
Definition: mutt.h:105
Flagged messages.
Definition: mutt.h:108
enum ContentType major_int
Definition: mutt.h:134
No messages.
Definition: mutt.h:98
int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs)
Complete a command name.
Definition: init.c:3357
Messages to be purged (bypass trash)
Definition: mutt.h:106
uint32_t HookFlags
Flags for mutt_parse_hook(), e.g. MUTT_FOLDER_HOOK.
Definition: hook.h:43
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
Definition: init.c:3331
Messages that have been replied to.
Definition: mutt.h:101
Convenience wrapper for the config headers.
All messages.
Definition: mutt.h:97
Parse and execute user-defined hooks.
MessageType
To set flags or match patterns.
Definition: mutt.h:95
const char * name
Definition: pgpmicalg.c:45
const char * major
Definition: mutt.h:133
struct ConfigSet * init_config(size_t size)
Initialise the config system.
Definition: init.c:3769
void myvar_set(const char *var, const char *val)
Set the value of a "my_" variable.
Definition: myvar.c:91
Old messages.
Definition: mutt.h:100
const char * line
Definition: common.c:36
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2649
void reset_value(const char *name)
Messages to be deleted.
Definition: mutt.h:104
enum CommandResult mutt_parse_rc_line(char *line, struct Buffer *token, struct Buffer *err)
Parse a line of user config.
Definition: init.c:3224
HookFlags mutt_get_hook_type(const char *name)
Find a hook by name.
Definition: init.c:2953
Superseded messages.
Definition: mutt.h:113
Tagged messages.
Definition: mutt.h:109
int mutt_label_complete(char *buf, size_t buflen, int numtabs)
Complete a label name.
Definition: init.c:3527
New messages.
Definition: mutt.h:99
Messages that have been read.
Definition: mutt.h:102
Mapping from user command name to function.
Expired messages.
Definition: mutt.h:112
int mutt_init(bool skip_sys_rc, struct ListHead *commands)
Initialise NeoMutt.
Definition: init.c:2973
Unread messages.
Definition: mutt.h:103
bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs)
Complete to the nearest notmuch tag.
Definition: init.c:3591
int mutt_var_value_complete(char *buf, size_t buflen, int pos)
Complete a variable/value.
Definition: init.c:3701
regex_t minor_regex
Definition: mutt.h:136
int mutt_query_variables(struct ListHead *queries)
Implement the -Q command line flag.
Definition: init.c:3280
void show_backtrace(void)
Log the program&#39;s call stack.
Definition: backtrace.c:37
Mapping between user-readable string and a constant.
Definition: mapping.h:29
Messages to be un-tagged.
Definition: mutt.h:110
void mutt_opts_free(void)
clean up before quitting
Definition: init.c:2886
uint16_t TokenFlags
Flags for mutt_extract_token(), e.g. MUTT_TOKEN_EQUAL.
Definition: mutt.h:77
An attachment matching a regex.
Definition: mutt.h:131
const char * minor
Definition: mutt.h:135
Trashed messages.
Definition: mutt.h:114
QuadOption
Possible values for a quad-option.
Definition: quad.h:35
ContentType
Content-Type.
Definition: mime.h:29