1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-16 09:29:32 +00:00

Improve FindAbsolutePath documentation and API

This commit is contained in:
cosineblast 2024-01-17 00:33:49 -03:00
parent 346dd7df85
commit a6f207a2a5
4 changed files with 11 additions and 10 deletions

View File

@ -317,7 +317,7 @@ void OpenIncludeFile (const char* Name, InputType IT, StringPool *FilesToIgnore)
}
/* Resolve real path of file in case of a symlink */
M = FindAbsolutePath(N);
M = FindRealPath(N);
if (M == 0) {
PPError ("Cannot resolve absolute path of '%s'", N);
xfree (N);

View File

@ -2979,7 +2979,7 @@ static void DoPragmaOnce (void)
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) {
AbEnd ("Failed to find the full path for the file %s", Filename);

View File

@ -3,17 +3,18 @@
#if defined(_WIN32)
# include <windows.h>
# include <fileapi.h>
# include "xmalloc.h"
#endif
#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.
** The absolute path for the file is stored in a malloced buffer.
** Returns NULL if some error occured.
** The real path for the file is stored in a malloced buffer.
** Returns NULL if the file doesn't exist.
** The returned path's separator is system specific.
*/
{

View File

@ -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.
** The absolute path for the file is stored in a malloced buffer.
** Returns NULL if some error occured.
** The real path for the file is stored in a malloced buffer.
** Returns NULL if the file doesn't exist.
** The returned path's separator is system specific.
*/