]>
Commit | Line | Data |
---|---|---|
95276127 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | ansi.c\r | |
15 | \r | |
16 | Abstract: \r | |
17 | \r | |
18 | \r | |
19 | Revision History\r | |
20 | --*/\r | |
21 | \r | |
22 | \r | |
95276127 | 23 | #include "Terminal.h"\r |
24 | \r | |
25 | VOID\r | |
26 | AnsiRawDataToUnicode (\r | |
27 | IN TERMINAL_DEV *TerminalDevice\r | |
28 | )\r | |
29 | {\r | |
30 | UINT8 RawData;\r | |
31 | \r | |
32 | //\r | |
33 | // pop the raw data out from the raw fifo,\r | |
34 | // and translate it into unicode, then push\r | |
35 | // the unicode into unicode fifo, until the raw fifo is empty.\r | |
36 | //\r | |
37 | while (!IsRawFiFoEmpty (TerminalDevice)) {\r | |
38 | \r | |
39 | RawFiFoRemoveOneKey (TerminalDevice, &RawData);\r | |
40 | \r | |
41 | UnicodeFiFoInsertOneKey (TerminalDevice, (UINT16) RawData);\r | |
42 | }\r | |
43 | }\r | |
44 | \r | |
45 | EFI_STATUS\r | |
46 | AnsiTestString (\r | |
47 | IN TERMINAL_DEV *TerminalDevice,\r | |
48 | IN CHAR16 *WString\r | |
49 | )\r | |
50 | {\r | |
51 | CHAR8 GraphicChar;\r | |
52 | \r | |
53 | //\r | |
54 | // support three kind of character:\r | |
55 | // valid ascii, valid efi control char, valid text graphics.\r | |
56 | //\r | |
57 | for (; *WString != CHAR_NULL; WString++) {\r | |
58 | \r | |
59 | if ( !(TerminalIsValidAscii (*WString) || \r | |
60 | TerminalIsValidEfiCntlChar (*WString) ||\r | |
61 | TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL) )) {\r | |
62 | \r | |
63 | return EFI_UNSUPPORTED;\r | |
64 | }\r | |
65 | }\r | |
66 | \r | |
67 | return EFI_SUCCESS;\r | |
68 | }\r |