~jsvoboda/helenos/dnsr

« back to all changes in this revision

Viewing changes to boot/arch/ia64/loader/gefi/apps/printenv.c

  • Committer: Martin Decky
  • Date: 2009-08-04 11:19:19 UTC
  • Revision ID: martin@uranus.dsrg.hide.ms.mff.cuni.cz-20090804111919-evyclddlr3v5lhmp
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <efi.h>
 
2
#include <efilib.h>
 
3
 
 
4
EFI_STATUS
 
5
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
 
6
{
 
7
        EFI_STATUS status;
 
8
        CHAR16 name[256], *val, fmt[20];
 
9
        EFI_GUID vendor;
 
10
        UINTN size;
 
11
 
 
12
        InitializeLib(image, systab);
 
13
 
 
14
        name[0] = 0;
 
15
        vendor = NullGuid;
 
16
 
 
17
        Print(L"GUID                                Variable Name        Value\n");
 
18
        Print(L"=================================== ==================== ========\n");
 
19
 
 
20
        StrCpy(fmt, L"%.-35g %.-20s %s\n");
 
21
        while (1) {
 
22
                size = sizeof(name);
 
23
                status = RT->GetNextVariableName(&size, name, &vendor);
 
24
                if (status != EFI_SUCCESS)
 
25
                        break;
 
26
 
 
27
                val = LibGetVariable(name, &vendor);
 
28
                Print(fmt, &vendor, name, val);
 
29
                FreePool(val);
 
30
        }
 
31
        return EFI_SUCCESS;
 
32
}