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

Definition of the Address 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 address_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool address_config_define_types (struct NeoMutt *n, struct ConfigSet *cs)
 Set up Config Types - Implements Module::config_define_types()
 
static bool address_config_define_variables (struct NeoMutt *n, struct ConfigSet *cs)
 Define the Config Variables - Implements Module::config_define_variables()
 
static bool address_cleanup (struct NeoMutt *n, void *data)
 Clean up a Module - Implements Module::cleanup()
 

Variables

const struct ConfigSetType CstAddress
 Config type representing an Email Address.
 
struct ConfigDef AddressVarsIdn []
 IDN Config definitions.
 
const struct Module ModuleAddress
 Module for the Address library.
 

Detailed Description

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

◆ address_init()

static bool address_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 45 of file module.c.

46{
47 struct AddressModuleData *mod_data = MUTT_MEM_CALLOC(1, struct AddressModuleData);
49
50 mod_data->notify = notify_new();
51 notify_set_parent(mod_data->notify, n->notify);
52
53 return true;
54}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_ADDRESS
ModuleAddress, Address
Definition module_api.h:47
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
Address 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:

◆ address_config_define_types()

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

Set up Config Types - Implements Module::config_define_types()

Definition at line 59 of file module.c.

60{
61 return cs_register_type(cs, &CstAddress);
62}
const struct ConfigSetType CstAddress
Config type representing an Email Address.
bool cs_register_type(struct ConfigSet *cs, const struct ConfigSetType *cst)
Register a type of config item.
Definition set.c:220
+ Here is the call graph for this function:

◆ address_config_define_variables()

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

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

Definition at line 67 of file module.c.

68{
69 bool rc = true;
70
71#if defined(HAVE_LIBIDN)
73#endif
74
75 return rc;
76}
struct ConfigDef AddressVarsIdn[]
IDN Config definitions.
Definition config.c:30
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
+ Here is the call graph for this function:

◆ address_cleanup()

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

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

Definition at line 81 of file module.c.

82{
83 struct AddressModuleData *mod_data = data;
84
85 notify_free(&mod_data->notify);
86
87 FREE(&mod_data);
88 return true;
89}
#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

◆ CstAddress

const struct ConfigSetType CstAddress
extern

Config type representing an Email Address.

Definition at line 265 of file config_type.c.

265 {
267 "address",
272 NULL, // string_plus_equals
273 NULL, // string_minus_equals
277};
static void address_destroy(void *var, const struct ConfigDef *cdef)
Destroy an Address object - Implements ConfigSetType::destroy() -.
Definition config_type.c:62
static bool address_has_been_set(void *var, const struct ConfigDef *cdef)
Is the config value different to its initial value?
static intptr_t address_native_get(void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get an Address object from an Address config item - Implements ConfigSetType::native_get() -.
static int address_native_set(void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set an Address config item by Address object - Implements ConfigSetType::native_set() -.
static int address_reset(void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset an Address to its initial value - Implements ConfigSetType::reset() -.
static int address_string_get(void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get an Address as a string - Implements ConfigSetType::string_get() -.
static int address_string_set(void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set an Address by string - Implements ConfigSetType::string_set() -.
Definition config_type.c:74
@ DT_ADDRESS
e-mail address
Definition types.h:31

◆ AddressVarsIdn

struct ConfigDef AddressVarsIdn[]
extern

IDN Config definitions.

Definition at line 30 of file config.c.

30 {
31 // clang-format off
32 { "idn_decode", DT_BOOL, true, 0, NULL,
33 "(idn) Decode international domain names"
34 },
35 { "idn_encode", DT_BOOL, true, 0, NULL,
36 "(idn) Encode international domain names"
37 },
38 { NULL },
39 // clang-format on
40};
@ DT_BOOL
boolean option
Definition types.h:32

◆ ModuleAddress

const struct Module ModuleAddress
Initial value:
= {
"address",
NULL,
NULL,
NULL,
}
static bool address_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:67
static bool address_config_define_types(struct NeoMutt *n, struct ConfigSet *cs)
Set up Config Types - Implements Module::config_define_types()
Definition module.c:59
static bool address_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:81
static bool address_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:45

Module for the Address library.

Definition at line 94 of file module.c.

94 {
96 "address",
100 NULL, // commands_register
101 NULL, // gui_init
102 NULL, // gui_cleanup
104};