TianoCore EDK2 master
Loading...
Searching...
No Matches
Cd.c File Reference

Go to the source code of this file.

Functions

EFI_STATUS ReplaceDriveWithCwd (IN OUT CHAR16 **FullPath, IN CONST CHAR16 *Cwd)
 
BOOLEAN IsCurrentFileSystem (IN CONST CHAR16 *FullPath, IN CONST CHAR16 *Cwd)
 
EFI_STATUS ExtractDriveAndPath (IN CONST CHAR16 *FullPath, OUT CHAR16 **Drive, OUT CHAR16 **Path)
 
SHELL_STATUS EFIAPI ShellCommandRunCd (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Detailed Description

Main file for attrib shell level 2 function.

(C) Copyright 2016 Hewlett Packard Enterprise Development LP
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2018, Dell Technologies. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Cd.c.

Function Documentation

◆ ExtractDriveAndPath()

EFI_STATUS ExtractDriveAndPath ( IN CONST CHAR16 *  FullPath,
OUT CHAR16 **  Drive,
OUT CHAR16 **  Path 
)

Extract drive string and path string from FullPath.

The caller must be free Drive and Path.

Parameters
[in]FullPathA path to be extracted.
[out]DriveBuffer to save drive identifier.
[out]PathBuffer to save path.
Return values
EFI_SUCCESSSuccess.
EFI_OUT_OF_RESOUCESA memory allocation failed.

Definition at line 121 of file Cd.c.

◆ IsCurrentFileSystem()

BOOLEAN IsCurrentFileSystem ( IN CONST CHAR16 *  FullPath,
IN CONST CHAR16 *  Cwd 
)

function to determine if FullPath is under current filesystem.

Parameters
[in]FullPathThe target location to determine.
[in]CwdCurrent directory.
Return values
TRUEThe FullPath is in the current filesystem.
FALSEThe FullPaht isn't in the current filesystem.

Definition at line 77 of file Cd.c.

◆ ReplaceDriveWithCwd()

EFI_STATUS ReplaceDriveWithCwd ( IN OUT CHAR16 **  FullPath,
IN CONST CHAR16 *  Cwd 
)

Function will replace drive identifier with CWD.

If FullPath beginning with ':' is invalid path, then ASSERT. If FullPath not include drive identifier , then do nothing. If FullPath likes "fs0:\xx" or "fs0:/xx" , then do nothing. If FullPath likes "fs0:xxx" or "fs0:", the drive replaced by CWD.

Parameters
[in,out]FullPathThe pointer to the string containing the path.
[in]CwdCurrent directory.
Return values
EFI_SUCCESSSuccess.
EFI_OUT_OF_SOURCESA memory allocation failed.

Definition at line 29 of file Cd.c.

◆ ShellCommandRunCd()

SHELL_STATUS EFIAPI ShellCommandRunCd ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'cd' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 173 of file Cd.c.