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