NeoMutt  2025-12-11-694-ga89709
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 "core/lib.h"
34#include "module_data.h"
35#include "set.h"
36
37extern const struct ConfigSetType CstBool;
38extern const struct ConfigSetType CstEnum;
39extern const struct ConfigSetType CstLong;
40extern const struct ConfigSetType CstMbtable;
41extern const struct ConfigSetType CstMyVar;
42extern const struct ConfigSetType CstNumber;
43extern const struct ConfigSetType CstPath;
44extern const struct ConfigSetType CstQuad;
45extern const struct ConfigSetType CstRegex;
46extern const struct ConfigSetType CstSlist;
47extern const struct ConfigSetType CstSort;
48extern const struct ConfigSetType CstString;
49
53static bool config_init(struct NeoMutt *n)
54{
55 // struct ConfigModuleData *md = MUTT_MEM_CALLOC(1, struct ConfigModuleData);
56 // neomutt_set_module_data(n, MODULE_ID_CONFIG, md);
57
58 return true;
59}
60
64static bool config_config_define_types(struct NeoMutt *n, struct ConfigSet *cs)
65{
66 bool rc = true;
67
68 rc &= cs_register_type(cs, &CstBool);
69 rc &= cs_register_type(cs, &CstEnum);
70 rc &= cs_register_type(cs, &CstLong);
71 rc &= cs_register_type(cs, &CstMbtable);
72 rc &= cs_register_type(cs, &CstMyVar);
73 rc &= cs_register_type(cs, &CstNumber);
74 rc &= cs_register_type(cs, &CstPath);
75 rc &= cs_register_type(cs, &CstQuad);
76 rc &= cs_register_type(cs, &CstRegex);
77 rc &= cs_register_type(cs, &CstSlist);
78 rc &= cs_register_type(cs, &CstSort);
79 rc &= cs_register_type(cs, &CstString);
80
81 return rc;
82}
83
87static bool config_cleanup(struct NeoMutt *n)
88{
89 // struct ConfigModuleData *md = neomutt_get_module_data(n, MODULE_ID_CONFIG);
90 // ASSERT(md);
91
92 // FREE(&md);
93 return true;
94}
95
99const struct Module ModuleConfig = {
101 "config",
104 NULL, // config_define_variables
105 NULL, // commands_register
106 NULL, // gui_init
107 NULL, // gui_cleanup
109};
const struct ConfigSetType CstBool
Config type representing an boolean.
Definition bool.c:241
const struct ConfigSetType CstPath
Config type representing a path.
Definition path.c:273
const struct ConfigSetType CstString
Config type representing a string.
Definition string.c:282
const struct Module ModuleConfig
Module for the Config library.
Definition module.c:99
const struct ConfigSetType CstNumber
Config type representing a number.
Definition number.c:327
const struct ConfigSetType CstMyVar
Config type representing a MyVar.
Definition myvar.c:203
const struct ConfigSetType CstSlist
Config type representing a list of strings.
Definition slist.c:334
static bool config_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:53
const struct ConfigSetType CstQuad
Config type representing a quad-option.
Definition quad.c:259
static bool config_cleanup(struct NeoMutt *n)
Clean up a Module - Implements Module::cleanup()
Definition module.c:87
static bool config_config_define_types(struct NeoMutt *n, struct ConfigSet *cs)
Set up Config Types - Implements Module::config_define_types()
Definition module.c:64
const struct ConfigSetType CstRegex
Config type representing a regular expression.
Definition regex.c:348
const struct ConfigSetType CstSort
Config type representing a sort option.
Definition sort.c:260
Config private Module data.
bool cs_register_type(struct ConfigSet *cs, const struct ConfigSetType *cst)
Register a type of config item.
Definition set.c:220
A collection of config items.
Convenience wrapper for the core headers.
const struct ConfigSetType CstEnum
Config type representing an enumeration.
Definition enum.c:202
const struct ConfigSetType CstLong
Config type representing a long.
Definition long.c:258
const struct ConfigSetType CstMbtable
Config type representing a multi-byte table.
Definition mbtable.c:354
@ MODULE_ID_CONFIG
ModuleConfig, Config
Definition module_api.h:59
Convenience wrapper for the library headers.
Container for lots of config items.
Definition set.h:251
Container for Accounts, Notifications.
Definition neomutt.h:41