mirror of
https://github.com/cc65/cc65.git
synced 2024-06-26 05:29:30 +00:00
Improve FindAbsolutePath documentation and API
This commit is contained in:
parent
346dd7df85
commit
a6f207a2a5
|
@ -317,7 +317,7 @@ void OpenIncludeFile (const char* Name, InputType IT, StringPool *FilesToIgnore)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resolve real path of file in case of a symlink */
|
/* Resolve real path of file in case of a symlink */
|
||||||
M = FindAbsolutePath(N);
|
M = FindRealPath(N);
|
||||||
if (M == 0) {
|
if (M == 0) {
|
||||||
PPError ("Cannot resolve absolute path of '%s'", N);
|
PPError ("Cannot resolve absolute path of '%s'", N);
|
||||||
xfree (N);
|
xfree (N);
|
||||||
|
|
|
@ -2979,7 +2979,7 @@ static void DoPragmaOnce (void)
|
||||||
AbEnd ("Cannot find the full path for the file %s", Filename);
|
AbEnd ("Cannot find the full path for the file %s", Filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * const FullPath = FindAbsolutePath(IncludePath);
|
const char * const FullPath = FindRealPath(IncludePath);
|
||||||
|
|
||||||
if (FullPath == NULL) {
|
if (FullPath == NULL) {
|
||||||
AbEnd ("Failed to find the full path for the file %s", Filename);
|
AbEnd ("Failed to find the full path for the file %s", Filename);
|
||||||
|
|
|
@ -3,17 +3,18 @@
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
|
# include <fileapi.h>
|
||||||
# include "xmalloc.h"
|
# include "xmalloc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|
||||||
char *FindAbsolutePath (const char *Path)
|
char *FindRealPath (const char *Path)
|
||||||
/*
|
/*
|
||||||
** Determines the absolute path of the given relative path.
|
** Determines the real path the given relative path of an existing file.
|
||||||
** If the path points to a symlink, resolves such symlink.
|
** If the path points to a symlink, resolves such symlink.
|
||||||
** The absolute path for the file is stored in a malloced buffer.
|
** The real path for the file is stored in a malloced buffer.
|
||||||
** Returns NULL if some error occured.
|
** Returns NULL if the file doesn't exist.
|
||||||
** The returned path's separator is system specific.
|
** The returned path's separator is system specific.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,12 +41,12 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
char *FindAbsolutePath (const char *path);
|
char *FindRealPath (const char *path);
|
||||||
/*
|
/*
|
||||||
** Determines the absolute path of the given relative path.
|
** Determines the real path the given relative path of an existing file.
|
||||||
** If the path points to a symlink, resolves such symlink.
|
** If the path points to a symlink, resolves such symlink.
|
||||||
** The absolute path for the file is stored in a malloced buffer.
|
** The real path for the file is stored in a malloced buffer.
|
||||||
** Returns NULL if some error occured.
|
** Returns NULL if the file doesn't exist.
|
||||||
** The returned path's separator is system specific.
|
** The returned path's separator is system specific.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user