NeoMutt  2025-12-11-117-gc1a713
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
neomutt.h
Go to the documentation of this file.
1
22
23#ifndef MUTT_CORE_NEOMUTT_H
24#define MUTT_CORE_NEOMUTT_H
25
26#include <locale.h>
27#include <stdbool.h>
28#include <sys/types.h>
29#include "account.h"
30#include "command.h"
31#include "mailbox.h"
32#ifdef __APPLE__
33#include <xlocale.h>
34#endif
35
36struct ConfigSet;
37struct NeoMutt;
38
44struct Module
45{
46 const char *name;
47
55 bool (*init)(struct NeoMutt *n);
56
67 bool (*config_define_types)(struct NeoMutt *n, struct ConfigSet *cs);
68
79 bool (*config_define_variables)(struct NeoMutt *n, struct ConfigSet *cs);
80
91 bool (*commands_register)(struct NeoMutt *n, struct CommandArray *ca);
92
100 bool (*gui_init)(struct NeoMutt *n);
101
110 void (*gui_cleanup)(struct NeoMutt *n);
111
119 void (*cleanup)(struct NeoMutt *n);
120
121 void *mod_data;
122};
123
128{
129 const struct Module **modules;
130 struct Notify *notify;
133 struct ConfigSet *cs;
135 struct AccountArray accounts;
136 locale_t time_c_locale;
138 struct CommandArray commands;
140
141 char *home_dir;
142 char *username;
143 char **env;
144};
145
146extern struct NeoMutt *NeoMutt;
147
159
160bool neomutt_account_add (struct NeoMutt *n, struct Account *a);
161void neomutt_account_remove(struct NeoMutt *n, struct Account *a);
162void neomutt_accounts_free (struct NeoMutt *n);
163void neomutt_free (struct NeoMutt **ptr);
164struct NeoMutt *neomutt_new (void);
165
166bool neomutt_init (struct NeoMutt *n, char **envp, const struct Module **modules);
167void neomutt_cleanup(struct NeoMutt *n);
168
169struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type);
170
171// Similar to mutt_file_fopen, but with the proper permissions inferred from
172#define mutt_file_fopen_masked(PATH, MODE) mutt_file_fopen_masked_full(PATH, MODE, __FILE__, __LINE__, __func__)
173
174#endif /* MUTT_CORE_NEOMUTT_H */
NeoMutt commands API.
A group of associated Mailboxes.
Representation of a mailbox.
MailboxType
Supported mailbox formats.
Definition mailbox.h:41
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching Mailboxes.
Definition neomutt.c:488
NotifyGlobal
Events not associated with an object.
Definition neomutt.h:154
@ NT_GLOBAL_STARTUP
NeoMutt is initialised.
Definition neomutt.h:155
@ NT_GLOBAL_COMMAND
A NeoMutt command.
Definition neomutt.h:157
@ NT_GLOBAL_SHUTDOWN
NeoMutt is about to close.
Definition neomutt.h:156
void neomutt_account_remove(struct NeoMutt *n, struct Account *a)
Remove an Account from the global list.
Definition neomutt.c:438
bool neomutt_account_add(struct NeoMutt *n, struct Account *a)
Add an Account to the global list.
Definition neomutt.c:418
void neomutt_cleanup(struct NeoMutt *n)
Clean up NeoMutt and Modules.
Definition neomutt.c:370
bool neomutt_init(struct NeoMutt *n, char **envp, const struct Module **modules)
Initialise NeoMutt.
Definition neomutt.c:315
void neomutt_accounts_free(struct NeoMutt *n)
Definition neomutt.c:459
struct NeoMutt * neomutt_new(void)
Create the main NeoMutt object.
Definition neomutt.c:303
void neomutt_free(struct NeoMutt **ptr)
Free a NeoMutt.
Definition neomutt.c:382
A group of associated Mailboxes.
Definition account.h:36
Container for lots of config items.
Definition set.h:248
A set of inherited config items.
Definition subset.h:46
A Hash Table.
Definition hash.h:99
void * mod_data
Module specific data.
Definition neomutt.h:121
bool(* gui_init)(struct NeoMutt *n)
Definition neomutt.h:100
void(* gui_cleanup)(struct NeoMutt *n)
Definition neomutt.h:110
const char * name
Definition neomutt.h:46
void(* cleanup)(struct NeoMutt *n)
Definition neomutt.h:119
bool(* init)(struct NeoMutt *n)
Definition neomutt.h:55
bool(* config_define_types)(struct NeoMutt *n, struct ConfigSet *cs)
Definition neomutt.h:67
bool(* commands_register)(struct NeoMutt *n, struct CommandArray *ca)
Definition neomutt.h:91
bool(* config_define_variables)(struct NeoMutt *n, struct ConfigSet *cs)
Definition neomutt.h:79
Container for Accounts, Notifications.
Definition neomutt.h:128
struct Notify * notify_timeout
Timeout notifications handler.
Definition neomutt.h:132
struct AccountArray accounts
All Accounts.
Definition neomutt.h:135
struct CommandArray commands
NeoMutt commands.
Definition neomutt.h:138
struct Notify * notify_resize
Window resize notifications handler.
Definition neomutt.h:131
char ** env
Private copy of the environment variables.
Definition neomutt.h:143
char * username
User's login name.
Definition neomutt.h:142
mode_t user_default_umask
User's default file writing permissions (inferred from umask)
Definition neomutt.h:137
const struct Module ** modules
Library modules.
Definition neomutt.h:129
char * home_dir
User's home directory.
Definition neomutt.h:141
struct ConfigSet * cs
Config set.
Definition neomutt.h:133
struct Notify * notify
Notifications handler.
Definition neomutt.h:130
struct HashTable * groups
Hash Table: "group-name" -> Group.
Definition neomutt.h:139
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:134
locale_t time_c_locale
Current locale but LC_TIME=C.
Definition neomutt.h:136
Notification API.
Definition notify.c:53