From acd32889f49328cccfdb4be351141a098ef2ae5c Mon Sep 17 00:00:00 2001 From: jbj Date: Sun, 5 Dec 1999 21:22:45 +0000 Subject: [PATCH] expose enough of the legacy fdio interface to compile rpmfind/rpm2html. CVS patchset: 3457 CVS date: 1999/12/05 21:22:45 --- CHANGES | 1 + lib/rpmio.h | 52 +++++++++++++++++----------------------------------- lib/url.c | 4 ++++ misc/err.c | 2 +- po/rpm.pot | 46 +++++++++++++++++++++++----------------------- rpm.spec | 2 +- 6 files changed, 47 insertions(+), 60 deletions(-) diff --git a/CHANGES b/CHANGES index c14c0fb..2c06d70 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,7 @@ - permit --whatprovides to lookup file dependencies. - fail to package if absolute symlink points within build root. - initial version of check-prereqs. + - expose enough of legacy fdio interface to compile rpmfind/rpm2html. 3.0.2 -> 3.0.3 - add --eval to find result of macro expansion. diff --git a/lib/rpmio.h b/lib/rpmio.h index 1262095..9349bb4 100644 --- a/lib/rpmio.h +++ b/lib/rpmio.h @@ -2,9 +2,12 @@ #define H_RPMIO #include +#include +#include +#include +#include #include #include -#include typedef /*@abstract@*/ /*@refcounted@*/ struct _FD_s * FD_t; typedef /*@observer@*/ struct FDIO_s * FDIO_t; @@ -13,23 +16,10 @@ typedef /*@observer@*/ struct FDIO_s * FDIO_t; extern "C" { #endif -#if HAVE_LIBIO_H -#include -#else -typedef ssize_t cookie_read_function_t (void *cookie, char *buf, size_t nbytes); -typedef ssize_t cookie_write_function_t (void *cookie, const char *buf, size_t nbytes); -typedef int cookie_seek_function_t (void *cookie, off_t offset, int whence); -typedef int cookie_close_function_t (void *cookie); -typedef struct { - cookie_read_function_t *read; - cookie_write_function_t *write; - cookie_seek_function_t *seek; - cookie_close_function_t *close; -} cookie_io_functions_t; -FILE * fopencookie (void *magic_cookie, const char * modes, - cookie_io_functions_t io_funcs); -#define fopencookie(_a, _b, _c) (NULL) -#endif +typedef ssize_t fdio_read_function_t (void *cookie, char *buf, size_t nbytes); +typedef ssize_t fdio_write_function_t (void *cookie, const char *buf, size_t nbytes); +typedef int fdio_seek_function_t (void *cookie, off_t offset, int whence); +typedef int fdio_close_function_t (void *cookie); typedef /*@null@*/ FD_t fdio_ref_function_t ( /*@only@*/ void * cookie, const char * msg, const char * file, unsigned line); @@ -57,10 +47,10 @@ typedef int fdio_lstat_function_t (const char * path, struct stat * st); typedef int fdio_access_function_t (const char * path, int amode); struct FDIO_s { - cookie_read_function_t * read; - cookie_write_function_t * write; - cookie_seek_function_t * seek; - cookie_close_function_t * close; + fdio_read_function_t * read; + fdio_write_function_t * write; + fdio_seek_function_t * seek; + fdio_close_function_t * close; fdio_ref_function_t * ref; fdio_deref_function_t * deref; @@ -138,22 +128,21 @@ extern /*@null@*/ FD_t fdDup(int fdno); extern /*@null@*/ FILE *fdFdopen( /*@only@*/ void * cookie, const char * mode); #endif +/* XXX legacy interface used in rpm2html */ +#define fdClose fdio->close +#define fdOpen fdio->_open + #if 0 #define fdRead fdio->read #define fdWrite fdio->write #define fdSeek fdio->seek -#define fdClose fdio->close +#define fdFileno fdio->_fileno #endif #define fdLink(_fd, _msg) fdio->ref(_fd, _msg, __FILE__, __LINE__) #define fdFree(_fd, _msg) fdio->deref(_fd, _msg, __FILE__, __LINE__) #define fdNew(_msg) fdio->new(_msg, __FILE__, __LINE__) -#if 0 -#define fdFileno fdio->_fileno -#define fdOpen fdio->_open -#endif - int fdWritable(FD_t fd, int secs); int fdReadable(FD_t fd, int secs); @@ -163,13 +152,6 @@ int fdReadable(FD_t fd, int secs); /* * 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 diff --git a/lib/url.c b/lib/url.c index 74d2eac..25fead3 100644 --- a/lib/url.c +++ b/lib/url.c @@ -13,6 +13,10 @@ #include #include +#ifndef IPPORT_HTTP +#define IPPORT_HTTP 80 +#endif + /*@access urlinfo@*/ #define URL_IOBUF_SIZE 4096 diff --git a/misc/err.c b/misc/err.c index e5f181a..fa23594 100644 --- a/misc/err.c +++ b/misc/err.c @@ -19,7 +19,7 @@ #include "system.h" -#ifdef HAVE_LIBIO +#ifdef HAVE_LIBIO_H #define flockfile(s) _IO_flockfile (s) #define funlockfile(s) _IO_funlockfile (s) #else diff --git a/po/rpm.pot b/po/rpm.pot index 8067f7d..8aa7508 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-12-02 13:26-0500\n" +"POT-Creation-Date: 1999-12-05 15:37-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2838,7 +2838,7 @@ msgstr "" msgid "opening database mode 0x%x in %s\n" msgstr "" -#: lib/rpmdb.c:157 lib/url.c:447 +#: lib/rpmdb.c:157 lib/url.c:451 #, c-format msgid "failed to open %s: %s\n" msgstr "" @@ -3032,59 +3032,59 @@ msgstr "" msgid "Installing %s\n" msgstr "" -#: lib/rpmio.c:755 +#: lib/rpmio.c:762 msgid "Success" msgstr "" -#: lib/rpmio.c:758 +#: lib/rpmio.c:765 msgid "Bad server response" msgstr "" -#: lib/rpmio.c:761 +#: lib/rpmio.c:768 msgid "Server IO error" msgstr "" -#: lib/rpmio.c:764 +#: lib/rpmio.c:771 msgid "Server timeout" msgstr "" -#: lib/rpmio.c:767 +#: lib/rpmio.c:774 msgid "Unable to lookup server host address" msgstr "" -#: lib/rpmio.c:770 +#: lib/rpmio.c:777 msgid "Unable to lookup server host name" msgstr "" -#: lib/rpmio.c:773 +#: lib/rpmio.c:780 msgid "Failed to connect to server" msgstr "" -#: lib/rpmio.c:776 +#: lib/rpmio.c:783 msgid "Failed to establish data connection to server" msgstr "" -#: lib/rpmio.c:779 +#: lib/rpmio.c:786 msgid "IO error to local file" msgstr "" -#: lib/rpmio.c:782 +#: lib/rpmio.c:789 msgid "Error setting remote server to passive mode" msgstr "" -#: lib/rpmio.c:785 +#: lib/rpmio.c:792 msgid "File not found on server" msgstr "" -#: lib/rpmio.c:788 +#: lib/rpmio.c:795 msgid "Abort in progress" msgstr "" -#: lib/rpmio.c:792 +#: lib/rpmio.c:799 msgid "Unknown or unexpected error" msgstr "" -#: lib/rpmio.c:1313 +#: lib/rpmio.c:1320 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" @@ -3383,37 +3383,37 @@ msgstr "" msgid "execution of script failed" msgstr "" -#: lib/url.c:81 +#: lib/url.c:85 #, c-format msgid "warning: u %p ctrl %p nrefs != 0 (%s %s)\n" msgstr "" -#: lib/url.c:98 +#: lib/url.c:102 #, c-format msgid "warning: u %p data %p nrefs != 0 (%s %s)\n" msgstr "" -#: lib/url.c:126 +#: lib/url.c:130 #, c-format msgid "warning: uCache[%d] %p nrefs(%d) != 1 (%s %s)\n" msgstr "" -#: lib/url.c:223 +#: lib/url.c:227 #, c-format msgid "Password for %s@%s: " msgstr "" -#: lib/url.c:248 lib/url.c:274 +#: lib/url.c:252 lib/url.c:278 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: lib/url.c:411 +#: lib/url.c:415 msgid "url port must be a number\n" msgstr "" #. XXX Fstrerror -#: lib/url.c:470 +#: lib/url.c:474 #, c-format msgid "failed to create %s: %s\n" msgstr "" diff --git a/rpm.spec b/rpm.spec index 6117569..d9f59ad 100644 --- a/rpm.spec +++ b/rpm.spec @@ -2,7 +2,7 @@ Summary: The Red Hat package management system. Name: rpm %define version 3.0.4 Version: %{version} -Release: 0.4 +Release: 0.5 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz Copyright: GPL -- 2.7.4