NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
connaccount.h
Go to the documentation of this file.
1
23#ifndef MUTT_CONN_CONNACCOUNT_H
24#define MUTT_CONN_CONNACCOUNT_H
25
26#include <stdbool.h>
27#include <stdint.h>
28
33{
39};
40
41typedef uint8_t MuttAccountFlags;
42#define MUTT_ACCT_NO_FLAGS 0
43#define MUTT_ACCT_PORT (1 << 0)
44#define MUTT_ACCT_USER (1 << 1)
45#define MUTT_ACCT_LOGIN (1 << 2)
46#define MUTT_ACCT_PASS (1 << 3)
47#define MUTT_ACCT_SSL (1 << 4)
48
53{
54 char host[128];
55 char login[128];
56 char user[128];
57 char pass[256];
58 unsigned short port;
59 unsigned char type;
61 const char *service;
62
68 const char *(*get_field)(enum ConnAccountField field, void *gf_data);
69
70 void *gf_data;
71};
72
73int mutt_account_getlogin (struct ConnAccount *account);
74char *mutt_account_getoauthbearer(struct ConnAccount *account, bool xoauth2);
75int mutt_account_getpass (struct ConnAccount *account);
76int mutt_account_getuser (struct ConnAccount *account);
77void mutt_account_unsetpass (struct ConnAccount *account);
78
79#endif /* MUTT_CONN_CONNACCOUNT_H */
int mutt_account_getuser(struct ConnAccount *account)
Retrieve username into ConnAccount, if necessary.
Definition: connaccount.c:50
uint8_t MuttAccountFlags
Flags, Which ConnAccount fields are initialised, e.g. MUTT_ACCT_PORT.
Definition: connaccount.h:41
ConnAccountField
Login credentials.
Definition: connaccount.h:33
@ MUTT_CA_OAUTH_CMD
OAuth refresh command.
Definition: connaccount.h:38
@ MUTT_CA_USER
User name.
Definition: connaccount.h:36
@ MUTT_CA_LOGIN
Login name.
Definition: connaccount.h:35
@ MUTT_CA_HOST
Server name.
Definition: connaccount.h:34
@ MUTT_CA_PASS
Password.
Definition: connaccount.h:37
void mutt_account_unsetpass(struct ConnAccount *account)
Unset ConnAccount's password.
Definition: connaccount.c:177
int mutt_account_getpass(struct ConnAccount *account)
Fetch password into ConnAccount, if necessary.
Definition: connaccount.c:130
char * mutt_account_getoauthbearer(struct ConnAccount *account, bool xoauth2)
Get an OAUTHBEARER/XOAUTH2 token.
Definition: connaccount.c:195
int mutt_account_getlogin(struct ConnAccount *account)
Retrieve login info into ConnAccount, if necessary.
Definition: connaccount.c:100
Login details for a remote server.
Definition: connaccount.h:53
char login[128]
Login name.
Definition: connaccount.h:55
char user[128]
Username.
Definition: connaccount.h:56
char pass[256]
Password.
Definition: connaccount.h:57
const char * service
Name of the service, e.g. "imap".
Definition: connaccount.h:61
char host[128]
Server to login to.
Definition: connaccount.h:54
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:59
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:60
void * gf_data
Private data to pass to get_field()
Definition: connaccount.h:70
unsigned short port
Port to connect to.
Definition: connaccount.h:58