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

Definition of the Core Module. More...

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

Go to the source code of this file.

Functions

static bool core_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool core_cleanup (struct NeoMutt *n, void *data)
 Clean up a Module - Implements Module::cleanup()
 

Variables

const struct Module ModuleCore
 Module for the Core library.
 

Detailed Description

Definition of the Core 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

◆ core_init()

static bool core_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 40 of file module.c.

41{
42 struct CoreModuleData *mod_data = MUTT_MEM_CALLOC(1, struct CoreModuleData);
44
45 mod_data->notify = notify_new();
46 notify_set_parent(mod_data->notify, n->notify);
47
48 return true;
49}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_CORE
ModuleCore, Core NeoMutt objects
Definition module_api.h:62
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
Core 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:

◆ core_cleanup()

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

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

Definition at line 54 of file module.c.

55{
56 struct CoreModuleData *mod_data = data;
57
58 notify_free(&mod_data->notify);
59
60 FREE(&mod_data);
61 return true;
62}
#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

◆ ModuleCore

const struct Module ModuleCore
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
}
static bool core_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:40
static bool core_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:54

Module for the Core library.

Definition at line 67 of file module.c.

67 {
69 NULL, // config_define_types
70 NULL, // config_define_variables
71 NULL, // commands_register
72 NULL, // gui_init
73 NULL, // gui_cleanup
75};