summaryrefslogtreecommitdiff
path: root/lib/libfetch/fetch.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch/fetch.h')
-rw-r--r--lib/libfetch/fetch.h71
1 files changed, 28 insertions, 43 deletions
diff --git a/lib/libfetch/fetch.h b/lib/libfetch/fetch.h
index 2e33245503cc..377edad2acc8 100644
--- a/lib/libfetch/fetch.h
+++ b/lib/libfetch/fetch.h
@@ -25,13 +25,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: fetch.h,v 1.7 1998/12/16 10:24:55 des Exp $
+ * $Id: fetch.h,v 1.3 1998/07/11 21:29:08 des Exp $
*/
#ifndef _FETCH_H_INCLUDED
#define _FETCH_H_INCLUDED
-#include <fetch_err.h>
+#include <sys/param.h>
+#include <stdio.h>
#define _LIBFETCH_VER "libfetch/1.0"
@@ -39,57 +40,41 @@
#define URL_USERLEN 256
#define URL_PWDLEN 256
-struct url {
- char scheme[URL_SCHEMELEN+1];
- char user[URL_USERLEN+1];
- char pwd[URL_PWDLEN+1];
- char host[MAXHOSTNAMELEN+1];
- int port;
- char doc[2];
+struct url_s {
+ char scheme[URL_SCHEMELEN+1];
+ char user[URL_USERLEN+1];
+ char pwd[URL_PWDLEN+1];
+ char host[MAXHOSTNAMELEN+1];
+ char *doc;
+ int port;
};
-struct url_stat {
- off_t size;
- time_t atime;
- time_t mtime;
-};
-
-struct url_ent {
- char name[MAXPATHLEN];
- struct url_stat stat;
-};
+typedef struct url_s url_t;
/* FILE-specific functions */
-FILE *fetchGetFile(struct url *, char *);
-FILE *fetchPutFile(struct url *, char *);
-int fetchStatFile(struct url *, struct url_stat *, char *);
-struct url_ent *fetchListFile(struct url *, char *);
+FILE *fetchGetFile(url_t *, char *);
+FILE *fetchPutFile(url_t *, char *);
/* HTTP-specific functions */
-char *fetchContentType(FILE *);
-FILE *fetchGetHTTP(struct url *, char *);
-FILE *fetchPutHTTP(struct url *, char *);
-int fetchStatHTTP(struct url *, struct url_stat *, char *);
-struct url_ent *fetchListHTTP(struct url *, char *);
+char *fetchContentType(FILE *);
+FILE *fetchGetHTTP(url_t *, char *);
+FILE *fetchPutHTTP(url_t *, char *);
/* FTP-specific functions */
-FILE *fetchGetFTP(struct url *, char *);
-FILE *fetchPutFTP(struct url *, char *);
-int fetchStatFTP(struct url *, struct url_stat *, char *);
-struct url_ent *fetchListFTP(struct url *, char *);
+FILE *fetchGetFTP(url_t *, char *);
+FILE *fetchPutFTP(url_t *, char *);
/* Generic functions */
-struct url *fetchParseURL(char *);
-FILE *fetchGetURL(char *, char *);
-FILE *fetchPutURL(char *, char *);
-int fetchStatURL(char *, struct url_stat *, char *);
-struct url_ent *fetchListURL(char *, char *);
-FILE *fetchGet(struct url *, char *);
-FILE *fetchPut(struct url *, char *);
-int fetchStat(struct url *, struct url_stat *, char *);
-struct url_ent *fetchList(struct url *, char *);
+int fetchConnect(char *, int);
+url_t *fetchParseURL(char *);
+void fetchFreeURL(url_t *);
+FILE *fetchGetURL(char *, char *);
+FILE *fetchPutURL(char *, char *);
+FILE *fetchGet(url_t *, char *);
+FILE *fetchPut(url_t *, char *);
-/* Last error code */
-extern int fetchLastErrCode;
+/* Error code and string */
+extern int fetchLastErrCode;
+extern const char *fetchLastErrText;
#endif