summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/Common/OsPath.c
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@bsdio.com>2023-02-19 23:21:43 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-03-24 14:52:14 +0000
commitb4e2cf092a2179ff693e24b12281ee99d230e031 (patch)
tree5d1f9f07c1b3996ee4012c0f7572bb2a6c8362d9 /BaseTools/Source/C/Common/OsPath.c
parentcf6a0a52b07195ba278e48b89cfb7ddbad332ab1 (diff)
downloadedk2-b4e2cf092a2179ff693e24b12281ee99d230e031.zip
edk2-b4e2cf092a2179ff693e24b12281ee99d230e031.tar.gz
edk2-b4e2cf092a2179ff693e24b12281ee99d230e031.tar.bz2
BaseTools: Source/C/Common: Fix doc block locations and convert to Doxygen
Move the documentation blocks from between the parameter list and function body to above the function. Convert all the documentation blocks to Doxygen format. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
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");