1 #ifndef __G_REALPATH_H__
2 #define __G_REALPATH_H__
9 * this should be a) filled in for win32 and b) put in glib...
13 g_realpath (const char *path
)
19 char buffer
[PATH_MAX
];
20 if (realpath(path
, buffer
))
21 return g_strdup(buffer
);
25 /* We don't want to include <windows.h> as it clashes horribly
26 * with token names from scannerparser.h. So just declare
27 * GetFullPathNameA() here.
29 extern __stdcall
GetFullPathNameA(const char*, int, char*, char**);
34 rc
= GetFullPathNameA(path
, 1, &dummy
, NULL
);
38 /* Weird failure, so just return the input path as such */
39 return g_strdup(path
);
43 buffer
= g_malloc(len
);
45 rc
= GetFullPathNameA(path
, len
, buffer
, NULL
);
47 if (rc
== 0 || rc
> len
)
49 /* Weird failure again */
51 return g_strdup(path
);