NeoMutt  2021-02-05-89-gabe350
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 <stdint.h>
27 
32 {
38 };
39 
40 typedef uint8_t MuttAccountFlags;
41 #define MUTT_ACCT_NO_FLAGS 0
42 #define MUTT_ACCT_PORT (1 << 0)
43 #define MUTT_ACCT_USER (1 << 1)
44 #define MUTT_ACCT_LOGIN (1 << 2)
45 #define MUTT_ACCT_PASS (1 << 3)
46 #define MUTT_ACCT_SSL (1 << 4)
47 
48 
52 {
53  char host[128];
54  char login[128];
55  char user[128];
56  char pass[256];
57  unsigned short port;
58  unsigned char type;
60  const char *service;
61 
67  const char *(*get_field)(enum ConnAccountField field, void *gf_data);
68 
69  void *gf_data;
70 };
71 
72 int mutt_account_getlogin (struct ConnAccount *account);
73 char *mutt_account_getoauthbearer(struct ConnAccount *account);
74 int mutt_account_getpass (struct ConnAccount *account);
75 int mutt_account_getuser (struct ConnAccount *account);
76 void mutt_account_unsetpass (struct ConnAccount *account);
77 
78 #endif /* MUTT_CONN_CONNACCOUNT_H */
ConnAccount
Login details for a remote server.
Definition: connaccount.h:51
ConnAccount::host
char host[128]
Server to login to.
Definition: connaccount.h:53
mutt_account_getpass
int mutt_account_getpass(struct ConnAccount *account)
Fetch password into ConnAccount, if necessary.
Definition: connaccount.c:111
mutt_account_getlogin
int mutt_account_getlogin(struct ConnAccount *account)
Retrieve login info into ConnAccount, if necessary.
Definition: connaccount.c:81
ConnAccount::login
char login[128]
Login name.
Definition: connaccount.h:54
ConnAccount::gf_data
void * gf_data
Private data to pass to get_field()
Definition: connaccount.h:69
MUTT_CA_PASS
@ MUTT_CA_PASS
Password.
Definition: connaccount.h:36
ConnAccountField
ConnAccountField
Login credentials.
Definition: connaccount.h:31
MUTT_CA_HOST
@ MUTT_CA_HOST
Server name.
Definition: connaccount.h:33
mutt_account_unsetpass
void mutt_account_unsetpass(struct ConnAccount *account)
Unset ConnAccount's password.
Definition: connaccount.c:141
mutt_account_getuser
int mutt_account_getuser(struct ConnAccount *account)
Retrieve username into ConnAccount, if necessary.
Definition: connaccount.c:48
ConnAccount::type
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:58
mutt_account_getoauthbearer
char * mutt_account_getoauthbearer(struct ConnAccount *account)
Get an OAUTHBEARER token.
Definition: connaccount.c:158
MuttAccountFlags
uint8_t MuttAccountFlags
Flags, Which ConnAccount fields are initialised, e.g. MUTT_ACCT_PORT.
Definition: connaccount.h:40
ConnAccount::flags
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:59
MUTT_CA_LOGIN
@ MUTT_CA_LOGIN
Login name.
Definition: connaccount.h:34
ConnAccount::port
unsigned short port
Port to connect to.
Definition: connaccount.h:57
ConnAccount::pass
char pass[256]
Password.
Definition: connaccount.h:56
ConnAccount::service
const char * service
Name of the service, e.g. "imap".
Definition: connaccount.h:60
MUTT_CA_USER
@ MUTT_CA_USER
User name.
Definition: connaccount.h:35
ConnAccount::user
char user[128]
Username.
Definition: connaccount.h:55
MUTT_CA_OAUTH_CMD
@ MUTT_CA_OAUTH_CMD
OAuth refresh command.
Definition: connaccount.h:37