]> Pileus Git - ~andy/fetchmail/blob - netrc.h
Fix typo repsonsible -> responsible.
[~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 /* The structure used to return account information from the .netrc. */
19 typedef struct _netrc_entry {
20   /* The exact host name given in the .netrc, NULL if default. */
21   char *host;
22
23   /* The login name of the user. */
24   char *login;
25
26   /* Password for the account (NULL, if none). */
27   char *password;
28
29   /* Pointer to the next entry in the list. */
30   struct _netrc_entry *next;
31 } netrc_entry;
32
33 __BEGIN_DECLS
34 /* Parse FILE as a .netrc file (as described in ftp(1)), and return a
35    list of entries.  NULL is returned if the file could not be
36    parsed. */
37 netrc_entry *parse_netrc (char *file);
38
39 /* Return the netrc entry from LIST corresponding to HOST.  NULL is
40    returned if no such entry exists. */
41 netrc_entry *search_netrc (netrc_entry *list, char *host, char *account);
42
43 /* Free the netrc list structure */
44 void free_netrc (netrc_entry *list);
45 __END_DECLS
46
47 #endif /* _NETRC_H_ */