]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /** @file\r |
2 | Miscelaneous Functions for <wchar.h>.\r | |
3 | \r | |
4 | Unless explicitly stated otherwise, if the execution of a function declared\r | |
5 | in this file causes copying to take place between objects that overlap, the\r | |
6 | behavior is undefined.\r | |
7 | \r | |
8 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
9 | This program and the accompanying materials are licensed and made available under\r | |
10 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
11 | The full text of the license may be found at\r | |
12 | http://opensource.org/licenses/bsd-license.php.\r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
16 | **/\r | |
17 | #include <Uefi.h>\r | |
18 | #include <Library/BaseLib.h>\r | |
19 | #include <Library/BaseMemoryLib.h>\r | |
20 | \r | |
21 | #include <LibConfig.h>\r | |
22 | \r | |
23 | #include <wchar.h>\r | |
24 | \r | |
25 | /** The wcslen function computes the length of the wide string pointed to by s.\r | |
26 | \r | |
27 | @return The wcslen function returns the number of wide characters that\r | |
28 | precede the terminating null wide character.\r | |
29 | **/\r | |
30 | size_t wcslen(const wchar_t *s)\r | |
31 | {\r | |
32 | return (size_t)StrLen( (CONST CHAR16 *)s);\r | |
33 | }\r | |
34 | \r | |
35 | /** The wmemset function copies the value of c into each of the first n wide\r | |
36 | characters of the object pointed to by s.\r | |
37 | \r | |
38 | @return The wmemset function returns the value of s.\r | |
39 | **/\r | |
40 | wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n)\r | |
41 | {\r | |
42 | return (wchar_t *)SetMem16( s, (UINTN)(n * sizeof(wchar_t)), (UINT16)c);\r | |
43 | }\r |