]> code.delx.au - refind/blob - refind/config.h
Added "windows_recovery" option to "showtools" token and
[refind] / refind / config.h
1 /*
2 * refit/config.h
3 * General header file
4 *
5 * Copyright (c) 2006-2009 Christoph Pfisterer
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the
18 * distribution.
19 *
20 * * Neither the name of Christoph Pfisterer nor the names of the
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36
37 /*
38 * Modifications copyright (c) 2012-2013 Roderick W. Smith
39 *
40 * Modifications distributed under the terms of the GNU General Public
41 * License (GPL) version 3 (GPLv3), a copy of which must be distributed
42 * with this source code or binaries made from it.
43 *
44 */
45
46 #ifndef __CONFIG_H_
47 #define __CONFIG_H_
48
49 #ifdef __MAKEWITH_GNUEFI
50 #include "efi.h"
51 #else
52 #include "../include/tiano_includes.h"
53 #endif
54 #include "global.h"
55
56
57 //
58 // config module
59 //
60
61 typedef struct {
62 UINT8 *Buffer;
63 UINTN BufferSize;
64 UINTN Encoding;
65 CHAR8 *Current8Ptr;
66 CHAR8 *End8Ptr;
67 CHAR16 *Current16Ptr;
68 CHAR16 *End16Ptr;
69 } REFIT_FILE;
70
71 #define HIDEUI_FLAG_NONE (0x0000)
72 #define HIDEUI_FLAG_BANNER (0x0001)
73 #define HIDEUI_FLAG_LABEL (0x0002)
74 #define HIDEUI_FLAG_SINGLEUSER (0x0004)
75 #define HIDEUI_FLAG_HWTEST (0x0008)
76 #define HIDEUI_FLAG_ARROWS (0x0010)
77 #define HIDEUI_FLAG_HINTS (0x0020)
78 #define HIDEUI_FLAG_EDITOR (0x0040)
79 #define HIDEUI_FLAG_SAFEMODE (0x0080)
80 #define HIDEUI_FLAG_ALL ((0xffff))
81
82 #define CONFIG_FILE_NAME L"refind.conf"
83 // Note: Below is combined with MOK_NAMES to make default
84 #define DONT_SCAN_FILES L"shim.efi,shim-fedora.efi,PreLoader.efi,TextMode.efi,ebounce.efi,GraphicsConsole.efi,bootmgr.efi"
85 #define DONT_SCAN_VOLUMES L"Recovery HD,LRS_ESP"
86 #define ALSO_SCAN_DIRS L"boot"
87
88 EFI_STATUS ReadFile(IN EFI_FILE_HANDLE BaseDir, CHAR16 *FileName, REFIT_FILE *File, UINTN *size);
89 VOID ReadConfig(CHAR16 *FileName);
90 VOID ScanUserConfigured(CHAR16 *FileName);
91 UINTN ReadTokenLine(IN REFIT_FILE *File, OUT CHAR16 ***TokenList);
92 VOID FreeTokenLine(IN OUT CHAR16 ***TokenList, IN OUT UINTN *TokenCount);
93 REFIT_FILE * ReadLinuxOptionsFile(IN CHAR16 *LoaderPath, IN REFIT_VOLUME *Volume);
94 CHAR16 * GetFirstOptionsFromFile(IN CHAR16 *LoaderPath, IN REFIT_VOLUME *Volume);
95
96 #endif
97
98 /* EOF */