You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
03b466e8db
This patch added command line history upport in SBL Shell. It makes it easy to run a previous command using Up/Down arrow key. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
65 lines
1.1 KiB
C
65 lines
1.1 KiB
C
/** @file
|
|
|
|
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#ifndef _HISTORY_H_
|
|
#define _HISTORY_H_
|
|
|
|
#include <PiPei.h>
|
|
#include <Library/BaseMemoryLib.h>
|
|
#include <Library/DebugLib.h>
|
|
#include <Library/MemoryAllocationLib.h>
|
|
#include <Library/ShellLib.h>
|
|
|
|
#define MAX_HISTORY_REC 32
|
|
|
|
/**
|
|
Initialize command line history buffer and index.
|
|
|
|
@param[in] IsInit Indicate initialization or de-initialization
|
|
|
|
**/
|
|
VOID
|
|
HistoryInit (
|
|
IN BOOLEAN IsInit
|
|
);
|
|
|
|
/**
|
|
Fill command buffer with next command line history.
|
|
|
|
@param[in] Line command line buffer to fill
|
|
|
|
@retval Length of the command line returned
|
|
**/
|
|
UINTN
|
|
HistoryDown (
|
|
IN OUT CHAR16 *Line
|
|
);
|
|
|
|
/**
|
|
Fill command buffer with previous command line history.
|
|
|
|
@param[in] Line Command line buffer to fill
|
|
|
|
@retval Length of the command line returned
|
|
**/
|
|
UINTN
|
|
HistoryUp (
|
|
IN OUT CHAR16 *Line
|
|
);
|
|
|
|
/**
|
|
Append a command lihe into command line history buffer.
|
|
|
|
@param[in] Line Command line buffer to append
|
|
|
|
**/
|
|
VOID
|
|
HistoryAdd (
|
|
IN OUT CHAR16 *Line
|
|
);
|
|
|
|
#endif |