NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
adata.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include "
private.h
"
31
#include "
mutt/lib.h
"
32
#include "
conn/lib.h
"
33
#include "
adata.h
"
34
42
void
nntp_adata_free
(
void
**ptr)
43
{
44
if
(!ptr || !*ptr)
45
return
;
46
47
struct
NntpAccountData
*
adata
= *ptr;
48
49
mutt_file_fclose
(&
adata
->fp_newsrc);
50
FREE
(&
adata
->newsrc_file);
51
FREE
(&
adata
->authenticators);
52
FREE
(&
adata
->overview_fmt);
53
mutt_socket_close
(
adata
->conn);
54
FREE
(&
adata
->conn);
55
FREE
(&
adata
->groups_list);
56
mutt_hash_free
(&
adata
->groups_hash);
57
FREE
(ptr);
58
}
59
65
struct
NntpAccountData
*
nntp_adata_new
(
struct
Connection
*
conn
)
66
{
67
struct
NntpAccountData
*
adata
=
MUTT_MEM_CALLOC
(1,
struct
NntpAccountData
);
68
adata
->conn =
conn
;
69
adata
->groups_hash =
mutt_hash_new
(1009,
MUTT_HASH_NONE
);
70
mutt_hash_set_destructor
(
adata
->groups_hash,
nntp_hashelem_free
, 0);
71
adata
->groups_max = 16;
72
adata
->groups_list =
MUTT_MEM_MALLOC
(
adata
->groups_max,
struct
NntpMboxData
*);
73
return
adata
;
74
}
lib.h
Connection Library.
mutt_file_fclose
#define mutt_file_fclose(FP)
Definition
file.h:144
nntp_adata_free
void nntp_adata_free(void **ptr)
Free the private Account data - Implements Account::adata_free() -.
Definition
adata.c:42
nntp_hashelem_free
void nntp_hashelem_free(int type, void *obj, intptr_t data)
Free our hash table data - Implements hash_hdata_free_t -.
Definition
nntp.c:112
mutt_hash_new
struct HashTable * mutt_hash_new(size_t num_elems, HashFlags flags)
Create a new Hash Table (with string keys).
Definition
hash.c:262
mutt_hash_set_destructor
void mutt_hash_set_destructor(struct HashTable *table, hash_hdata_free_t fn, intptr_t fn_data)
Set the destructor for a Hash Table.
Definition
hash.c:304
mutt_hash_free
void mutt_hash_free(struct HashTable **ptr)
Free a hash table.
Definition
hash.c:460
MUTT_HASH_NONE
@ MUTT_HASH_NONE
No flags are set.
Definition
hash.h:115
FREE
#define FREE(x)
Free memory and set the pointer to NULL.
Definition
memory.h:68
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition
memory.h:52
MUTT_MEM_MALLOC
#define MUTT_MEM_MALLOC(n, type)
Definition
memory.h:53
lib.h
Convenience wrapper for the library headers.
nntp_adata_new
struct NntpAccountData * nntp_adata_new(struct Connection *conn)
Allocate and initialise a new NntpAccountData structure.
Definition
adata.c:65
adata.h
Nntp-specific Account data.
private.h
Usenet network mailbox type; talk to an NNTP server.
mutt_socket_close
int mutt_socket_close(struct Connection *conn)
Close a socket.
Definition
socket.c:100
Account::adata
void * adata
Private data (for Mailbox backends).
Definition
account.h:42
Connection
Definition
connection.h:48
NntpAccountData
NNTP-specific Account data -.
Definition
adata.h:36
NntpAccountData::conn
struct Connection * conn
Connection to NNTP Server.
Definition
adata.h:63
NntpMboxData
NNTP-specific Mailbox data -.
Definition
mdata.h:34