NeoMutt  2019-12-07
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 <stdbool.h>
31 #include <stdint.h>
32 #include "config/lib.h"
33 #include "hook.h"
34 #include "keymap.h"
35 #include "mutt_commands.h"
36 
37 struct Buffer;
38 struct ListHead;
39 struct Mapping;
40 
41 /* On OS X 10.5.x, wide char functions are inlined by default breaking
42  * --without-wc-funcs compilation
43  */
44 #ifdef __APPLE_CC__
45 #define _DONT_USE_CTYPE_INLINE_
46 #endif
47 
48 /* PATH_MAX is undefined on the hurd */
49 #ifndef PATH_MAX
50 #define PATH_MAX 4096
51 #endif
52 
53 #ifdef HAVE_FGETS_UNLOCKED
54 #define fgets fgets_unlocked
55 #endif
56 
57 #ifdef HAVE_FGETC_UNLOCKED
58 #define fgetc fgetc_unlocked
59 #endif
60 
61 typedef uint16_t CompletionFlags;
62 #define MUTT_COMP_NO_FLAGS 0
63 #define MUTT_ALIAS (1 << 0)
64 #define MUTT_FILE (1 << 1)
65 #define MUTT_EFILE (1 << 2)
66 #define MUTT_CMD (1 << 3)
67 #define MUTT_PASS (1 << 4)
68 #define MUTT_CLEAR (1 << 5)
69 #define MUTT_COMMAND (1 << 6)
70 #define MUTT_PATTERN (1 << 7)
71 #define MUTT_LABEL (1 << 8)
72 #define MUTT_NM_QUERY (1 << 9)
73 #define MUTT_NM_TAG (1 << 10)
74 
75 typedef uint16_t TokenFlags;
76 #define MUTT_TOKEN_NO_FLAGS 0
77 #define MUTT_TOKEN_EQUAL (1 << 0)
78 #define MUTT_TOKEN_CONDENSE (1 << 1)
79 #define MUTT_TOKEN_SPACE (1 << 2)
80 #define MUTT_TOKEN_QUOTE (1 << 3)
81 #define MUTT_TOKEN_PATTERN (1 << 4)
82 #define MUTT_TOKEN_COMMENT (1 << 5)
83 #define MUTT_TOKEN_SEMICOLON (1 << 6)
84 #define MUTT_TOKEN_BACKTICK_VARS (1 << 7)
85 #define MUTT_TOKEN_NOSHELL (1 << 8)
86 #define MUTT_TOKEN_QUESTION (1 << 9)
87 
88 
94 {
95  MUTT_ALL = 1,
113 
115 };
116 
117 /* flags for parse_spam_list */
118 #define MUTT_SPAM 1
119 #define MUTT_NOSPAM 2
120 
121 int mutt_init(bool skip_sys_rc, struct ListHead *commands);
122 struct ConfigSet *init_config(size_t size);
123 
124 #define EXEC_SHELL "/bin/sh"
125 
126 char *mutt_compile_help(char *buf, size_t buflen, enum MenuType menu, const struct Mapping *items);
127 
128 int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags);
129 void mutt_opts_free(void);
130 enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt);
131 int mutt_label_complete(char *buf, size_t buflen, int numtabs);
132 int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs);
133 int mutt_var_value_complete(char *buf, size_t buflen, int pos);
134 bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs);
135 bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs);
136 HookFlags mutt_get_hook_type(const char *name);
137 enum CommandResult mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
138 int mutt_query_variables(struct ListHead *queries);
139 void reset_value(const char *name);
140 
141 #ifdef HAVE_LIBUNWIND
142 void show_backtrace(void);
143 #endif
144 
145 #endif /* MUTT_MUTT_H */
Deleted messages.
Definition: mutt.h:105
bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs)
Complete to the nearest notmuch tag.
Definition: init.c:3676
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:61
MenuType
Types of GUI selections.
Definition: keymap.h:69
Messages in limited view.
Definition: mutt.h:109
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:103
Flagged messages.
Definition: mutt.h:106
No messages.
Definition: mutt.h:96
int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs)
Complete a command name.
Definition: init.c:3385
Messages to be purged (bypass trash)
Definition: mutt.h:104
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:3359
Messages that have been replied to.
Definition: mutt.h:99
Convenience wrapper for the config headers.
All messages.
Definition: mutt.h:95
Parse and execute user-defined hooks.
MessageType
To set flags or match patterns.
Definition: mutt.h:93
const char * name
Definition: pgpmicalg.c:46
struct ConfigSet * init_config(size_t size)
Initialise the config system.
Definition: init.c:3797
Old messages.
Definition: mutt.h:98
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:2674
void reset_value(const char *name)
Messages to be deleted.
Definition: mutt.h:102
enum CommandResult mutt_parse_rc_line(char *line, struct Buffer *token, struct Buffer *err)
Parse a line of user config.
Definition: init.c:3251
HookFlags mutt_get_hook_type(const char *name)
Find a hook by name.
Definition: init.c:2976
Superseded messages.
Definition: mutt.h:111
Tagged messages.
Definition: mutt.h:107
int mutt_label_complete(char *buf, size_t buflen, int numtabs)
Complete a label name.
Definition: init.c:3555
New messages.
Definition: mutt.h:97
Messages that have been read.
Definition: mutt.h:100
Mapping from user command name to function.
Expired messages.
Definition: mutt.h:110
int mutt_init(bool skip_sys_rc, struct ListHead *commands)
Initialise NeoMutt.
Definition: init.c:2996
Unread messages.
Definition: mutt.h:101
bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs)
Complete to the nearest notmuch tag.
Definition: init.c:3619
int mutt_var_value_complete(char *buf, size_t buflen, int pos)
Complete a variable/value.
Definition: init.c:3729
int mutt_query_variables(struct ListHead *queries)
Implement the -Q command line flag.
Definition: init.c:3308
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:108
void mutt_opts_free(void)
clean up before quitting
Definition: init.c:2909
uint16_t TokenFlags
Flags for mutt_extract_token(), e.g. MUTT_TOKEN_EQUAL.
Definition: mutt.h:75
Trashed messages.
Definition: mutt.h:112
QuadOption
Possible values for a quad-option.
Definition: quad.h:35