Rocco Rutte:
[apps/madmutt.git] / account.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 2000-3 Brendan Cully <brendan@kublai.com>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 /* remote host account manipulation (POP/IMAP) */
11
12 #ifndef _MUTT_ACCOUNT_H_
13 #define _MUTT_ACCOUNT_H_ 1
14
15 #include "url.h"
16
17 /* account types */
18 enum {
19   M_ACCT_TYPE_NONE = 0,
20   M_ACCT_TYPE_IMAP,
21   M_ACCT_TYPE_NNTP,
22   M_ACCT_TYPE_POP
23 };
24
25 /* account flags */
26 #define M_ACCT_PORT (1<<0)
27 #define M_ACCT_USER (1<<1)
28 #define M_ACCT_PASS (1<<2)
29 #define M_ACCT_SSL  (1<<3)
30
31 typedef struct {
32   char user[64];
33   char pass[64];
34   char host[128];
35   unsigned short port;
36   unsigned char type;
37   unsigned char flags;
38 } ACCOUNT;
39
40 int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * m2);
41 int mutt_account_fromurl (ACCOUNT * account, ciss_url_t * url);
42 void mutt_account_tourl (ACCOUNT * account, ciss_url_t * url);
43 int mutt_account_getuser (ACCOUNT * account);
44 int mutt_account_getpass (ACCOUNT * account);
45 void mutt_account_unsetpass (ACCOUNT * account);
46
47 #endif /* _MUTT_ACCOUNT_H_ */