<commit_before>#include <efi.h>
#include <efilib.h>
#include <efidef.h>

void * LoadFile(CHAR16 * name)
{


  return NULL;
}

<commit_msg>started work into loading files from disk<commit_after>#include <efi.h>
#include <efilib.h>

void * LoadFile(CHAR16 * name)
{
  // Get Protocol handle
  EFI_GUID LoadFileProtocolGuid = LOAD_FILE_PROTOCOL;

  UINTN BufferSize = 4096;
  EFI_HANDLE * HandleBuffer = AllocatePool(BufferSize);
  UINTN DummySearchKey;

  EFI_STATUS ret = uefi_call_wrapper(BS->LocateHandle, 5, ByProtocol, &LoadFileProtocolGuid, &DummySearchKey, &BufferSize, HandleBuffer);

  if(ret == EFI_BUFFER_TOO_SMALL)
  {
    Print(L"We found the FileSystem Protocol handle\n");
    Print(L"But the Buffer is too small\n");
    FreePool(HandleBuffer);
    HandleBuffer = AllocatePool(BufferSize);
  } else
  {
    switch(ret)
    {
      case EFI_NOT_FOUND:
        Print(L"Protocol Not found\n");
        break;
      case EFI_INVALID_PARAMETER:
        Print(L"Invalid parameter\n");
        break;
    }
  }

  ret = uefi_call_wrapper(BS->LocateHandle, 5, ByProtocol, &LoadFileProtocolGuid, &DummySearchKey, &BufferSize, HandleBuffer);

  if(ret == EFI_SUCCESS)
  {
    Print(L"And Loaded every handle to memory\n");
    UINTN HandleNum = BufferSize/sizeof(EFI_HANDLE);
    Print(L"Number of handles: %d\n", HandleNum);
  }

  // From the handle get the protocol

  // read the file


  // return a pointer to the file

  // if anything fails return NULL
  return NULL;
}


{'fraction_non_alphanumeric': 0.10991233985165205, 'fraction_numerical': 0.006743088334457181, 'mean_word_length': 3.6230529595015577, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6492388', 'n_tokens_mistral': 527, 'n_tokens_neox': 509, 'n_words': 123}