NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c File Reference

Definition of the Maildir Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "module_data.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool maildir_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool maildir_config_define_variables (struct NeoMutt *n, struct ConfigSet *cs)
 Define the Config Variables - Implements Module::config_define_variables()
 
static bool maildir_cleanup (struct NeoMutt *n, void *data)
 Clean up a Module - Implements Module::cleanup()
 

Variables

struct ConfigDef MaildirVars []
 Config definitions for the Maildir library.
 
struct ConfigDef MaildirVarsHcache []
 Config definitions for the Maildir header cache.
 
const struct Module ModuleMaildir
 Module for the Maildir library.
 

Detailed Description

Definition of the Maildir Module.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file module.c.

Function Documentation

◆ maildir_init()

static bool maildir_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 43 of file module.c.

44{
45 struct MaildirModuleData *mod_data = MUTT_MEM_CALLOC(1, struct MaildirModuleData);
47
48 mod_data->notify = notify_new();
49 notify_set_parent(mod_data->notify, n->notify);
50
51 return true;
52}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_MAILDIR
ModuleMaildir, Maildir Mailbox
Definition module_api.h:75
struct Notify * notify_new(void)
Create a new notifications handler.
Definition notify.c:62
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition notify.c:95
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:677
Maildir private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
+ Here is the call graph for this function:

◆ maildir_config_define_variables()

static bool maildir_config_define_variables ( struct NeoMutt * n,
struct ConfigSet * cs )
static

Define the Config Variables - Implements Module::config_define_variables()

Definition at line 57 of file module.c.

58{
60
61#if defined(USE_HCACHE)
63#endif
64
65 return rc;
66}
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
struct ConfigDef MaildirVars[]
Config definitions for the Maildir library.
Definition config.c:68
struct ConfigDef MaildirVarsHcache[]
Config definitions for the Maildir header cache.
Definition config.c:90
+ Here is the call graph for this function:

◆ maildir_cleanup()

static bool maildir_cleanup ( struct NeoMutt * n,
void * data )
static

Clean up a Module - Implements Module::cleanup()

Definition at line 71 of file module.c.

72{
73 struct MaildirModuleData *mod_data = data;
74
75 notify_free(&mod_data->notify);
76
77 FREE(&mod_data);
78 return true;
79}
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition notify.c:75
+ Here is the call graph for this function:

Variable Documentation

◆ MaildirVars

struct ConfigDef MaildirVars[]
extern

Config definitions for the Maildir library.

Definition at line 68 of file config.c.

68 {
69 // clang-format off
70 { "check_new", DT_BOOL, true, 0, NULL,
71 "(maildir,mh) Check for new mail while the mailbox is open"
72 },
73 { "maildir_check_cur", DT_BOOL, false, 0, NULL,
74 "Check both 'new' and 'cur' directories for new mail"
75 },
76 { "maildir_field_delimiter", DT_STRING|D_NOT_EMPTY|D_ON_STARTUP, IP ":", 0, maildir_field_delimiter_validator,
77 "Field delimiter to be used for maildir email files (default is colon, recommended alternative is semi-colon)"
78 },
79 { "maildir_trash", DT_BOOL, false, 0, NULL,
80 "Use the maildir 'trashed' flag, rather than deleting"
81 },
82 { NULL },
83 // clang-format on
84};
#define IP
Definition set.h:55
static int maildir_field_delimiter_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "maildir_field_delimiter" config variable - Implements ConfigDef::validator() -.
Definition config.c:43
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_STRING
a string
Definition types.h:44
#define D_NOT_EMPTY
Empty strings are not allowed.
Definition types.h:80
#define D_ON_STARTUP
May only be set at startup.
Definition types.h:79

◆ MaildirVarsHcache

struct ConfigDef MaildirVarsHcache[]
extern

Config definitions for the Maildir header cache.

Definition at line 90 of file config.c.

90 {
91 // clang-format off
92 { "maildir_header_cache_verify", DT_BOOL, true, 0, NULL,
93 "Check for maildir changes when opening mailbox"
94 },
95 { NULL },
96 // clang-format on
97};

◆ ModuleMaildir

const struct Module ModuleMaildir
Initial value:
= {
"maildir",
NULL,
NULL,
NULL,
NULL,
}
static bool maildir_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:71
static bool maildir_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:43
static bool maildir_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:57

Module for the Maildir library.

Definition at line 84 of file module.c.

84 {
86 "maildir",
88 NULL, // config_define_types
90 NULL, // commands_register
91 NULL, // gui_init
92 NULL, // gui_cleanup
94};