diff common/portpath.c @ 146:306e4db11761

Added portable path name handling functions. Windows implementation missing.
author Sascha Wilde <wilde@intevation.de>
date Mon, 24 Mar 2014 17:23:06 +0100
parents
children 4a4b5e640d1a 6d64d7e9fa32
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/portpath.c	Mon Mar 24 17:23:06 2014 +0100
@@ -0,0 +1,30 @@
+#include "portpath.h"
+
+#include <libgen.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+char *
+port_dirname(char *path)
+{
+#ifndef _WIN32
+  return dirname(path);
+#else
+  fprintf(stderr, "Windows Suport missing!");
+  abort();
+#endif
+ 
+}
+
+char *
+port_realpath(char *path)
+{
+#ifndef _WIN32
+  return realpath(path, NULL);
+#else
+  fprintf(stderr, "Windows Suport missing!");
+  abort();
+#endif
+}

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