summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-02-26 21:02:21 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-02-26 21:02:21 +0200
commit47a1e0515012d4aaf4f95fd71c4bc6de526e8d86 (patch)
tree1860b66be006ad0df30894d3876e9ffe170ce8ff /rpmio
parentedc6b13d19d832ec56b63007ccc84a0f43cf2629 (diff)
downloadlibrpm-tizen-47a1e0515012d4aaf4f95fd71c4bc6de526e8d86.tar.gz
librpm-tizen-47a1e0515012d4aaf4f95fd71c4bc6de526e8d86.tar.bz2
librpm-tizen-47a1e0515012d4aaf4f95fd71c4bc6de526e8d86.zip
Make the rest of rpmio vectors static inside rpmio
- no external needs, gets them out of exported library symbols
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmio.c53
-rw-r--r--rpmio/rpmio_internal.h99
2 files changed, 48 insertions, 104 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index f23be670b..5013af21f 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -51,6 +51,49 @@ int noLibio = 1;
#define TIMEOUT_SECS 60
+/** \ingroup rpmio
+ * \name RPMIO Vectors.
+ */
+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, _libio_pos_t pos, int whence);
+typedef int (*fdio_close_function_t) (void *cookie);
+typedef FD_t (*fdio_ref_function_t) ( void * cookie, const char * msg);
+typedef FD_t (*fdio_deref_function_t) ( FD_t fd, const char * msg);
+typedef FD_t (*fdio_new_function_t) (const char * msg);
+typedef int (*fdio_fileno_function_t) (void * cookie);
+typedef FD_t (*fdio_open_function_t) (const char * path, int flags, mode_t mode);
+typedef FD_t (*fdio_fopen_function_t) (const char * path, const char * fmode);
+typedef void * (*fdio_ffileno_function_t) (FD_t fd);
+typedef int (*fdio_fflush_function_t) (FD_t fd);
+
+/** \ingroup rpmio
+ */
+struct FDIO_s {
+ fdio_read_function_t read;
+ fdio_write_function_t write;
+ fdio_seek_function_t seek;
+ fdio_close_function_t close;
+
+ fdio_ref_function_t _fdref;
+ fdio_deref_function_t _fdderef;
+ fdio_new_function_t _fdnew;
+ fdio_fileno_function_t _fileno;
+
+ fdio_open_function_t _open;
+ fdio_fopen_function_t _fopen;
+ fdio_ffileno_function_t _ffileno;
+ fdio_fflush_function_t _fflush;
+};
+
+/* forward refs */
+static FDIO_t fdio;
+static FDIO_t fpio;
+static FDIO_t ufdio;
+static FDIO_t gzdio;
+static FDIO_t bzdio;
+static FDIO_t fadio;
+
/**
*/
int _rpmio_debug = 0;
@@ -368,7 +411,7 @@ static struct FDIO_s fdio_s = {
fdRead, fdWrite, fdSeek, fdClose, fdLink, fdFree, fdNew, fdFileno,
fdOpen, NULL, fdGetFp, NULL
};
-FDIO_t fdio = &fdio_s ;
+static FDIO_t fdio = &fdio_s ;
int fdWritable(FD_t fd, int secs)
{
@@ -817,7 +860,7 @@ static struct FDIO_s ufdio_s = {
ufdRead, ufdWrite, ufdSeek, ufdClose, fdLink, fdFree, fdNew, fdFileno,
ufdOpen, NULL, fdGetFp, NULL
};
-FDIO_t ufdio = &ufdio_s ;
+static FDIO_t ufdio = &ufdio_s ;
ssize_t timedRead(FD_t fd, void * bufptr, size_t length)
{
@@ -1023,7 +1066,7 @@ static struct FDIO_s gzdio_s = {
gzdRead, gzdWrite, gzdSeek, gzdClose, fdLink, fdFree, fdNew, fdFileno,
NULL, gzdOpen, gzdFileno, gzdFlush
};
-FDIO_t gzdio = &gzdio_s ;
+static FDIO_t gzdio = &gzdio_s ;
#endif /* HAVE_ZLIB_H */
@@ -1186,7 +1229,7 @@ static struct FDIO_s bzdio_s = {
bzdRead, bzdWrite, bzdSeek, bzdClose, fdLink, fdFree, fdNew, fdFileno,
NULL, bzdOpen, bzdFileno, bzdFlush
};
-FDIO_t bzdio = &bzdio_s ;
+static FDIO_t bzdio = &bzdio_s ;
#endif /* HAVE_BZLIB_H */
@@ -1691,4 +1734,4 @@ static struct FDIO_s fpio_s = {
ufdRead, ufdWrite, fdSeek, ufdClose, fdLink, fdFree, fdNew, fdFileno,
ufdOpen, NULL, fdGetFp, NULL
};
-FDIO_t fpio = &fpio_s ;
+static FDIO_t fpio = &fpio_s ;
diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h
index 9f67a7a61..57de0dd8b 100644
--- a/rpmio/rpmio_internal.h
+++ b/rpmio/rpmio_internal.h
@@ -70,105 +70,6 @@ struct _FD_s {
rpm_off_t fd_cpioPos; /* cpio: */
};
-/** \ingroup rpmio
- * \name RPMIO Vectors.
- */
-
-/**
- */
-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, _libio_pos_t pos, int whence);
-
-/**
- */
-typedef int (*fdio_close_function_t) (void *cookie);
-
-
-/**
- */
-typedef FD_t (*fdio_ref_function_t) ( void * cookie, const char * msg);
-
-/**
- */
-typedef FD_t (*fdio_deref_function_t) ( FD_t fd, const char * msg);
-
-
-/**
- */
-typedef FD_t (*fdio_new_function_t) (const char * msg);
-
-
-/**
- */
-typedef int (*fdio_fileno_function_t) (void * cookie);
-
-
-/**
- */
-typedef FD_t (*fdio_open_function_t) (const char * path, int flags, mode_t mode);
-
-/**
- */
-typedef FD_t (*fdio_fopen_function_t) (const char * path, const char * fmode);
-
-/**
- */
-typedef void * (*fdio_ffileno_function_t) (FD_t fd);
-
-/**
- */
-typedef int (*fdio_fflush_function_t) (FD_t fd);
-
-/** \ingroup rpmio
- */
-struct FDIO_s {
- fdio_read_function_t read;
- fdio_write_function_t write;
- fdio_seek_function_t seek;
- fdio_close_function_t close;
-
- fdio_ref_function_t _fdref;
- fdio_deref_function_t _fdderef;
- fdio_new_function_t _fdnew;
- fdio_fileno_function_t _fileno;
-
- fdio_open_function_t _open;
- fdio_fopen_function_t _fopen;
- fdio_ffileno_function_t _ffileno;
- fdio_fflush_function_t _fflush;
-};
-
-/**
- */
-extern FDIO_t fdio;
-
-/**
- */
-extern FDIO_t fpio;
-
-/**
- */
-extern FDIO_t ufdio;
-
-/**
- */
-extern FDIO_t gzdio;
-
-/**
- */
-extern FDIO_t bzdio;
-
-/**
- */
-extern FDIO_t fadio;
-
#define FDSANE(fd) assert(fd && fd->magic == FDMAGIC)
extern int _rpmio_debug;