]>
git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c
2 Implementation of translation upon PC ANSI.
4 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Translate all raw data in the Raw FIFI into unicode, and insert
20 them into Unicode FIFO.
22 @param TerminalDevice The terminal device.
28 AnsiRawDataToUnicode (
29 IN TERMINAL_DEV
*TerminalDevice
35 // pop the raw data out from the raw fifo,
36 // and translate it into unicode, then push
37 // the unicode into unicode fifo, until the raw fifo is empty.
39 while (!IsRawFiFoEmpty (TerminalDevice
)) {
41 RawFiFoRemoveOneKey (TerminalDevice
, &RawData
);
43 UnicodeFiFoInsertOneKey (TerminalDevice
, (UINT16
) RawData
);
48 Check if input string is valid Ascii string, valid EFI control characters
49 or valid text graphics.
51 @param TerminalDevice The terminal device.
52 @param WString The input string.
54 @retval EFI_UNSUPPORTED If not all input characters are valid.
55 @retval EFI_SUCCESS If all input characters are valid.
60 IN TERMINAL_DEV
*TerminalDevice
,
67 // support three kind of character:
68 // valid ascii, valid efi control char, valid text graphics.
70 for (; *WString
!= CHAR_NULL
; WString
++) {
72 if ( !(TerminalIsValidAscii (*WString
) ||
73 TerminalIsValidEfiCntlChar (*WString
) ||
74 TerminalIsValidTextGraphics (*WString
, &GraphicChar
, NULL
) )) {
76 return EFI_UNSUPPORTED
;