TianoCore EDK2 master
Loading...
Searching...
No Matches
UnicodeCollation.c File Reference
#include "Fat.h"

Go to the source code of this file.

Functions

EFI_STATUS InitializeUnicodeCollationSupportWorker (IN EFI_HANDLE AgentHandle, IN EFI_GUID *ProtocolGuid, IN CONST CHAR16 *VariableName, IN CONST CHAR8 *DefaultLanguage)
 
EFI_STATUS InitializeUnicodeCollationSupport (IN EFI_HANDLE AgentHandle)
 
INTN FatStriCmp (IN CHAR16 *S1, IN CHAR16 *S2)
 
VOID FatStrUpr (IN OUT CHAR16 *String)
 
VOID FatStrLwr (IN OUT CHAR16 *String)
 
VOID FatFatToStr (IN UINTN FatSize, IN CHAR8 *Fat, OUT CHAR16 *String)
 
BOOLEAN FatStrToFat (IN CHAR16 *String, IN UINTN FatSize, OUT CHAR8 *Fat)
 

Variables

EFI_UNICODE_COLLATION_PROTOCOLmUnicodeCollationInterface = NULL
 

Detailed Description

Unicode Collation Support component that hides the trivial difference of Unicode Collation and Unicode collation 2 Protocol.

Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UnicodeCollation.c.

Function Documentation

◆ FatFatToStr()

VOID FatFatToStr ( IN UINTN  FatSize,
IN CHAR8 *  Fat,
OUT CHAR16 *  String 
)

Convert FAT string to unicode string.

Parameters
FatSizeThe size of FAT string.
FatThe FAT string.
StringThe unicode string.
Returns
None.

Definition at line 227 of file UnicodeCollation.c.

◆ FatStriCmp()

INTN FatStriCmp ( IN CHAR16 *  S1,
IN CHAR16 *  S2 
)

Performs a case-insensitive comparison of two Null-terminated Unicode strings.

Parameters
S1A pointer to a Null-terminated Unicode string.
S2A pointer to a Null-terminated Unicode string.
Return values
0S1 is equivalent to S2.
>0S1 is lexically greater than S2.
<0S1 is lexically less than S2.

Definition at line 164 of file UnicodeCollation.c.

◆ FatStrLwr()

VOID FatStrLwr ( IN OUT CHAR16 *  String)

Lowercase a string

Parameters
StringThe string which will be lower-cased.

Definition at line 206 of file UnicodeCollation.c.

◆ FatStrToFat()

BOOLEAN FatStrToFat ( IN CHAR16 *  String,
IN UINTN  FatSize,
OUT CHAR8 *  Fat 
)

Convert unicode string to Fat string.

Parameters
StringThe unicode string.
FatSizeThe size of the FAT string.
FatThe FAT string.
Return values
TRUEConvert successfully.
FALSEConvert error.

Definition at line 253 of file UnicodeCollation.c.

◆ FatStrUpr()

VOID FatStrUpr ( IN OUT CHAR16 *  String)

Uppercase a string.

Parameters
StringThe string which will be upper-cased.

Definition at line 188 of file UnicodeCollation.c.

◆ InitializeUnicodeCollationSupport()

EFI_STATUS InitializeUnicodeCollationSupport ( IN EFI_HANDLE  AgentHandle)

Initialize Unicode Collation support.

It tries to locate Unicode Collation 2 protocol and matches it with current platform language code. If for any reason the first attempt fails, it then tries to use Unicode Collation Protocol.

Parameters
AgentHandleThe handle used to open Unicode Collation (2) protocol.
Return values
EFI_SUCCESSThe Unicode Collation (2) protocol has been successfully located.
OthersThe Unicode Collation (2) protocol has not been located.

Definition at line 120 of file UnicodeCollation.c.

◆ InitializeUnicodeCollationSupportWorker()

EFI_STATUS InitializeUnicodeCollationSupportWorker ( IN EFI_HANDLE  AgentHandle,
IN EFI_GUID ProtocolGuid,
IN CONST CHAR16 *  VariableName,
IN CONST CHAR8 *  DefaultLanguage 
)

Worker function to initialize Unicode Collation support.

It tries to locate Unicode Collation (2) protocol and matches it with current platform language code.

Parameters
AgentHandleThe handle used to open Unicode Collation (2) protocol.
ProtocolGuidThe pointer to Unicode Collation (2) protocol GUID.
VariableNameThe name of the RFC 4646 or ISO 639-2 language variable.
DefaultLanguageThe default language in case the RFC 4646 or ISO 639-2 language is absent.
Return values
EFI_SUCCESSThe Unicode Collation (2) protocol has been successfully located.
OthersThe Unicode Collation (2) protocol has not been located.

Definition at line 30 of file UnicodeCollation.c.

Variable Documentation

◆ mUnicodeCollationInterface

EFI_UNICODE_COLLATION_PROTOCOL* mUnicodeCollationInterface = NULL

Definition at line 12 of file UnicodeCollation.c.