]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/TerminalDxe/ansi.c
apply for doxgen format.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / TerminalDxe / ansi.c
1 /** @file
2 Provides misc functions upon ansi.
3
4 Copyright (c) 2006, 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
9
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.
12
13 **/
14
15
16 #include "Terminal.h"
17
18 VOID
19 AnsiRawDataToUnicode (
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)) {
31
32 RawFiFoRemoveOneKey (TerminalDevice, &RawData);
33
34 UnicodeFiFoInsertOneKey (TerminalDevice, (UINT16) RawData);
35 }
36 }
37
38 EFI_STATUS
39 AnsiTestString (
40 IN TERMINAL_DEV *TerminalDevice,
41 IN CHAR16 *WString
42 )
43 {
44 CHAR8 GraphicChar;
45
46 //
47 // support three kind of character:
48 // valid ascii, valid efi control char, valid text graphics.
49 //
50 for (; *WString != CHAR_NULL; WString++) {
51
52 if ( !(TerminalIsValidAscii (*WString) ||
53 TerminalIsValidEfiCntlChar (*WString) ||
54 TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL) )) {
55
56 return EFI_UNSUPPORTED;
57 }
58 }
59
60 return EFI_SUCCESS;
61 }