return;
struct Account *a = *ptr;
- account_mailbox_remove(a, NULL);
+ notify_free(&a->notify);
if (a->free_adata)
a->free_adata(&a->adata);
- notify_free(&a->notify);
- // account_free_config(a);
+ account_mailbox_remove(a, NULL);
cs_subset_free(&a->sub);
FREE(&a->name);
mailbox_changed(m, MBN_CLOSED);
notify_free(&m->notify);
- mutt_buffer_free(&m->pathbuf);
- FREE(&m->name);
if (m->mdata && m->free_mdata)
m->free_mdata(&m->mdata);
+
+ mutt_buffer_free(&m->pathbuf);
+ FREE(&m->name);
FREE(&m->realpath);
+
FREE(ptr);
}
return;
struct NeoMutt *n = *ptr;
+ notify_free(&n->notify);
neomutt_account_remove(n, NULL);
- notify_free(&n->notify);
cs_subset_free(&n->sub);
FREE(ptr);
/**
* email_free - Free an Email
- * @param[out] e Email to free
+ * @param[out] ptr Email to free
*/
-void email_free(struct Email **e)
+void email_free(struct Email **ptr)
{
- if (!e || !*e)
+ if (!ptr || !*ptr)
return;
- mutt_env_free(&(*e)->env);
- mutt_body_free(&(*e)->content);
- FREE(&(*e)->maildir_flags);
- FREE(&(*e)->tree);
- FREE(&(*e)->path);
+
+ struct Email *e = *ptr;
+
+ if (e->edata && e->free_edata)
+ e->free_edata(&e->edata);
+
+ mutt_env_free(&e->env);
+ mutt_body_free(&e->content);
+ FREE(&e->maildir_flags);
+ FREE(&e->tree);
+ FREE(&e->path);
#ifdef MIXMASTER
- mutt_list_free(&(*e)->chain);
+ mutt_list_free(&e->chain);
#endif
- driver_tags_free(&(*e)->tags);
- if ((*e)->edata && (*e)->free_edata)
- (*e)->free_edata(&(*e)->edata);
- FREE(e);
+ driver_tags_free(&e->tags);
+
+ FREE(ptr);
}
/**
STAILQ_HEAD(EmailList, EmailNode);
bool email_cmp_strict(const struct Email *e1, const struct Email *e2);
-void email_free (struct Email **e);
+void email_free (struct Email **ptr);
struct Email *email_new (void);
size_t email_size (const struct Email *e);
if (((data == ptr->data) || !data) && (table->cmp_key(ptr->key, key) == 0))
{
*last = ptr->next;
- if (table->elem_free)
- table->elem_free(ptr->type, ptr->data, table->hash_data);
+ if (table->free_hdata)
+ table->free_hdata(ptr->type, ptr->data, table->hdata);
if (table->strdup_keys)
FREE(&ptr->key.strkey);
FREE(&ptr);
{
if (!table)
return;
- table->elem_free = fn;
- table->hash_data = fn_data;
+ table->free_hdata = fn;
+ table->hdata = fn_data;
}
/**
}
/**
- * mutt_hash_free - elem_free a hash table
+ * mutt_hash_free - free_hdata a hash table
* @param[out] ptr Hash Table to be freed
*/
void mutt_hash_free(struct Hash **ptr)
{
tmp = elem;
elem = elem->next;
- if (pptr->elem_free)
- pptr->elem_free(tmp->type, tmp->data, pptr->hash_data);
+ if (pptr->free_hdata)
+ pptr->free_hdata(tmp->type, tmp->data, pptr->hdata);
if (pptr->strdup_keys)
FREE(&tmp->key.strkey);
FREE(&tmp);
*/
struct Hash
{
- size_t nelem; ///< Number of elements in the Hash table
- bool strdup_keys : 1; ///< if set, the key->strkey is strdup'ed
- bool allow_dups : 1; ///< if set, duplicate keys are allowed
- struct HashElem **table; ///< Array of Hash keys
+ size_t nelem; ///< Number of elements in the Hash table
+ bool strdup_keys : 1; ///< if set, the key->strkey is strdup'ed
+ bool allow_dups : 1; ///< if set, duplicate keys are allowed
+ struct HashElem **table; ///< Array of Hash keys
size_t (*gen_hash)(union HashKey, size_t); ///< Function to generate hash id from the key
int (*cmp_key)(union HashKey, union HashKey); ///< Function to compare two Hash keys
- hashelem_free_t elem_free; ///< Function to free a Hash element
- intptr_t hash_data; ///< Data to pass to the elem_free() function
+ intptr_t hdata; ///< Data to pass to the free_hdata() function
+ hashelem_free_t free_hdata; ///< Function to free a Hash element
};
typedef uint8_t HashFlags; ///< Flags for mutt_hash_new(), e.g. #MUTT_HASH_STRCASECMP