0c663b7771
FTP error return code because 1) They return NULL, it means that ftpErrno can't be used because it takes file pointer 2) They don't have FILE-type argument as f.e. ftpGet/ftpPut to use it for ftpErrno instead. For that functions I add yet one int* type argument to store FTP error return code. It is impossible to add some global variable for that reason, because user can have multiply FTP connections opened at the same time. So, interface changed, major number bumped. Userland changes will follows. Minor bugfixes, the code: Forget to close file in few places, when failure occurse Forget to NULL cached host name, multiply free is possible
29 lines
727 B
Makefile
29 lines
727 B
Makefile
LIB= ftpio
|
|
CFLAGS+= -I${.CURDIR} -Wall
|
|
SRCS= ftpio.c ftperr.c
|
|
MAN3= ftpio.3
|
|
CLEANFILES+= ftperr.c
|
|
|
|
SHLIB_MAJOR= 4
|
|
SHLIB_MINOR= 0
|
|
|
|
beforeinstall:
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/ftpio.h \
|
|
${DESTDIR}/usr/include
|
|
|
|
ftperr.c: ftp.errors
|
|
@echo '#include <stdio.h>' > ${.TARGET}
|
|
@echo '#include "ftpio.h"' >> ${.TARGET}
|
|
@echo "struct ftperr ftpErrList[] = {" \ >> ${.TARGET}
|
|
@cat ${.ALLSRC} \
|
|
| grep -v ^# \
|
|
| sort \
|
|
| while read NUM STRING; do \
|
|
echo " { $${NUM}, \"$${STRING}\" },"; \
|
|
done >> ${.TARGET}
|
|
@echo "};" >> ${.TARGET}
|
|
@echo -n "int const ftpErrListLength = " >> ${.TARGET}
|
|
@echo "sizeof(ftpErrList) / sizeof(*ftpErrList);" >> ${.TARGET}
|
|
|
|
.include <bsd.lib.mk>
|