summaryrefslogtreecommitdiff
path: root/lib/rpmio.h
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-11-18 18:07:46 +0000
committerjbj <devnull@localhost>1999-11-18 18:07:46 +0000
commit1f6614e61efc520d2da0c09604d4ee1c06117073 (patch)
treeed7066a82ca608c08be5fbe194611486349eb1a5 /lib/rpmio.h
parent3a6118d4194d9672b24cd7b357e6191f4eb47fde (diff)
downloadlibrpm-tizen-1f6614e61efc520d2da0c09604d4ee1c06117073.tar.gz
librpm-tizen-1f6614e61efc520d2da0c09604d4ee1c06117073.tar.bz2
librpm-tizen-1f6614e61efc520d2da0c09604d4ee1c06117073.zip
The death of lib/ftp.c, merged into lib/rpmio.c.
Start composting the rpmio API. Preliminary (not working) support for HTTP PUT. build.c: Check fd for NULL and use Ferror() for Fopen return. build/parseSpec.c: ditto build/pack.c: Use fdGetFP() rather than fpio->ffileno(). build/parseSpec.c: ditto build/pack.c: Use Stat/Mkdir wrappers. build/pack.c: Do Fflush before fdDup so that writes can remain buffered. lib/install.c: ditto build/parsePrep.c: Skip over URL leadin when writing %prep scriptlet. lib/misc.c: Rewrite to use simpler urlPath(). Restore checks on local fs. lib/rpmchecksig.c: Open with "r+" rather than "w" to avoid truncation. lib/url.c: Do lazy malloc of u->buf in rpmio.c checkResponse(). lib/rpmio.c: Make persist/contentLength per-fd rather than per-url. lib/rpmio.c: Add wr_chunked method for HTTP PUT (still broken). lib/rpmio.c: ftpAbort() should use timedRead. lib/rpmio.c: Add Fflush(). lib/url.c: urlPath() should return something ("/") on url = NULL (paranoia). lib/url.c: urlSplit() should return something ("/") on url w/o path. CVS patchset: 3429 CVS date: 1999/11/18 18:07:46
Diffstat (limited to 'lib/rpmio.h')
-rw-r--r--lib/rpmio.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/lib/rpmio.h b/lib/rpmio.h
index 72b6fb86e..ddb5289fc 100644
--- a/lib/rpmio.h
+++ b/lib/rpmio.h
@@ -70,6 +70,7 @@ int Fclose ( /*@killref@*/ FD_t fd);
FD_t Fdopen (FD_t fd, const char * fmode);
FD_t Fopen (const char * path, const char * fmode);
+int Fflush (FD_t fd);
int Ferror (FD_t fd);
int Fileno (FD_t fd);
@@ -102,9 +103,6 @@ void fdSetIo (FD_t fd, FDIO_t io);
int fdGetRdTimeoutSecs(FD_t fd);
-int fdGetFtpFileDoneNeeded(FD_t fd);
-void fdSetFtpFileDoneNeeded(FD_t fd, int ftpFileDoneNeeded);
-
long int fdGetCpioPos(FD_t fd);
void fdSetCpioPos(FD_t fd, long int cpioPos);
@@ -129,12 +127,35 @@ extern /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode);
#define fdOpen fdio->open
#endif
+int fdWritable(FD_t fd, int secs);
+int fdReadable(FD_t fd, int secs);
+
/*@observer@*/ extern FDIO_t fdio;
/*@observer@*/ extern FDIO_t fpio;
/*
* Support for FTP and HTTP I/O.
*/
+#ifndef IPPORT_FTP
+#define IPPORT_FTP 21
+#endif
+#ifndef IPPORT_HTTP
+#define IPPORT_HTTP 80
+#endif
+
+#define FTPERR_BAD_SERVER_RESPONSE -1
+#define FTPERR_SERVER_IO_ERROR -2
+#define FTPERR_SERVER_TIMEOUT -3
+#define FTPERR_BAD_HOST_ADDR -4
+#define FTPERR_BAD_HOSTNAME -5
+#define FTPERR_FAILED_CONNECT -6
+#define FTPERR_FILE_IO_ERROR -7
+#define FTPERR_PASSIVE_ERROR -8
+#define FTPERR_FAILED_DATA_CONNECT -9
+#define FTPERR_FILE_NOT_FOUND -10
+#define FTPERR_NIC_ABORT_IN_PROGRESS -11
+#define FTPERR_UNKNOWN -100
+
/*@dependent@*/ /*@null@*/ void * ufdGetUrlinfo(FD_t fd);
/*@observer@*/ const char * urlStrerror(const char * url);
@@ -162,10 +183,6 @@ const char *const ftpStrerror(int errorNumber);
#define ufdUnlink ufdio->unlink
#endif
-int fdWritable(FD_t fd, int secs);
-int fdReadable(FD_t fd, int secs);
-int fdRdline(FD_t fd, /*@out@*/ char * buf, size_t len);
-
int timedRead(FD_t fd, /*@out@*/ void * bufptr, int length);
#define timedRead ufdio->read