]> Pileus Git - ~andy/fetchmail/blob - netrc.h
Minor bug fixes for socket.c
[~andy/fetchmail] / netrc.h
1 /* netrc.h -- declarations for netrc.c
2  * For license terms, see the file COPYING in this directory.
3  */
4
5 #ifndef _NETRC_H_
6 #define _NETRC_H_ 1
7
8 # undef __BEGIN_DECLS
9 # undef __END_DECLS
10 #ifdef __cplusplus
11 # define __BEGIN_DECLS extern "C" {
12 # define __END_DECLS }
13 #else
14 # define __BEGIN_DECLS /* empty */
15 # define __END_DECLS /* empty */
16 #endif
17
18 #undef __P
19 #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
20 # define __P(protos) protos
21 #else
22 # define __P(protos) ()
23 #endif
24
25 /* The structure used to return account information from the .netrc. */
26 typedef struct _netrc_entry {
27   /* The exact host name given in the .netrc, NULL if default. */
28   char *host;
29
30   /* The login name of the user. */
31   char *login;
32
33   /* Password for the account (NULL, if none). */
34   char *password;
35
36   /* Pointer to the next entry in the list. */
37   struct _netrc_entry *next;
38 } netrc_entry;
39
40 __BEGIN_DECLS
41 /* Parse FILE as a .netrc file (as described in ftp(1)), and return a
42    list of entries.  NULL is returned if the file could not be
43    parsed. */
44 netrc_entry *parse_netrc __P((char *file));
45
46 /* Return the netrc entry from LIST corresponding to HOST.  NULL is
47    returned if no such entry exists. */
48 netrc_entry *search_netrc __P((netrc_entry *list, char *host, char *account));
49
50 /* Free the netrc list structure */
51 void free_netrc __P((netrc_entry *list));
52 __END_DECLS
53
54 #endif /* _NETRC_H_ */