NeoMutt
2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
autocrypt_data.c
Go to the documentation of this file.
1
29
#include "config.h"
30
#include <stddef.h>
31
#include "
private.h
"
32
#include "
mutt/lib.h
"
33
#include "
address/lib.h
"
34
#include "
autocrypt_data.h
"
35
40
struct
AutocryptData
*
autocrypt_data_new
(
void
)
41
{
42
struct
AutocryptData
*ad =
MUTT_MEM_CALLOC
(1,
struct
AutocryptData
);
43
44
ARRAY_INIT
(&ad->
entries
);
45
46
return
ad;
47
}
48
55
void
account_entry_array_clear
(
struct
AccountEntryArray *
entries
)
56
{
57
struct
AccountEntry
**pe = NULL;
58
ARRAY_FOREACH
(pe, entries)
59
{
60
struct
AccountEntry
*e = *pe;
61
mutt_autocrypt_db_account_free
(&e->
account
);
62
mutt_addr_free
(&e->
addr
);
63
FREE
(pe);
64
}
65
66
ARRAY_FREE
(entries);
67
}
68
72
void
autocrypt_data_free
(
struct
Menu
*menu,
void
**ptr)
73
{
74
if
(!ptr || !*ptr)
75
return
;
76
77
struct
AutocryptData
*ad = *ptr;
78
account_entry_array_clear
(&ad->
entries
);
79
80
FREE
(ptr);
81
}
mutt_addr_free
void mutt_addr_free(struct Address **ptr)
Free a single Address.
Definition:
address.c:462
lib.h
Email Address Handling.
ARRAY_FOREACH
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition:
array.h:212
ARRAY_FREE
#define ARRAY_FREE(head)
Release all memory.
Definition:
array.h:204
ARRAY_INIT
#define ARRAY_INIT(head)
Initialize an array.
Definition:
array.h:65
mutt_autocrypt_db_account_free
void mutt_autocrypt_db_account_free(struct AutocryptAccount **ptr)
Free an AutocryptAccount.
Definition:
db.c:246
autocrypt_data_new
struct AutocryptData * autocrypt_data_new(void)
Create new Autocrypt Data.
Definition:
autocrypt_data.c:40
account_entry_array_clear
void account_entry_array_clear(struct AccountEntryArray *entries)
Clear an AccountEntry array.
Definition:
autocrypt_data.c:55
autocrypt_data.h
Private Autocrypt Data.
autocrypt_data_free
void autocrypt_data_free(struct Menu *menu, void **ptr)
Free Autocrypt Data - Implements Menu::mdata_free() -.
Definition:
autocrypt_data.c:72
FREE
#define FREE(x)
Definition:
memory.h:55
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition:
memory.h:40
lib.h
Convenience wrapper for the library headers.
private.h
GUI display the mailboxes in a side panel.
AccountEntry
An entry in the Autocrypt account Menu.
Definition:
private.h:46
AccountEntry::addr
struct Address * addr
Email address associated with the account.
Definition:
private.h:49
AccountEntry::account
struct AutocryptAccount * account
Account details.
Definition:
private.h:48
AutocryptData
Data to pass to the Autocrypt Functions.
Definition:
autocrypt_data.h:35
AutocryptData::entries
struct AccountEntryArray entries
Account Entries.
Definition:
autocrypt_data.h:38
Menu
Definition:
lib.h:79