NeoMutt  2025-12-11-872-g385a04
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#include "module_api.h"
33#ifdef __APPLE__
34#include <xlocale.h>
35#endif
36
40struct NeoMutt
41{
42 const struct Module *modules[MODULE_ID_MAX];
44
45 struct Notify *notify;
48 struct ConfigSet *cs;
49 struct ConfigSubset *sub;
50 struct AccountArray accounts;
51 locale_t time_c_locale;
53 struct CommandArray commands;
54
55 char *home_dir;
56 char *username;
57 char **env;
58};
59
60extern struct NeoMutt *NeoMutt;
61
73
74bool neomutt_account_add (struct NeoMutt *n, struct Account *a);
75void neomutt_account_remove(struct NeoMutt *n, struct Account *a);
76void neomutt_accounts_free (struct NeoMutt *n);
77void neomutt_free (struct NeoMutt **ptr);
78struct NeoMutt *neomutt_new (void);
79
80void *neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id);
81void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data);
82
83bool neomutt_init (struct NeoMutt *n, char **envp, const struct Module **modules);
84void neomutt_cleanup(struct NeoMutt *n);
85
86bool neomutt_gui_init (struct NeoMutt *n);
87void neomutt_gui_cleanup(struct NeoMutt *n);
88
89struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type);
90
92#define mutt_file_fopen_masked(PATH, MODE) mutt_file_fopen_masked_full(PATH, MODE, __FILE__, __LINE__, __func__)
93
94#endif /* MUTT_CORE_NEOMUTT_H */
NeoMutt commands API.
A group of associated Mailboxes.
Representation of a mailbox.
MailboxType
Supported mailbox formats.
Definition mailbox.h:40
Module API.
ModuleId
Unique Module Ids.
Definition module_api.h:42
@ MODULE_ID_MAX
Definition module_api.h:93
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching Mailboxes.
Definition neomutt.c:604
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:677
NotifyGlobal
Events not associated with an object.
Definition neomutt.h:68
@ NT_GLOBAL_STARTUP
NeoMutt is initialised.
Definition neomutt.h:69
@ NT_GLOBAL_COMMAND
A NeoMutt command.
Definition neomutt.h:71
@ NT_GLOBAL_SHUTDOWN
NeoMutt is about to close.
Definition neomutt.h:70
void neomutt_account_remove(struct NeoMutt *n, struct Account *a)
Remove an Account from the global list.
Definition neomutt.c:554
bool neomutt_account_add(struct NeoMutt *n, struct Account *a)
Add an Account to the global list.
Definition neomutt.c:534
void neomutt_cleanup(struct NeoMutt *n)
Clean up NeoMutt and Modules.
Definition neomutt.c:471
bool neomutt_init(struct NeoMutt *n, char **envp, const struct Module **modules)
Initialise NeoMutt.
Definition neomutt.c:347
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
void neomutt_accounts_free(struct NeoMutt *n)
Definition neomutt.c:575
void neomutt_gui_cleanup(struct NeoMutt *n)
Clean up the GUI Modules.
Definition neomutt.c:486
struct NeoMutt * neomutt_new(void)
Create the main NeoMutt object.
Definition neomutt.c:335
void neomutt_free(struct NeoMutt **ptr)
Free a NeoMutt.
Definition neomutt.c:498
bool neomutt_gui_init(struct NeoMutt *n)
Initialise the GUI Modules.
Definition neomutt.c:397
A group of associated Mailboxes.
Definition account.h:36
Container for lots of config items.
Definition set.h:251
A set of inherited config items.
Definition subset.h:46
Container for Accounts, Notifications.
Definition neomutt.h:41
const struct Module * modules[MODULE_ID_MAX]
Library modules.
Definition neomutt.h:42
struct Notify * notify_timeout
Timeout notifications handler.
Definition neomutt.h:47
struct AccountArray accounts
All Accounts.
Definition neomutt.h:50
struct CommandArray commands
NeoMutt commands.
Definition neomutt.h:53
struct Notify * notify_resize
Window resize notifications handler.
Definition neomutt.h:46
char ** env
Private copy of the environment variables.
Definition neomutt.h:57
char * username
User's login name.
Definition neomutt.h:56
void * module_data[MODULE_ID_MAX]
Private library module data.
Definition neomutt.h:43
mode_t user_default_umask
User's default file writing permissions (inferred from umask)
Definition neomutt.h:52
char * home_dir
User's home directory.
Definition neomutt.h:55
struct ConfigSet * cs
Config set.
Definition neomutt.h:48
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
locale_t time_c_locale
Current locale but LC_TIME=C.
Definition neomutt.h:51
Notification API.
Definition notify.c:53