diff options
author | jbj <devnull@localhost> | 1999-11-27 00:15:07 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-11-27 00:15:07 +0000 |
commit | db3213b0574239c732f4a9e59a1e297589d3eb3c (patch) | |
tree | 6e1f1b459deef6069a9390b3de596ed4529ade05 /lib | |
parent | 4d26dfa475765173ecb06bf17bda66ddb179acad (diff) | |
download | rpm-db3213b0574239c732f4a9e59a1e297589d3eb3c.tar.gz rpm-db3213b0574239c732f4a9e59a1e297589d3eb3c.tar.bz2 rpm-db3213b0574239c732f4a9e59a1e297589d3eb3c.zip |
lib/stubs.c: Add portability routines to rpmlib for portable shared rpmlib.
lib/rpmio.c: Internalize single use of inet_aton().
lib/rpmio.h: Include libio.h retrofit here rather than in system.h.
configure.in: Remove regex/glob tests.
CVS patchset: 3440
CVS date: 1999/11/27 00:15:07
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/rpmio.h | 15 | ||||
-rw-r--r-- | lib/stubs.c | 67 |
3 files changed, 83 insertions, 1 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index a8bd2de21..28847a571 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -29,7 +29,7 @@ librpm_la_SOURCES = \ lookup.c macro.c md5.c md5sum.c \ messages.c misc.c oldheader.c package.c problems.c query.c \ rebuilddb.c rpmchecksig.c rpmdb.c rpmerr.c rpminstall.c \ - rpmio.c rpmlead.c rpmmalloc.c rpmrc.c signature.c stringbuf.c \ + rpmio.c rpmlead.c rpmmalloc.c rpmrc.c signature.c stringbuf.c stubs.c \ tagName.c tagtable.c transaction.c uninstall.c url.c verify.c tagtable.c: rpmlib.h diff --git a/lib/rpmio.h b/lib/rpmio.h index 13e7e3686..05430a3ae 100644 --- a/lib/rpmio.h +++ b/lib/rpmio.h @@ -13,6 +13,21 @@ typedef /*@observer@*/ struct FDIO_s * FDIO_t; extern "C" { #endif +#if HAVE_LIBIO_H +#include <libio.h> +#else +typedef ssize_t cookie_read_function_t (void *cookie, void *buf, size_t nbytes); +typedef ssize_t cookie_write_function_t (void *cookie, const void *buf, size_t nbytes); +typedef int cookie_seek_function_t (void *cookie, fpos_t *pos, 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; +#endif + typedef /*@null@*/ FD_t fdio_ref_function_t ( /*@only@*/ void * cookie, const char * msg, const char * file, unsigned line); typedef /*@null@*/ FD_t fdio_deref_function_t ( /*@only@*/ FD_t fd, diff --git a/lib/stubs.c b/lib/stubs.c new file mode 100644 index 000000000..7419647cc --- /dev/null +++ b/lib/stubs.c @@ -0,0 +1,67 @@ +/* XXX Portable shared libraries require rpmlib to contain these functions. */ + +#include "system.h" + +#if !defined(HAVE_BASENAME) +#include "misc/basename.c" +#endif + +#if !defined(HAVE_GETCWD) +#include "misc/getcwd.c" +#endif + +#if !defined(HAVE_GETWD) +#include "misc/getwd.c" +#endif + +#if !defined(HAVE_PUTENV) +#include "misc/putenv.c" +#endif + +#if !defined(HAVE_REALPATH) +#include "misc/realpath.c" +#endif + +#if !defined(HAVE_STPCPY) +#include "misc/stpcpy.c" +#endif + +#if !defined(HAVE_STPNCPY) +#include "misc/stpncpy.c" +#endif + +#if !defined(HAVE_STRCASECMP) +#include "misc/strcasecmp.c" +#endif + +#if !defined(HAVE_STRNCASECMP) +#include "misc/strncasecmp.c" +#endif + +#if !defined(HAVE_STRCSPN) +#include "misc/strcspn.c" +#endif + +#if !defined(HAVE_STRSPN) +#include "misc/strdup.c" +#endif + +#if !defined(HAVE_STRERROR) +#include "misc/error.c" +#endif + +#if !defined(HAVE_STRTOL) +#include "misc/strtol.c" +#endif + +#if !defined(HAVE_STRTOUL) +#include "misc/strtoul.c" +#endif + +#if !defined(HAVE_STRSPN) +#include "misc/strspn.c" +#endif + +#if !defined(HAVE_STRSTR) +#include "misc/strstr.c" +#endif |