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#ifdef USE_SASL_GNU
36#include "gsasl2.h"
37#endif
38#ifdef USE_SASL_CYRUS
39#include "sasl.h"
40#endif
41#include "module_data.h"
42
43extern struct ConfigDef ConnVars[];
44extern struct ConfigDef ConnVarsGetaddr[];
45extern struct ConfigDef ConnVarsGnutls[];
46extern struct ConfigDef ConnVarsOpenssl[];
47extern struct ConfigDef ConnVarsPartial[];
48extern struct ConfigDef ConnVarsSsl[];
49
53static bool conn_init(struct NeoMutt *n)
54{
55 struct ConnModuleData *mod_data = MUTT_MEM_CALLOC(1, struct ConnModuleData);
57
58#ifdef USE_SSL_OPENSSL
59 mod_data->host_ex_data_index = -1;
60 mod_data->skip_mode_ex_data_index = -1;
61#endif
62
63 mod_data->notify = notify_new();
64 notify_set_parent(mod_data->notify, n->notify);
65
66 return true;
67}
68
72static bool conn_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
73{
74 bool rc = true;
75
77
78#if defined(USE_SSL)
80#endif
81
82#if defined(USE_SSL_GNUTLS)
84#endif
85
86#if defined(USE_SSL_OPENSSL)
88#endif
89
90#if defined(HAVE_SSL_PARTIAL_CHAIN)
92#endif
93
94#if defined(HAVE_GETADDRINFO)
96#endif
97
98 return rc;
99}
100
104static bool conn_cleanup(struct NeoMutt *n, void *data)
105{
106 struct ConnModuleData *mod_data = data;
107
108 notify_free(&mod_data->notify);
109
110#ifdef USE_SASL_CYRUS
112#endif
113#ifdef USE_SASL_GNU
114 mutt_gsasl_cleanup(&mod_data->mutt_gsasl_ctx);
115#endif
116
117#ifdef USE_SASL_CYRUS
118 FREE(&mod_data->mutt_sasl_callbacks);
119 FREE(&mod_data->secret_ptr);
120#endif
121 FREE(&mod_data);
122 return true;
123}
124
128const struct Module ModuleConn = {
130 "conn",
131 conn_init,
132 NULL, // config_define_types
134 NULL, // commands_register
135 NULL, // gui_init
136 NULL, // gui_cleanup
138};
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
struct ConfigDef ConnVarsSsl[]
General SSL Config definitions for the conn library.
Definition config.c:66
struct ConfigDef ConnVars[]
Config definitions for the connection library.
Definition config.c:39
struct ConfigDef ConnVarsOpenssl[]
OpenSSL Config definitions for the connection library.
Definition config.c:125
struct ConfigDef ConnVarsPartial[]
SSL partial chains Config definitions for the connection library.
Definition config.c:145
struct ConfigDef ConnVarsGetaddr[]
GetAddrInfo Config definitions for the connection library.
Definition config.c:159
struct ConfigDef ConnVarsGnutls[]
GnuTLS Config definitions for the connection library.
Definition config.c:108
static bool conn_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:104
const struct Module ModuleConn
Module for the Conn library.
Definition module.c:128
static bool conn_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:72
static bool conn_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:53
Conn private Module data.
Convenience wrapper for the core headers.
GNU SASL authentication support.
void mutt_gsasl_cleanup(Gsasl **ctx)
Shutdown GNU SASL library.
Definition gsasl.c:151
#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_CONN
ModuleConn, Network connections
Definition module_api.h:60
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
void mutt_sasl_cleanup(void)
Invoke when processing is complete.
Definition sasl.c:789
SASL authentication support.
Container for lots of config items.
Definition set.h:251
Conn private Module data.
Definition module_data.h:38
struct Notify * notify
Notifications.
Definition module_data.h:39
int skip_mode_ex_data_index
OpenSSL skip mode extra data index.
Definition module_data.h:49
int host_ex_data_index
OpenSSL host extra data index.
Definition module_data.h:48
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45