Added support for "%v" as a variable for the kernel version number in
[refind] / refind / mystrings.h
1 /*
2 * refit/mystrings.h
3 * String functions header file
4 *
5 * Copyright (c) 2012-2015 Roderick W. Smith
6 *
7 * Distributed under the terms of the GNU General Public License (GPL)
8 * version 3 (GPLv3), or (at your option) any later version.
9 *
10 */
11 /*
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 */
25
26 #ifndef __MYSTRINGS_H_
27 #define __MYSTRINGS_H_
28
29 #ifdef __MAKEWITH_GNUEFI
30 #include <efi.h>
31 #include <efilib.h>
32 #else
33 #include "../include/tiano_includes.h"
34 #endif
35 #include "../EfiLib/GenericBdsLib.h"
36
37 typedef struct _string_list {
38 CHAR16 *Value;
39 struct _string_list *Next;
40 } STRING_LIST;
41
42 BOOLEAN StriSubCmp(IN CHAR16 *TargetStr, IN CHAR16 *BigStr);
43 BOOLEAN MyStriCmp(IN CONST CHAR16 *String1, IN CONST CHAR16 *String2);
44 CHAR16* MyStrStr (IN CHAR16 *String, IN CHAR16 *StrCharSet);
45 VOID ToLower(CHAR16 * MyString);
46 VOID MergeStrings(IN OUT CHAR16 **First, IN CHAR16 *Second, CHAR16 AddChar);
47 VOID MergeWords(CHAR16 **MergeTo, CHAR16 *InString, CHAR16 AddChar);
48 BOOLEAN LimitStringLength(CHAR16 *TheString, UINTN Limit);
49 CHAR16 *FindNumbers(IN CHAR16 *InString);
50 UINTN NumCharsInCommon(IN CHAR16* String1, IN CHAR16* String2);
51 CHAR16 *FindCommaDelimited(IN CHAR16 *InString, IN UINTN Index);
52 BOOLEAN IsIn(IN CHAR16 *SmallString, IN CHAR16 *List);
53 BOOLEAN IsInSubstring(IN CHAR16 *BigString, IN CHAR16 *List);
54 BOOLEAN ReplaceSubstring(IN OUT CHAR16 **MainString, IN CHAR16 *SearchString, IN CHAR16 *ReplString);
55
56 BOOLEAN IsValidHex(CHAR16 *Input);
57 UINT64 StrToHex(CHAR16 *Input, UINTN Position, UINTN NumChars);
58 BOOLEAN IsGuid(CHAR16 *UnknownString);
59 CHAR16 * GuidAsString(EFI_GUID *GuidData);
60 EFI_GUID StringAsGuid(CHAR16 * InString);
61
62 VOID DeleteStringList(STRING_LIST *StringList);
63
64 #endif