diff options
author | des <des@FreeBSD.org> | 2000-07-17 21:25:00 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2000-07-17 21:25:00 +0000 |
commit | 3033318809d10165bff918597656578a8dc16bd9 (patch) | |
tree | 00a4cf3f1c1814ebff20dc85906c41eb5d9c7ccb /lib/libfetch/file.c | |
parent | 9e42d615d8102289f59981b6332a387ed4c92781 (diff) | |
download | FreeBSD-src-3033318809d10165bff918597656578a8dc16bd9.zip FreeBSD-src-3033318809d10165bff918597656578a8dc16bd9.tar.gz |
Introduce fetchXGet*(), which combine the functionalities of fetchGet*() and
fetchStat*(). In most cases, either fetchGet*() or fetchXGet*() is a wrapper
around the other; in all cases, calling fetchGet*() is identical to calling
fetchXGet*() with the second argument set to NULL.
Diffstat (limited to 'lib/libfetch/file.c')
-rw-r--r-- | lib/libfetch/file.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libfetch/file.c b/lib/libfetch/file.c index 0da44c9..7cf6efd 100644 --- a/lib/libfetch/file.c +++ b/lib/libfetch/file.c @@ -39,10 +39,13 @@ #include "common.h" FILE * -fetchGetFile(struct url *u, char *flags) +fetchXGetFile(struct url *u, struct url_stat *us, char *flags) { FILE *f; + if (us && fetchStatFile(u, us, flags) == -1) + return NULL; + f = fopen(u->doc, "r"); if (f == NULL) @@ -57,6 +60,12 @@ fetchGetFile(struct url *u, char *flags) } FILE * +fetchGetFile(struct url *u, char *flags) +{ + return fetchXGetFile(u, NULL, flags); +} + +FILE * fetchPutFile(struct url *u, char *flags) { FILE *f; |