Add fdLink, fdFree, fdNew functions.
authorRalf Corsépius <corsepiu@fedoraproject.org>
Fri, 21 Sep 2007 15:02:45 +0000 (17:02 +0200)
committerRalf Corsépius <corsepiu@fedoraproject.org>
Fri, 21 Sep 2007 15:02:45 +0000 (17:02 +0200)
rpmio/rpmio.c

index b40ea32..9bf08e5 100644 (file)
@@ -188,7 +188,16 @@ DBGIO(fd, (stderr, "==> fdFdopen(%p,\"%s\") fdno %d -> fp %p fdno %d\n", cookie,
 #endif
 
 /* =============================================================== */
-/* FIX: cookie is modified */
+
+/**
+ */
+FD_t fdLink (void * cookie, const char * msg)
+{
+    return fdio->_fdref(cookie, msg, __FILE__, __LINE__);
+}
+
+/**
+ */
 static inline FD_t XfdLink(void * cookie, const char * msg,
                const char * file, unsigned line)
 {
@@ -203,6 +212,15 @@ DBGREFS(fd, (stderr, "--> fd  %p ++ %d %s at %s:%u %s\n", fd, fd->nrefs, msg, fi
     return fd;
 }
 
+/**
+ */
+FD_t fdFree(FD_t fd, const char * msg)
+{
+     return fdio->_fdderef(fd, msg, __FILE__, __LINE__);
+}
+
+/**
+ */
 static inline
 FD_t XfdFree( FD_t fd, const char *msg,
                const char *file, unsigned line)
@@ -230,6 +248,15 @@ DBGREFS(fd, (stderr, "--> fd  %p -- %d %s at %s:%u %s\n", fd, fd->nrefs, msg, fi
     return NULL;
 }
 
+/**
+ */
+FD_t fdNew (const char * msg)
+{
+    return fdio->_fdnew(msg, __FILE__, __LINE__);
+}
+
+/**
+ */
 static inline
 FD_t XfdNew(const char * msg, const char * file, unsigned line)
 {