]> code.delx.au - refind/commitdiff
Pull string functions from refind/lib.[ch] into refind/mystrings.[ch]
authorsrs5694 <srs5694@users.sourceforge.net>
Tue, 10 Nov 2015 00:03:36 +0000 (19:03 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Tue, 10 Nov 2015 00:03:36 +0000 (19:03 -0500)
14 files changed:
EfiLib/BdsHelper.c
libeg/image.c
libeg/screen.c
refind.inf
refind/Make.tiano
refind/Makefile
refind/apple.c
refind/config.c
refind/icns.c
refind/legacy.c
refind/lib.c
refind/lib.h
refind/main.c
refind/menu.c

index 47ecf9ac59b028b295f285c2d504b90cdf11f6aa..f7d20af03461e998aecb6acf692fbad1ace1f7c2 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "BdsHelper.h"
 #include "legacy.h"
+#include "mystrings.h"
 #include "../refind/screen.h"
 #include "../refind/lib.h"
 #include "../include/refit_call_wrapper.h"
index d91602d5b3d90110c1e25d823991924054be4f52..c61f34847dbeeb5cedd5d22c9ce3783f1a030ed6 100644 (file)
@@ -59,6 +59,7 @@
 #include "../refind/global.h"
 #include "../refind/lib.h"
 #include "../refind/screen.h"
+#include "../refind/mystrings.h"
 #include "../include/refit_call_wrapper.h"
 #include "lodepng.h"
 
index 61df93b6ef3baf477e700288b6c77ab342c3699c..506355e0e73b92773fe5d7b26ec8c452b40d2582 100644 (file)
@@ -58,6 +58,7 @@
 #include "libegint.h"
 #include "../refind/screen.h"
 #include "../refind/lib.h"
+#include "../refind/mystrings.h"
 #include "../include/refit_call_wrapper.h"
 #include "libeg.h"
 #include "../include/Handle.h"
index 1112947b9603ecf40bf377970368c5901d36ecdc..3f6096f4bd8dc6009777890dbde656bb0c246bde 100644 (file)
@@ -45,6 +45,7 @@
   refind/lib.c\r
   refind/line_edit.c\r
   refind/menu.c\r
+  refind/mystrings.c\r
   refind/screen.c\r
   refind/driver_support.c\r
   refind/gpt.c\r
index bda28cfea6e455679420ab5127255f5b473e04ca..7a985754eb91c2a0b2e888b55dfe1f5f6624c8c5 100644 (file)
@@ -35,7 +35,7 @@ ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel
 #                /usr/local/UDK2010/MyWorkSpace/Build/MdeModule/RELEASE_GCC46/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeMain/DxeMain.obj
 
 
-SOURCE_NAMES     = apple config line_edit driver_support icns lib main menu screen gpt crc32 legacy AutoGen
+SOURCE_NAMES     = apple config mystrings line_edit driver_support icns lib main menu screen gpt crc32 legacy AutoGen
 OBJS             = $(SOURCE_NAMES:=.obj)
 
 all: $(BUILDME)
index 00735fe9746ad28e77cebe09b8ef36264ba7a8df..6bb240517cf0724b0097b71a7c65f6183da6ce2d 100644 (file)
@@ -25,7 +25,7 @@ LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -I$(SR
 LOCAL_LDFLAGS   = -L$(SRCDIR)/../libeg/ -L$(SRCDIR)/../mok/ -L$(SRCDIR)/../EfiLib/
 LOCAL_LIBS      = -leg -lmok -lEfiLib
 
-OBJS            = main.o apple.o line_edit.o config.o menu.o screen.o icns.o gpt.o crc32.o lib.o driver_support.o legacy.o
+OBJS            = main.o mystrings.o apple.o line_edit.o config.o menu.o screen.o icns.o gpt.o crc32.o lib.o driver_support.o legacy.o
 #OBJS            = main.o line_edit.o config.o menu.o screen.o icns.o lib.o mok.o driver_support.o variables.o sha256.o pecoff.o simple_file.o security_policy.o guid.o
 
 all: $(TARGET)
index 6225d9afd288eb51e380f070ad78fedef71b9ec7..5b334f1650743b9f329e5f4838251fe3f690f8c1 100644 (file)
@@ -24,6 +24,7 @@
 #include "lib.h"
 #include "screen.h"
 #include "apple.h"
+#include "mystrings.h"
 #include "refit_call_wrapper.h"
 
 CHAR16 gCsrStatus[256];
index f592eb9a046c1b8384ceba1a373f7d82986a6663..8aa2850183157005b02457688a28d6da8a248538 100644 (file)
@@ -63,6 +63,7 @@
 #include "config.h"
 #include "screen.h"
 #include "apple.h"
+#include "mystrings.h"
 #include "../include/refit_call_wrapper.h"
 #include "../mok/mok.h"
 
index f091e41366fc1c17b8b04aa581c463efbb2e51fc..5e74bb285c68e9250d9d61a29d2738fc0aa03e89 100644 (file)
@@ -38,6 +38,7 @@
 #include "lib.h"
 #include "icns.h"
 #include "config.h"
+#include "mystrings.h"
 #include "../refind/screen.h"
 
 //
index 3f1ccc705feda8aa6edb4e0e7092c4cd9a626345..9ac7ce229af64a59317a996bed4fa654fb40295f 100644 (file)
@@ -63,6 +63,7 @@
 #include "refit_call_wrapper.h"
 #include "screen.h"
 #include "syslinux_mbr.h"
+#include "mystrings.h"
 #include "../EfiLib/BdsHelper.h"
 #include "../EfiLib/legacy.h"
 #include "Handle.h"
index 3a75cdfdcacb62cb8746ed225184c7c86e05c73c..5bc1828bd9401cda06c9b89e544333f887d919e8 100644 (file)
@@ -63,6 +63,7 @@
 #include "../include/RemovableMedia.h"
 #include "gpt.h"
 #include "config.h"
+#include "mystrings.h"
 
 #ifdef __MAKEWITH_GNUEFI
 #define EfiReallocatePool ReallocatePool
@@ -1461,130 +1462,6 @@ INTN FindMem(IN VOID *Buffer, IN UINTN BufferLength, IN VOID *SearchString, IN U
     return -1;
 }
 
-BOOLEAN StriSubCmp(IN CHAR16 *SmallStr, IN CHAR16 *BigStr) {
-    BOOLEAN Found = 0, Terminate = 0;
-    UINTN BigIndex = 0, SmallIndex = 0, BigStart = 0;
-
-    if (SmallStr && BigStr) {
-        while (!Terminate) {
-            if (BigStr[BigIndex] == '\0') {
-                Terminate = 1;
-            }
-            if (SmallStr[SmallIndex] == '\0') {
-                Found = 1;
-                Terminate = 1;
-            }
-            if ((SmallStr[SmallIndex] & ~0x20) == (BigStr[BigIndex] & ~0x20)) {
-                SmallIndex++;
-                BigIndex++;
-            } else {
-                SmallIndex = 0;
-                BigStart++;
-                BigIndex = BigStart;
-            }
-        } // while
-    } // if
-    return Found;
-} // BOOLEAN StriSubCmp()
-
-// Performs a case-insensitive string comparison. This function is necesary
-// because some EFIs have buggy StriCmp() functions that actually perform
-// case-sensitive comparisons.
-// Returns TRUE if strings are identical, FALSE otherwise.
-BOOLEAN MyStriCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString) {
-    if (FirstString && SecondString) {
-        while ((*FirstString != L'\0') && ((*FirstString & ~0x20) == (*SecondString & ~0x20))) {
-                FirstString++;
-                SecondString++;
-        }
-        return (*FirstString == *SecondString);
-    } else {
-        return FALSE;
-    }
-} // BOOLEAN MyStriCmp()
-
-// Convert input string to all-lowercase.
-// DO NOT USE the standard StrLwr() function, since it's broken on some EFIs!
-VOID ToLower(CHAR16 * MyString) {
-    UINTN i = 0;
-
-    if (MyString) {
-        while (MyString[i] != L'\0') {
-            if ((MyString[i] >= L'A') && (MyString[i] <= L'Z'))
-                MyString[i] = MyString[i] - L'A' + L'a';
-            i++;
-        } // while
-    } // if
-} // VOID ToLower()
-
-// Merges two strings, creating a new one and returning a pointer to it.
-// If AddChar != 0, the specified character is placed between the two original
-// strings (unless the first string is NULL or empty). The original input
-// string *First is de-allocated and replaced by the new merged string.
-// This is similar to StrCat, but safer and more flexible because
-// MergeStrings allocates memory that's the correct size for the
-// new merged string, so it can take a NULL *First and it cleans
-// up the old memory. It should *NOT* be used with a constant
-// *First, though....
-VOID MergeStrings(IN OUT CHAR16 **First, IN CHAR16 *Second, CHAR16 AddChar) {
-    UINTN Length1 = 0, Length2 = 0;
-    CHAR16* NewString;
-
-    if (*First != NULL)
-        Length1 = StrLen(*First);
-    if (Second != NULL)
-        Length2 = StrLen(Second);
-    NewString = AllocatePool(sizeof(CHAR16) * (Length1 + Length2 + 2));
-    if (NewString != NULL) {
-        if ((*First != NULL) && (Length1 == 0)) {
-            MyFreePool(*First);
-            *First = NULL;
-        }
-        NewString[0] = L'\0';
-        if (*First != NULL) {
-            StrCat(NewString, *First);
-            if (AddChar) {
-                NewString[Length1] = AddChar;
-                NewString[Length1 + 1] = '\0';
-            } // if (AddChar)
-        } // if (*First != NULL)
-        if (Second != NULL)
-            StrCat(NewString, Second);
-        MyFreePool(*First);
-        *First = NewString;
-    } else {
-        Print(L"Error! Unable to allocate memory in MergeStrings()!\n");
-    } // if/else
-} // VOID MergeStrings()
-
-// Similar to MergeStrings, but breaks the input string into word chunks and
-// merges each word separately. Words are defined as string fragments separated
-// by ' ', '_', or '-'.
-VOID MergeWords(CHAR16 **MergeTo, CHAR16 *SourceString, CHAR16 AddChar) {
-    CHAR16 *Temp, *Word, *p;
-    BOOLEAN LineFinished = FALSE;
-
-    if (SourceString) {
-        Temp = Word = p = StrDuplicate(SourceString);
-        if (Temp) {
-            while (!LineFinished) {
-                if ((*p == L' ') || (*p == L'_') || (*p == L'-') || (*p == L'\0')) {
-                    if (*p == L'\0')
-                        LineFinished = TRUE;
-                    *p = L'\0';
-                    if (*Word != L'\0')
-                        MergeStrings(MergeTo, Word, AddChar);
-                    Word = p + 1;
-                } // if
-                p++;
-            } // while
-            MyFreePool(Temp);
-        } else {
-            Print(L"Error! Unable to allocate memory in MergeWords()!\n");
-        } // if/else
-    } // if
-} // VOID MergeWords()
-
 // Takes an input pathname (*Path) and returns the part of the filename from
 // the final dot onwards, converted to lowercase. If the filename includes
 // no dots, or if the input is NULL, returns an empty (but allocated) string.
@@ -1669,89 +1546,6 @@ CHAR16 *FindPath(IN CHAR16* FullPath) {
    return (PathOnly);
 }
 
-/*++
- * 
- * Routine Description:
- *
- *  Find a substring.
- *
- * Arguments: 
- *
- *  String      - Null-terminated string to search.
- *  StrCharSet  - Null-terminated string to search for.
- *
- * Returns:
- *  The address of the first occurrence of the matching substring if successful, or NULL otherwise.
- * --*/
-CHAR16* MyStrStr (IN CHAR16  *String, IN CHAR16  *StrCharSet)
-{
-    CHAR16 *Src;
-    CHAR16 *Sub;
-
-    if ((String == NULL) || (StrCharSet == NULL))
-        return NULL;
-
-    Src = String;
-    Sub = StrCharSet;
-
-    while ((*String != L'\0') && (*StrCharSet != L'\0')) {
-        if (*String++ != *StrCharSet) {
-            String = ++Src;
-            StrCharSet = Sub;
-        } else {
-            StrCharSet++;
-        }
-    }
-    if (*StrCharSet == L'\0') {
-        return Src;
-    } else {
-        return NULL;
-    }
-} // CHAR16 *MyStrStr()
-
-// Restrict TheString to at most Limit characters.
-// Does this in two ways:
-// - Locates stretches of two or more spaces and compresses
-//   them down to one space.
-// - Truncates TheString
-// Returns TRUE if changes were made, FALSE otherwise
-BOOLEAN LimitStringLength(CHAR16 *TheString, UINTN Limit) {
-    CHAR16    *SubString, *TempString;
-    UINTN     i;
-    BOOLEAN   HasChanged = FALSE;
-
-    // SubString will be NULL or point WITHIN TheString
-    SubString = MyStrStr(TheString, L"  ");
-    while (SubString != NULL) {
-        i = 0;
-        while (SubString[i] == L' ')
-            i++;
-        if (i >= StrLen(SubString)) {
-            SubString[0] = '\0';
-            HasChanged = TRUE;
-        } else {
-            TempString = StrDuplicate(&SubString[i]);
-            if (TempString != NULL) {
-                StrCpy(&SubString[1], TempString);
-                MyFreePool(TempString);
-                HasChanged = TRUE;
-            } else {
-                // memory allocation problem; abort to avoid potentially infinite loop!
-                break;
-            } // if/else
-        } // if/else
-        SubString = MyStrStr(TheString, L"  ");
-    } // while
-
-    // If the string is still too long, truncate it....
-    if (StrLen(TheString) > Limit) {
-        TheString[Limit] = '\0';
-        HasChanged = TRUE;
-    } // if
-
-    return HasChanged;
-} // BOOLEAN LimitStringLength()
-
 // Takes an input loadpath, splits it into disk and filename components, finds a matching
 // DeviceVolume, and returns that and the filename (*loader).
 VOID FindVolumeAndFilename(IN EFI_DEVICE_PATH *loadpath, OUT REFIT_VOLUME **DeviceVolume, OUT CHAR16 **loader) {
@@ -1813,74 +1607,6 @@ BOOLEAN SplitVolumeAndFilename(IN OUT CHAR16 **Path, OUT CHAR16 **VolName) {
     }
 } // BOOLEAN SplitVolumeAndFilename()
 
-// Returns all the digits in the input string, including intervening
-// non-digit characters. For instance, if InString is "foo-3.3.4-7.img",
-// this function returns "3.3.4-7". If InString contains no digits,
-// the return value is NULL.
-CHAR16 *FindNumbers(IN CHAR16 *InString) {
-    UINTN i, StartOfElement, EndOfElement = 0, CopyLength;
-    CHAR16 *Found = NULL;
-
-    if (InString == NULL)
-        return NULL;
-
-    StartOfElement = StrLen(InString);
-    // Find start & end of target element
-    for (i = 0; InString[i] != L'\0'; i++) {
-        if ((InString[i] >= L'0') && (InString[i] <= L'9')) {
-            if (StartOfElement > i)
-                StartOfElement = i;
-            if (EndOfElement < i)
-                EndOfElement = i;
-        } // if
-    } // for
-    // Extract the target element
-    if (EndOfElement > 0) {
-        if (EndOfElement >= StartOfElement) {
-            CopyLength = EndOfElement - StartOfElement + 1;
-            Found = StrDuplicate(&InString[StartOfElement]);
-            if (Found != NULL)
-                Found[CopyLength] = 0;
-        } // if (EndOfElement >= StartOfElement)
-    } // if (EndOfElement > 0)
-    return (Found);
-} // CHAR16 *FindNumbers()
-
-// Find the #Index element (numbered from 0) in a comma-delimited string
-// of elements.
-// Returns the found element, or NULL if Index is out of range or InString
-// is NULL. Note that the calling function is responsible for freeing the
-// memory associated with the returned string pointer.
-CHAR16 *FindCommaDelimited(IN CHAR16 *InString, IN UINTN Index) {
-    UINTN    StartPos = 0, CurPos = 0, InLength;
-    BOOLEAN  Found = FALSE;
-    CHAR16   *FoundString = NULL;
-
-    if (InString != NULL) {
-        InLength = StrLen(InString);
-        // After while() loop, StartPos marks start of item #Index
-        while ((Index > 0) && (CurPos < InLength)) {
-            if (InString[CurPos] == L',') {
-                Index--;
-                StartPos = CurPos + 1;
-            } // if
-            CurPos++;
-        } // while
-        // After while() loop, CurPos is one past the end of the element
-        while ((CurPos < InLength) && (!Found)) {
-            if (InString[CurPos] == L',')
-                Found = TRUE;
-            else
-                CurPos++;
-        } // while
-        if (Index == 0)
-            FoundString = StrDuplicate(&InString[StartPos]);
-        if (FoundString != NULL)
-            FoundString[CurPos - StartPos] = 0;
-    } // if
-    return (FoundString);
-} // CHAR16 *FindCommaDelimited()
-
 // Take an input path name, which may include a volume specification and/or
 // a path, and return separate volume, path, and file names. For instance,
 // "BIGVOL:\EFI\ubuntu\grubx64.efi" will return a VolName of "BIGVOL", a Path
@@ -1909,40 +1635,7 @@ VOID SplitPathName(CHAR16 *InPath, CHAR16 **VolName, CHAR16 **Path, CHAR16 **Fil
         *Filename = NULL;
     }
     MyFreePool(Temp);
-} // VOID SplitPathName
-
-// Returns TRUE if SmallString is an element in the comma-delimited List,
-// FALSE otherwise. Performs comparison case-insensitively.
-BOOLEAN IsIn(IN CHAR16 *SmallString, IN CHAR16 *List) {
-   UINTN     i = 0;
-   BOOLEAN   Found = FALSE;
-   CHAR16    *OneElement;
-
-   if (SmallString && List) {
-      while (!Found && (OneElement = FindCommaDelimited(List, i++))) {
-         if (MyStriCmp(OneElement, SmallString))
-            Found = TRUE;
-      } // while
-   } // if
-   return Found;
-} // BOOLEAN IsIn()
-
-// Returns TRUE if any element of List can be found as a substring of
-// BigString, FALSE otherwise. Performs comparisons case-insensitively.
-BOOLEAN IsInSubstring(IN CHAR16 *BigString, IN CHAR16 *List) {
-   UINTN   i = 0, ElementLength;
-   BOOLEAN Found = FALSE;
-   CHAR16  *OneElement;
-
-   if (BigString && List) {
-      while (!Found && (OneElement = FindCommaDelimited(List, i++))) {
-         ElementLength = StrLen(OneElement);
-         if ((ElementLength <= StrLen(BigString)) && (StriSubCmp(OneElement, BigString)))
-            Found = TRUE;
-      } // while
-   } // if
-   return Found;
-} // BOOLEAN IsSubstringIn()
+} // VOID SplitPathName()
 
 // Returns TRUE if specified Volume, Directory, and Filename correspond to an
 // element in the comma-delimited List, FALSE otherwise. Note that Directory and
@@ -2031,128 +1724,6 @@ BOOLEAN EjectMedia(VOID) {
     return (Ejected > 0);
 } // VOID EjectMedia()
 
-// Returns TRUE if *Input contains nothing but valid hexadecimal characters,
-// FALSE otherwise. Note that a leading "0x" is NOT acceptable in the input!
-BOOLEAN IsValidHex(CHAR16 *Input) {
-    BOOLEAN IsHex = TRUE;
-    UINTN i = 0;
-
-    while ((Input[i] != L'\0') && IsHex) {
-        if (!(((Input[i] >= L'0') && (Input[i] <= L'9')) ||
-              ((Input[i] >= L'A') && (Input[i] <= L'F')) ||
-              ((Input[i] >= L'a') && (Input[i] <= L'f')))) {
-                IsHex = FALSE;
-        }
-        i++;
-    } // while
-    return IsHex;
-} // BOOLEAN IsValidHex()
-
-// Converts consecutive characters in the input string into a
-// number, interpreting the string as a hexadecimal number, starting
-// at the specified position and continuing for the specified number
-// of characters or until the end of the string, whichever is first.
-// NumChars must be between 1 and 16. Ignores invalid characters.
-UINT64 StrToHex(CHAR16 *Input, UINTN Pos, UINTN NumChars) {
-    UINT64 retval = 0x00;
-    UINTN  NumDone = 0, InputLength;
-    CHAR16 a;
-
-    if ((Input == NULL) || (NumChars == 0) || (NumChars > 16)) {
-        return 0;
-    }
-
-    InputLength = StrLen(Input);
-    while ((Pos <= InputLength) && (NumDone < NumChars)) {
-        a = Input[Pos];
-        if ((a >= '0') && (a <= '9')) {
-            retval *= 0x10;
-            retval += (a - '0');
-            NumDone++;
-        }
-        if ((a >= 'a') && (a <= 'f')) {
-            retval *= 0x10;
-            retval += (a - 'a' + 0x0a);
-            NumDone++;
-        }
-        if ((a >= 'A') && (a <= 'F')) {
-            retval *= 0x10;
-            retval += (a - 'A' + 0x0a);
-            NumDone++;
-        }
-        Pos++;
-    } // while()
-    return retval;
-} // StrToHex()
-
-// Returns TRUE if UnknownString can be interpreted as a GUID, FALSE otherwise.
-// Note that the input string must have no extraneous spaces and must be
-// conventionally formatted as a 36-character GUID, complete with dashes in
-// appropriate places.
-BOOLEAN IsGuid(CHAR16 *UnknownString) {
-    UINTN   Length, i;
-    BOOLEAN retval = TRUE;
-    CHAR16  a;
-
-    if (UnknownString == NULL)
-        return FALSE;
-
-    Length = StrLen(UnknownString);
-    if (Length != 36)
-        return FALSE;
-
-    for (i = 0; i < Length; i++) {
-        a = UnknownString[i];
-        if ((i == 8) || (i == 13) || (i == 18) || (i == 23)) {
-            if (a != L'-')
-                retval = FALSE;
-        } else if (((a < L'a') || (a > L'f')) &&
-                   ((a < L'A') || (a > L'F')) &&
-                   ((a < L'0') && (a > L'9'))) {
-            retval = FALSE;
-        } // if/else if
-    } // for
-    return retval;
-} // BOOLEAN IsGuid()
-
-// Return the GUID as a string, suitable for display to the user. Note that the calling
-// function is responsible for freeing the allocated memory.
-CHAR16 * GuidAsString(EFI_GUID *GuidData) {
-   CHAR16 *TheString;
-
-   TheString = AllocateZeroPool(42 * sizeof(CHAR16));
-   if (TheString != 0) {
-      SPrint (TheString, 82, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
-              (UINTN)GuidData->Data1, (UINTN)GuidData->Data2, (UINTN)GuidData->Data3,
-              (UINTN)GuidData->Data4[0], (UINTN)GuidData->Data4[1], (UINTN)GuidData->Data4[2],
-              (UINTN)GuidData->Data4[3], (UINTN)GuidData->Data4[4], (UINTN)GuidData->Data4[5],
-              (UINTN)GuidData->Data4[6], (UINTN)GuidData->Data4[7]);
-   }
-   return TheString;
-} // GuidAsString(EFI_GUID *GuidData)
-
-EFI_GUID StringAsGuid(CHAR16 * InString) {
-    EFI_GUID  Guid = NULL_GUID_VALUE;
-
-    if (!IsGuid(InString)) {
-        return Guid;
-    }
-
-    Guid.Data1 = (UINT32) StrToHex(InString, 0, 8);
-    Guid.Data2 = (UINT16) StrToHex(InString, 9, 4);
-    Guid.Data3 = (UINT16) StrToHex(InString, 14, 4);
-    Guid.Data4[0] = (UINT8) StrToHex(InString, 19, 2);
-    Guid.Data4[1] = (UINT8) StrToHex(InString, 21, 2);
-    Guid.Data4[2] = (UINT8) StrToHex(InString, 23, 2);
-    Guid.Data4[3] = (UINT8) StrToHex(InString, 26, 2);
-    Guid.Data4[4] = (UINT8) StrToHex(InString, 28, 2);
-    Guid.Data4[5] = (UINT8) StrToHex(InString, 30, 2);
-    Guid.Data4[6] = (UINT8) StrToHex(InString, 32, 2);
-    Guid.Data4[7] = (UINT8) StrToHex(InString, 34, 2);
-
-    return Guid;
-} // EFI_GUID StringAsGuid()
-
 // Returns TRUE if the two GUIDs are equal, FALSE otherwise
 BOOLEAN GuidsAreEqual(EFI_GUID *Guid1, EFI_GUID *Guid2) {
     return (CompareMem(Guid1, Guid2, 16) == 0);
index 037605c88da8d98f0ea6ae24e63883f76e255703..7f379b3b1ca1ac746347b69589c23bcc873a9082 100644 (file)
@@ -118,34 +118,18 @@ CHAR16 * StripEfiExtension(CHAR16 *FileName);
 INTN FindMem(IN VOID *Buffer, IN UINTN BufferLength, IN VOID *SearchString, IN UINTN SearchStringLength);
 VOID ReinitVolumes(VOID);
 
-BOOLEAN StriSubCmp(IN CHAR16 *TargetStr, IN CHAR16 *BigStr);
-BOOLEAN MyStriCmp(IN CONST CHAR16 *String1, IN CONST CHAR16 *String2);
-CHAR16* MyStrStr (IN CHAR16  *String, IN CHAR16  *StrCharSet);
-VOID ToLower(CHAR16 * MyString);
-VOID MergeStrings(IN OUT CHAR16 **First, IN CHAR16 *Second, CHAR16 AddChar);
-VOID MergeWords(CHAR16 **MergeTo, CHAR16 *InString, CHAR16 AddChar);
 CHAR16 *FindExtension(IN CHAR16 *Path);
 CHAR16 *FindLastDirName(IN CHAR16 *Path);
 CHAR16 *FindPath(IN CHAR16* FullPath);
-BOOLEAN LimitStringLength(CHAR16 *TheString, UINTN Limit);
 VOID FindVolumeAndFilename(IN EFI_DEVICE_PATH *loadpath, OUT REFIT_VOLUME **DeviceVolume, OUT CHAR16 **loader);
 BOOLEAN SplitVolumeAndFilename(IN OUT CHAR16 **Path, OUT CHAR16 **VolName);
-CHAR16 *FindNumbers(IN CHAR16 *InString);
-CHAR16 *FindCommaDelimited(IN CHAR16 *InString, IN UINTN Index);
 VOID SplitPathName(CHAR16 *InPath, CHAR16 **VolName, CHAR16 **Path, CHAR16 **Filename);
-BOOLEAN IsIn(IN CHAR16 *SmallString, IN CHAR16 *List);
-BOOLEAN IsInSubstring(IN CHAR16 *BigString, IN CHAR16 *List);
 BOOLEAN FilenameIn(IN REFIT_VOLUME *Volume, IN CHAR16 *Directory, IN CHAR16 *Filename, IN CHAR16 *List);
 BOOLEAN VolumeNumberToName(REFIT_VOLUME *Volume, CHAR16 **VolName);
 VOID MyFreePool(IN OUT VOID *Pointer);
 
 BOOLEAN EjectMedia(VOID);
 
-BOOLEAN IsValidHex(CHAR16 *Input);
-UINT64 StrToHex(CHAR16 *Input, UINTN Position, UINTN NumChars);
-BOOLEAN IsGuid(CHAR16 *UnknownString);
-CHAR16 * GuidAsString(EFI_GUID *GuidData);
-EFI_GUID StringAsGuid(CHAR16 * InString);
 BOOLEAN GuidsAreEqual(EFI_GUID *Guid1, EFI_GUID *Guid2);
 
 VOID EraseUint32List(UINT32_LIST **TheList);
index e23187bb1365f8f10ea5c1aac8477a2b57faddc1..f79ef3a81e7526e30cb0516ee58c9698b0786ad5 100644 (file)
@@ -65,6 +65,7 @@
 #include "mok.h"
 #include "gpt.h"
 #include "apple.h"
+#include "mystrings.h"
 #include "security_policy.h"
 #include "driver_support.h"
 #include "../include/Handle.h"
@@ -192,7 +193,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.10.0");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.10.0.1");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");
index dc3121df2af2ea094909d64e3c481e903684e661..35a8f26cdcb18c3cf75ae606831a4651ef56b4b4 100644 (file)
@@ -63,6 +63,7 @@
 #include "libeg.h"
 #include "libegint.h"
 #include "line_edit.h"
+#include "mystrings.h"
 #include "../include/refit_call_wrapper.h"
 
 #include "../include/egemb_back_selected_small.h"