1 #ifndef __G_REALPATH_H__
2 #define __G_REALPATH_H__
12 * this should be a) filled in for win32 and b) put in glib...
16 g_realpath (const char *path)
22 char buffer [PATH_MAX];
23 if (realpath(path, buffer))
24 return g_strdup(buffer);
28 /* We don't want to include <windows.h> as it clashes horribly
29 * with token names from scannerparser.h. So just declare
30 * GetFullPathNameA() here unless we already defined it, like
34 extern __stdcall GetFullPathNameA(const char*, int, char*, char**);
40 rc = GetFullPathNameA(path, 1, &dummy, NULL);
44 /* Weird failure, so just return the input path as such */
45 return g_strdup(path);
49 buffer = g_malloc(len);
51 rc = GetFullPathNameA(path, len, buffer, NULL);
53 if (rc == 0 || rc > len)
55 /* Weird failure again */
57 return g_strdup(path);