]> Pileus Git - ~andy/fetchmail/blob - netrc.h
Initial revision
[~andy/fetchmail] / netrc.h
1 /* netrc.h -- declarations for netrc.c
2    Copyright (C) 1996, Free Software Foundation, Inc.
3    Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
18
19 #ifndef _NETRC_H_
20 #define _NETRC_H_ 1
21
22 # undef __BEGIN_DECLS
23 # undef __END_DECLS
24 #ifdef __cplusplus
25 # define __BEGIN_DECLS extern "C" {
26 # define __END_DECLS }
27 #else
28 # define __BEGIN_DECLS /* empty */
29 # define __END_DECLS /* empty */
30 #endif
31
32 #undef __P
33 #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
34 # define __P(protos) protos
35 #else
36 # define __P(protos) ()
37 #endif
38
39 /* The structure used to return account information from the .netrc. */
40 typedef struct _netrc_entry {
41   /* The exact host name given in the .netrc, NULL if default. */
42   char *host;
43
44   /* The name of the account. */
45   char *account;
46
47   /* Password for the account (NULL, if none). */
48   char *password;
49
50   /* Pointer to the next entry in the list. */
51   struct _netrc_entry *next;
52 } netrc_entry;
53
54 __BEGIN_DECLS
55 /* Parse FILE as a .netrc file (as described in ftp(1)), and return a
56    list of entries.  NULL is returned if the file could not be
57    parsed. */
58 netrc_entry *parse_netrc __P((char *file));
59
60 /* Return the netrc entry from LIST corresponding to HOST.  NULL is
61    returned if no such entry exists. */
62 netrc_entry *search_netrc __P((netrc_entry *list, char *host));
63 __END_DECLS
64
65 #endif /* _NETRC_H_ */