NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c
Go to the documentation of this file.
1
22
28
29#include "config.h"
30#include <stdbool.h>
31#include <stddef.h>
32#include "mutt/lib.h"
33#include "config/lib.h"
34#include "core/lib.h"
35#include "module_data.h"
36
37extern struct ConfigDef NntpVars[];
38
42static bool nntp_init(struct NeoMutt *n)
43{
44 struct NntpModuleData *mod_data = MUTT_MEM_CALLOC(1, struct NntpModuleData);
46
47 mod_data->notify = notify_new();
48 notify_set_parent(mod_data->notify, n->notify);
49
50 return true;
51}
52
56static bool nntp_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
57{
59}
60
64static bool nntp_cleanup(struct NeoMutt *n, void *data)
65{
66 struct NntpModuleData *mod_data = data;
67
68 notify_free(&mod_data->notify);
69
70 FREE(&mod_data);
71 return true;
72}
73
77const struct Module ModuleNntp = {
79 "nntp",
81 NULL, // config_define_types
83 NULL, // commands_register
84 NULL, // gui_init
85 NULL, // gui_cleanup
87};
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
Convenience wrapper for the core headers.
const struct Module ModuleNntp
Module for the Nntp library.
Definition module.c:77
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_NNTP
ModuleNntp, Nntp
Definition module_api.h:81
Convenience wrapper for the library headers.
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 notify_free(struct Notify **ptr)
Free a notification handler.
Definition notify.c:75
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 ConfigDef NntpVars[]
Config definitions for the NNTP library.
Definition config.c:59
static bool nntp_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:64
static bool nntp_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:56
static bool nntp_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:42
Nntp private Module data.
Container for lots of config items.
Definition set.h:251
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
Nntp private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31