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

Go to the source code of this file.

Functions

EFI_STATUS PrintSfoVolumeInfoTableEntry (IN CONST EFI_SHELL_FILE_INFO *TheList)
 
VOID PrintFileInformation (IN CONST BOOLEAN Sfo, IN CONST EFI_SHELL_FILE_INFO *TheNode, IN UINT64 *Files, IN UINT64 *Size, IN UINT64 *Dirs)
 
VOID PrintNonSfoHeader (IN CONST CHAR16 *Path)
 
VOID PrintNonSfoFooter (IN UINT64 Files, IN UINT64 Size, IN UINT64 Dirs)
 
VOID FileTimeToLocalTime (IN EFI_TIME *Time, IN INT16 LocalTimeZone)
 
SHELL_STATUS PrintLsOutput (IN CONST BOOLEAN Rec, IN CONST UINT64 Attribs, IN CONST BOOLEAN Sfo, IN CONST CHAR16 *RootPath, IN CONST CHAR16 *SearchString, IN BOOLEAN *Found, IN CONST UINTN Count, IN CONST INT16 TimeZone, IN CONST BOOLEAN ListUnfiltered)
 
SHELL_STATUS EFIAPI ShellCommandRunLs (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

UINTN mDayOfMonth [] = { 31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 }
 
STATIC CONST SHELL_PARAM_ITEM LsParamList []
 

Detailed Description

Main file for ls shell level 2 function.

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

Definition in file Ls.c.

Function Documentation

◆ FileTimeToLocalTime()

VOID FileTimeToLocalTime ( IN EFI_TIME Time,
IN INT16  LocalTimeZone 
)

Change the file time to local time based on the timezone.

Parameters
[in]TimeThe file time.
[in]LocalTimeZoneLocal time zone.

Definition at line 339 of file Ls.c.

◆ PrintFileInformation()

VOID PrintFileInformation ( IN CONST BOOLEAN  Sfo,
IN CONST EFI_SHELL_FILE_INFO TheNode,
IN UINT64 *  Files,
IN UINT64 *  Size,
IN UINT64 *  Dirs 
)

print out the info on a single file.

Parameters
[in]SfoTRUE if in SFO, false otherwise.
[in]TheNodethe EFI_SHELL_FILE_INFO node to print out information on.
[in]Filesincremented if a file is printed.
[in]Sizeincremented by file size.
[in]Dirsincremented if a directory is printed.

Definition at line 164 of file Ls.c.

◆ PrintLsOutput()

SHELL_STATUS PrintLsOutput ( IN CONST BOOLEAN  Rec,
IN CONST UINT64  Attribs,
IN CONST BOOLEAN  Sfo,
IN CONST CHAR16 *  RootPath,
IN CONST CHAR16 *  SearchString,
IN BOOLEAN *  Found,
IN CONST UINTN  Count,
IN CONST INT16  TimeZone,
IN CONST BOOLEAN  ListUnfiltered 
)

print out the list of files and directories from the LS command

Parameters
[in]RecTRUE to automatically recurse into each found directory FALSE to only list the specified directory.
[in]AttribsList of required Attribute for display. If 0 then all non-system and non-hidden files will be printed.
[in]SfoTRUE to use Standard Format Output, FALSE otherwise
[in]RootPathString with starting path to search in.
[in]SearchStringString with search string.
[in]FoundSet to TRUE, if anyone were found.
[in]CountThe count of bits enabled in Attribs.
[in]TimeZoneThe current time zone offset.
[in]ListUnfilteredTRUE to request listing the directory contents unfiltered.
Return values
SHELL_SUCCESSthe printing was successful.

Definition at line 445 of file Ls.c.

◆ PrintNonSfoFooter()

VOID PrintNonSfoFooter ( IN UINT64  Files,
IN UINT64  Size,
IN UINT64  Dirs 
)

print out the footer when not using standard format output.

Parameters
[in]FilesThe number of files.
[in]SizeThe size of files in bytes.
[in]DirsThe number of directories.

Definition at line 311 of file Ls.c.

◆ PrintNonSfoHeader()

VOID PrintNonSfoHeader ( IN CONST CHAR16 *  Path)

print out the header when not using standard format output.

Parameters
[in]PathString with starting path.

Definition at line 275 of file Ls.c.

◆ PrintSfoVolumeInfoTableEntry()

EFI_STATUS PrintSfoVolumeInfoTableEntry ( IN CONST EFI_SHELL_FILE_INFO TheList)

print out the standard format output volume entry.

Parameters
[in]TheLista list of files from the volume.

Definition at line 21 of file Ls.c.

◆ ShellCommandRunLs()

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

Function for 'ls' command.

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

Definition at line 722 of file Ls.c.

Variable Documentation

◆ LsParamList

STATIC CONST SHELL_PARAM_ITEM LsParamList[]
Initial value:
= {
{ L"-r", TypeFlag },
{ L"-a", TypeStart },
{ L"-sfo", TypeFlag },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeStart
A flag that has variable value appended to the end (IE "-ad", "-afd", "-adf", etc....
Definition: ShellLib.h:702
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 707 of file Ls.c.

◆ mDayOfMonth

UINTN mDayOfMonth[] = { 31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 }

Definition at line 13 of file Ls.c.