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

Definition of the Parse Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/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 parse_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool parse_cleanup (struct NeoMutt *n, void *data)
 Clean up a Module - Implements Module::cleanup()
 

Variables

const struct Module ModuleParse
 Module for the Parse library.
 

Detailed Description

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

◆ parse_init()

static bool parse_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 39 of file module.c.

40{
41 struct ParseModuleData *mod_data = MUTT_MEM_CALLOC(1, struct ParseModuleData);
43
44 mod_data->notify = notify_new();
45 notify_set_parent(mod_data->notify, n->notify);
46
47 return true;
48}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_PARSE
ModuleParse, Text parsing functions
Definition module_api.h:84
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
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
Parse private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31
+ Here is the call graph for this function:

◆ parse_cleanup()

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

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

Definition at line 53 of file module.c.

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

◆ ModuleParse

const struct Module ModuleParse
Initial value:
= {
"parse",
NULL,
NULL,
NULL,
NULL,
NULL,
}
static bool parse_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:39
static bool parse_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:53

Module for the Parse library.

Definition at line 66 of file module.c.

66 {
68 "parse",
70 NULL, // config_define_types
71 NULL, // config_define_variables
72 NULL, // commands_register
73 NULL, // gui_init
74 NULL, // gui_cleanup
76};