TianoCore EDK2 master
Loading...
Searching...
No Matches
Ansi.c
Go to the documentation of this file.
1
9#include "Terminal.h"
10
18VOID
20 IN TERMINAL_DEV *TerminalDevice
21 )
22{
23 UINT8 RawData;
24
25 //
26 // pop the raw data out from the raw fifo,
27 // and translate it into unicode, then push
28 // the unicode into unicode fifo, until the raw fifo is empty.
29 //
30 while (!IsRawFiFoEmpty (TerminalDevice) && !IsUnicodeFiFoFull (TerminalDevice)) {
31 RawFiFoRemoveOneKey (TerminalDevice, &RawData);
32
33 UnicodeFiFoInsertOneKey (TerminalDevice, (UINT16)RawData);
34 }
35}
36
50 IN TERMINAL_DEV *TerminalDevice,
51 IN CHAR16 *WString
52 )
53{
54 CHAR8 GraphicChar;
55
56 //
57 // support three kind of character:
58 // valid ascii, valid efi control char, valid text graphics.
59 //
60 for ( ; *WString != CHAR_NULL; WString++) {
61 if ( !(TerminalIsValidAscii (*WString) ||
62 TerminalIsValidEfiCntlChar (*WString) ||
63 TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL)))
64 {
65 return EFI_UNSUPPORTED;
66 }
67 }
68
69 return EFI_SUCCESS;
70}
EFI_STATUS AnsiTestString(IN TERMINAL_DEV *TerminalDevice, IN CHAR16 *WString)
Definition: Ansi.c:49
VOID AnsiRawDataToUnicode(IN TERMINAL_DEV *TerminalDevice)
Definition: Ansi.c:19
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
BOOLEAN TerminalIsValidAscii(IN CHAR16 Ascii)
BOOLEAN TerminalIsValidEfiCntlChar(IN CHAR16 CharC)
BOOLEAN RawFiFoRemoveOneKey(TERMINAL_DEV *TerminalDevice, UINT8 *Output)
BOOLEAN IsUnicodeFiFoFull(TERMINAL_DEV *TerminalDevice)
BOOLEAN UnicodeFiFoInsertOneKey(TERMINAL_DEV *TerminalDevice, UINT16 Input)
BOOLEAN IsRawFiFoEmpty(TERMINAL_DEV *TerminalDevice)
BOOLEAN TerminalIsValidTextGraphics(IN CHAR16 Graphic, OUT CHAR8 *PcAnsi OPTIONAL, OUT CHAR8 *Ascii OPTIONAL)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112