/*
- * Copyright (c) 1995-2000, Index Data.
+ * Copyright (C) 1995-2005, Index Data ApS
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation, in whole or in part, for any purpose, is hereby granted,
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Log: tpath.h,v $
- * Revision 1.2 2000-02-28 11:20:06 adam
- * Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL.
- *
- * Revision 1.1 1999/11/30 13:47:11 adam
- * Improved installation. Moved header files to include/yaz.
- *
- * Revision 1.4 1997/10/31 12:20:08 adam
- * Improved memory debugging for xmalloc/nmem.c. References to NMEM
- * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
- * Bug fix: missing fclose in data1_read_espec1.
+ * $Id: tpath.h,v 1.9 2006-04-26 09:40:43 adam Exp $
*
*/
+/**
+ * \file tpath.h
+ * \brief Header for path fopen
+ */
#ifndef TPATH_H
#define TPATH_H
#include <yaz/yconfig.h>
+#include <stdio.h>
YAZ_BEGIN_CDECL
-YAZ_EXPORT FILE *yaz_path_fopen(const char *path,
- const char *name, const char *mode);
+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);
+
+YAZ_EXPORT int yaz_fclose(FILE *f);
+
+YAZ_EXPORT int yaz_is_abspath (const char *p);
+
+/** \brief resolve file on path
+ \param fname "short" filename (without path)
+ \param path the path (dir1:dir2,..) - ala Unix
+ \param base can be added to relative paths (NULL for no append)
+ \param fullpath the full path to filename (if succesful)
+
+ Returns 0/NULL if no fname could be found in path;
+ pointer to fullpath if fname could be found.
+ We assume fullpath is 1024 bytes in length!
+*/
+YAZ_EXPORT char *yaz_filepath_resolve(const char *fname, const char *path,
+ const char *base, char *fullpath);
+
YAZ_END_CDECL
#endif
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+