From: Ralf Corsépius Date: Fri, 21 Sep 2007 15:02:45 +0000 (+0200) Subject: Add fdLink, fdFree, fdNew functions. X-Git-Tag: tznext/4.11.0.1.tizen20130304~5301 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07e383ce0d9a8beeec36e9aed66a2017e95dfcb6;p=tools%2Flibrpm-tizen.git Add fdLink, fdFree, fdNew functions. --- diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index b40ea32..9bf08e5 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -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) {