]>
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 FIFO into unicode, and insert
20 them into Unicode FIFO.
22 @param TerminalDevice The terminal device.
26 AnsiRawDataToUnicode (
27 IN TERMINAL_DEV
*TerminalDevice
33 // pop the raw data out from the raw fifo,
34 // and translate it into unicode, then push
35 // the unicode into unicode fifo, until the raw fifo is empty.
37 while (!IsRawFiFoEmpty (TerminalDevice
)) {
39 RawFiFoRemoveOneKey (TerminalDevice
, &RawData
);
41 UnicodeFiFoInsertOneKey (TerminalDevice
, (UINT16
) RawData
);
46 Check if input string is valid Ascii string, valid EFI control characters
47 or valid text graphics.
49 @param TerminalDevice The terminal device.
50 @param WString The input string.
52 @retval EFI_UNSUPPORTED If not all input characters are valid.
53 @retval EFI_SUCCESS If all input characters are valid.
58 IN TERMINAL_DEV
*TerminalDevice
,
65 // support three kind of character:
66 // valid ascii, valid efi control char, valid text graphics.
68 for (; *WString
!= CHAR_NULL
; WString
++) {
70 if ( !(TerminalIsValidAscii (*WString
) ||
71 TerminalIsValidEfiCntlChar (*WString
) ||
72 TerminalIsValidTextGraphics (*WString
, &GraphicChar
, NULL
) )) {
74 return EFI_UNSUPPORTED
;