From a1743ee8f71f729c1cc264e70d926b0908f77adc Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 5 Apr 2002 12:46:07 +0000 Subject: [PATCH] yaz_fclose and yaz_fopen implemented --- include/yaz/tpath.h | 10 ++++++---- retrieval/d1_handle.c | 4 ++-- util/tpath.c | 13 +++++++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/yaz/tpath.h b/include/yaz/tpath.h index 425687e..5f9e907 100644 --- a/include/yaz/tpath.h +++ b/include/yaz/tpath.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: tpath.h,v 1.3 2002-04-04 20:49:46 adam Exp $ + * $Id: tpath.h,v 1.4 2002-04-05 12:46:07 adam Exp $ * */ @@ -34,10 +34,12 @@ YAZ_BEGIN_CDECL -YAZ_EXPORT FILE *yaz_path_fopen_base(const char *path, const char *name, - const char *mode, const char *base); +YAZ_EXPORT FILE *yaz_fopen(const char *path, const char *name, + const char *mode, const char *base); YAZ_EXPORT FILE *yaz_path_fopen(const char *path, const char *name, - const char *mode); + const char *mode); + +YAZ_EXPORT int yaz_fclose(FILE *f); YAZ_EXPORT int yaz_is_abspath (const char *p); diff --git a/retrieval/d1_handle.c b/retrieval/d1_handle.c index d1c7f95..541ee84 100644 --- a/retrieval/d1_handle.c +++ b/retrieval/d1_handle.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2002, Index Data. * See the file LICENSE for details. * - * $Id: d1_handle.c,v 1.7 2002-04-04 20:49:46 adam Exp $ + * $Id: d1_handle.c,v 1.8 2002-04-05 12:46:07 adam Exp $ */ #include @@ -128,5 +128,5 @@ FILE *data1_path_fopen (data1_handle dh, const char *file, const char *mode) { const char *path = data1_get_tabpath(dh); const char *root = data1_get_tabroot(dh); - return yaz_path_fopen_base (path, file, "r", root); + return yaz_fopen (path, file, "r", root); } diff --git a/util/tpath.c b/util/tpath.c index b8f0794..10087cc 100644 --- a/util/tpath.c +++ b/util/tpath.c @@ -3,7 +3,7 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Id: tpath.c,v 1.6 2002-04-04 20:49:46 adam Exp $ + * $Id: tpath.c,v 1.7 2002-04-05 12:46:07 adam Exp $ */ #if HAVE_CONFIG_H #include @@ -18,11 +18,16 @@ FILE *yaz_path_fopen(const char *path, const char *name, const char *mode) { - return yaz_path_fopen_base (path, name, mode, 0); + return yaz_fopen (path, name, mode, 0); } -FILE *yaz_path_fopen_base(const char *path, const char *name, const char *mode, - const char *base) +int yaz_fclose (FILE *f) +{ + fclose (f); +} + +FILE *yaz_fopen(const char *path, const char *name, const char *mode, + const char *base) { char spath[1024]; -- 1.7.10.4