summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorRalf Corsépius <corsepiu@fedoraproject.org>2007-09-21 16:50:59 +0200
committerRalf Corsépius <corsepiu@fedoraproject.org>2007-09-21 16:50:59 +0200
commit868ff87bc0ac8adbff6629e91111e79c49553c91 (patch)
tree7655d97491f39edb27c56d5a82ce5b6c00ea5e07 /rpmio
parente152864a768c7cd81479b43e15f4f2cb340e0910 (diff)
downloadlibrpm-tizen-868ff87bc0ac8adbff6629e91111e79c49553c91.tar.gz
librpm-tizen-868ff87bc0ac8adbff6629e91111e79c49553c91.tar.bz2
librpm-tizen-868ff87bc0ac8adbff6629e91111e79c49553c91.zip
Add fdClose, fdOpen, fdRead, fdWrite functions.
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmio.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index c1dc204fb..b40ea3289 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -265,6 +265,15 @@ FD_t XfdNew(const char * msg, const char * file, unsigned line)
return XfdLink(fd, msg, file, line);
}
+/**
+ */
+ssize_t fdRead(void * cookie, char * buf, size_t count)
+{
+ return fdio->read(cookie, buf, count);
+}
+
+/**
+ */
static ssize_t __fdRead(void * cookie, char * buf, size_t count)
{
FD_t fd = c2f(cookie);
@@ -283,6 +292,15 @@ DBGIO(fd, (stderr, "==>\t__fdRead(%p,%p,%ld) rc %ld %s\n", cookie, buf, (long)co
return rc;
}
+/**
+ */
+ssize_t fdWrite(void * cookie, const char * buf, size_t count)
+{
+ return fdio->write(cookie, buf, count);
+}
+
+/**
+ */
static ssize_t __fdWrite(void * cookie, const char * buf, size_t count)
{
FD_t fd = c2f(cookie);
@@ -324,6 +342,15 @@ DBGIO(fd, (stderr, "==>\tfdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence
return rc;
}
+/**
+ */
+int fdClose( void * cookie)
+{
+ return fdio->close(cookie);
+}
+
+/**
+ */
static int __fdClose( void * cookie)
{
FD_t fd;
@@ -346,6 +373,15 @@ DBGIO(fd, (stderr, "==>\t__fdClose(%p) rc %lx %s\n", (fd ? fd : NULL), (unsigned
return rc;
}
+/**
+ */
+FD_t fdOpen(const char *path, int flags, mode_t mode)
+{
+ return fdio->_open(path, flags, mode);
+}
+
+/**
+ */
static FD_t __fdOpen(const char *path, int flags, mode_t mode)
{
FD_t fd;