summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/Common/OsPath.c
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/C/Common/OsPath.c')
-rw-r--r--BaseTools/Source/C/Common/OsPath.c97
1 files changed, 33 insertions, 64 deletions
diff --git a/BaseTools/Source/C/Common/OsPath.c b/BaseTools/Source/C/Common/OsPath.c
index 35ca547..9901f68 100644
--- a/BaseTools/Source/C/Common/OsPath.c
+++ b/BaseTools/Source/C/Common/OsPath.c
@@ -20,14 +20,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
// BUGBUG: Not fully implemented yet.
//
-CHAR8*
-OsPathDirName (
- IN CHAR8 *FilePath
- )
-/*++
-
-Routine Description:
+/**
This function returns the directory path which contains the particular path.
Some examples:
"a/b/c" -> "a/b"
@@ -40,15 +34,15 @@ Routine Description:
The caller must free the string returned.
-Arguments:
-
- FilePath Path name of file to get the parent directory for.
-
-Returns:
+ @param FilePath Path name of file to get the parent directory for.
- NULL if error
+ @return NULL if error
+**/
+CHAR8*
+OsPathDirName (
+ IN CHAR8 *FilePath
+ )
---*/
{
CHAR8 *Return;
CHAR8 *Pos;
@@ -97,14 +91,8 @@ Returns:
//
// BUGBUG: Not fully implemented yet.
//
-VOID
-OsPathNormPathInPlace (
- IN CHAR8 *Path
- )
-/*++
-
-Routine Description:
+/**
This function returns the directory path which contains the particular path.
Some examples:
"a/b/../c" -> "a/c"
@@ -113,15 +101,14 @@ Routine Description:
This function does not check for the existence of the file.
-Arguments:
-
- Path Path name of file to normalize
+ @param Path Path name of file to normalize
-Returns:
-
- The string is altered in place.
-
---*/
+ @return The string is altered in place.
+**/
+VOID
+OsPathNormPathInPlace (
+ IN CHAR8 *Path
+ )
{
CHAR8 *Pos;
INTN Offset;
@@ -200,16 +187,7 @@ Returns:
}
#endif
-
-CHAR8*
-OsPathPeerFilePath (
- IN CHAR8 *OldPath,
- IN CHAR8 *Peer
- )
-/*++
-
-Routine Description:
-
+/**
This function replaces the final portion of a path with an alternative
'peer' filename. For example:
"a/b/../c", "peer" -> "a/b/../peer"
@@ -219,16 +197,16 @@ Routine Description:
This function does not check for the existence of the file.
-Arguments:
-
- OldPath Path name of replace the final segment
- Peer The new path name to concatenate to become the peer path
+ @param OldPath Path name of replace the final segment
+ @param Peer The new path name to concatenate to become the peer path
-Returns:
-
- A CHAR8* string, which must be freed by the caller
-
---*/
+ @return A CHAR8* string, which must be freed by the caller
+**/
+CHAR8*
+OsPathPeerFilePath (
+ IN CHAR8 *OldPath,
+ IN CHAR8 *Peer
+ )
{
CHAR8 *Result;
INTN Offset;
@@ -259,27 +237,18 @@ Returns:
return Result;
}
+/**
+ Checks if a file exists
+
+ @param InputFileName The name of the file to check for existence
+ @retval TRUE The file exists
+ @retval FALSE The file does not exist
+**/
BOOLEAN
OsPathExists (
IN CHAR8 *InputFileName
)
-/*++
-
-Routine Description:
-
- Checks if a file exists
-
-Arguments:
-
- InputFileName The name of the file to check for existence
-
-Returns:
-
- TRUE The file exists
- FALSE The file does not exist
-
---*/
{
FILE *InputFile;
InputFile = fopen (LongFilePath (InputFileName), "rb");