diff common/portpath.h @ 188:a3bde2aaabd9

merged.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 26 Mar 2014 09:12:10 +0100
parents 70d627e9e801
children 17e1c8f37d72
line wrap: on
line diff
--- a/common/portpath.h	Wed Mar 26 09:10:46 2014 +0100
+++ b/common/portpath.h	Wed Mar 26 09:12:10 2014 +0100
@@ -1,6 +1,8 @@
 #ifndef PORTPATH_H
 #define PORTPATH_H
 
+#include <stdbool.h>
+
 /**
  * @file  portpath.h
  * @brief Platform independent functions for file and path handling.
@@ -18,16 +20,6 @@
  */
 char *port_dirname(char *path);
 
-
-/**
- * @brief portable version of dirname
- * @details return the directory component of the given path.
- * The argument path may be altered by the function.
- * @param[inout] path the pathname
- * @returns a pointer to the string containing the directory component
- */
-char *port_dirname(char *path);
-
 /**
  * @brief portable version of realpath
  * @details return the expanded absolute pathname for the given path.
@@ -38,4 +30,22 @@
  */
 char *port_realpath(char *path);
 
+/**
+ * @brief test if a file exists
+ * @details uses a platform specific stat call to test if the given
+ * file exists.
+ * @param[in] path the path to the file
+ * @returns true if the file exists and false otherwise
+ */
+bool port_fileexits(char *path);
+
+/**
+ * @brief test if a file is a directory
+ * @details uses a platform specific stat call to test if the given
+ * file is an directory.
+ * @param[in] path the path to the file
+ * @returns true if the file is an directory and false otherwise
+ */
+bool port_isdir(char *path);
+
 #endif

http://wald.intevation.org/projects/trustbridge/