apt
1.5
|
00001 // -*- mode: cpp; mode: fold -*- 00002 // Description /*{{{*/ 00003 // $Id: netrc.h,v 1.11 2004/01/07 09:19:35 bagder Exp $ 00004 /* ###################################################################### 00005 00006 netrc file parser - returns the login and password of a give host in 00007 a specified netrc-type file 00008 00009 Originally written by Daniel Stenberg, <daniel@haxx.se>, et al. and 00010 placed into the Public Domain, do with it what you will. 00011 00012 ##################################################################### */ 00013 /*}}}*/ 00014 #ifndef NETRC_H 00015 #define NETRC_H 00016 00017 #include <string> 00018 00019 #ifndef APT_8_CLEANER_HEADERS 00020 #include <apt-pkg/strutl.h> 00021 #endif 00022 00023 #define DOT_CHAR "." 00024 #define DIR_CHAR "/" 00025 00026 class URI; 00027 00028 // Assume: password[0]=0, host[0] != 0. 00029 // If login[0] = 0, search for login and password within a machine section 00030 // in the netrc. 00031 // If login[0] != 0, search for password within machine and login. 00032 int parsenetrc (char *host, char *login, char *password, char *filename); 00033 00034 void maybe_add_auth (URI &Uri, std::string NetRCFile); 00035 #endif