summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/Makefile
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>1998-11-05 19:48:17 +0000
committerdes <des@FreeBSD.org>1998-11-05 19:48:17 +0000
commite9582417392ed244d57d8d625ab335a3589831fe (patch)
treef937a3458c7c3f4987fe77d8a77a47b948807065 /lib/libfetch/Makefile
parent58045d2d2c66cc826418c2c40735d7130c308a14 (diff)
downloadFreeBSD-src-e9582417392ed244d57d8d625ab335a3589831fe.zip
FreeBSD-src-e9582417392ed244d57d8d625ab335a3589831fe.tar.gz
First of a series of cleanups to libfetch. Changed files, in
alphabetical order: Makefile: Add common.c to SRCS. Make debugging easier by making 'CFLAGS += -DNDEBUG' conditional on DEBUG Don't declare struct {ftp,http}err in {ftp,http}err.c; use struct fetcherr instead. README: Remove the todo list, which is out of date anyway. common.c: (new file) Gather utility functions in this file. Merge the error reporting functions intp _fetch_errstring(), _fetch_seterr() and _fetch_syserr(). Set fetchLastErrCode and fetchLastErrText appropriately when fetchConnect fails. common.h: (new file) Gather internal prototypes and structures in this files. fetch.3: Undocument fetchFreeURL(). Document a few more known bugs. Document fetchLastErrCode and fetchLastErrText. fetch.c: Add descriptive comments to all functions that lacked them. Move fetchConnect() to common.c. Obviate the need for fetchFreeURL(), and remove it. fetch.h: Modify struct url_t so the document part is at the end. ftp.c: Remove code that is duplicated elsewhere. http.c: Remove code that is duplicated elsewhere. Prompted by: jkh
Diffstat (limited to 'lib/libfetch/Makefile')
-rw-r--r--lib/libfetch/Makefile26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile
index 2afd8bb..ca48d06 100644
--- a/lib/libfetch/Makefile
+++ b/lib/libfetch/Makefile
@@ -1,8 +1,11 @@
-# $Id$
+# $Id: Makefile,v 1.5 1998/08/17 20:39:09 bde Exp $
LIB= fetch
-CFLAGS+= -I. -Wall -pedantic -DNDEBUG
-SRCS= fetch.c ftp.c http.c file.c
+CFLAGS+= -I. -Wall -pedantic
+.if !defined(DEBUG)
+CFLAGS+= -DNDEBUG
+.endif
+SRCS= fetch.c common.c ftp.c http.c file.c
DPSRCS= ftperr.c httperr.c
MAN3= fetch.3
CLEANFILES= ${DPSRCS}
@@ -17,11 +20,7 @@ beforeinstall:
${DESTDIR}/usr/include
ftperr.c: ftp.errors
- @echo "struct ftperr {" \ > ${.TARGET}
- @echo " const int num;" \ >> ${.TARGET}
- @echo " const char *string;" \ >> ${.TARGET}
- @echo "};" \ >> ${.TARGET}
- @echo "static struct ftperr _ftp_errlist[] = {" \ >> ${.TARGET}
+ @echo "static struct fetcherr _ftp_errlist[] = {" \ >> ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
@@ -30,13 +29,12 @@ ftperr.c: ftp.errors
done >> ${.TARGET}
@echo " { -1, \"Unknown FTP error\" }" >> ${.TARGET}
@echo "};" >> ${.TARGET}
+ @echo "#define _ftp_errstring(n) _fetch_errstring(_ftp_errlist, n)" >> ${.TARGET}
+ @echo "#define _ftp_seterr(n) _fetch_seterr(_ftp_errlist, n)" >> ${.TARGET}
+
httperr.c: http.errors
- @echo "struct httperr {" \ > ${.TARGET}
- @echo " const int num;" \ >> ${.TARGET}
- @echo " const char *string;" \ >> ${.TARGET}
- @echo "};" \ >> ${.TARGET}
- @echo "static struct httperr _http_errlist[] = {" \ >> ${.TARGET}
+ @echo "static struct fetcherr _http_errlist[] = {" \ >> ${.TARGET}
@cat ${.ALLSRC} \
| grep -v ^# \
| sort \
@@ -45,6 +43,8 @@ httperr.c: http.errors
done >> ${.TARGET}
@echo " { -1, \"Unknown HTTP error\" }" >> ${.TARGET}
@echo "};" >> ${.TARGET}
+ @echo "#define _http_errstring(n) _fetch_errstring(_http_errlist, n)" >> ${.TARGET}
+ @echo "#define _http_seterr(n) _fetch_seterr(_http_errlist, n)" >> ${.TARGET}
.include <bsd.lib.mk>
OpenPOWER on IntegriCloud