NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
adata.c File Reference

Pop-specific Account data. More...

#include "config.h"
#include "core/lib.h"
#include "adata.h"
+ Include dependency graph for adata.c:

Go to the source code of this file.

Functions

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

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.c.

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 40 of file adata.c.

41 {
42  if (!ptr || !*ptr)
43  return;
44 
45  struct PopAccountData *adata = *ptr;
46  FREE(&adata->auth_list.data);
47  FREE(ptr);
48 }
struct Buffer auth_list
list of auth mechanisms
Definition: adata.h:53
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
char * data
Pointer to data.
Definition: buffer.h:35
#define FREE(x)
Definition: memory.h:40
POP-specific Account data -.
Definition: adata.h:36
+ 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 54 of file adata.c.

55 {
56  return mutt_mem_calloc(1, sizeof(struct PopAccountData));
57 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
POP-specific Account data -.
Definition: adata.h:36
+ Here is the call graph for this function:
+ 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 64 of file adata.c.

65 {
66  if (!m || (m->type != MUTT_POP))
67  return NULL;
68  struct Account *a = m->account;
69  if (!a)
70  return NULL;
71  return a->adata;
72 }
enum MailboxType type
Mailbox type.
Definition: mailbox.h:105
A group of associated Mailboxes.
Definition: account.h:36
'POP3' Mailbox type
Definition: mailbox.h:55
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
struct Account * account
Account that owns this Mailbox.
Definition: mailbox.h:131
+ Here is the caller graph for this function: