diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-05 20:55:45 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-05 20:55:45 +0000 |
commit | a1d4bfcc3f58a9ed0ce6118556016c7c058d01b1 (patch) | |
tree | a27ce55f0ba51146714246b53849e4c9c7fe0d2d /ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c | |
parent | c5981e3c3d9afbd6183704937e8c93f6306fc8ca (diff) | |
download | edk2-platforms-a1d4bfcc3f58a9ed0ce6118556016c7c058d01b1.tar.xz |
add comments to function declarations and definitions and updated to match coding style document.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11505 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c')
-rw-r--r-- | ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c | 191 |
1 files changed, 42 insertions, 149 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c index 5397071b3b..8562662638 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c @@ -35,26 +35,15 @@ HEFI_EDITOR_BUFFER_IMAGE HFileImageConst = { FALSE
};
+/**
+ Initialization function for HFileImage
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HFileImageInit (
VOID
)
-/*++
-
-Routine Description:
-
- Initialization function for HFileImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
//
// basically initialize the HFileImage
@@ -70,29 +59,17 @@ Returns: return EFI_SUCCESS;
}
+/**
+ Backup function for HFileImage. Only a few fields need to be backup.
+ This is for making the file buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HFileImageBackup (
VOID
)
-/*++
-
-Routine Description:
-
- Backup function for HFileImage
- Only a few fields need to be backup.
- This is for making the file buffer refresh
- as few as possible.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
-
---*/
{
SHELL_FREE_NON_NULL (HFileImageBackupVar.FileName);
HFileImageBackupVar.FileName = CatSPrint(NULL, L"%s", HFileImage.FileName);
@@ -103,25 +80,15 @@ Returns: return EFI_SUCCESS;
}
+/**
+ Cleanup function for HFileImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HFileImageCleanup (
VOID
)
-/*++
-
-Routine Description:
-
- Cleanup function for HFileImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
-
---*/
{
SHELL_FREE_NON_NULL (HFileImage.FileName);
@@ -130,26 +97,18 @@ Returns: return EFI_SUCCESS;
}
+/**
+ Set FileName field in HFileImage
+
+ @param[in] Str File name to set.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HFileImageSetFileName (
IN CONST CHAR16 *Str
)
-/*++
-
-Routine Description:
-
- Set FileName field in HFileImage
-
-Arguments:
-
- Str -- File name to set
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
-
---*/
{
UINTN Size;
UINTN Index;
@@ -175,79 +134,21 @@ Returns: return EFI_SUCCESS;
}
-EFI_STATUS
-HFileImageGetFileInfo (
- IN EFI_FILE_HANDLE Handle,
- IN CHAR16 *FileName,
- OUT EFI_FILE_INFO **InfoOut
- )
-/*++
-
-Routine Description:
-
- Get this file's information
-
-Arguments:
-
- Handle - in NT32 mode Directory handle, in other mode File Handle
- FileName - The file name
- InfoOut - parameter to pass file information out
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
- EFI_LOAD_ERROR
-
---*/
-{
-
- VOID *Info;
- UINTN Size;
- EFI_STATUS Status;
-
- Size = SIZE_OF_EFI_FILE_INFO + 1024;
- Info = AllocateZeroPool (Size);
- if (!Info) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // get file information
- //
- Status = Handle->GetInfo (Handle, &gEfiFileInfoGuid, &Size, Info);
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
-
- *InfoOut = (EFI_FILE_INFO *) Info;
+/**
+ Read a file from disk into HBufferImage.
- return EFI_SUCCESS;
-
-}
+ @param[in] FileName filename to read.
+ @param[in] Recover if is for recover, no information print.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HFileImageRead (
IN CONST CHAR16 *FileName,
IN BOOLEAN Recover
)
-/*++
-
-Routine Description:
-
- Read a file from disk into HBufferImage
-
-Arguments:
-
- FileName -- filename to read
- Recover -- if is for recover, no information print
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
HEFI_EDITOR_LINE *Line;
UINT8 *Buffer;
@@ -343,27 +244,19 @@ Returns: return EFI_SUCCESS;
}
+/**
+ Save lines in HBufferImage to disk.
+
+ @param[in] FileName The file name.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HFileImageSave (
IN CHAR16 *FileName
)
-/*++
-
-Routine Description:
-
- Save lines in HBufferImage to disk
-
-Arguments:
-
- FileName - The file name
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
LIST_ENTRY *Link;
|