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

Definition of the Expando 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 expando_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool expando_config_define_types (struct NeoMutt *n, struct ConfigSet *cs)
 Set up Config Types - Implements Module::config_define_types()
 
static bool expando_cleanup (struct NeoMutt *n, void *data)
 Clean up a Module - Implements Module::cleanup()
 

Variables

const struct ConfigSetType CstExpando
 Config type representing an Expando.
 
const struct Module ModuleExpando
 Module for the Expando library.
 

Detailed Description

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

◆ expando_init()

static bool expando_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 42 of file module.c.

43{
44 struct ExpandoModuleData *mod_data = MUTT_MEM_CALLOC(1, struct ExpandoModuleData);
46
47 mod_data->notify = notify_new();
48 notify_set_parent(mod_data->notify, n->notify);
49
50 return true;
51}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_EXPANDO
ModuleExpando, Parse Expando string
Definition module_api.h:66
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
Expando 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:

◆ expando_config_define_types()

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

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

Definition at line 56 of file module.c.

57{
58 return cs_register_type(cs, &CstExpando);
59}
bool cs_register_type(struct ConfigSet *cs, const struct ConfigSetType *cst)
Register a type of config item.
Definition set.c:220
const struct ConfigSetType CstExpando
Config type representing an Expando.
+ Here is the call graph for this function:

◆ expando_cleanup()

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

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

Definition at line 64 of file module.c.

65{
66 struct ExpandoModuleData *mod_data = data;
67
68 notify_free(&mod_data->notify);
69
70 FREE(&mod_data);
71 return true;
72}
#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

◆ CstExpando

const struct ConfigSetType CstExpando
extern

Config type representing an Expando.

Definition at line 339 of file config_type.c.

339 {
341 "expando",
347 NULL, // string_minus_equals
351};
static void expando_destroy(void *var, const struct ConfigDef *cdef)
Destroy an Expando object - Implements ConfigSetType::destroy() -.
Definition config_type.c:48
static bool expando_has_been_set(void *var, const struct ConfigDef *cdef)
Is the config value different to its initial value?
static int expando_native_set(void *var, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Set an Expando object from an Expando config item - Implements ConfigSetType::native_get() -.
static intptr_t expando_native_get(void *var, const struct ConfigDef *cdef, struct Buffer *err)
Get an Expando object from an Expando config item - Implements ConfigSetType::native_get() -.
static int expando_reset(void *var, const struct ConfigDef *cdef, struct Buffer *err)
Reset an Expando to its initial value - Implements ConfigSetType::reset() -.
static int expando_string_get(void *var, const struct ConfigDef *cdef, struct Buffer *result)
Get an Expando as a string - Implements ConfigSetType::string_get() -.
static int expando_string_plus_equals(void *var, const struct ConfigDef *cdef, const char *value, struct Buffer *err)
Add to an Expando by string - Implements ConfigSetType::string_plus_equals() -.
static int expando_string_set(void *var, struct ConfigDef *cdef, const char *value, struct Buffer *err)
Set an Expando by string - Implements ConfigSetType::string_set() -.
Definition config_type.c:60
@ DT_EXPANDO
an expando
Definition types.h:34

◆ ModuleExpando

const struct Module ModuleExpando
Initial value:
= {
"expando",
NULL,
NULL,
NULL,
NULL,
}
static bool expando_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:42
static bool expando_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:64
static bool expando_config_define_types(struct NeoMutt *n, struct ConfigSet *cs)
Set up Config Types - Implements Module::config_define_types()
Definition module.c:56

Module for the Expando library.

Definition at line 77 of file module.c.

77 {
79 "expando",
82 NULL, // config_define_variables
83 NULL, // commands_register
84 NULL, // gui_init
85 NULL, // gui_cleanup
87};