]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/EnhancedFatDxe/FileName.c
FatPkg/EnhancedFatDxe: Make the comments align with EDKIIcoding style
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / FileName.c
index f393aa6357b396c59c1889fccb4de7c9f1607049..8aa37456ab1c1509e6d858244af5793c54cd4f83 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Functions for manipulating file names.\r
 \r
 Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available\r
@@ -9,45 +10,28 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
+**/\r
 \r
-Module Name:\r
-\r
-  FileName.c\r
-\r
-Abstract:\r
+#include "Fat.h"\r
 \r
-  Functions for manipulating file names\r
+/**\r
 \r
-Revision History\r
+  This function checks whether the input FileName is a valid 8.3 short name.\r
+  If the input FileName is a valid 8.3, the output is the 8.3 short name;\r
+  otherwise, the output is the base tag of 8.3 short name.\r
 \r
---*/\r
+  @param  FileName              - The input unicode filename.\r
+  @param  File8Dot3Name         - The output ascii 8.3 short name or base tag of 8.3 short name.\r
 \r
-#include "Fat.h"\r
+  @retval TRUE                  - The input unicode filename is a valid 8.3 short name.\r
+  @retval FALSE                 - The input unicode filename is not a valid 8.3 short name.\r
 \r
+**/\r
 BOOLEAN\r
 FatCheckIs8Dot3Name (\r
   IN  CHAR16    *FileName,\r
   OUT CHAR8     *File8Dot3Name\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function checks whether the input FileName is a valid 8.3 short name.\r
-  If the input FileName is a valid 8.3, the output is the 8.3 short name;\r
-  otherwise, the output is the base tag of 8.3 short name.\r
-\r
-Arguments:\r
-\r
-  FileName              - The input unicode filename.\r
-  File8Dot3Name         - The output ascii 8.3 short name or base tag of 8.3 short name.\r
-\r
-Returns:\r
-\r
-  TRUE                  - The input unicode filename is a valid 8.3 short name.\r
-  FALSE                 - The input unicode filename is not a valid 8.3 short name.\r
-\r
---*/\r
 {\r
   BOOLEAN PossibleShortName;\r
   CHAR16  *TempName;\r
@@ -118,28 +102,22 @@ Returns:
   return PossibleShortName;\r
 }\r
 \r
-STATIC\r
-UINTN\r
-FatTrimAsciiTrailingBlanks (\r
-  IN CHAR8        *Name,\r
-  IN UINTN        Len\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Trim the trailing blanks of fat name.\r
 \r
-Arguments:\r
-\r
-  Name                  - The Char8 string needs to be trimed.\r
-  Len                   - The length of the fat name.\r
-\r
-Returns:\r
+  @param  Name                  - The Char8 string needs to be trimed.\r
+  @param  Len                   - The length of the fat name.\r
 \r
   The real length of the fat name after the trailing blanks are trimmed.\r
 \r
---*/\r
+**/\r
+STATIC\r
+UINTN\r
+FatTrimAsciiTrailingBlanks (\r
+  IN CHAR8        *Name,\r
+  IN UINTN        Len\r
+  )\r
 {\r
   while (Len > 0 && Name[Len - 1] == ' ') {\r
     Len--;\r
@@ -148,6 +126,17 @@ Returns:
   return Len;\r
 }\r
 \r
+/**\r
+\r
+  Convert the ascii fat name to the unicode string and strip trailing spaces,\r
+  and if necessary, convert the unicode string to lower case.\r
+\r
+  @param  FatName               - The Char8 string needs to be converted.\r
+  @param  Len                   - The length of the fat name.\r
+  @param  LowerCase             - Indicate whether to convert the string to lower case.\r
+  @param  Str                   - The result of the convertion.\r
+\r
+**/\r
 VOID\r
 FatNameToStr (\r
   IN  CHAR8            *FatName,\r
@@ -155,25 +144,6 @@ FatNameToStr (
   IN  UINTN            LowerCase,\r
   OUT CHAR16           *Str\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Convert the ascii fat name to the unicode string and strip trailing spaces,\r
-  and if necessary, convert the unicode string to lower case.\r
-\r
-Arguments:\r
-\r
-  FatName               - The Char8 string needs to be converted.\r
-  Len                   - The length of the fat name.\r
-  LowerCase             - Indicate whether to convert the string to lower case.\r
-  Str                   - The result of the convertion.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   //\r
   // First, trim the trailing blanks\r
@@ -192,27 +162,19 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+\r
+  This function generates 8Dot3 name from user specified name for a newly created file.\r
+\r
+  @param  Parent                - The parent directory.\r
+  @param  DirEnt                - The directory entry whose 8Dot3Name needs to be generated.\r
+\r
+**/\r
 VOID\r
 FatCreate8Dot3Name (\r
   IN FAT_OFILE    *Parent,\r
   IN FAT_DIRENT   *DirEnt\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function generates 8Dot3 name from user specified name for a newly created file.\r
-\r
-Arguments:\r
-\r
-  Parent                - The parent directory.\r
-  DirEnt                - The directory entry whose 8Dot3Name needs to be generated.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   CHAR8 *ShortName;\r
   CHAR8 *ShortNameChar;\r
@@ -275,29 +237,23 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
-UINT8\r
-FatCheckNameCase (\r
-  IN CHAR16           *Str,\r
-  IN UINT8            InCaseFlag\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Check the string is lower case or upper case\r
   and it is used by fatname to dir entry count\r
 \r
-Arguments:\r
-\r
-  Str                   - The string which needs to be checked.\r
-  InCaseFlag            - The input case flag which is returned when the string is lower case.\r
+  @param Str                   - The string which needs to be checked.\r
+  @param InCaseFlag            - The input case flag which is returned when the string is lower case.\r
 \r
-Returns:\r
+  @retval OutCaseFlag           - The output case flag.\r
 \r
-  OutCaseFlag           - The output case flag.\r
-\r
---*/\r
+**/\r
+STATIC\r
+UINT8\r
+FatCheckNameCase (\r
+  IN CHAR16           *Str,\r
+  IN UINT8            InCaseFlag\r
+  )\r
 {\r
   CHAR16  Buffer[FAT_MAIN_NAME_LEN + 1 + FAT_EXTEND_NAME_LEN + 1];\r
   UINT8   OutCaseFlag;\r
@@ -328,25 +284,17 @@ Returns:
   return OutCaseFlag;\r
 }\r
 \r
-VOID\r
-FatSetCaseFlag (\r
-  IN FAT_DIRENT   *DirEnt\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Set the caseflag value for the directory entry.\r
 \r
-Arguments:\r
-\r
-  DirEnt                - The logical directory entry whose caseflag value is to be set.\r
-\r
-Returns:\r
-\r
-  None.\r
+  @param DirEnt                - The logical directory entry whose caseflag value is to be set.\r
 \r
---*/\r
+**/\r
+VOID\r
+FatSetCaseFlag (\r
+  IN FAT_DIRENT   *DirEnt\r
+  )\r
 {\r
   CHAR16  LfnBuffer[FAT_MAIN_NAME_LEN + 1 + FAT_EXTEND_NAME_LEN + 1];\r
   CHAR16  *TempCharPtr;\r
@@ -389,28 +337,21 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+\r
+  Convert the 8.3 ASCII fat name to cased Unicode string according to case flag.\r
+\r
+  @param  DirEnt                - The corresponding directory entry.\r
+  @param  FileString            - The output Unicode file name.\r
+  @param  FileStringMax           The max length of FileString.\r
+\r
+**/\r
 VOID\r
 FatGetFileNameViaCaseFlag (\r
   IN     FAT_DIRENT   *DirEnt,\r
   IN OUT CHAR16       *FileString,\r
   IN     UINTN        FileStringMax\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Convert the 8.3 ASCII fat name to cased Unicode string according to case flag.\r
-\r
-Arguments:\r
-\r
-  DirEnt                - The corresponding directory entry.\r
-  FileString            - The output Unicode file name.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   UINT8   CaseFlag;\r
   CHAR8   *File8Dot3Name;\r
@@ -429,25 +370,19 @@ Returns:
   }\r
 }\r
 \r
-UINT8\r
-FatCheckSum (\r
-  IN CHAR8  *ShortNameString\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Get the Check sum for a short name.\r
 \r
-Arguments:\r
+  @param  ShortNameString       - The short name for a file.\r
 \r
-  ShortNameString       - The short name for a file.\r
+  @retval Sum                   - UINT8 checksum.\r
 \r
-Returns:\r
-\r
-  Sum                   - UINT8 checksum.\r
-\r
---*/\r
+**/\r
+UINT8\r
+FatCheckSum (\r
+  IN CHAR8  *ShortNameString\r
+  )\r
 {\r
   UINTN ShortNameLen;\r
   UINT8 Sum;\r
@@ -459,29 +394,23 @@ Returns:
   return Sum;\r
 }\r
 \r
-CHAR16 *\r
-FatGetNextNameComponent (\r
-  IN  CHAR16      *Path,\r
-  OUT CHAR16      *Name\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Takes Path as input, returns the next name component\r
   in Name, and returns the position after Name (e.g., the\r
   start of the next name component)\r
 \r
-Arguments:\r
-\r
-  Path                  - The path of one file.\r
-  Name                  - The next name component in Path.\r
-\r
-Returns:\r
+  @param  Path                  - The path of one file.\r
+  @param  Name                  - The next name component in Path.\r
 \r
   The position after Name in the Path\r
 \r
---*/\r
+**/\r
+CHAR16 *\r
+FatGetNextNameComponent (\r
+  IN  CHAR16      *Path,\r
+  OUT CHAR16      *Name\r
+  )\r
 {\r
   while (*Path != 0 && *Path != PATH_NAME_SEPARATOR) {\r
     *Name++ = *Path++;\r
@@ -497,31 +426,24 @@ Returns:
   return Path;\r
 }\r
 \r
-BOOLEAN\r
-FatFileNameIsValid (\r
-  IN  CHAR16  *InputFileName,\r
-  OUT CHAR16  *OutputFileName\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Check whether the IFileName is valid long file name. If the IFileName is a valid\r
   long file name, then we trim the possible leading blanks and leading/trailing dots.\r
   the trimmed filename is stored in OutputFileName\r
 \r
-Arguments:\r
+  @param  InputFileName         - The input file name.\r
+  @param  OutputFileName        - The output file name.\r
 \r
-  InputFileName         - The input file name.\r
-  OutputFileName        - The output file name.\r
+  @retval TRUE                  - The InputFileName is a valid long file name.\r
+  @retval FALSE                 - The InputFileName is not a valid long file name.\r
 \r
-\r
-Returns:\r
-\r
-  TRUE                  - The InputFileName is a valid long file name.\r
-  FALSE                 - The InputFileName is not a valid long file name.\r
-\r
---*/\r
+**/\r
+BOOLEAN\r
+FatFileNameIsValid (\r
+  IN  CHAR16  *InputFileName,\r
+  OUT CHAR16  *OutputFileName\r
+  )\r
 {\r
   CHAR16  *TempNamePointer;\r
   CHAR16  TempChar;\r