NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
adata.h File Reference

Pop-specific Account data. More...

#include <stdbool.h>
#include <time.h>
#include "private.h"
#include "mutt/lib.h"
+ Include dependency graph for adata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PopAccountData
 POP-specific Account data -. More...
 

Functions

void pop_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free()
 
struct PopAccountDatapop_adata_get (struct Mailbox *m)
 Get the Account data for this mailbox.
 
struct PopAccountDatapop_adata_new (void)
 Create a new PopAccountData object.
 

Detailed Description

Pop-specific Account data.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file adata.h.

Function Documentation

◆ pop_adata_free()

void pop_adata_free ( void **  ptr)

Free the private Account data - Implements Account::adata_free()

The PopAccountData struct stores global POP data, such as the connection to the database. This function will close the database, free the resources and the struct itself.

Definition at line 41 of file adata.c.

42{
43 if (!ptr || !*ptr)
44 return;
45
46 struct PopAccountData *adata = *ptr;
47 FREE(&adata->auth_list.data);
48
49 if (adata->conn)
50 {
51 if (adata->conn->close)
52 adata->conn->close(adata->conn);
53 FREE(&adata->conn);
54 }
55
56 FREE(ptr);
57}
#define FREE(x)
Definition: memory.h:45
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
POP-specific Account data -.
Definition: adata.h:37
+ Here is the caller graph for this function:

◆ pop_adata_get()

struct PopAccountData * pop_adata_get ( struct Mailbox m)

Get the Account data for this mailbox.

Parameters
mMailbox
Return values
ptrPopAccountData

Definition at line 73 of file adata.c.

74{
75 if (!m || (m->type != MUTT_POP))
76 return NULL;
77 struct Account *a = m->account;
78 if (!a)
79 return NULL;
80 return a->adata;
81}
@ MUTT_POP
'POP3' Mailbox type
Definition: mailbox.h:52
A group of associated Mailboxes.
Definition: account.h:37
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
struct Account * account
Account that owns this Mailbox.
Definition: mailbox.h:128
+ Here is the caller graph for this function:

◆ pop_adata_new()

struct PopAccountData * pop_adata_new ( void  )

Create a new PopAccountData object.

Return values
ptrNew PopAccountData struct

Definition at line 63 of file adata.c.

64{
65 return mutt_mem_calloc(1, sizeof(struct PopAccountData));
66}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
+ Here is the call graph for this function:
+ Here is the caller graph for this function: