NeoMutt  2020-06-26-89-g172cd3
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 */
int mutt_account_getpass(struct ConnAccount *account)
Fetch password into ConnAccount, if necessary.
Definition: connaccount.c:111
char login[128]
Login name.
Definition: connaccount.h:54
char user[128]
Username.
Definition: connaccount.h:55
Password.
Definition: connaccount.h:36
int mutt_account_getuser(struct ConnAccount *account)
Retrieve username into ConnAccount, if necessary.
Definition: connaccount.c:48
ConnAccountField
Login credentials.
Definition: connaccount.h:31
char host[128]
Server to login to.
Definition: connaccount.h:53
char pass[256]
Password.
Definition: connaccount.h:56
char * mutt_account_getoauthbearer(struct ConnAccount *account)
Get an OAUTHBEARER token.
Definition: connaccount.c:158
unsigned short port
Port to connect to.
Definition: connaccount.h:57
uint8_t MuttAccountFlags
Flags, Which ConnAccount fields are initialised, e.g. MUTT_ACCT_PORT.
Definition: connaccount.h:40
void * gf_data
Private data to pass to get_field()
Definition: connaccount.h:69
User name.
Definition: connaccount.h:35
unsigned char type
Connection type, e.g. MUTT_ACCT_TYPE_IMAP.
Definition: connaccount.h:58
void mutt_account_unsetpass(struct ConnAccount *account)
Unset ConnAccount&#39;s password.
Definition: connaccount.c:141
const char * service
Name of the service, e.g. "imap".
Definition: connaccount.h:60
OAuth refresh command.
Definition: connaccount.h:37
Login details for a remote server.
Definition: connaccount.h:51
int mutt_account_getlogin(struct ConnAccount *account)
Retrieve login info into ConnAccount, if necessary.
Definition: connaccount.c:81
Login name.
Definition: connaccount.h:34
Server name.
Definition: connaccount.h:33
MuttAccountFlags flags
Which fields are initialised, e.g. MUTT_ACCT_USER.
Definition: connaccount.h:59