]>
git.proxmox.com Git - efi-boot-shim.git/blob - ucs2.h
2 * shim - trivial UEFI first-stage bootloader
4 * Copyright 2013 Red Hat, Inc <pjones@redhat.com>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 * OF THE POSSIBILITY OF SUCH DAMAGE.
31 * Significant portions of this code are derived from Tianocore
32 * (http://tianocore.sf.net) and are Copyright 2009-2012 Intel
40 __attribute__((unused
))
41 StrCaseCmp(CHAR16
*s0
, CHAR16
*s1
)
45 if (*s0
== L
'\0' || *s1
== L
'\0')
47 c0
= (*s0
>= L
'a' && *s0
<= L
'z') ? *s0
- 32 : *s0
;
48 c1
= (*s1
>= L
'a' && *s1
<= L
'z') ? *s1
- 32 : *s1
;
58 __attribute__((unused
))
59 StrnCaseCmp(CHAR16
*s0
, CHAR16
*s1
, int n
)
64 if (*s0
== L
'\0' || *s1
== L
'\0')
66 c0
= (*s0
>= L
'a' && *s0
<= L
'z') ? *s0
- 32 : *s0
;
67 c1
= (*s1
>= L
'a' && *s1
<= L
'z') ? *s1
- 32 : *s1
;
77 __attribute__((unused
))
78 StrCSpn(const CHAR16
*s
, const CHAR16
*reject
)
82 for (ret
= 0; s
[ret
] != L
'\0'; ret
++) {
84 for (i
= 0; reject
[i
] != L
'\0'; i
++) {
85 if (reject
[i
] == s
[ret
])
92 #endif /* SHIM_UCS2_H */