diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2000-06-29 08:26:26 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2000-06-29 08:26:26 +0000 |
| commit | f325efaaa8dcfcd2bc8942d818fdf18c11a3e439 (patch) | |
| tree | e071e45e160dce1eb55420a7154c5dc4c8011f04 /lib/libfetch/fetch.h | |
| parent | 358c7ac1dcf9c1633e1f815eec7c09cc5cf0c1c1 (diff) | |
Notes
Diffstat (limited to 'lib/libfetch/fetch.h')
| -rw-r--r-- | lib/libfetch/fetch.h | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/lib/libfetch/fetch.h b/lib/libfetch/fetch.h index 23667911b993..2395220af8ef 100644 --- a/lib/libfetch/fetch.h +++ b/lib/libfetch/fetch.h @@ -31,9 +31,7 @@ #ifndef _FETCH_H_INCLUDED #define _FETCH_H_INCLUDED -#include <fetch_err.h> - -#define _LIBFETCH_VER "libfetch/1.0" +#define _LIBFETCH_VER "libfetch/2.0" #define URL_SCHEMELEN 16 #define URL_USERLEN 256 @@ -45,7 +43,9 @@ struct url { char pwd[URL_PWDLEN+1]; char host[MAXHOSTNAMELEN+1]; int port; - char doc[2]; + char *doc; + off_t offset; + size_t length; }; struct url_stat { @@ -59,6 +59,27 @@ struct url_ent { struct url_stat stat; }; +/* Error codes */ +#define FETCH_ABORT 1 +#define FETCH_AUTH 2 +#define FETCH_DOWN 3 +#define FETCH_EXISTS 4 +#define FETCH_FULL 5 +#define FETCH_INFO 6 +#define FETCH_MEMORY 7 +#define FETCH_MOVED 8 +#define FETCH_NETWORK 9 +#define FETCH_OK 10 +#define FETCH_PROTO 11 +#define FETCH_RESOLV 12 +#define FETCH_SERVER 13 +#define FETCH_TEMP 14 +#define FETCH_TIMEOUT 15 +#define FETCH_UNAVAIL 16 +#define FETCH_UNKNOWN 17 +#define FETCH_URL 18 +#define FETCH_VERBOSE 19 + /* FILE-specific functions */ FILE *fetchGetFile(struct url *, char *); FILE *fetchPutFile(struct url *, char *); @@ -79,7 +100,6 @@ int fetchStatFTP(struct url *, struct url_stat *, char *); struct url_ent *fetchListFTP(struct url *, char *); /* Generic functions */ -struct url *fetchParseURL(char *); FILE *fetchGetURL(char *, char *); FILE *fetchPutURL(char *, char *); int fetchStatURL(char *, struct url_stat *, char *); @@ -89,8 +109,15 @@ FILE *fetchPut(struct url *, char *); int fetchStat(struct url *, struct url_stat *, char *); struct url_ent *fetchList(struct url *, char *); +/* URL parsing */ +struct url *fetchMakeURL(char *, char *, int, char *, char *, char *); +struct url *fetchParseURL(char *); +void fetchFreeURL(struct url *); + /* Last error code */ extern int fetchLastErrCode; +#define MAXERRSTRING 256 +extern char fetchLastErrString[MAXERRSTRING]; extern int fetchTimeout; #endif |
