NeoMutt  2025-12-11-769-g906513
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
crypt_mod.c
Go to the documentation of this file.
1
23
29
30#include "config.h"
31#include "mutt/lib.h"
32#include "core/lib.h"
33#include "crypt_mod.h"
34#include "lib.h"
35#include "module_data.h"
36
42{
44 struct CryptModule *module = MUTT_MEM_CALLOC(1, struct CryptModule);
45 module->specs = specs;
46 STAILQ_INSERT_HEAD(&mod_data->crypt_modules, module, entries);
47}
48
57{
59 const struct CryptModule *module = NULL;
60 STAILQ_FOREACH(module, &mod_data->crypt_modules, entries)
61 {
62 if (module->specs->identifier == identifier)
63 {
64 return module->specs;
65 }
66 }
67 return NULL;
68}
69
74{
76 struct CryptModule *np = NULL, *tmp = NULL;
77 STAILQ_FOREACH_SAFE(np, &mod_data->crypt_modules, entries, tmp)
78 {
79 STAILQ_REMOVE(&mod_data->crypt_modules, np, CryptModule, entries);
80 FREE(&np);
81 }
82}
Convenience wrapper for the core headers.
const struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
Definition crypt_mod.c:56
void crypto_module_register(const struct CryptModuleSpecs *specs)
Register a new crypto module.
Definition crypt_mod.c:41
void crypto_module_cleanup(void)
Clean up the crypto modules.
Definition crypt_mod.c:73
Register crypto modules.
#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_NCRYPT
ModuleNcrypt, Ncrypt
Definition module_api.h:80
Convenience wrapper for the library headers.
API for encryption/signing of emails.
Ncrypt private Module data.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:665
#define STAILQ_REMOVE(head, elm, type, field)
Definition queue.h:441
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
#define STAILQ_INSERT_HEAD(head, elm, field)
Definition queue.h:421
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition queue.h:400
int identifier
Identifying bit.
Definition crypt_mod.h:48
A crypto plugin module.
Definition crypt_mod.h:314
const struct CryptModuleSpecs * specs
Crypto module definition.
Definition crypt_mod.h:315
Ncrypt private Module data.
Definition module_data.h:38
struct CryptModuleList crypt_modules
Linked list of crypto modules.
Definition module_data.h:48
Container for Accounts, Notifications.
Definition neomutt.h:41