48#define CONFIG_INIT_TYPE(CS, NAME) \
49 extern const struct ConfigSetType Cst##NAME; \
50 cs_register_type(CS, &Cst##NAME)
53#define CONFIG_INIT_VARS(CS, NAME) \
54 bool config_init_##NAME(struct ConfigSet *cs); \
55 config_init_##NAME(CS)
87 setlocale(LC_ALL,
"");
92 bindtextdomain(PACKAGE, domdir);
94 bindtextdomain(PACKAGE, MUTTLOCALEDIR);
140 const char *l10n = gettext(
buf_string(value));
155 static const char *names[] = {
"folder",
"mbox",
"postponed",
"record" };
158 for (
size_t i = 0; i <
countof(names); i++)
195 for (
int i = 0; n->
modules[i]; i++)
210 for (
int i = 0; n->
modules[i]; i++)
231 if (getsid(0) == getpid())
250 struct CommandArray *ca = &n->
commands;
255 for (
int i = 0; n->
modules[i]; i++)
285 for (
int i = 0; n->
modules[i]; i++)
526 const char *file,
int line,
const char *func)
struct HashTable * groups_new(void)
Create a HashTable for the Address Groups.
void groups_free(struct HashTable **pptr)
Free Address Groups HashTable.
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_REMOVE(head, elem)
Remove an entry from the array, shifting down the subsequent entries.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_INIT(head)
Initialize an array.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
bool config_str_set_initial(struct ConfigSet *cs, const char *name, const char *value)
Set the initial value of a Config Option.
bool config_he_set_initial(struct ConfigSet *cs, struct HashElem *he, const char *value)
Set the initial value of a Config Option.
Convenience wrapper for the config headers.
struct HashElem * cs_get_elem(const struct ConfigSet *cs, const char *name)
Get the HashElem representing a config item.
void cs_free(struct ConfigSet **ptr)
Free a Config Set.
struct ConfigSet * cs_new(size_t size)
Create a new Config Set.
int cs_he_initial_get(const struct ConfigSet *cs, struct HashElem *he, struct Buffer *result)
Get the initial, or parent, value of a config item.
void account_free(struct Account **ptr)
Free an Account.
A group of associated Mailboxes.
@ NT_ACCOUNT_ADD
Account has been added.
@ NT_ACCOUNT_DELETE_ALL
All Accounts are about to be deleted.
const char * mailbox_get_type_name(enum MailboxType type)
Get the type of a Mailbox.
Representation of a mailbox.
MailboxType
Supported mailbox formats.
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
void envlist_free(char ***envp)
Free the private copy of the environment.
char ** envlist_init(char **envp)
Create a copy of the environment.
FILE * mutt_file_fopen_full(const char *path, const char *mode, const mode_t perms, const char *file, int line, const char *func)
Call fopen() safely.
#define mutt_debug(LEVEL,...)
@ LL_DEBUG3
Log at debug level 3.
@ LL_DEBUG1
Log at debug level 1.
@ LL_NOTIFY
Log of notifications.
bool OptLocales
(pseudo) set if user has valid locale definition
#define FREE(x)
Free memory and set the pointer to NULL.
#define MUTT_MEM_CALLOC(n, type)
Convenience wrapper for the library headers.
struct Notify * notify_new(void)
Create a new notifications handler.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
void notify_free(struct Notify **ptr)
Free a notification handler.
const char * mutt_str_getenv(const char *name)
Get an environment variable.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
void expand_path(struct Buffer *buf, bool regex)
Create the canonical path.
Some miscellaneous functions.
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching Mailboxes.
static bool init_modules(struct NeoMutt *n)
Initialise the Modules.
static bool init_locale(struct NeoMutt *n)
Initialise the Locale/NLS settings.
static void cleanup_modules(struct NeoMutt *n)
Clean up each of the Modules.
static void localise_config(struct ConfigSet *cs)
Localise some config.
void neomutt_account_remove(struct NeoMutt *n, struct Account *a)
Remove an Account from the global list.
static void reset_tilde(struct ConfigSet *cs)
Temporary measure.
bool neomutt_account_add(struct NeoMutt *n, struct Account *a)
Add an Account to the global list.
void neomutt_cleanup(struct NeoMutt *n)
Clean up NeoMutt and Modules.
bool neomutt_init(struct NeoMutt *n, char **envp, const struct Module **modules)
Initialise NeoMutt.
void neomutt_accounts_free(struct NeoMutt *n)
FILE * mutt_file_fopen_masked_full(const char *path, const char *mode, const char *file, int line, const char *func)
Wrapper around mutt_file_fopen_full()
struct NeoMutt * neomutt_new(void)
Create the main NeoMutt object.
static bool init_config(struct NeoMutt *n)
Initialise the config system.
static bool init_env(struct NeoMutt *n, char **envp)
Initialise the Environment.
void neomutt_free(struct NeoMutt **ptr)
Free a NeoMutt.
static bool init_commands(struct NeoMutt *n)
Initialise the NeoMutt commands.
Container for Accounts, Notifications.
@ NT_ACCOUNT
Account has changed, NotifyAccount, EventAccount.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
A group of associated Mailboxes.
enum MailboxType type
Type of Mailboxes this Account contains.
struct Notify * notify
Notifications: NotifyAccount, EventAccount.
struct MailboxArray mailboxes
All Mailboxes.
String manipulation buffer.
char * data
Pointer to data.
Container for lots of config items.
struct ConfigSet * cs
Parent ConfigSet.
enum ConfigScope scope
Scope of Subset, e.g. SET_SCOPE_ACCOUNT.
An Event that happened to an Account.
The item stored in a Hash Table.
int type
Type of data stored in Hash Table, e.g. DT_STRING.
const char * name
Name of the library module.
bool(* init)(struct NeoMutt *n)
bool(* config_define_types)(struct NeoMutt *n, struct ConfigSet *cs)
bool(* commands_register)(struct NeoMutt *n, struct CommandArray *ca)
bool(* config_define_variables)(struct NeoMutt *n, struct ConfigSet *cs)
Container for Accounts, Notifications.
struct Notify * notify_timeout
Timeout notifications handler.
struct AccountArray accounts
All Accounts.
struct CommandArray commands
NeoMutt commands.
struct Notify * notify_resize
Window resize notifications handler.
char ** env
Private copy of the environment variables.
char * username
User's login name.
mode_t user_default_umask
User's default file writing permissions (inferred from umask)
const struct Module ** modules
Library modules.
char * home_dir
User's home directory.
struct ConfigSet * cs
Config set.
struct Notify * notify
Notifications handler.
struct HashTable * groups
Hash Table: "group-name" -> Group.
struct ConfigSubset * sub
Inherited config items.
locale_t time_c_locale
Current locale but LC_TIME=C.
struct HashElemArray get_elem_list(struct ConfigSet *cs, enum GetElemListFlags flags)
Create a sorted list of all config items.
struct ConfigSubset * cs_subset_new(const char *name, struct ConfigSubset *sub_parent, struct Notify *not_parent)
Create a new Config Subset.
void cs_subset_free(struct ConfigSubset **ptr)
Free a Config Subset.
@ GEL_ALL_CONFIG
All the normal config (no synonyms or deprecated)
@ SET_SCOPE_NEOMUTT
This Config is NeoMutt-specific (global)
#define D_L10N_STRING
String can be localised.