1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
1998-08-17 20:39:09 +00:00
|
|
|
|
2014-05-06 04:22:01 +00:00
|
|
|
.include <src.opts.mk>
|
2006-03-17 18:54:44 +00:00
|
|
|
|
1998-07-09 16:52:44 +00:00
|
|
|
LIB= fetch
|
2001-10-18 08:29:26 +00:00
|
|
|
CFLAGS+= -I.
|
2000-05-25 16:24:31 +00:00
|
|
|
SRCS= fetch.c common.c ftp.c http.c file.c \
|
|
|
|
ftperr.h httperr.h
|
|
|
|
INCS= fetch.h
|
2001-03-27 17:27:19 +00:00
|
|
|
MAN= fetch.3
|
2000-05-25 16:24:31 +00:00
|
|
|
CLEANFILES= ftperr.h httperr.h
|
2002-06-06 13:45:46 +00:00
|
|
|
|
2006-07-27 04:54:03 +00:00
|
|
|
.if ${MK_INET6_SUPPORT} != "no"
|
|
|
|
CFLAGS+= -DINET6
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_OPENSSL} != "no"
|
2003-01-31 23:26:55 +00:00
|
|
|
CFLAGS+= -DWITH_SSL
|
2014-11-25 11:07:26 +00:00
|
|
|
LIBADD+= ssl crypto
|
2010-01-19 10:19:55 +00:00
|
|
|
.else
|
2014-11-25 11:07:26 +00:00
|
|
|
LIBADD+= md
|
2002-06-06 13:45:46 +00:00
|
|
|
.endif
|
1998-07-09 16:52:44 +00:00
|
|
|
|
2007-05-24 20:28:14 +00:00
|
|
|
CFLAGS+= -DFTP_COMBINE_CWDS
|
|
|
|
|
2009-07-19 17:25:24 +00:00
|
|
|
SHLIB_MAJOR= 6
|
1998-07-09 16:52:44 +00:00
|
|
|
|
2007-12-19 05:10:07 +00:00
|
|
|
ftperr.h: ftp.errors ${.CURDIR}/Makefile
|
2007-12-14 10:26:58 +00:00
|
|
|
@echo "static struct fetcherr ftp_errlist[] = {" > ${.TARGET}
|
2007-12-19 05:10:07 +00:00
|
|
|
@cat ${.CURDIR}/ftp.errors \
|
1998-07-09 16:52:44 +00:00
|
|
|
| grep -v ^# \
|
|
|
|
| sort \
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
| while read NUM CAT STRING; do \
|
|
|
|
echo " { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
|
1998-07-09 16:52:44 +00:00
|
|
|
done >> ${.TARGET}
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
@echo " { -1, FETCH_UNKNOWN, \"Unknown FTP error\" }" >> ${.TARGET}
|
1998-07-09 16:52:44 +00:00
|
|
|
@echo "};" >> ${.TARGET}
|
1998-11-05 19:48:17 +00:00
|
|
|
|
2007-12-19 05:10:07 +00:00
|
|
|
httperr.h: http.errors ${.CURDIR}/Makefile
|
2007-12-14 10:26:58 +00:00
|
|
|
@echo "static struct fetcherr http_errlist[] = {" > ${.TARGET}
|
2007-12-19 05:10:07 +00:00
|
|
|
@cat ${.CURDIR}/http.errors \
|
1998-07-09 16:52:44 +00:00
|
|
|
| grep -v ^# \
|
|
|
|
| sort \
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
| while read NUM CAT STRING; do \
|
|
|
|
echo " { $${NUM}, FETCH_$${CAT}, \"$${STRING}\" },"; \
|
1998-07-09 16:52:44 +00:00
|
|
|
done >> ${.TARGET}
|
1998-12-15 12:24:26 +00:00
|
|
|
@echo " { -1, FETCH_UNKNOWN, \"Unknown HTTP error\" }" >> ${.TARGET}
|
1998-07-09 16:52:44 +00:00
|
|
|
@echo "};" >> ${.TARGET}
|
Second of a series of cleanups to libfetch.
This commit introduces the following features:
a) the fetchStat*() functions, which return meta-information for a
document, such as size, modification time, etc.
b) the use of the com_err(3) facilities to report errors.
It also fixes a bunch of style bugs and a few logic bugs and somewhat
improves the man page.
Changed files, in alphabetical order:
Makefile:
Don't generate macros in {ftp,http}err.c.
Generate category fields for the error message lists.
Compile the error table.
Install fetch_err.h along with fetch.h.
common.c:
Remove the _netdb_errstring() macro, and add FETCH_ERR_NETDB to the
error code in the _netdb_seterr() macro.
Add categories to the _netdb_errlist table.
Report errors through the Common Error library.
common.h:
Add the DEBUG macros.
Add prototype for fetchConnect().
Remove the prototype for _fetch_errstring(), which is local to common.c
Add a categroy field to struct fetcherr, and define constants for
error categories.
Define macros for _{url,netdb,ftp,http}_seterr().
errors.et: (new file)
List error categories.
fetch.3:
Document the fetchStat*() functions.
Move the "unimplemented functionality" comments from NOTES to BUGS.
Document that applications which use libfetch must also use
libcom_err, and list existing error codes.
Undocument fetchLastErr{Code,String}.
Remove the (empty) DIAGNOSTICS section.
Mention Eugene Skepner in the AUTHORS section.
fetch.c:
Move the DEBUG macros to common.c
Add fetchStat() and fetchStatURL().
Generate error messages for URL parser errors, and fix a minor bug
in the parser.
Use 'struct url' instead of 'url_t'.
Remove fetchLastErr{Code,String}.
fetch.h:
Use 'struct url' instead of 'url_t', and remove the typedef.
Define struct url_stat (used by fetchStat()).
Add prototypes for fetchStat*().
Remove the declarations for fetchLastErr{Code,String}.
Include fetch_err.h.
fetch_err.et: (new file)
Error table for libfetch.
file.c:
Add fetchStatFile().
Use 'struct url' instead of 'url_t'.
ftp.c:
Add fetchStatFTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErrCode.
ftp.errors:
Add categories to all error messages.
http.c:
Add fetchStatHTTP().
Use 'struct url' instead of 'url_t'.
Don't use fetchLastErr{Code,Text}.
http.errors:
Add categories to all error messages.
Prompted by: jkh and Eugene Skepner
Numerous sugestions from: Garett Wollman and Eugene Skepner
1998-11-06 22:14:08 +00:00
|
|
|
|
2001-10-18 08:29:26 +00:00
|
|
|
MLINKS+= fetch.3 fetchFreeURL.3
|
|
|
|
MLINKS+= fetch.3 fetchGet.3
|
|
|
|
MLINKS+= fetch.3 fetchGetFTP.3
|
|
|
|
MLINKS+= fetch.3 fetchGetFile.3
|
|
|
|
MLINKS+= fetch.3 fetchGetHTTP.3
|
|
|
|
MLINKS+= fetch.3 fetchGetURL.3
|
|
|
|
MLINKS+= fetch.3 fetchList.3
|
|
|
|
MLINKS+= fetch.3 fetchListFTP.3
|
|
|
|
MLINKS+= fetch.3 fetchListFile.3
|
|
|
|
MLINKS+= fetch.3 fetchListHTTP.3
|
|
|
|
MLINKS+= fetch.3 fetchListURL.3
|
|
|
|
MLINKS+= fetch.3 fetchMakeURL.3
|
|
|
|
MLINKS+= fetch.3 fetchParseURL.3
|
|
|
|
MLINKS+= fetch.3 fetchPut.3
|
|
|
|
MLINKS+= fetch.3 fetchPutFTP.3
|
|
|
|
MLINKS+= fetch.3 fetchPutFile.3
|
|
|
|
MLINKS+= fetch.3 fetchPutHTTP.3
|
|
|
|
MLINKS+= fetch.3 fetchPutURL.3
|
2019-08-28 17:01:28 +00:00
|
|
|
MLINKS+= fetch.3 fetchReqHTTP.3
|
2001-10-18 08:29:26 +00:00
|
|
|
MLINKS+= fetch.3 fetchStat.3
|
|
|
|
MLINKS+= fetch.3 fetchStatFTP.3
|
|
|
|
MLINKS+= fetch.3 fetchStatFile.3
|
|
|
|
MLINKS+= fetch.3 fetchStatHTTP.3
|
|
|
|
MLINKS+= fetch.3 fetchStatURL.3
|
|
|
|
MLINKS+= fetch.3 fetchXGet.3
|
|
|
|
MLINKS+= fetch.3 fetchXGetFTP.3
|
|
|
|
MLINKS+= fetch.3 fetchXGetFile.3
|
|
|
|
MLINKS+= fetch.3 fetchXGetHTTP.3
|
|
|
|
MLINKS+= fetch.3 fetchXGetURL.3
|
2000-10-28 20:32:39 +00:00
|
|
|
|
1998-07-09 16:52:44 +00:00
|
|
|
.include <bsd.lib.mk>
|